Loading
Please wait
Preparing your content...
Loading
Preparing your content...
System Design
Twenty-four problems in six groups of four. Each one walks through requirements, rough numbers, a diagram, the key design choices, and a list of follow-up questions with answers.
4 problems
The classic primitives every interview starts from.
Turn long URLs into short links and redirect billions of clicks with low latency.
Protect services from traffic spikes with token buckets, sliding windows, and distributed coordination.
Generate globally unique, roughly sortable IDs at high throughput without a central bottleneck.
Build a linearly scalable, fault-tolerant KV store with consistent hashing, replication, and tunable consistency.
4 problems
Feeds, media and marketplaces at consumer scale.
Fan out tweets to millions of followers in real time with push and pull hybrid.
Upload, process, and serve billions of photos with thumbnails, CDN, and metadata.
Ingest, transcode, store, and stream video at massive scale with adaptive bitrate.
Match riders to drivers in real time with geo-indexing, surge pricing, and dispatch.
4 problems
Multi-user editing, money and recommendations.
Build a real-time messaging system with 1:1, groups, presence, and message history.
Deliver billions of notifications across push, email, SMS, and in-app with preferences, deduplication, and observability.
Sync files across devices with block-level deduplication, conflict resolution, and selective sync.
Real-time collaborative editing with OT/CRDT, presence, comments, and offline support.
4 problems
Crawling, ranking and serving content near the user.
Generate personalized recommendations at scale with candidate generation, ranking, and real-time features.
Sell millions of seats for high-demand events with fairness, concurrency control, and fraud prevention.
Process credit card payments with idempotency, authorization, capture, refunds, and PCI compliance.
Return ranked suggestions in under 50 ms as the user types, with typo tolerance and personalization.
4 problems
The infrastructure components the other designs lean on.
Crawl the web, build an inverted index, and serve ranked search results at scale.
A scalable, highly available cache with consistent hashing, replication, and cache-aside patterns.
Build a Kafka-like log: partitioned, replicated, with consumer groups and exactly-once semantics.
Provide mutual exclusion with leases, fencing tokens, and linearizable semantics across a cluster.
4 problems
The shared services every large system eventually grows.
Cache content at the edge, invalidate on demand, and route users to the nearest PoP.
Route, authenticate, rate-limit, and observe all external traffic to your microservices.
Distribute traffic across backends with health checks, session affinity, and TLS termination.
Register, health-check, and resolve service instances with client-side load balancing.
Follow the same six steps every time and you will rarely get lost.
01
Separate functional from non-functional requirements. Ask about scale, read/write ratio and what is out of scope.
02
Work out requests per second, storage and bandwidth. Rough numbers are enough to decide whether you need sharding or caching.
03
List the main endpoints and entities. Pick storage that matches the access pattern.
04
Clients, load balancer, services, data stores, caches and queues. Walk one request through end to end.
05
Pick the one or two components that are hardest (key generation, fan-out, consistency) and discuss trade-offs.
06
What happens when a node, a zone or a dependency fails? Add replication, retries, monitoring and rate limits.