Back-of-Envelope Estimation
The art of quickly calculating system requirements using approximations. Essential for system design interviews and capacity planning.
Back-of-Envelope Calculator
Quick estimates for system design interviews
1Why Estimation Matters
System design is the same. Before choosing technologies, you need to estimate traffic, storage, and bandwidth to know if your design can handle the load.
Avoid over-provisioning (wasting money) or under-provisioning (outages).
Interviewers expect you to estimate QPS, storage, and bandwidth unprompted.
We need sharding because 1B rows will not fit on one machine - more convincing with numbers.
2Essential Numbers to Memorize
Powers of 2 (Data Sizes)
| Power | Exact Value | Approx | Name |
|---|---|---|---|
| 2^10 | 1,024 | 1 Thousand | 1 KB |
| 2^20 | 1,048,576 | 1 Million | 1 MB |
| 2^30 | 1,073,741,824 | 1 Billion | 1 GB |
| 2^40 | 1,099,511,627,776 | 1 Trillion | 1 TB |
| 2^50 | ~1 Quadrillion | 1 Quadrillion | 1 PB |
Time Conversions
Latency Numbers (Approximate)
Typical Data Sizes
3The Estimation Framework
4Common Estimation Scenarios
- 1. Monthly Active Users (MAU) = 300M
- 2. Daily Active Users (DAU) = 50% of MAU = 150M
- 3. Each user views timeline ~10 times/day
- 4. Total daily requests = 150M × 10 = 1.5B requests/day
- 5. QPS = 1.5B / 86,400 ≈ 17,000 QPS
- 6. Peak QPS = 2× average = ~35,000 QPS
- 1. Tweets per day = 500M
- 2. Average tweet size = 200 bytes (text only)
- 3. Daily storage = 500M × 200B = 100GB/day
- 4. Yearly storage = 100GB × 365 = 36.5TB/year
- 5. 5-year storage = 36.5TB × 5 = 182.5TB
- 6. With 3x replication = 182.5TB × 3 ≈ 550TB
- 1. DAU = 500M users
- 2. Each user views ~20 images/day
- 3. Average image size = 200KB
- 4. Daily data transfer = 500M × 20 × 200KB = 2PB/day
- 5. Per second = 2PB / 86,400s ≈ 23GB/s
- 6. In bits = 23GB × 8 = 185 Gbps
5Quick Reference Formulas
6Practice: Estimate a URL Shortener
Try This Exercise
Design a URL shortener (like bit.ly) and estimate:
- How many URLs can be shortened per day?
- How much storage is needed for 10 years?
- What QPS should the read service handle?
Assumptions: 100M new URLs/month, 100:1 read:write ratio
Write QPS: 100M / (30 × 86400) ≈ 40 QPS
Read QPS: 40 × 100 = 4,000 QPS
Storage: 100M × 12 months × 10 years × 500B = 6TB
With overhead: 6TB × 3 (replication) = 18TB total
7Common Mistakes
8Key Takeaways
9Interview Follow-up Questions
Interview Follow-up Questions
Common follow-up questions interviewers ask
10Test Your Understanding
Test Your Understanding
5 questions
A service has 500M monthly active users, 20% are daily active. Each user makes 8 requests per day. What is the approximate QPS?
You need to store 10 million images, each 500KB on average. How much storage is needed with 3x replication?
Which is approximately correct: 2^30 equals?
A system needs to handle 50,000 QPS at peak. Your servers handle 2,000 QPS each. How many servers minimum (with 25% buffer)?
Reading from RAM is approximately how much faster than reading from SSD?