The interview problem
A service's safe concurrency changes with request cost. Design a feedback controller that avoids unstable overload oscillations.
Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.
1. Scope and worked approach
Assume the admission layer sees all requests to the controlled backend. Measure completed latency and a low-load baseline, then adjust an in-flight limit gradually within hard minimum and maximum bounds. Separate queued time from backend time and partition measurements for materially different request classes. Reject or shed excess work rather than growing an unlimited queue. Keep an operator override and a conservative startup limit.
2. Trace the design or derivation
Measure baseline and samples → compare congestion signal → bound limit change → admit or reject
Controller state needs enough smoothing to resist one outlier but must retain a separate emergency ceiling for memory or connection exhaustion. Compare against a tuned fixed limit before accepting the added complexity. A lower p99 achieved solely by rejecting most traffic is not an unconditional improvement.
3. Calculate the example
At 200 completions/s and mean residence time 0.1 seconds, Little's-law average occupancy is 20 under stable conditions. If residence time rises to 0.5 seconds at the same throughput, occupancy becomes 100; admitting more work may be increasing queueing rather than useful capacity.
4. Failure cases and trade-offs
Latency rises can reflect heavier legitimate work, not congestion. Sampling only successful fast calls biases the controller. Aggressive gains oscillate; slow gains react late. Jitter baseline probes across clients to avoid synchronized capacity reductions.
5. Validation, follow-ups and self-review
Replay cost shifts, bursts and dependency slowdown; inspect limit oscillation and useful throughput. Follow-up: how do delayed completions bias feedback? Self-review: state control scope, measurement boundary and fail-safe bounds.
Sources and related practice
Technical reference: www.envoyproxy.io — Adaptive concurrency concepts; the Little-law example is not an Envoy controller formula.
Source publication/update: Not established. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.
Continue with Design a distributed rate limiter; Isolate slow dependencies with bulkheads.
Continue your preparation
Choose a connected learning path or browse more System design questions. Read our editorial method and attribution policy.