URL Shortener
Shorten a long URL. Read-heavy. Don't collide.
The index · 81 systems
Don't skip to the diagram — that's the trap that makes designs collapse at scale. Start with clarifications, defend each choice against an AI staff engineer, then watch the simulator execute the diagram you land on.
Compose products from existing primitives — the classic interview loop: clarifications, requirements, capacity, API, data model, HLD, deep dives, trade-offs.
Shorten a long URL. Read-heavy. Don't collide.
Store text/code blobs with TTL and access control.
Politely traverse the web at scale. Don't crawl yourself in circles.
Push or pull? Both. The canonical fanout problem.
Ranked feed with cursor pagination. No `OFFSET`.
Vote-driven ranking with hot/top/new at scale.
Hundreds of millions of long-lived sockets, sub-second 1:1 + group delivery, E2E-encrypted, multi-device, multi-region active-active.
OT vs CRDT. Causal ordering. Real conflict-freedom. Server-authoritative single-writer doc-actor with WAL-before-ack — per-doc serialization, persisted before broadcast, pinned to a home region.
Channels, presence, history. Push or pull — and how a hot-channel fanout doesn't melt the gateway.
Push, email, SMS. Idempotent. Failover.
Pub/sub at scale. WebSocket vs SSE vs long polling. Approximate by design — mega-rooms drop comments on purpose.
Match a rider to the closest acceptable driver in under 3 s. Geohash, S2, surge.
Tiles, road graphs, contraction hierarchies, ETA.
Chunking, dedup, sync, conflict resolution.
ABR, CDN, transcoding, hot/cold — the egress, fan-out, and popularity Pareto.
Stream processing with watermarks and exactly-once.
Candidate generation + ranking. Online + batch.
Idempotent, double-entry, sagas vs 2PC.
Don't oversell. Hold-then-confirm.
Single-writer matching. Microsecond budgets.
Cron at scale: leader, exactly-once, DAGs.
Long-running multi-step LLM agents — durable workflow + sandboxed execution + LLM gateway. Brain / hands / state are independently replaceable. The agent run is a workflow, not a request.
Generate globally unique, monotonic-ish IDs at scale.
Cap request rates per user/key across a fleet.
Search by location with relevance ranking.
"X users viewing this right now." Hot keys, HLL.
Green dot for contacts. Mind the N² watch problem. Approximate by design — never quote presence more precisely than reality.
High write rate, ephemeral, do not persist.
Cursor + presence broadcast. Awareness protocols.
Millions of viewers on one entity. Approximate by design.
Eventual consistency, but the liker sees their own write. Counts are approximate by design; hot keys are the real enemy.
Dedup, bot-filter, batched aggregation.
Sliding windows + Count-Min Sketch + top-K.
Per-message per-recipient. Group chat amplifies.
Goal scored → 30M phones updated in <2s. Pub/sub fanout, edge delivery, thundering herd.
Conflate stale, prioritize, ordered, backpressure.
Order, fairness, anti-sniping, optimistic UI.
APNs/FCM rate limits, dedup, DND.
Idempotency keys, dedup window, retry storms.
At-least-once, backoff, poison pills, signing.
Single trigger, 50M recipient idempotency, catch-up.
Trie/FST, prefix sharding, personalization.
Edit distance at scale + LMs + query log mining.
Per-user storage + privacy + cold start.
Coalesce, probabilistic early expiration, SWR.
Write-through vs write-behind. Two generals.
Cache misses for things that never existed.
Redlock controversy, fencing tokens, lease vs lock.
ZK/etcd primitives, split-brain, lease renewal.