Mid to Senior Engineer

System Design Interview Prep

A structured path from the interview framework through core concepts, key technologies and patterns to eighteen full problem breakdowns, each with diagrams and weak, solid and excellent answers to every deep dive.

36 chaptersUpdated 2026-10-02

Introduction

Chapter 1How to Approach a System Design InterviewThe 45-minute sequence, the requirement questions that change the design, and back-of-the-envelope estimation.

Core concepts

Chapter 2Scaling Out: Load Balancers, Caches and CDNsStateless servers, load-balancing algorithms, cache patterns and failures, and CDN design.
Chapter 3Data Storage: Choosing a Database, Replication and ShardingPicking a store from the access pattern, indexes, replication lag, shard keys, consistent hashing and CAP.
Chapter 4Consistency, Consensus and Distributed TransactionsIsolation levels, idempotency, quorums, Raft, fencing tokens, sagas and the outbox pattern.
Chapter 5Queues, Streams and Asynchronous ProcessingQueues versus logs, partitions and ordering, delivery guarantees, dead letters and backpressure.
Chapter 6Reliability: Rate Limiting, Retries and Resilience PatternsAvailability arithmetic, timeouts, retries with jitter, circuit breakers, bulkheads and rate-limiter algorithms.

Key technologies

Chapter 7RedisData structures, why it is fast, replication and cluster slots, and the interview uses: cache, rate limiter, leaderboard, lock, streams.
Chapter 8Kafka and Distributed LogsPartitions and ordering, replication and acknowledgements, delivery guarantees, retention, lag and poison messages.
Chapter 9PostgreSQLThe write-ahead log, MVCC, indexes, the scaling ladder, replication and failover, and schema changes.
Chapter 10Cassandra, DynamoDB and Wide-Column StoresPartition and clustering keys, modelling from the query, tunable consistency, hot partitions and repair.
Chapter 11Elasticsearch and Search EnginesThe inverted index, ranking, shards and replicas, near-real-time search and keeping the index in sync.

Patterns

Chapter 12Scaling ReadsMeasure first, then CDN, caches, replicas, denormalised read models and sharding, with the freshness cost of each.
Chapter 13Scaling WritesCheaper writes, batching and queues, partitioning, hot keys and salted counters.
Chapter 14Real-Time UpdatesPolling to WebSockets, connection servers and pub/sub fan-out, catch-up on reconnect and slow clients.
Chapter 15Long-Running TasksAccept fast and work elsewhere: job state machines, leases, retries, checkpoints, fairness and notifying clients.
Chapter 16Dealing with ContentionAtomic updates, pessimistic and optimistic locking, single writers, holds with expiry and fencing tokens.
Chapter 17Multi-Step Processes and WorkflowsSagas, orchestration versus choreography, durable execution, compensation and observability.

Problem breakdowns

Chapter 18Design a URL ShortenerSizing, five ways to generate codes, the redirect path, caching, sharding and 301 versus 302, with bad, good and great answers.
Chapter 19Design a Rate LimiterToken bucket versus window counters, atomic distributed counters, failing open or closed, and what clients see.
Chapter 20Design a Distributed CacheConsistent hashing with virtual nodes, replication and failover, LRU and LFU eviction, hot keys and stampedes.
Chapter 21Design a News Feed and Notification SystemFan-out on write versus read, the hybrid for celebrities, ranking stages and a notification pipeline.
Chapter 22Design a Chat SystemWebSockets, session routing, per-conversation ordering, sync on reconnect, group chat and presence.
Chapter 23Design a Cloud DriveChunking, de-duplication, durability, atomic commit, device sync with a change log, and video delivery.
Chapter 24Design a Ticket Booking SystemSeat holds, double-booking prevention, the waiting room for flash sales, search and payment failure.
Chapter 25Design a Ride-Sharing ServiceIngesting location updates, geo cells, the dispatch protocol, live tracking and surge pricing.
Chapter 26Design a Web CrawlerThe URL frontier, politeness, Bloom-filter de-duplication, spider traps, recrawling and fault tolerance.
Chapter 27Design a Payment SystemIdempotency, the unknown state, a double-entry ledger, webhooks and reconciliation.
Chapter 28Design Search AutocompleteTries with precomputed top-k, the offline build, freshness, edge caching, safety and sharding.
Chapter 29Design a Metrics and Monitoring SystemTime-series storage, compression, downsampling, the cardinality trap and reliable alerting.
Chapter 30Design a Food Delivery PlatformDiscovery at scale, the three-party order state machine, authorise-then-capture, dispatch timed to preparation and estimates.
Chapter 31Design a Video Streaming PlatformParallel transcoding, adaptive bitrate, tiered CDN and pre-positioning, storage cost and live streaming.
Chapter 32Design Collaborative Document EditingWhy concurrent edits conflict, operational transformation versus CRDTs, per-document owners, history and offline merges.
Chapter 33Design a Real-Time LeaderboardWhy rank counts are slow, sorted sets, time windows, sharding by score range or by player, bursts and idempotency.
Chapter 34Design Ad Click AggregationExactly-once effects, event-time windows and watermarks, hot-ad two-stage aggregation, reconciliation and lambda versus kappa.
Chapter 35Design a Distributed Message QueueSegmented logs, replication with in-sync replicas and the high watermark, consumer groups and offsets, compaction and tiering.

Wrap-up

Chapter 36Observability, Security and Finishing StrongMetrics, tracing and alerting, safe deployment, security basics, multi-region trade-offs and a scoring rubric.
Header Logo