Skip to content
tezvyn:
Menu

⚙️Backend Dev

Backend engineering, APIs, and databases

534 bites

Test yourself: Top 30 intermediate Backend Dev interview questions →Multiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Intermediate everything in Backend Dev, page 2

intermediate1 min read

Streaming large file downloads efficiently

Use StreamingResponse with a generator that yields chunks (or FileResponse for an on-disk file), set media_type and a Content-Disposition header, so memory stays flat regardless of file size.

intermediate1 min read

Pydantic computed fields in response models

A @computed_field decorated property is excluded from input and validation but included in serialization and the OpenAPI schema, ideal for values like full_name derived from other fields.

intermediate1 min read

Mapping camelCase JSON to snake_case Pydantic fields

Set an alias_generator (to_camel) plus populate_by_name in model config, accept aliases on input, and serialize with by_alias=True so responses come out camelCase.

intermediate1 min read

Pydantic BaseModel vs dataclasses in FastAPI

BaseModel validates and coerces data at runtime, parses and serializes JSON, integrates with OpenAPI schema generation, and supports rich validators; dataclasses only store data with no validation.

intermediate1 min read

Testing a DB endpoint via dependency override

Use app.dependency_overrides to swap the real get_db for one yielding a test database session, run against a disposable SQLite or test Postgres, and assert through TestClient.

intermediate1 min read

Secure refresh token flow for access renewal

Short-lived access token, longer-lived refresh token stored server-side, a refresh endpoint that validates and rotates the refresh token issuing a new pair.

intermediate1 min read

WebSocket connection manager and broadcast

A manager class holding a list of active connections, connect accepts and appends, disconnect removes, broadcast iterates sending to each, all wrapped in try/finally to handle disconnects.

intermediate1 min read

BackgroundTasks dependency vs response.background

The injected BackgroundTasks parameter lets endpoints and dependencies stack tasks and is the common path; response.background attaches a single Starlette task when you return a Response object…

intermediate1 min read

Propagating a correlation ID without parameter passing

Middleware reads or generates the header, stores it in a contextvars.ContextVar, service code reads it anywhere, and logging filters inject it.

intermediate1 min read

MongoDB async ODM vs SQLAlchemy sessions

Motor client as a connection pool with no SQLAlchemy-style session or transaction; Beanie document models over Motor; initialize once at startup and await find queries.

intermediate1 min read

asyncio.gather vs asyncio.wait

Gather returns ordered results and propagates the first exception (or captures them); wait returns done/pending sets and never raises, you inspect each.

intermediate1 min read

How FastAPI uses type hints for validation

Hints drive parsing, validation, and conversion; a path declared int is coerced or returns 422; OpenAPI is auto-generated.

intermediate1 min read

Diagnosing intermittent crashes with PM2

PM2 auto-restarts and runs cluster mode for availability, inspect logs and metrics, watch memory for leaks, capture errors.

intermediate2 min read

Unit testing Express auth middleware in isolation

Build fake req/res, use a spy/mock for next and res methods, assert next called on valid token and 401 sent on invalid.

intermediate1 min read

JWT login and protected route flow in Express

Verify credentials, sign a JWT, client stores and sends it (Authorization header or httpOnly cookie), middleware verifies signature on protected routes.

intermediate1 min read

Defining many-to-many relationships in Sequelize

Use belongsToMany through a join table, the through table holds the foreign keys, eager-load courses with include.

intermediate1 min read

Nested routes versus query params for related resources

Nested routes express ownership and scope clearly, query params on the flat resource are flexible for filtering and combining.

intermediate1 min read

Callback hell and how to refactor it

Deeply nested callbacks (pyramid of doom) hurt readability and error handling, refactor with promises or async/await.

intermediate1 min read

Blocking versus non-blocking I/O in Node

Blocking calls halt the thread until done, non-blocking returns immediately and notifies via callback or promise, fs.readFileSync versus fs.readFile.

intermediate1 min read

Managing user presence with reconnection grace periods

Rely on heartbeats, apply a grace period before marking offline, reconcile reconnects by user not socket id, use a shared store for multi-instance.

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles