System Design · Core
Back-of-Envelope Estimation
Quick math for RPS, storage, and bandwidth so design choices are grounded.
Concrete example: If Netflix serves 100,000 simultaneous viewers at 5 Mbps each, the outgoing traffic is about 500 Gbps. That immediately justifies a CDN instead of serving every stream from one origin.
1. Why estimate
Numbers decide whether you need a cache, shards, or a CDN — not vibes. Interviewers want to hear you say assumptions out loud before you draw boxes.
2. Typical questions
- QPS / RPS (peak and average)
- Storage over N years
- Bandwidth (ingress/egress)
- Cache size / hit-rate assumptions
3. Powers of ten (memorize)
Round aggressively to powers of 10. Being within 2× is fine — the goal is to show reasoning, not perfect arithmetic.
4. Worked example — URL shortener
Takeaway: modest writes, heavy reads → cache + read replicas; one primary DB may still work for writes.
5. Worked example — Instagram-style feed writes
Say out loud: "I'll assume X users, Y actions each, convert to per-second, multiply by peak factor 2–3×."
6. Cache sizing (quick)
7. Bandwidth example — photo upload app
8. Latency reference (memorize order of magnitude)
| Operation | ~Latency |
|---|---|
| L1 / L2 cache | 1–4 ns |
| RAM | ~100 ns |
| SSD read | ~100 µs |
| Same-DC RTT | ~0.5 ms |
| HDD seek | ~10 ms |
| Cross-country RTT | ~150 ms |
9. Throughput ballparks
- SSD sequential read ~500 MB/s; 1 Gbps NIC ~125 MB/s
- One modest web box: often ~1k–10k simple req/s depending on work
- One DB primary: often ~1k–5k simple writes/s before you shard
Quick revision
- Always state assumptions before multiplying.
- Derive: writes/s, reads/s, GB/month, peak multiplier.
- Latency ladder: RAM << SSD << disk << WAN.
- Use numbers to justify cache / shard / CDN.