The "Napkin" Calculation
Before you can design a system, you need to know its scale. Is this handling 1,000 requests per second or 1,000,000? The answer changes everything — a system for 1,000 RPS fits on a single server; a system for 1,000,000 RPS needs a distributed architecture. Interviewers expect you to estimate scale quickly, without a calculator. The tool for this is Powers of 2 approximations.
The Rule of Thumb
The key insight is that $2^{10} = 1,024$, which is close enough to $10^3 = 1,000$ that we can treat them as equal for estimation purposes. This gives us a clean mapping between binary units (used by computers) and decimal units (used by humans):
| Power of 2 | Exact Value | Approximation | Name |
|---|---|---|---|
| $2^{10}$ | 1,024 | $10^3$ | Thousand / Kilobyte (KB) |
| $2^{20}$ | 1,048,576 | $10^6$ | Million / Megabyte (MB) |
| $2^{30}$ | ~1.07 billion | $10^9$ | Billion / Gigabyte (GB) |
| $2^{40}$ | ~1.1 trillion | $10^{12}$ | Trillion / Terabyte (TB) |
| $2^{50}$ | ~1.1 quadrillion | $10^{15}$ | Quadrillion / Petabyte (PB) |
Example Calculation
Scenario: "We have 1 million daily active users. Each user uploads 10 KB of data per day. How much storage do we need for 3 years?"
Work through it step by step, keeping everything in powers of 10:
- Users = $10^6$
- Data per user per day = $10 \times 10^3$ bytes = $10^4$ bytes
- Days = $3 \times 365 \approx 1,000$ days = $10^3$ days
- Total = $10^6 \times 10^4 \times 10^3 = 10^{13}$ bytes
Convert: $10^{13}$ bytes = $10^{13} / 10^{12}$ TB = 10 TB.
The interviewer does not care if the real answer is 10.95 TB. They care that you arrived at the right order of magnitude (tens of terabytes, not hundreds of gigabytes, not petabytes) and that you can reason through it systematically.
Useful Rates to Memorize
- Seconds in a day: $86,400 \approx 10^5$. This lets you convert "X per day" to "X per second" quickly.
- 1 million requests/day = $10^6 / 10^5$ = ~10 requests/second.
- 1 billion requests/day = $10^9 / 10^5$ = ~10,000 requests/second.