Estimate Servers for an API Load
Problem
A consumer product with 100 million daily active users exposes a JSON API from its mobile apps. Each user makes on the order of 20 API calls per day. A typical call does a couple of database reads, some business logic, and serializes a response, taking about 50 ms end to end on an unloaded server, of which roughly 20 ms is CPU on the API server and the rest is waiting on downstream calls.
Estimate how many API servers you need to run. Show the request rate, the per-server capacity, and the headroom you would add before you would sign off on the number.
- Assume each API server is a 32-core machine.
- Plan for peak traffic, not average.
- The service runs in three zones and must survive losing one at peak.
Examples
Defaults to state; each can be swapped for whatever the interviewer gives you:
- Requests per day: 100M users × 20 calls = 2 × 10^9 requests/day.
- Peak-to-average ratio: 3× is standard for a consumer app concentrated in a few time zones; 2× for a global audience.
- CPU per request: 20 ms of CPU on the API server. If the interviewer says "it's an I/O-bound service, CPU is 5 ms," recompute; the method is the same.
- Target utilization: run servers at 50-70% CPU at peak, not 100%. Latency degrades sharply above ~70-80% because queuing delay grows non-linearly with utilization.
- Zone failure: with three zones, losing one leaves two-thirds of capacity, so provision 1.5× the peak need.
- Latency budget: the 50 ms is service time; you are asked for capacity, not tail latency, but note that they interact.
Hints
- Start with QPS at peak. Average QPS is a trap; nobody provisions for 3 a.m.
- A server's throughput is cores ÷ CPU-seconds per request, scaled by target utilization. Wall-clock latency including I/O waits does not limit throughput if the server is asynchronous or has enough threads; CPU does.
- Headroom is multiplicative: utilization target, zone failure, and growth each add a factor. Apply them in sequence and state each one.
Last reviewed 8 September 2026
Approach · Answer · Complexity · Follow-ups · Company variations
The rest of this question — the worked approach, the Python solution with passing tests, complexity, follow-ups and how each company frames it — is part of the guides.
Get the full guide
Pick the company you're interviewing with. Each guide has every question tiered for that loop — one-time purchase, lifetime access.
Also in: Apple, Google, Meta, Microsoft, Netflix
Interviewing at more than one? All 6 guides for $499 · save $395
Not ready to buy? Get the free starter pack — 13 questions with full solutions.