Reference
Everything you need to know cold on interview day. Keep this open in another tab.
Universal constants
- 1 day = 86,400 seconds
- 1 month ≈ 2.5 M seconds · 1 year ≈ 31.5 M seconds
- Peak multiplier: 5× average (consumer APIs) · 10× (notifications / events)
- Concurrent users ≈ 10% of DAU at any moment
- Read/write ratio typical: 100:1 for social feeds, 10:1 for e-commerce
The 5-step framework
- Clarify: state assumptions, scale, consistency, edge cases — out loud
- Traffic: DAU × actions/day ÷ 86,400 = avg RPS → ×5 (or ×10) = peak
- Storage: entities/day × bytes/entity × retention days
- Bandwidth: peak RPS × payload × 8 bits = bps
- Scale: ops_needed ÷ component_capacity = nodes → ×3 replication
Component throughput
| Redis single node | ~100K ops/s |
| MySQL / Postgres write | 5K–10K/s |
| Cassandra per node | ~50K writes/s |
| Kafka single broker | ~1M msgs/s |
| Elasticsearch per node | ~5K writes/s |
| S3 / object storage | ~3.5K req/s per prefix |
| Load balancer (L7) | ~100K req/s |
| SSD random IOPS | 100K IOPS |
| HDD sequential | 100 MB/s |
Latency numbers (know these cold)
| L1 cache reference | ~0.5 ns |
| L2 cache reference | ~7 ns |
| RAM access | ~100 ns |
| SSD random read | ~150 μs |
| HDD random read | ~10 ms |
| Same-DC network RTT | ~0.5 ms |
| Cross-region RTT (US↔EU) | ~80 ms |
| Cross-region RTT (US↔Asia) | ~150 ms |
| TCP handshake (local) | ~1 ms |
Storage sizes
| UUID / GUID | 16 B |
| Unix timestamp (int64) | 8 B |
| Average user record | ~1 KB |
| Tweet / short message | ~200–500 B |
| Redis key overhead | ~60 B |
| MySQL row overhead | ~100 B |
| Photo (JPEG compressed) | ~300 KB |
| Video 1 min 720p | ~50 MB |
| Video 1 min 4K | ~375 MB |
Powers of 2
| 210 = 1 KB | 1,024 |
| 220 = 1 MB | 1,048,576 |
| 230 = 1 GB | 1,073,741,824 |
| 240 = 1 TB | ~1 trillion |
| 250 = 1 PB | ~1 quadrillion |
Quick rules of thumb
- 1M users × 1 KB = 1 GB storage
- 1M req/day ÷ 86,400 ≈ 12 RPS
- 100M DAU × 10 actions = ~12K avg RPS (×5 peak = 60K RPS)
- 1 TB/day ÷ 86,400 ≈ 12 MB/s ingress
- Replication factor 3 → multiply raw storage × 3
- Index overhead ≈ 10–20% on top of data size