Backend Architecture
Request lifecycle: multiple-choice review
Six questions that cut across all seven stops. Each one mirrors a real incident — not a stage to name, but a symptom to localize to one stop and the mechanism that explains it.
Confirm you can take a symptom and jump to the right stop: connect accept-queue limits, middleware ordering, serialization cost, backpressure, and tail amplification into one decision reflex.
Under a traffic burst, clients get connection timeouts and resets, but the application logs are completely empty — no 500s, no handler traces. Which stop, and why are the logs empty?
A security review finds one admin endpoint serves unauthenticated requests, even though the auth middleware is implemented, tested, and registered. What is the most likely cause?
An endpoint is 40% slower after its result set grew from 50 to 5,000 rows, yet the database query time is unchanged at 8 ms. Where did the time go, and what is the first fix?
A streaming export OOMs only when a client downloads over a slow link. The code calls res.write() in a loop and ignores the return value. What is the precise mechanism?
A product page fans out to 100 independent services in parallel and waits for all. Each has a p99 of 10 ms (1% chance a call exceeds it). Roughly what fraction of page loads exceed 10 ms on at least one call, and what is the durable fix?
A request has a 1 s SLA. Service A (client timeout 1 s) calls service B (client timeout 1 s). When B hangs, A keeps working for the full second after the client has already given up. Why, and what fixes it?
The through-line of the unit is one reflex: given a symptom, jump to the stop that owns it. Empty logs under a burst means the accept queue (somaxconn) dropped connections before any code ran; an unauthenticated endpoint means middleware order, not auth logic; a slowdown that tracks payload size means serialization; an OOM under slow clients means ignored backpressure; and a slow page despite healthy services means tail amplification under fan-out, fixed with propagated deadlines and hedging. Latency is the sum across all seven stops plus queueing — so the map turns blind debugging into a single jump.