Many system design interviews start with estimation. How much traffic? How much storage? How many servers? Interviewers aren't checking exact numbers. They're checking that you can reason from a few assumptions to a sensible answer.
Numbers worth remembering
- There are about 86,400 seconds in a day. Round to 100,000 for quick math.
- 1 million requests a day is roughly 12 per second on average.
- Peak traffic is often 2 to 3 times the average.
- 99.9% uptime allows about 43 minutes of downtime a month.
Requests per second
2 million daily users each make 30 requests a day. What's the load? 60 million requests ÷ 86,400 ≈ 694 per second on average. At 3x peak, about 2,100 per second.
Storage
Users upload 500,000 photos a day at 2 MB each, stored 3 times. How much a year? 1 TB a day raw, so about 1,100 TB a year with copies. Then ask: do old photos need fast storage?
Uptime of a chain
A request passes through services at 99.99%, 99.9% and 99.95%. Overall? Multiply them: about 99.84%, or roughly 69 minutes of downtime a month. Every extra hop costs availability.
Caching
A cache answers in 2 ms, the database in 50 ms, and 90% of reads hit the cache. Average latency? 0.9 × 2 + 0.1 × 50 = 6.8 ms. Raising the hit rate to 98% brings it under 3 ms.
Sharding
40 TB of data, growing 20% a year, with shards under 2 TB and 2 years of headroom. How many shards? 40 × 1.2² = 57.6 TB. 57.6 ÷ 2 = 28.8, so 29 shards.
How to answer well
- State assumptions out loud and round aggressively
- Show the formula before the number
- Say what the number means for the design
For coding interviews too, see whether LeetCode is still worth it.
Questions
What is back of the envelope estimation?
Quick math from rough assumptions to size traffic, storage and servers. Interviewers care about reasoning, not exact numbers.
How do I convert daily requests to requests per second?
Divide by 86,400. 1 million requests a day is about 12 per second on average.
How do you calculate availability for services in a chain?
Multiply each service's availability. Three services at 99.9% give about 99.7% overall.