Learning path
Work through in order, or jump to what your next interview needs. Your progress is saved on this device.
Module 1
Foundations
How to run the interview, estimate on the back of an envelope, and reason about scale, availability and consistency.
- How to run a system design interviewA repeatable way to spend 45 minutes: scope the problem, size it, sketch a design, go deep where it is hard, and state your trade-offs.12 min
- Back-of-envelope estimation and latency numbersTurn daily users into requests per second, storage and bandwidth in a few minutes, and learn the latency figures that tell you which designs are plausible.13 min
- ScalabilityHow a system grows from one server to many: scale up first, make services stateless, then scale reads and writes separately by removing one bottleneck at a time.13 min
- Availability and reliabilityTurn "it must not go down" into numbers: what each nine allows, how redundancy and failover change the maths, and how SLOs and error budgets guide decisions.14 min
- Consistency modelsWhat "consistent" means when data lives on several machines, from linearizability down to eventual consistency, and how to choose the weakest model a feature can tolerate.14 min
- CAP and PACELCWhat the CAP theorem really says, what a system must choose when the network splits, and how PACELC extends the trade-off to latency when nothing is broken.13 min
Module 2
Networking
What happens between the client and your servers: DNS, transport, HTTP, TLS, load balancers, CDNs and API styles.
- DNSHow a name becomes an IP address, what caching and TTLs do to every change you make, and where DNS-based load balancing and failover stop working.13 min
- TCP vs UDPWhat TCP does to turn lossy packets into an ordered stream, what that costs in latency, what UDP leaves out on purpose, and how to choose between them.13 min
- HTTP/1.1 vs HTTP/2 vs HTTP/3What each HTTP version fixed, where head-of-line blocking moved each time, and which version to use on each hop of a design.13 min
- TLSWhat TLS guarantees, how certificates and the TLS 1.3 handshake work, where to terminate it in a design, and when to use mutual TLS between services.14 min
- Load balancing: L4 vs L7What a load balancer sees at layer 4 and layer 7, how the main algorithms choose a server, and how health checks, draining and redundancy keep traffic flowing.14 min
- CDNsWhy distance sets a floor on latency, how a CDN routes users to a nearby edge and what it caches there, and the cost and failure trade-offs of putting one in front of your origin.13 min
- API gatewaysWhat belongs in an API gateway and what does not, how it differs from a load balancer, reverse proxy and service mesh, and the risks of putting one component in front of everything.12 min
- REST vs gRPC vs GraphQLThe design idea behind each API style, what each costs, how pagination, versioning and idempotency work across them, and how to choose one for a given product.14 min
- WebSockets, SSE and long pollingFour ways to push data from server to client, what each costs to run, and how to keep millions of long-lived connections working through load balancers, deploys and reconnects.14 min
Module 3
Databases and storage
Storage engines, transactions, replication, partitioning and consensus, and how to pick a database.
- SQL vs NoSQLWhat relational databases guarantee, what broke at web scale, and the criteria that decide which kind of store a system needs.12 min
- Indexes and B-treesHow a B-tree finds one row among 100 million in three or four page reads, how to design composite and covering indexes, and what every index costs on writes.13 min
- LSM treesHow log-structured merge trees turn random writes into sequential ones, what compaction costs, and how to choose between an LSM tree and a B-tree.13 min
- Normalization vs denormalizationWhy storing each fact once prevents a class of bugs, when joins become too expensive, and how to copy data on purpose without letting the copies drift.12 min
- ACID and isolation levelsWhat a transaction really guarantees, which concurrency bugs each isolation level still allows, and how to stop lost updates and write skew.14 min
- ReplicationKeep copies of the same data on several machines, and reason about what lag, failover and conflicting writes do to the guarantees you can offer.15 min
- Sharding and partitioningSplit one large data set across machines: choose a strategy and a shard key, handle hot spots and cross-shard work, and know when not to shard at all.15 min
- Consistent hashingHow to spread keys over a changing set of servers so that adding or losing one moves only a small share of the data.12 min
- Distributed transactions and two-phase commitWhy committing atomically across databases is hard, how two-phase commit works and where it blocks, and how to decide whether you need it at all.15 min
- SagasRun a business transaction across services as a chain of local transactions with compensating actions, and handle the isolation you give up.14 min
- Consensus: Raft and PaxosHow a group of machines agrees on one value despite crashes and an unreliable network, how Raft and Paxos do it, and what that agreement costs.16 min
- Key-value, document and wide-column storesThe data model, strengths, limits and partitioning of the three main NoSQL families, and how to design tables from access patterns.13 min
- Graph, time-series and object storageThree kinds of data a general database handles badly, the stores built for each, and a decision guide across every store type in this module.13 min
Module 4
Caching
Where to put a cache, how to keep it honest, and what happens when it empties at the wrong moment.
- Caching patternsHow cache-aside, read-through, write-through, write-behind and write-around work, how each one fails, and how to pick a read and a write strategy for a workload.13 min
- Eviction policiesWhat a cache should throw away when it is full, how LRU, LFU and their production approximations work, and how to match a policy to a workload.13 min
- Cache stampede and thundering herdWhy one expired key or one cache restart can take a database down, how to tell stampede, avalanche and penetration apart, and which fix fits each.13 min
- Cache invalidationWhy keeping a cache in step with the database is hard, which write-path choices cause stale data, and what TTLs, deletes, versioned keys and change data capture can each guarantee.14 min
- CDN cachingHow to use Cache-Control, validators, cache keys and purging so that a CDN serves as much as possible without ever serving the wrong thing to the wrong person.14 min
- Redis vs MemcachedThe differences between Redis and Memcached that change a design (data model, threading, persistence, clustering, memory) and how to justify choosing one for a workload.14 min
Module 5
Messaging and async
Queues, logs, delivery guarantees and the patterns that keep asynchronous systems correct.
- Queues vs logsWhy systems go asynchronous, how a message queue differs from a retained log, and how to choose between them for a given job.11 min
- Kafka: partitions and consumer groupsHow Kafka orders, replicates and distributes records, and how to choose keys, replication settings and a partition count in a design.14 min
- Delivery semanticsWhere a message can be lost or duplicated, what at-most-once, at-least-once and exactly-once really promise, and how to get an effectively-once result.13 min
- IdempotencyHow to make retried requests and redelivered messages harmless with idempotency keys, deduplication tables, conditional writes and the transactional outbox.13 min
- Dead-letter queues and retriesHow to retry failures that might pass, give up on those that will not, and park poison messages where someone will see and fix them.13 min
- BackpressureWhat happens when producers outrun consumers, why unbounded queues fail, and how to push back by blocking, shedding, dropping or scaling.13 min
- Fan-out on write vs fan-out on readHow to build a timeline by precomputing it when someone posts or assembling it when someone reads, and why real feeds mix the two.13 min
Module 6
Distributed patterns and operations
Rate limiting, IDs, locks, discovery, resilience, observability and security basics.
- Rate limiting algorithmsCompare token bucket, leaky bucket and the three window algorithms, and decide where a limit should be enforced and what the client should be told.13 min
- Unique ID generation and SnowflakeChoose between auto-increment, UUIDs, ticket ranges and Snowflake ids, and reason about bit budgets, clock problems and index locality.13 min
- Distributed locksUnderstand why a lock across machines is really a lease, how a paused holder breaks it, and when to use fencing tokens or avoid the lock entirely.13 min
- Leader electionChoose one owner for a job, replace it automatically when it fails, and make a node that wrongly believes it is still leader harmless.13 min
- Service discoveryExplain how services find each other when instances change every few minutes, compare client-side, server-side, DNS and mesh approaches, and plan for stale data.13 min
- Timeouts and retries with jitterBound every remote call with a timeout and a deadline, retry only what is safe, and use backoff, jitter and retry budgets so that retries do not turn a blip into an outage.13 min
- Circuit breakers and bulkheadsStop one failing dependency from taking down every service above it by failing fast, isolating resources per dependency and shedding load you cannot serve.13 min
- Observability: logs, metrics and tracesKnow what each signal answers and what it costs, measure services with RED and USE, alert on SLOs, and use the three together to find the cause of an incident.14 min
- Authentication and authorization: sessions, OAuth and JWTChoose between server-side sessions and tokens, validate JWTs safely, explain the OAuth 2.0 authorization code flow with PKCE, and pick an authorization model.15 min
- Encryption at rest and in transitMatch encryption to the threat it answers, explain TLS, mTLS and the layers of encryption at rest, and design key management with envelope encryption and rotation.14 min
Module 7
Case studies
Sixteen full design walkthroughs, each with a 45-minute interview script.
- Design a URL shortenerA small product with a 100-to-1 read-heavy workload. The interesting parts are generating short codes without collisions and keeping redirects fast.22 min
- Design a rate limiterA distributed rate limiter for a public API. Atomic counters shared by many gateways, what to do when the counter store fails, and limits that span regions.23 min
- Design a distributed cacheA Memcached or Redis-like cache cluster. Partitioning with consistent hashing, routing, eviction, hot keys, and what happens to the database when a node dies.23 min
- Design a key-value storeA Dynamo-style store that stays writable through node failures. Partitioning, tunable quorums, conflict resolution, hinted handoff, Merkle tree repair and an LSM storage engine.24 min
- Design a unique ID generatorGenerate 64-bit, roughly time-sortable IDs on many machines with no coordination per ID. The hard parts are handing out worker IDs safely and clocks that move backwards.21 min
- Design typeahead (search autocomplete)Suggest the most popular completions for a prefix on every keystroke. The work is done offline, by precomputing the top results for each prefix, so serving is a memory lookup.22 min
- Design a web crawlerFetch a page, extract its links, repeat, a billion times a month. The hard parts are politeness per host, deduplicating URLs and content, and deciding what to fetch again.24 min
- Design a news feed or timelineBuild a home timeline for 200 million daily users. The core decision is when to do the work, at post time or at read time, and what to do about accounts with millions of followers.24 min
- Design a chat systemDeliver messages between people in real time, in order and exactly once from the user's point of view, across phones that are offline half the time and users with several devices.25 min
- Design a notification serviceOne internal service that sends push, email and SMS for every team. The design work is in isolating channels, never sending twice, respecting user preferences and surviving provider failures.24 min
- Design video streamingTake an uploaded video, turn it into segments at several qualities, and play it smoothly on any network. Delivery bandwidth dominates the cost, so the CDN and the encoding ladder drive the design.25 min
- Design file sync (Dropbox-style)Keep a folder identical on every device by splitting files into content-addressed blocks, committing changes to a strongly consistent metadata journal and sending only what changed.24 min
- Design ride-sharing with geo-indexingIngest a quarter of a million driver locations a second into an in-memory geospatial index, answer nearby-driver queries, and dispatch each driver to exactly one trip.24 min
- Design a payment systemTake card payments through a payment service provider without ever charging twice or losing a payment, using idempotency keys, a double-entry ledger and reconciliation.25 min
- Design flash-sale inventorySell a small, fixed stock to a huge simultaneous crowd without overselling, by admitting buyers at a controlled rate, gating stock in Redis and keeping the database as the final authority.24 min
- Design food deliveryCoordinate customers, restaurants and couriers so that food is found, ordered, cooked, collected and tracked, with search, an order state machine, timed dispatch and peak-hour load.24 min