Web Frameworks
The server-side frameworks that turn an HTTP request into application code — Spring and Quarkus on the JVM, Django and FastAPI in Python, Express and NestJS in Node, plus Laravel, Rails, ASP.NET Core, Gin, Axum and more. Interviewers use whichever framework you claim to probe how much of the request lifecycle you actually understand versus how much you let the framework hide.
on this pageshowhide
explore
- Spring Framework (has its own guide)2384 questions
- Core Container & IoC225 questions
- Aspect-Oriented Programming152 questions
- Transaction Management151 questions
- Spring MVC (Servlet Web)172 questions
- Spring WebFlux (Reactive Web)145 questions
- Spring Boot155 questions
- Spring Data157 questions
- Spring Security186 questions
- Spring Cloud144 questions
- Messaging & Integration141 questions
- Spring Batch148 questions
- Testing171 questions
- Observability & Actuator148 questions
- AOT & Native Image145 questions
- Wider Spring Portfolio144 questions
- Quarkusempty
- GraalVM Native Imageempty
- CDI & Extensionsempty
- Panache Data Accessempty
- Ktor29 questions
- Application Setup4 questions
- Routing5 questions
- Plugins and Pipeline4 questions
- Content Negotiation5 questions
- Authentication5 questions
- Ktor Client6 questions
- Javalinempty
- Play Frameworkempty
- Vert.xempty
- http4sempty
- Tapirempty
- Scalatraempty
- Akkaempty
- Akka Streamsempty
- Akka HTTPempty
- Pekkoempty
- Django (has its own guide)556 questions
- Projects & Settings30 questions
- URL Dispatcher19 questions
- Views & Responses24 questions
- Class-Based Views27 questions
- Server-Side Templates27 questions
- Form Processing27 questions
- Model Classes42 questions
- QuerySet API29 questions
- ORM Query Tuning22 questions
- Databases & Transactions26 questions
- Migration Workflows24 questions
- Admin Site27 questions
- Accounts & Sign-In26 questions
- Access Rights & Groups17 questions
- Middleware Components11 questions
- Sessions & Messages14 questions
- Built-In Protections22 questions
- Static & Media Files17 questions
- Cache Toolkit16 questions
- Async Support14 questions
- Signals, Tasks & Email21 questions
- Translation & Locales20 questions
- Logging & Debugging14 questions
- Test Toolkit26 questions
- Running in Production14 questions
- Django REST Framework (has its own guide)71 questions
- Serializers19 questions
- API Views & Routers13 questions
- Auth & Throttle Policies13 questions
- Listing & Wire Contract17 questions
- Tests & Schemas9 questions
- Django Ninja19 questions
- Routers & Operations4 questions
- Pydantic Schemas & Errors6 questions
- Auth & Throttling5 questions
- Async Operations & Docs4 questions
- FastAPI138 questions
- Path Operations & Routing12 questions
- Payload Schemas11 questions
- Depends Wiring11 questions
- Thread Pool & Loop12 questions
- HTTP Inputs & Outputs16 questions
- Docs & ASGI Stack12 questions
- Security Dependencies16 questions
- Live Data Channels11 questions
- App Test Tooling11 questions
- Data Layer Wiring11 questions
- Lifespan, State & Settings5 questions
- Hosting & Launch10 questions
- Flaskempty
- Routing and Viewsempty
- Jinja2 Templatingempty
- Blueprintsempty
- Pyramidempty
- Sanicempty
- Tornadoempty
- aiohttpempty
- Express.js58 questions
- Routes and Path Syntax5 questions
- Middleware Pipeline6 questions
- Request & Response5 questions
- Four-Argument Error Handlers5 questions
- REST API Patterns6 questions
- Production Hardening & Deployment6 questions
- Identity & Permissions20 questions
- HTTP Route Testing5 questions
- Fastifyempty
- NestJS69 questions
- Module Graph & Providers6 questions
- Env Config & Schemas5 questions
- Route Decorators & Versioning5 questions
- Pipes and Validation6 questions
- Guards and Interceptors5 questions
- Exception Filters and Middleware6 questions
- Request Lifecycle Order5 questions
- Application Lifecycle Hooks5 questions
- Test Modules & E2E5 questions
- Sign-In & Policies15 questions
- Microservices and Messaging6 questions
- Honoempty
- Itty Routerempty
- Laravel (has its own guide)581 questions
- App Setup & Structure33 questions
- Service Container20 questions
- URL Mapping30 questions
- Endpoint Classes12 questions
- Middleware Layers21 questions
- Request Data & Replies37 questions
- Eloquent Models44 questions
- Database Layer28 questions
- Cache & Locks11 questions
- Blade Views22 questions
- Frontend Stack Choices16 questions
- Artisan & Dev Tools20 questions
- Validating Incoming Data21 questions
- Crypto & Forgery Defenses12 questions
- Accounts & Access Control47 questions
- Errors, Logs & Debugging31 questions
- Localization11 questions
- Queues & Jobs24 questions
- Task Scheduler12 questions
- Signals & Outbound Messages25 questions
- Storage Facade11 questions
- Automated App Checks27 questions
- Everyday Helpers27 questions
- Shipping & Running24 questions
- Official Add-Ons15 questions
- Symfonyempty
- Event Dispatcherempty
- Doctrine Integrationempty
- Security Componentempty
- Forms and Validationempty
- Yiiempty
- Livewire49 questions
- Components & Properties6 questions
- Callable Actions & Dispatch5 questions
- Data Binding & Forms5 questions
- Hydrate, Update & Render Hooks6 questions
- Lazy Loading & Navigation6 questions
- Uploaded Files in Components6 questions
- Payload Security6 questions
- Alpine Integration & JS Hooks5 questions
- Rendered State Assertions4 questions
- Ruby on Rails (has its own guide)621 questions
- Project Anatomy & Startup36 questions
- Command Line Toolkit14 questions
- Route Mapping DSL27 questions
- Action Controller Layer38 questions
- API-Only Apps12 questions
- Active Record Models29 questions
- Model Associations21 questions
- Query Interface41 questions
- Database Adapters29 questions
- Migration Files & Tasks26 questions
- Action View Templates25 questions
- Form Builders20 questions
- Front-End Asset Builds15 questions
- Active Support28 questions
- Logins & Permissions38 questions
- Hardening & Secrets32 questions
- Logs, Errors & Debuggers21 questions
- Response & Data Caching24 questions
- Active Job23 questions
- Action Cable10 questions
- Mailer & Mailbox12 questions
- File Uploads & Rich Text18 questions
- I18n Translations12 questions
- Page-Splitting Gems10 questions
- Testing Setup & Styles30 questions
- Plugins & Engines11 questions
- Deploying & Running19 questions
- Sinatra6 questions
- Rack6 questions
- ASP.NET Core (has its own guide)431 questions
- Project Setup & Startup21 questions
- Servers & Hosting19 questions
- HTTP Pipeline Composition20 questions
- Endpoint Routing Engine16 questions
- Minimal APIs18 questions
- MVC & Razor Pages28 questions
- Razor6 questions
- Model Binding Pipeline25 questions
- Configuration Sources & Options16 questions
- IServiceCollection Wiring14 questions
- Errors & Problem Details10 questions
- Request & Session State10 questions
- Sign-In & Permissions29 questions
- Built-In Security Defenses25 questions
- Database Plumbing10 questions
- Caching Stack26 questions
- Observability Signals22 questions
- API Contracts & Protocols27 questions
- Calling Downstream APIs11 questions
- Raw Push Channels11 questions
- Off-Request Processing11 questions
- Cultures & Translations10 questions
- App Testing Practice21 questions
- Performance & Deployment14 questions
- Solution Layout & Layers11 questions
- Aspire21 questions
- AppHost Resource Model5 questions
- ServiceDefaults Project4 questions
- Hosting & Client Integrations6 questions
- Publishing & Dashboard6 questions
- SignalR Core28 questions
- Hub Methods & Typed Hubs6 questions
- JavaScript & .NET Clients6 questions
- Users, Groups & Connections5 questions
- Backplanes & Scale-Out5 questions
- Transports & Hub Security6 questions
- Orleansempty
- YARPempty
- Ocelotempty
- Steeltoeempty
- ginempty
- Middlewareempty
- Response Renderingempty
- Testing Gin Appsempty
- echoempty
- fiberempty
- beegoempty
- Actixempty
- Axumempty
- Routingempty
- Extractorsempty
- Tower Middlewareempty
- State and Sharingempty
- Error Handlingempty
- Rocketempty
- Locoempty
- hyperempty
- Vaporempty
- Hummingbirdempty
- Venomempty
- Web Framework Concepts238 questions
- Request Lifecycle & Routing30 questions
- Middleware, Filters & Interceptors29 questions
- Handler Binding & Content Negotiation31 questions
- Dependency Injection & Configuration25 questions
- Boundary Serialization & Validation29 questions
- Error Handling & Problem Responses24 questions
- Sessions, Cookies & State22 questions
- Blocking, Async & Streaming24 questions
- Testing the HTTP Layer24 questions
- AI Engineerrole
- ASP.NET Coretool
- Backend Developerrole
- Blazortool
- Celerytool
- Djangotool
- Django REST frameworktool
- Expresstool
- FastAPItool
- Forward Deployed Engineerrole
- Full Stack Developerrole
- GraphQLskill
- Hotwiretool
- JS Full Stack Developerrole
- Java Backend Developerrole
- Kotlin Backend Developerrole
- Laraveltool
- Livewiretool
- Node.jstool
- Rubyskill
- Ruby on Railstool
- Server-Side Game Developerrole
- Spring Boottool
- Symfonytool
- Testcontainerstool
- jOOQtool
questions
5 305 · 17 sectionsWhat is @After advice in Spring AOP and when does it run?
basics
~20 s@After is advice that runs after a matched method finishes — whether it returned normally or threw an exception. It behaves like a finally block, so it is used for cleanup. It cannot see the return value or the exception.
What does Spring's @AfterReturning advice do, and when does it run?
basics
~10 s@AfterReturning is AOP advice that runs after an advised method finishes successfully (returns normally). It does NOT run if the method throws an exception. It can read the returned value but cannot replace it.
What is @AfterThrowing advice in Spring AOP and when does it run?
basics
~10 s@AfterThrowing is an aspect advice method that runs only when the matched method (join point) exits by throwing an exception. If the method returns normally, it does not run.
What is @Around advice in Spring AOP, and why must it call ProceedingJoinPoint.proceed()?
basics
~20 s@Around wraps a method call. It runs code before and after the target method. You must call proceed() to actually run the target method; if you skip it, the target never executes and you return your own value instead.
What is @Before advice in Spring AOP and when does it run?
basics
~10 s@Before advice is aspect code that runs before a matched method (the join point) executes. It's used for things like logging entry or validating arguments. It runs before, then the real method still runs.
In Ktor, what is the difference between starting a server with embeddedServer and with EngineMain?
basics
~10 sembeddedServer starts Ktor from Kotlin code, with the engine, host and port passed as arguments. EngineMain is a prebuilt main function that boots the same server from an application.conf or application.yaml file instead.
In Ktor, how do you protect a route with the Authentication plugin and read the principal?
basics
~10 sInstall Authentication and configure a named provider, then wrap the routes in authenticate("name") { }. Inside a handler, call.principal<T>() returns whatever the provider's validate block produced; routes outside the block stay public.
In Ktor, how do you create an HttpClient and read the status and body of a GET response?
basics
~10 sConstruct an HttpClient with an engine, then call the suspend function client.get(url). It returns an HttpResponse: read the code from response.status and the payload from response.bodyAsText() or the typed response.body<T>().
In Ktor, why do call.receive<User>() and call.respond(user) fail unless ContentNegotiation is installed?
basics
~20 sKtor's pipelines natively handle only bytes, text and form data. ContentNegotiation registers converters that map a media type to a class, so without it no converter exists for User and both the receive and the respond transformation fail.
In Ktor, what does install() do, and at which scopes can a plugin be installed?
basics
~20 sKtor's install() adds a plugin to a pipeline and runs its configuration block once at startup. Plugins can be installed application-wide inside a module, or — when the plugin is route-scoped — on a single route so only that subtree is affected.
How do you register a model with Django's admin, and how do you choose the columns its change list shows?
basics
~10 sRegister a model in the app's admin.py with admin.site.register(Ticket, TicketAdmin) or the @admin.register(Ticket) decorator on a ModelAdmin subclass. The change list shows the columns named in ModelAdmin.list_display, defaulting to the object's str.
In Django, what do the is_staff and is_superuser user flags each control, and can a superuser without is_staff use the admin?
basics
~20 sis_staff lets an active user into the Django admin; is_superuser makes has_perm() return True for every permission. They are independent: a superuser with is_staff=False cannot log in to the admin, and a staff user with no permissions sees nothing to edit.
In Django's async ORM, which QuerySet calls need an a-prefixed version in an async view, and which can you chain as usual?
basics
~10 sQuerySet builders such as filter(), exclude() and order_by() run no SQL, so they stay unchanged. Calls that execute a query use awaited a-prefixed versions: aget(), afirst(), acount(), acreate(). Iterate with async for.
In Django, how do you write an async view, both as a function-based view and as a class-based view?
basics
~20 sDeclare a function-based view with async def. For a class-based view, declare its HTTP handlers such as get() and post() with async def, leaving as_view() alone; the handlers must be all async or all sync.
In Django's contrib.auth, what is the difference between authenticate() and login(), and why does a sign-in view call both?
basics
~20 sauthenticate() checks credentials against the configured backends and returns a user or None without changing any state. login() takes that user and records it in the session, so later requests arrive with request.user set. A sign-in view needs both steps.
In Django REST Framework, what do authentication classes do, and what do request.user and request.auth hold after TokenAuthentication succeeds?
basics
~20 sAuthentication classes identify the caller; permission classes decide access. DRF tries each class in order, and the first returning (user, auth) sets request.user and request.auth: for TokenAuthentication, the token's user and Token instance; otherwise AnonymousUser and None.
In Django REST Framework, which permission applies to a view when none is configured, and how do you require authentication across the whole API?
basics
~10 sDRF's default permission is AllowAny, so an unconfigured view accepts anonymous requests. Set DEFAULT_PERMISSION_CLASSES to IsAuthenticated in REST_FRAMEWORK; a view's own permission_classes then replaces that list rather than adding to it.
In Django REST Framework, how do you switch on AnonRateThrottle and UserRateThrottle, and what does a throttled client receive back?
basics
~20 sDRF throttles nothing by default: list the classes in DEFAULT_THROTTLE_CLASSES and give 'anon' and 'user' rates like '100/day' in DEFAULT_THROTTLE_RATES. A throttled request gets 429 with a Retry-After header and a 'Request was throttled.' detail.
In Django REST Framework, what happens when a view raises NotFound, PermissionDenied or Throttled, and what body does the default exception handler return?
basics
~20 sDRF catches APIException subclasses raised in a view and returns a Response with the class's status_code and a body of {"detail": message}. Django's Http404 and PermissionDenied are mapped to 404 and 403; other exceptions propagate as a 500.
In Django REST Framework, how do filter_backends let clients filter, search and order a list endpoint such as GET /jobs/?
basics
~10 sA DRF generic view passes its queryset through each class in filter_backends: DjangoFilterBackend (django-filter) handles field filters like ?remote=true, SearchFilter handles ?search= over search_fields, and OrderingFilter handles ?ordering= limited to ordering_fields.
In Django Ninja, how do you protect a partner operation with an APIKeyHeader authenticator, and what does request.auth hold afterwards?
basics
~10 sSubclass ninja.security.APIKeyHeader, set param_name to the header, and implement authenticate(request, key) returning the partner or None; pass an instance as auth=. Ninja stores the truthy return value in request.auth, or answers 401.
In Django Ninja, how do NinjaAPI, Router and add_router() fit together, and how is the API mounted in urls.py?
basics
~10 sNinjaAPI is the API; each app defines a Router whose decorated functions are operations; api.add_router(prefix, router) mounts each router; and urls.py includes everything once with path('api/', api.urls), which also serves /docs and /openapi.json.
In Django Ninja, when a posted JSON body fails the operation's Schema, where does the 422 come from and what does it contain?
basics
~10 sDjango Ninja validates every declared parameter before calling the view, collects the failures into ninja.errors.ValidationError, and NinjaAPI's default handler for that exception returns 422 with a detail list of type, loc and msg entries.
In Django Ninja, with auth= set on the NinjaAPI, a Router and an operation, which applies, and how is one operation made public?
basics
~10 sThe most specific auth= replaces the others: operation, then the add_router() mount, then Router(auth=), then a parent router, then NinjaAPI(auth=). Settings are never merged. auth=None on an operation or router makes it public.
In Django Ninja, how does an operation decide whether a parameter comes from the path, the query string or the request body?
basics
~20 sDjango Ninja applies rules in order: an explicit Query/Path/Body/Form/File/Header/Cookie marker wins; a name in the path is a path parameter; a list, set, tuple or Schema is body; any other scalar is a query parameter.
In FastAPI, how do you make a sign-up endpoint send a welcome email only after the client has received its response?
basics
~10 sDeclare a parameter typed BackgroundTasks, call background_tasks.add_task(send_welcome_email, email) and return normally; FastAPI sends the response first, then calls the function with those arguments in the same process.
In FastAPI, when should a path operation function be declared with plain def, and when with async def?
basics
~20 sUse async def when the function awaits an async library or does no blocking I/O; use plain def when it calls a blocking library, because FastAPI runs def functions on a worker thread. When unsure, def is the safer choice.
In a FastAPI app, how does a yield dependency give each request its own database Session, and why is the engine created only once?
basics
~20 sCreate the engine once per process, write get_session() that yields a Session inside a with block, and alias it as SessionDep = Annotated[Session, Depends(get_session)]. FastAPI calls it once per request and closes the session afterwards.
In FastAPI, what does Depends() do with a function, and how does an Annotated alias let several endpoints share it?
basics
~20 sfastapi.Depends(func) tells FastAPI to call func for each request, reading func's own parameters as request inputs, and inject its return value. An alias such as Paging = Annotated[dict, Depends(paging)] bundles the type and the Depends so every endpoint reuses one declaration.
In FastAPI, how does a dependency written with yield instead of return run setup and cleanup around a request?
basics
~20 sFastAPI runs the code before the yield ahead of the endpoint, injects the yielded value, and runs the code after it once the request finishes, by default after the response is sent. Wrap the yield in try/finally.
With Passport and passport-jwt in an Express API, how do you protect a route with a bearer token from the Authorization header?
basics
~10 sRegister a passport-jwt JwtStrategy with jwtFromRequest set to ExtractJwt.fromAuthHeaderAsBearerToken() and a secretOrKey, map the verified payload to a user in its verify callback, then guard routes with passport.authenticate('jwt', { session: false }).
Why is express-session's default MemoryStore unsuitable for a production Express app, and what does its startup warning mean?
basics
~20 sWithout a store option, express-session keeps every session in a MemoryStore inside one Node process: abandoned sessions pile up in the heap, other processes cannot see them, and a restart wipes them, signing every user out.
With Passport in an Express app, what do passport.use(), a strategy such as passport-local and its verify callback each do during a password login?
basics
~20 spassport.use() registers a strategy under a name and passport.authenticate('local') runs it on a route. The strategy pulls credentials out of the request; your verify callback looks the user up and reports the outcome through done().
In Express 5, how does Express recognise an error-handling middleware function, and why must it be registered after the routes?
basics
~20 sExpress treats a middleware function as an error handler only when it declares exactly four parameters, (err, req, res, next). Errors travel forward through the stack, so it must be registered after the routes and middleware whose errors it should catch.
In Express 5, what must every (req, res, next) middleware do, and why does a request hang when one neither responds nor calls next()?
basics
~20 sExpress middleware must either end the request-response cycle with a response or call next() to pass control on. Doing neither leaves the request hanging: Express has no fallback reply and no response timeout, so the client waits until something else gives up.
In a NestJS app, how do you restrict a route to certain roles with a custom @Roles() decorator and a roles guard?
basics
~20 sCreate a Roles decorator with Reflector.createDecorator() or SetMetadata(), put it on the handler, and write a CanActivate guard that reads it through Reflector and compares it with request.user's roles; a false return makes Nest answer 403.
In a NestJS app using @nestjs/passport, what should a PassportStrategy subclass's validate() return, and where does that value end up?
basics
~10 svalidate() should return the authenticated user, which AuthGuard assigns to req.user before the handler runs. Returning null or false fails authentication with a 401; a thrown exception goes to Nest's exception layer instead.
In a NestJS 12 app, what does ConfigModule.forRoot() do with a .env file, and how do other modules get ConfigService?
basics
~20 sConfigModule.forRoot() parses the .env file in the working directory, merges it with process.env (real environment variables win by default) and registers ConfigService. A feature module imports ConfigModule to inject it, unless forRoot set isGlobal: true.
In a NestJS controller, how do @Controller, @Get, @Post, @Param, @Query and @Body turn an HTTP request into a handler call?
basics
~20 s@Controller('users') sets a path prefix and @Get(':id') or @Post() adds the HTTP method and sub-path. Nest fills arguments from @Param, @Query and @Body, then sends the return value, as JSON for objects, with status 200, or 201 for POST.
In NestJS 12, what response does the built-in exception filter send when a handler throws a NotFoundException, and when it throws a plain Error?
basics
~20 sNest's built-in global filter turns any HttpException, such as NotFoundException, into a JSON body with its status and message, here a 404. A plain Error outside that hierarchy becomes a logged 500 whose message is "Internal server error".
In Laravel, what is the difference between a gate defined with Gate::define and a policy class, and when would you choose each?
basics
~20 sA gate is a named closure registered with Gate::define for one-off checks not tied to a model. A policy is a class grouping one model's abilities (view, update, delete), found from the model you pass; most model rules belong there.
In Laravel's config/auth.php, what is the difference between a guard and a user provider, and what ships by default?
basics
~20 sA guard decides how a request is authenticated and remembered; a user provider decides where user records are loaded from. The Laravel 13 skeleton ships one web guard (session driver) pointing at one users provider (eloquent, App\Models\User).
In Laravel, how does a hand-built login use Auth::attempt, and why does the documented example call $request->session()->regenerate() afterwards?
basics
~20 sAuth::attempt($credentials) finds the user by the non-password keys, checks the password hash and, on success, signs them into the session, returning true or false. Regenerating the session ID defeats session fixation; Laravel 13's guard already does it in login().
In Laravel, what must be in place for the verified middleware to keep users with unconfirmed email addresses out of a route?
basics
~10 sApp\Models\User must implement Illuminate\Contracts\Auth\MustVerifyEmail, users needs an email_verified_at column, sign-up must dispatch Registered, the verification.notice, verification.verify and verification.send routes must exist, and routes use ['auth', 'verified'].
What two authentication mechanisms does Laravel Sanctum provide, and which one suits a first-party SPA versus a mobile app?
basics
~20 sSanctum offers cookie-based session authentication for a first-party SPA on a stateful domain, and database-backed personal access tokens sent as a Bearer header for mobile apps and scripts. Your own SPA uses the session; the mobile app uses a token.
In Livewire, how do wire:click and wire:submit call component methods, and how are arguments passed to those methods?
basics
~20 swire:click="addItem(42)" and wire:submit="checkout" send a request that calls that public method on the Livewire component. Arguments are JavaScript expressions sent as JSON; type-hinted models are resolved from ids and container services are injected. wire:submit prevents the browser submit itself.
In a Livewire component's Alpine code, how do $wire reads, writes and method calls differ in when they reach the server?
basics
~20 sReading $wire.guests and assigning $wire.guests = 3 stay in the browser; the assignment rides along with the next Livewire request. $wire.$set() sends a request by default, and calling $wire.checkAvailability() always does, resolving with the PHP return value.
In Livewire, when does an input bound with wire:model send its value to the server, and what does the .live modifier change?
basics
~20 sBy default wire:model is deferred: typing updates only client-side state, and the value reaches the server with the next action's request, such as a wire:submit. wire:model.live sends an update as the value changes, debounced 150 ms on text inputs.
In Livewire, how do you pass data from a Blade view into a nested component, and when does that component's mount() method run?
basics
~20 sPass props as attributes on <livewire:name /> (a colon prefix evaluates PHP) or in @livewire's array. mount() receives them by parameter name, or matching public properties are filled. mount() runs once, at creation, never on later requests.
In a Livewire component, how do you run code whenever a user changes one public property, such as recomputing an order total?
basics
~20 sDefine an updatedQuantity() method on the component: Livewire calls it after it writes a new quantity sent from the browser, so it can recompute the total. updatingQuantity() runs before the write; generic updating() and updated() receive the property name.
In Rails Action Cable, how do stream_from and stream_for differ, and how does a server-side broadcast reach a channel's subscribers?
basics
~10 sstream_from subscribes a channel to a broadcasting by its literal string name; stream_for builds that name from a record (channel name plus GlobalID). ActionCable.server.broadcast(name, data) or SomeChannel.broadcast_to(record, data) publishes it to every current subscriber.
In Rails, what is the difference between calling perform_later and perform_now on an Active Job class, and what does each one return?
basics
~20 sperform_later serializes the arguments and hands the job to the configured queue adapter, returning the job instance (or false if enqueuing failed); perform_now runs perform at once in the calling process and returns perform's own return value.
In a new Rails 8.1 app, which Active Job backend runs jobs in production, where does it keep them, and what starts its workers?
basics
~20 sSolid Queue: rails new installs it, stores jobs as rows in a separate queue database and sets it as the production adapter. bin/jobs starts its supervisor, or Puma starts it through plugin :solid_queue when SOLID_QUEUE_IN_PUMA is set.
In an Active Record model, in what order do the lifecycle callbacks run when save is called on a new record?
basics
~10 sSaving a new Active Record object runs before_validation, after_validation, before_save, around_save, before_create, around_create, the INSERT, after_create, after_save, then after_commit once the transaction commits. Updates swap each create hook for its update twin.
In a Rails 8.1 app, what does an Active Record model inheriting from ApplicationRecord get from its table's schema without declaring any attributes?
basics
~20 sActive Record reads the table's columns when the class first needs them and defines a typed reader, writer and ? method for each, seeds new records with column defaults and treats the primary key as id; ApplicationRecord itself is abstract and has no table.
In Sinatra, how is a request matched to a route such as get '/payments/:id', and how do you read path, splat and query parameters?
basics
~20 sSinatra tries the routes for the request's verb in definition order and runs the first match. Named segments, splats, regexp captures, query and form fields all land in params as strings, readable by string or symbol key.
In a Sinatra payment-webhook receiver, how would you use a before filter and a helper to reject requests whose signature fails to verify?
basics
~10 sDefine a helper that computes an HMAC of the raw body and calls halt 401 on a mismatch, then call it from before '/webhooks/*'. The halt skips the route, while after filters still run.
In Sinatra, what does erb :receipt render, and how do the layout, locals and instance variables reach that template?
basics
~10 serb :receipt renders views/receipt.erb, wrapped in views/layout.erb when that file exists. The template runs with the request's app instance as self, so it sees instance variables and helpers; the locals option adds local variables.
In a Sinatra route block, what is the difference between halt, pass and redirect, and what response does each one produce?
basics
~20 shalt stops the request at once and sends the status, headers and body you give it. pass abandons the current route so the next matching route answers, or a 404. redirect sets Location and a 302 or 303, then halts.
In Sinatra 4, how does a classic top-level app differ from a Sinatra::Base subclass in its defaults and startup, and how is each one run?
basics
~20 srequire 'sinatra' sends top-level DSL calls to Sinatra::Application and starts a server at exit when the file runs directly. A Sinatra::Base subclass is a plain Rack app with logging, method override and auto-start off, started by run! or a Rack server.
In Ruby, what is a Rack application, and what exactly must its call(env) method receive and return?
basics
~20 sA Rack application is any Ruby object that responds to call(env). It receives the request as an env Hash and returns a non-frozen three-element Array: an Integer status, a Hash of lower-case headers, and a body that responds to each or call.
In a Rack app, how would you write a middleware that measures each request's duration and adds it as a response header?
basics
~20 sA Rack middleware is a class whose initialize takes the inner app and whose call(env) reads a monotonic clock, calls @app.call(env), writes the elapsed time into the returned headers under a lower-case name, and returns the triple; config.ru adds it with use.
In a Rack config.ru, what do use, run and map do, and in which order does a request pass through the middleware?
basics
~20 sconfig.ru is Ruby evaluated inside a Rack::Builder: use adds a middleware, run sets the innermost app, and map mounts a sub-app under a path prefix. The first use line is the outermost layer, so it sees the request first and the response last.
In a Rack app, what do Rack::Request and Rack::Response give you over the raw env Hash and the response Array?
basics
~20 sRack::Request wraps the env Hash with readers such as params, path_info, get?, cookies and ip, caching parsed values in env. Rack::Response collects status, headers and body with helpers such as write, set_cookie and redirect, and finish returns the SPEC triple.
A Rack 2 middleware breaks after upgrading to Rack 3; what did the Rack 3 SPEC change about status, headers and the response Array?
basics
~20 sRack 3 requires an Integer status of at least 100, a mutable Hash of headers with lower-case names and Array values for repeated headers, and a non-frozen response Array; rackup, Rack::Server and Rack::Session also moved into separate gems.
In ASP.NET Core 10, how do you host a gRPC service defined in a .proto file, and what do Grpc.Tools, AddGrpc and MapGrpcService each do?
basics
~10 sReference Grpc.AspNetCore, add the .proto as a <Protobuf> item so Grpc.Tools generates a base class at build time, override its methods, then call builder.Services.AddGrpc() and app.MapGrpcService<T>(). Calls must arrive over HTTP/2.
In an ASP.NET Core 10 Minimal API, what goes wrong when GET /employees/{id} returns the EF Core Employee entity instead of an EmployeeDto record?
basics
~20 sReturning the entity hands System.Text.Json every public property, so Salary and any column added later leak, loaded navigations can throw an object-cycle JsonException, and the JSON contract changes whenever the table does. A response record lists exactly what is public.
In ASP.NET Core 10, what do AddOpenApi and MapOpenApi do, and at which URL is the default OpenAPI document served?
basics
~20 sAddOpenApi registers ASP.NET Core's built-in OpenAPI generator for a document named v1, and MapOpenApi adds a GET endpoint that builds and serves it at /openapi/v1.json. The webapi template maps it only in Development and ships no UI.
In ASP.NET Core, how do you add API versioning with the Asp.Versioning 10 packages, and what do its defaults do with an unversioned request?
basics
~20 sAsp.Versioning.Http (Minimal APIs) or Asp.Versioning.Mvc (controllers, via .AddMvc()) plus services.AddApiVersioning(). By default versions come from the api-version query parameter or a URL segment, nothing is assumed, so a request to a versioned endpoint without a version gets 400.
In an ASP.NET Core clean-architecture solution split into Web, Application, Domain and Infrastructure projects, what belongs in each project and which project references which?
basics
~20 sDomain holds entities and rules and references nothing. Application holds use cases and the interfaces they need, referencing Domain. Infrastructure implements those interfaces with EF Core and references Application. Web hosts Program.cs and the endpoints, referencing Application and Infrastructure.
In Aspire 13, what is the AppHost project, and what do its project file and AppHost.cs contain?
basics
~10 sThe AppHost is a small C# executable that only describes and starts the distributed app: its project file uses Aspire.AppHost.Sdk, and AppHost.cs calls DistributedApplication.CreateBuilder, adds resources such as AddProject<Projects.X>, then Build().Run().
What does the Aspire dashboard show while an Aspire 13 AppHost runs, and how do you get into it?
basics
~20 sThe Aspire dashboard is a local web UI the AppHost starts: it lists each resource's state, endpoints and environment, and shows console logs, structured logs, traces and metrics. You enter through the login URL with a browser token that aspire run prints.
In an Aspire solution, what does builder.AddServiceDefaults() turn on in each service, and why is ServiceDefaults a project rather than a package?
basics
~20 sAddServiceDefaults is a template-generated extension that adds OpenTelemetry logs, metrics and traces, a self liveness check, service discovery, and resilience plus discovery on every factory-created HttpClient. It ships as source in your solution so each team can edit it.
In an Aspire AppHost, what is the difference between WithReference and WaitFor, and why does a pizza-ordering API usually need both on its database?
basics
~20 sWithReference tells the consumer where a dependency is by injecting its connection string or endpoints at start; WaitFor holds the consumer back until that dependency is running and healthy. Without WaitFor the API can start before PostgreSQL accepts connections.
In Aspire 13, what is the difference between a hosting integration and a client integration, and which project gets each package?
basics
~20 sA hosting integration (an Aspire.Hosting.* package) goes in the AppHost and models a resource such as a PostgreSQL container. A client integration goes in the consuming service and registers a configured client, health check and telemetry from a connection string.
With the @microsoft/signalr JavaScript client, how do you connect to a hub, handle server pushes with on, and call a hub method?
basics
~10 sBuild a connection with new signalR.HubConnectionBuilder().withUrl("/ticker").build(), register handlers with connection.on("PriceChanged", fn) before awaiting connection.start(), then call hub methods with connection.invoke("Subscribe", "MSFT"), which returns a promise of the server's result.
In ASP.NET Core SignalR, what is a hub, how do you wire it up, and how do Clients.All, Clients.Caller and Clients.Others differ?
basics
~20 sA SignalR hub is a class deriving from Hub whose public methods clients call by name. Register it with AddSignalR() and MapHub<QuizHub>("/quiz"). Clients.All reaches every connection, Clients.Caller only the invoking connection, Clients.Others everyone except that caller.
Which transports does ASP.NET Core SignalR support, and how does a client end up using one of them?
basics
~20 sSignalR supports WebSockets, Server-Sent Events and long polling. By default the client first POSTs to the hub's /negotiate endpoint, gets the transports the server allows, and tries them in that order, falling back to the next one when a transport fails to start.
In the SignalR JavaScript and .NET clients, what does withAutomaticReconnect() do by default, and what does a reconnect not give back?
basics
~20 sSignalR clients do not reconnect unless you call withAutomaticReconnect(). By default it waits 0, 2, 10 and 30 seconds before four attempts, then closes. A successful reconnect is a new connection with a new connection id; pending calls and server-side per-connection state are gone.
In the SignalR JavaScript and .NET clients, how do invoke/InvokeAsync and send/SendAsync differ, and when should you pick each?
basics
~20 sinvoke (InvokeAsync in .NET) waits for the hub method to finish and returns its result or error. send (SendAsync) completes once the message is sent, so it returns nothing and never reports server-side failures. Use invoke when the outcome matters.
In a server-side web framework, how does a JSON request body differ from a form-encoded one, and what tells the framework which arrived?
basics
~20 sThe Content-Type request header names the format, and the framework picks a body parser from it. A JSON body is one nested, typed value; a form-encoded body is a flat, percent-encoded list of string key/value pairs.
How does a server-side web framework turn a multipart/form-data request body into the parts a handler works with?
basics
~20 sA multipart/form-data body is a run of boundary-delimited parts, each with its own headers naming the form field and, for files, a filename. The framework walks them in arrival order as field values or file handles.
In a server-side web framework, which parts of an HTTP request can a handler parameter be bound from?
basics
~20 sHandler parameters bind from captured path segments, the query string, headers, cookies, form fields, or the parsed body. The framework picks the source from an explicit marker on the parameter, or infers it from the parameter's name and type.
In a server-side web framework, how does an object returned from a handler become a response body and a status code?
basics
~20 sThe returned value models the body, not the whole response. The framework picks a writer for the negotiated media type, serializes the value, synthesises Content-Type and framing, then applies a default success status, conventionally 200.
In a web framework, how does a text value from a URL become a typed handler argument such as a number or enum?
basics
~20 sA URL carries only text. The binder finds a converter for the parameter's declared type, runs it on the raw string, and passes the result in. A failed conversion ends the request as a client error before the handler runs.