← All posts

Series

System Design Mastermind

Real products reverse-engineered for Senior system-design interviews. Start with Foundations (the core concepts, told as stories), then three tracks: the classics, platform and infrastructure, and AI/ML systems. Each one walks the flow, the numbers, the APIs, the databases and what happens when each piece fails, with every claim tagged as seen, inferred or unknown.

Start here: F01
Foundations
18/18
Classics
6/10
Platform & Infra
5/12
AI / ML systems
8/9
Published
37 · 12 coming

The problems almost every loop draws from.

01

Uber system design, reverse-engineered: from tap to pickup

In-memory geo index sharded by map cell → rank nearby drivers by road ETA → offer to one driver with a 15 s timeout → accept with compare-and-set → push updates to both apps.

30 min · interactive Preview
12

Rate limiter system design: fair limits at a million requests a second

Check every request once in the API gateway → one atomic Lua script per request on the caller's shard of a sharded Redis (token bucket for per-second, window for per-day) → 429 + Retry-After, or forward with RateLimit headers → local cache for keys already over → each rule fails open or closed on purpose.

30 min · interactive Preview
23

WhatsApp system design: chat, offline delivery and the three ticks

One long-lived encrypted connection per device → the chat server stores a copy per recipient device in a replicated offline queue, then acks (✓) → session lookup, forward or push → the device saves and acks, the copy is deleted (✓✓) → a read receipt when opened. Client-made ids and dedupe at both ends, backoff with jitter on reconnect, Sender Keys for groups.

32 min · interactive Preview
26

Ticketmaster system design: selling seats without double-booking

Cached reads for browsing → a seat inventory with one row per seat, sharded by event → a hold is one conditional UPDATE (only if free or expired) with a 10-minute timer → pay with a client-made idempotency key → confirm only if the hold is still yours, plus an outbox for tickets. A waiting room admits fans at the rate booking can serve.

32 min · interactive Preview
29

News feed system design: fan-out, celebrities and ranking

Write each post once → fan-out workers push its id into active followers' capped Redis timelines → accounts above ~1M followers are merged at read time instead → the feed service gathers ~1,500 candidates, a light model trims them, a heavy model predicts actions, a weighted sum orders them → deletes and blocks are checked at read time, pages use a cursor.

32 min · interactive Preview
32

Notification system design: push, email and SMS without spam, drops or duplicates

One Notify API with an idempotency key → a router checks dedupe, preferences, caps and quiet hours, picks live devices → per-channel queues with a transactional lane apart from bulk → workers call APNs, FCM, email and SMS with priority, expiry and a collapse id, retry 429s with backoff and delete dead tokens → campaigns paced below the provider quota, OTPs fall back to SMS.

32 min · interactive Preview
··

Video streaming (YouTube / Netflix)

Coming next
··

URL shortener

Coming next
··

Typeahead / autocomplete

Coming next
··

Distributed cache / key-value store

Coming next