Interview Q&A · questions with model answers
Web Framework Internals Interview Questions
Part of the study plan for: Backend Engineer
Ordered by how often they're asked. Most-asked answers are free to read in full; members see every answer and can rate their confidence on each.
-
What does PHP-FPM's capacity depend on, and why can it fail with low CPU usage?
Capacity is roughly the number of workers (pm.max_children) divided by the average request time. Workers waiting on slow I/O use no CPU but still occupy slots, so the pool saturates, requests queue…
-
Scenario: users get 504 errors but your application logs show those requests succeeding. What is happening?
An outer layer (load balancer or reverse proxy) timed out before the application finished; the app kept working and logged success. Align timeouts so inner layers are shorter than outer ones, move…
-
Scenario: after moving to an async framework, every endpoint becomes slow whenever one partner API is slow. Why?
A blocking call (synchronous HTTP client, time.sleep, sync DB driver, CPU-heavy code) inside an async handler holds the event loop, so all requests on that loop wait. Use async clients, offload…
-
Scenario: an API returns 500 instead of 401 for expired tokens. In which frameworks have you seen this and why?
It happens when the auth check throws in a layer outside the framework's exception handling: a servlet filter in Spring (bypasses @ControllerAdvice), an HTTPException raised in Starlette/FastAPI…
-
Scenario: one new endpoint leaked other customers' data while forty others were fine. How do you prevent this class of bug?
Move authorisation out of per-controller code into a default-deny pipeline layer (middleware, guard, dependency, security config) that requires every route to declare a rule, keep resource-level…