Skip to main content

Foundational Building Blocks

Run the four warm-up 'design X' interviews that show up in almost every loop (URL shortener, distributed rate limiter, Snowflake ID generator, and typeahead), moving cleanly from back-of-envelope estimation to a concrete data model, a read path, and the one deep dive each problem is really testing.

0/4

Social, Feed & Messaging

Whiteboard the four social-scale classics under interview time pressure: a fan-out timeline with celebrity hot keys, a photo-sharing app that splits blobs from metadata behind a CDN, a real-time chat system with per-conversation ordering and offline delivery, and a reusable multi-channel notification backbone.

0/4

Geo, Media & Collaboration

Walk an interviewer through five of the most-asked case studies end to end: ride matching over moving objects, cross-device file sync, upload-to-playback video at global scale, real-time collaborative editing, and read-heavy proximity search. Each teaches a transferable core that recurs far beyond the named product.

0/5
Lesson 09

Design a Ride-Sharing Service (Uber)

Index moving drivers with a space-filling spatial index (H3/S2/geohash) sharded by geography, keep locations in memory as overwrites, and rank matches by ETA under an exclusive-assignment lock, with the trip state machine as the one strongly consistent part.

hard40 min
Lesson 10

Design a File Sync & Storage Service (Dropbox)

Content-defined chunking plus per-chunk hashing gives dedup and delta sync (upload only changed chunks), a strongly consistent metadata service maps files to chunk manifests and versions, and conflicts are resolved by keeping both copies plus history rather than merging blindly.

hard40 min
Lesson 11

Design Video Streaming / VOD (YouTube/Netflix)

Transcode once, asynchronously, into an ABR ladder of segmented renditions with manifests; let the client adapt bitrate per segment; and serve segments from a CDN (Open Connect-style edge caches) with long TTLs so origin egress stays flat even under viral read spikes.

hard40 min
Lesson 12

Design a Collaborative Editor (Google Docs)

Converge concurrent edits with OT (server-ordered, transform indices, memory-lean, Docs-style) or CRDTs (per-character ids, commutative merge, offline/P2P-friendly), broadcast ephemeral presence over WebSocket, persist an op log plus snapshots for replay and reconnect, and route all editors of a document to one server for coherent ordering.

hard40 min
Lesson 13

Design Yelp / Nearby Places (Proximity Search)

Nearby-places is read-heavy over a near-static POI set, so serve it from a search engine (geo_distance plus attribute filters plus ranking) fed by a denormalized read model, cache popular result pages and detail pages with generous TTLs invalidated on rare edits, and do not over-build the low-rate write path.

medium40 min

Storage & Infrastructure Systems

Run the infrastructure 'design X' interviews that sit under almost every product: a distributed cache, a key-value store, an object store, a Kafka-style log, a job scheduler, a coordination service, a code sandbox, and a webhook delivery system, reasoning from durability and consistency guarantees down to the one hard correctness detail each problem is really testing.

0/8
Lesson 14

Design a Distributed Cache (Redis-like)

Place keys with consistent hashing plus virtual nodes (never hash mod N), evict with LRU or LFU plus TTL, choose cache-aside by default, and defend hot keys with replication and stampedes with coalescing plus TTL jitter.

hard40 min
Lesson 15

Design a Key-Value Store (DynamoDB/Cassandra)

Partition with consistent hashing and replication factor N, tune consistency with R + W > N (which is freshness, not linearizability), resolve conflicts with vector clocks or LWW plus read-repair and Merkle anti-entropy, and store writes in an LSM (commit log, memtable, SSTable, compaction).

hard40 min
Lesson 16

Design an Object Store (Amazon S3)

Hit 11 nines with erasure coding (k + m Reed-Solomon, roughly 1.4x overhead) instead of 3x replication, scale the metadata index by partitioning bucket+key across a KV store, give strong read-after-write via a durable metadata commit, support multipart upload and range GET, and maintain durability with checksums, scrubbing, and reconstruction.

hard40 min
Lesson 17

Design a Message Queue / Streaming Log (Kafka)

Model it as a partitioned append-only log with per-partition ordering, get durability from ISR replication and acks=all, offer at-least-once delivery plus idempotent consumers for exactly-once processing (never claim exactly-once delivery), and scale reads with consumer groups where parallelism equals partition count.

hard40 min
Lesson 18

Design a Distributed Job Scheduler / Cron

