05 / SYSTEM DESIGN

System Design

A playbook for the 45-minute design interview, the numbers you must be able to estimate, twenty-nine one-page concept sheets (each with a "Say this" line and the trade-offs), and six full walkthroughs. The Digital Mansion primer is the gentle on-ramp if you have never been asked to "design Instagram".

Start here 39 pages · 3 groups

Concepts

29 pages

One page per concept: what it is, how it works, the trade-offs, the numbers, and the sentence to say.

  1. ACID vs BASEArticle
  2. API Design: REST vs GraphQL vs gRPCArticle
  3. API GatewayArticle
  4. Availability and the NinesArticle
  5. Blob / Object StorageArticle
  6. CachingArticle
  7. CAP Theorem (and PACELC)Article
  8. CDN (Content Delivery Network)Article
  9. Consistency ModelsArticle
  10. Consistent HashingArticle
  11. Database IndexingArticle
  12. Database ReplicationArticle
  13. Database ShardingArticle
  14. Distributed Transactions and SagasArticle
  15. DNSArticle
  16. Event-Driven ArchitectureArticle
  17. IdempotencyArticle
  18. Latency vs ThroughputArticle
  19. Load BalancersArticle
  20. Message Queues and StreamsArticle
  21. Microservices vs MonolithArticle
  22. ObservabilityArticle
  23. Proxies: Forward vs ReverseArticle
  24. Rate LimitingArticle
  25. Scaling: Horizontal vs VerticalArticle
  26. Security Basics: AuthN and AuthZArticle
  27. SQL vs NoSQLArticle
  28. Unique ID GenerationArticle
  29. Real-Time Delivery: Polling, Long Polling, SSE, WebSocketsArticle

Vocabulary dump (the words that vanish mid-interview)#

  1. idempotent — same effect when repeated; backpressure — downstream slows upstream instead of dropping; fan-out — one event delivered to many consumers/feeds.
  2. hot partition — one shard/key takes disproportionate load; thundering herd — many clients wake/retry at once (cache miss storm); split brain — two nodes both think they are leader.
  3. quorum — majority (⌊N/2⌋+1) or R+W>N overlap; tail latency — p99/p99.9, what users actually feel; head-of-line blocking — one slow item blocks everything queued behind it.
  4. circuit breaker — stop calling a failing dependency, probe later; bulkhead — isolate pools so one failure can't drain all resources; sidecar — per-service helper proxy/process (Envoy); service mesh — sidecars + control plane (Istio, Linkerd) for mTLS/retries/telemetry.
  5. saga — chain of local transactions with compensations; outbox — write event in the same DB transaction, relay publishes it; CQRS — separate write model and read model(s).
  6. materialized view — precomputed query result stored as a table; denormalization — duplicate data to avoid joins; write amplification — one logical write causes many physical writes (indexes, LSM compaction); read amplification — one logical read touches many structures (SSTables).
  7. cold start — latency penalty of a fresh instance/function/cache; warm cache — pre-populated before traffic; stale-while-revalidate — serve stale now, refresh in background.
  8. exponential backoff with jitter — retry delays double plus randomness to avoid synchronized retry storms; leader election — pick one coordinator via consensus (Raft/Paxos/Zab in etcd/Zookeeper) or lease.
  9. gossip protocol — nodes periodically exchange state with random peers; membership/failure detection converges in O(log N) rounds; vector clock — per-node counters to detect concurrent vs causal versions; CRDT — data type that merges concurrent updates deterministically (counters, sets, text).
  10. Bloom filter — probabilistic "definitely not / probably yes" set membership, no false negatives; HyperLogLog — count distinct in ~12 KB with ~1% error (Redis PFCOUNT); Merkle tree — hash tree to compare replicas and sync only differing ranges (Cassandra repair, Git, Dynamo).