Skip to content
tezvyn:

⚙️Backend Dev

Backend engineering, APIs, and databases

533 bites

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

Interview questions in Backend Dev, page 22

How do you define a WebSocket endpoint in FastAPI?
easy2 min read

How do you define a WebSocket endpoint in FastAPI?

Import WebSocket, use @app.websocket, await accept, receive_text, then send_text.

easy1 min read

How to add Socket.IO to an Express application?

Create HTTP server with express(), attach Socket.IO to it, listen on server not app, define event handlers.

advanced2 min read

Tuning HNSW for recall vs latency

ANN trades exactness for speed, and HNSW knobs M and efConstruction shape graph quality while efSearch trades query latency for recall at runtime.

easy2 min read

Handling Result and errors in a Rust web handler

Handler returns Result, the ? operator early-returns errors, a custom error type implements IntoResponse to map to 500, success returns 200 with data.

easy2 min read

What are startup and shutdown events in FastAPI?

Tests app lifespan hooks and resource lifecycle. Startup creates DB pools before traffic arrives; shutdown closes them after the last request. These decorators are deprecated; prefer lifespan context managers. Red flag: per-request middleware.

intermediate1 min read

How do Socket.IO rooms organize client communication?

Rooms group sockets for targeted broadcasting, socket can join multiple rooms, emit to room broadcasts to all members.

intermediate1 min read

Zero-downtime schema migration on a hot table

Expand-migrate-contract phases, dual-write and backfill, decouple deploys from migrations.

easy1 min read

In-memory rate limiter middleware in Go

Use a token-bucket limiter (golang.org/x/time/rate), guard a per-client map with sync.Mutex, wrap http.Handler so requests over the limit get 429.

How do you handle a WebSocket client disconnect in FastAPI?
intermediate2 min read

How do you handle a WebSocket client disconnect in FastAPI?

Cite installing websockets, Handling disconnections and multiple clients pattern, and Depends.

intermediate1 min read

How does Socket.IO handle WebSocket failures with fallbacks?

Transports are communication protocols, WebSocket is primary, long-polling is fallback, client auto-detects and downgrades.

intermediate1 min read

SQL isolation levels and the anomalies they prevent

Read Uncommitted allows dirty reads; Read Committed blocks them; Repeatable Read blocks non-repeatable reads; Serializable blocks phantoms.

intermediate1 min read

Logging middleware wrapping an http.Handler in Go

Middleware has signature func(http.Handler) http.Handler, records start time, calls next.ServeHTTP, then logs method, URL, and elapsed duration; chaining works because the wrapper is itself a…

intermediate2 min read

Use startup events to initialize a database pool and inject it

This tests FastAPI lifespan hooks and dependency injection for shared state. A strong answer creates the pool in an async startup handler, stores it on app.state, and accesses it via a dependency in routes. A red flag is creating a fresh pool per request.

intermediate1 min read

How to authenticate WebSocket connections using JWTs?

Client sends JWT on connection, server validates via middleware, socket is attached to user.

intermediate1 min read

When a graph database beats relational or document stores

Deeply connected data, variable-depth traversals, fraud or recommendation paths, index-free adjacency.

intermediate2 min read

Static dispatch over Write with generics in Rust

Write generically over the std::io::Write trait with a type parameter W: Write, letting the compiler monomorphize and inline per concrete type, avoiding the vtable indirection of Box<dyn Write>.

How do you authenticate a FastAPI WebSocket connection?
intermediate2 min read

How do you authenticate a FastAPI WebSocket connection?

This tests WebSocket limits and FastAPI dependency injection. Pass the JWT via query parameter or cookie at handshake, validate it with Depends, and reject with HTTP 403 or 1008 close.

intermediate1 min read

How to sync state across multiple user devices?

Attach userId to each socket, track active sockets per user, broadcast user state to all their sockets.

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

Choosing a good shard key and avoiding hot spots

High cardinality, even write distribution, query alignment; monotonic keys send all writes to one shard.

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