Index jobs by run time and poll the due window, make a single worker win via a compare-and-set lease with a visibility timeout so crashes retry rather than duplicate, add fencing tokens to defeat the paused-worker double-run, achieve effectively-once with idempotency keys, and handle clock skew and missed windows with an explicit misfire policy.

hard40 min
Lesson 19

Design a Distributed Lock / Coordination Service (ZooKeeper/etcd)

A Redis SETNX-with-TTL lock is unsafe because a single node can fail over and a paused holder can outlive its TTL; build on a consensus-backed store for linearizable lock state, auto-release via session leases and heartbeats, defeat the stale-holder double-run with monotonic fencing tokens, notify clients with watches instead of polling, and elect leaders with ordered ephemeral keys.

hard40 min
Lesson 20

Design a Code Execution Sandbox / Online Judge

Pick the isolation boundary deliberately (microVM/Firecracker as the strong default, hardened seccomp container as the middle ground, never a bare container for hostile code), bound every resource with cgroups plus timeouts plus a pids limit plus no network, run each submission in a fresh throwaway sandbox behind a queue and autoscaling worker pool with a warm pool, and stream results while enforcing per-user fairness.

hard40 min
Lesson 21

Design a Reliable Webhook Delivery System

Guarantee at-least-once (persist, enqueue, ack on 2xx) with a stable event id so consumers dedupe, deliver from a separate queue-driven service (never inline), retry with exponential backoff plus jitter over a long window, sign payloads with HMAC-SHA256 plus timestamp and rotate secrets, make ordering opt-in per resource key, and protect everyone with dead-letters plus per-tenant isolation and circuit breakers.

medium40 min

Commerce, Money & Analytics

Run the correctness-critical and high-volume 'design X' interviews that separate senior candidates: a payment ledger that never loses money, a flash-sale system that never oversells, a web crawler at web scale, a metrics platform, a real-time ad-click aggregator, a leaderboard, and a microsecond order-matching engine. Each is a repeatable pattern you can name and defend under pressure.

0/7
Lesson 22

Design a Payment System & Ledger

Idempotency keys on every mutating call turn retries safe, an append-only double-entry ledger with derived balances gives auditability and reconciliation, and a saga with compensations plus idempotent webhook handling coordinates the provider, wallet, and orders without a distributed transaction.

hard40 min
Lesson 23

Design E-Commerce Inventory / Flash Sale (Ticketmaster)

Prevent oversell with a single atomic conditional decrement (never read-then-write), use reservation holds with TTL and automatic release for the cart window, and put a fair, rate-limiting waiting room in front to shed and pace the spike so the inventory store sees bounded load.

hard40 min
Lesson 24

Design a Web Crawler

A two-layer frontier balances priority and per-host politeness, bloom-filter URL dedup plus simhash content dedup avoid redundant work and traps, distributed async fetchers with DNS caching do the I/O, and adaptive incremental recrawl with conditional GETs keeps the corpus fresh.

hard40 min
Lesson 25

Design a Metrics & Monitoring System (Prometheus/Datadog)

Buffer the ingestion firehose through Kafka into a compressed TSDB partitioned by time, control cost with cardinality limits plus retention tiers and downsampled rollups, serve dashboards from a label-indexed query engine, and evaluate alert rules on a schedule with a dedup/group/route alert manager.

hard40 min
Lesson 26

Design an Ad Click Aggregator / Real-Time Analytics

Dedup clicks idempotently (bloom/windowed store or Flink exactly-once) so at-least-once delivery does not double-count, window on event time with watermarks and allowed lateness for out-of-order clicks, use Lambda/Kappa so a fast approximate stream is reconciled by an exact batch (or replayable) source of truth, and shard hot-campaign counters.

hard40 min
Lesson 27

Design a Leaderboard / Top-K / Distributed Counter

Use a Redis sorted set for O(log n) updates and top-K/rank reads instead of SQL sort-per-request, shard the ZSET by segment with a merged global top-N, break hot counters into summed sub-counters for write parallelism, reach for HyperLogLog and Count-Min Sketch when approximate is good enough, and keep authoritative scores in a database with Redis as a rebuildable index.

medium40 min
Lesson 28

Design a Stock Exchange / Order-Matching Engine

Match by price-time priority in an in-memory order book, process a single-writer sequenced event stream single-threaded (Disruptor style) for lock-free determinism and microsecond latency, shard by instrument for scale, keep matching fully deterministic (no wall-clock, no randomness), recover by replaying a replicated event journal from snapshots, and fan out market data on a separate bus with hot standbys.

hard45 min