The whole repo, compressed into scannable reference tables for the night before an interview. This is not where you learn these things — it’s where you revise them once you already understand them. Skim it before a mock or an interview to reload everything into working memory.
Time to read: ~10 minutes to skim; keep it open during revision
🚨 Use this to refresh, not to learn. A cheat sheet is dangerous as a first exposure (you’ll memorize without understanding). Once you’ve done the chapters and case studies, this reloads it fast.
1. Requirements (5m) — functional + non-functional; interpret NFRs; scope out
2. Estimation (5m) — QPS, storage, bandwidth; use the numbers
3. High-level (10m) — client → LB → services → stores; both paths; API + data model
4. Deep dives (15m) — the component that matters; options + trade-off + choice; edge cases
5. Bottlenecks (5m) — what breaks next, how to scale it
6. Wrap up (5m) — summarize + trade-offs + what's left
🚨 Clarify before solutioning · estimate with purpose · justify every choice · drive · connect back to requirements. → Framework
| Thing | Value |
|---|---|
| Seconds/day | ~86,400 → 10⁵ |
| Seconds/month | ~2.6M |
| Seconds/year | ~31.5M → 3×10⁷ |
| Peak factor | ~2–5× average |
| Char | 1 byte · Tweet ~300 B · Web page ~1 MB · Photo ~1–5 MB · 1 min 1080p ~50 MB |
| 1 server | ~10K–100K QPS (simple) |
| Redis node | ~100K+ ops/s |
| SQL primary | ~a few K writes/s |
Latency (Jeff Dean-ish): L1 ~1 ns · RAM ~100 ns · SSD read ~100 µs · same-DC RTT ~0.5 ms · disk seek ~10 ms · cross-continent RTT ~100–150 ms. → Latency Numbers
Formulas: QPS = actions/day ÷ 10⁵ · Storage = objects × size × retention · Bandwidth = QPS × payload · Servers = total QPS ÷ per-server QPS (+ margin). → Estimation Drills
| Need | Reach for | | — | — | | Read-heavy, repeated reads | Cache (Redis) | | Static/media to global users | CDN | | Decouple / absorb bursts / async | Message queue / log (Kafka) | | Large blobs (images, video, files) | Object storage (S3) + CDN | | Scale reads | Replicas (+ cache) | | Scale writes / data size | Shard | | Distribute keys over changing nodes | Consistent hashing + vnodes | | “Is it in the set?” cheaply | Bloom filter | | “What’s nearby?” | Geospatial index (geohash/S2) | | Full-text search | Inverted index (Elasticsearch) | | Sortable distributed IDs | Snowflake | | Real-time bidirectional | WebSocket · one-way push → SSE | | Rank/top-K | Sorted set (Redis ZSET) | → Component Drills
| SQL | NoSQL | |
|---|---|---|
| Best for | Transactions, joins, strong consistency | Scale, flexible schema, simple access |
| Consistency | Strong (ACID) | Often eventual |
| Scaling | Harder (vertical + shard) | Horizontal by design |
| Pick when | Money, relational, complex queries | Massive scale, KV/document/wide-column access |
Storage engines: B-tree = read-optimized (SQL) · LSM-tree = write-optimized (Cassandra, metrics/logs).
1 server → split app/DB → add cache → add read replicas → load balancer + many app servers
→ CDN for static → shard the DB → microservices → multi-region
🚨 Each stage fixes the previous bottleneck; almost every stage is about the database; don’t skip ahead. → 1 → 1B
🚨 Then stop cramming and sleep. A rested brain outperforms a crammed one in a design interview.