Part 12 — Case Studies
36 full system designs, each run through the framework
from Part 11. This is where all the theory becomes muscle memory. Every case study follows the same
structure — requirements, estimation, API, data model, high-level design, deep dives, bottlenecks,
trade-offs, follow-ups, and what junior/mid/senior answers look like — so you learn the shape of a good
answer, not just the facts of one system.
Time for this part: Weeks 3–8, in parallel with Part 11. Don’t read these passively — for each one, try
to design it yourself first (set a 45-minute timer), then read. The gap between your answer and the
write-up is your study list.
How to use them: The studies are ordered easy → hard and grouped by the pattern they teach. Patterns
recur — fan-out, reserve-then-confirm, candidate-gen→rank, event-log-as-source-of-truth — and the studies
cross-reference each other so you build a web, not a list. When a study reuses a pattern, it says so and
moves on; learn to do the same in interviews.
The 36 designs
Warm-ups — the shape of an answer (Tier 1)
| # |
Design |
Teaches |
| 8 |
Twitter / X ⭐ |
Fan-out write vs read; the celebrity problem; hybrid |
| 9 |
Instagram |
The media pipeline; async processing; CDN |
| 10 |
News Feed |
Ranked feeds; candidate-gen → ranking |
| 11 |
Chat System ⭐ |
WebSockets; presence; delivery guarantees; offline sync |
| 12 |
Video Streaming |
Transcoding; adaptive bitrate; CDN at planetary scale |
| 13 |
File Storage / Dropbox |
Chunking; dedup; delta sync; conflict resolution |
Location & marketplaces (Tier 2–3)
Infrastructure — build the building blocks (Tier 2–3)
| # |
Design |
Teaches |
| 17 |
Distributed Cache |
Consistent hashing; eviction; replication internals |
| 18 |
Job Scheduler |
Exactly-once; leader election; lease-based recovery |
Commerce, money & inventory — correctness first (Tier 3)
Search, maps & big data (Tier 3)
Real-time, correctness & ML (Tier 2–3)
The recurring patterns
Once you’ve done a dozen, you’ll notice the same handful of ideas solve most problems. This is the payoff —
recognizing the pattern is half the battle:
- Read-heavy → cache + precompute. URL shortener, feeds, typeahead, search. Reads scale by copying.
- Fan-out (write vs read) + the celebrity/hot-key hybrid. Twitter, Instagram, news feed, notifications,
chat groups.
- Metadata in the DB, big blobs in object storage + CDN. Pastebin, Instagram, video, file storage.
- Reserve-then-confirm with a TTL (don’t oversell). E-commerce, ticketing, hotel booking.
- Candidate generation → ranking (two-stage). News feed, recommendations, search, fraud.
- Precomputed feature store + fast online serving. Feed ranking, recommendations, fraud detection.
- Event log as source of truth; derive views; replay. Ad aggregator, stock exchange, payments,
message queue.
- At-least-once + idempotency = exactly-once effect. Notifications, job scheduler, payments, queues.
- Strong consistency only for money & stock; eventual everywhere else. E-commerce, payments,
ticketing.
- Geospatial index + partition by geography. Ride-hailing, food delivery, maps.
- Stateful real-time connections (WebSocket/UDP) + presence + reconnect sync. Chat, collaborative
editing, multiplayer games.
- Batch (exact, slow) + stream (fresh, approximate) two-speed. Ad aggregator, typeahead, search,
metrics, recommendations.
How to practice a case study
- Read the requirements only, then close the page.
- Design it yourself in 45 minutes — out loud, on a whiteboard, following the framework.
- Compare to the write-up. Note what you missed — a deep dive? the key trade-off? an edge case?
- Redo it a week later. The goal is fluency, not memorization — you should be able to derive the
design, not recall it.
- Explain it to someone (or rubber-duck it). If you can teach it, you know it.
See Part 13 — Practice for structured drills and a problem bank.
Next: Part 13 — Practice — drills, self-grading, and how to turn these case studies
into interview-ready fluency.