Advanced interview questions in Backend Dev, page 7
How do you directly modify FastAPI's generated OpenAPI dictionary?
Tests deep FastAPI lifecycle knowledge. Override app.openapi: save the original, call it to get the dict, mutate it, cache on app.openapi_schema, and return. Red flag: rewriting /openapi.json in middleware or touching the schema cache directly.
TSM-Tree vs LSM-Tree storage engines
Both buffer writes in memory and flush sorted immutable files, but TSM organizes by series and time with columnar, heavily compressed blocks tuned for ordered appends and range scans.
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.
Cross-server Socket.IO communication in horizontal scaling?
Local io.emit() only reaches local sockets, need adapter (Redis) for inter-server broadcast.

How do you broadcast WebSocket messages to all clients across server nodes?
Tests WebSocket horizontal scaling and pub/sub backplanes. A strong answer names a broker like Redis, describes cross-node fan-out, and keeps connection state purely local.
WebSocket optimization for high-frequency data?
Large payloads increase latency, frequent tiny messages waste overhead, solutions include compression, selective fields, and batching.
Architecting an L7 proxy in Go versus Rust
Go offers GC and cheap goroutines for fast delivery but tail-latency GC pauses; Rust offers ownership and async/await for predictable latency at higher complexity.
How do you handle slow startup without blocking the FastAPI event loop?
It tests FastAPI lifespan events and event loop hygiene. Use an async lifespan to offload blocking model loading to a thread pool, track readiness with a global flag, and return 503 for early requests. Never block the event loop in startup handlers.
Why Pin is needed for self-referential Futures
Async blocks compile to state machines that can hold references into their own storage; Pin guarantees the value will not move so those internal pointers stay valid across polls.

How do you inspect WebSocket close codes in FastAPI?
Tests WebSocket lifecycle handling in FastAPI. Strong answers catch the disconnect exception, read its code attribute, and log 1000 for normal closures versus 1001/1006 for crashes.
Graceful shutdown implementation and zero-downtime deployments?
Listen for SIGTERM, stop accepting new connections, drain in-flight requests, close resources, exit.
Diagnosing a slow FastAPI endpoint under load
Add timing and tracing to isolate the slow span, watch CPU vs wait time and event-loop lag, then use profilers like py-spy or cProfile and DB EXPLAIN.
Multi-stage Docker builds for lean production images?
Build stage compiles/installs, runtime stage copies artifacts only, discards build tools.
Limits of BackgroundTasks vs Celery or ARQ
BackgroundTasks run in the same worker with no persistence, retries, or visibility, and die with the process; Celery or ARQ add durability, retries, scheduling, and separate workers.
Zero-downtime blue-green deploys on Kubernetes
Run blue and green deployments, switch a Service or ingress selector to the new color after readiness probes pass, drain old pods gracefully, and handle backward-compatible DB migrations.
Managing secrets for containerized Node.js on Kubernetes
Use Kubernetes Secrets or an external vault, mount as files not env, encrypt at rest, rotate.
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