System Design

Open-ended design scenarios plus the classic interview question set.

Learn the reason behind each component

42 independent guides. Each includes local concept explanations, a correctness contract, a worked failure trace, and a runnable Python learning model.

Read in this order: requirements → concepts → data flow → concurrency and failure behavior → sizing → worked example. Explain what can fail before choosing a technology.

Suggested first route: consistent hashing → rate limiting → safe retries → leases and fencing → consensus. Then choose a product design.

Sections

01·Design Scenarios14 pages 02·Foundations5 pages 03·Counting & Analytics5 pages 04·Feeds, Messaging & Social5 pages 05·Search, Geo & Logistics4 pages 06·Media & Collaboration3 pages 07·Coordination, Money & Markets5 pages 08·Patterns1 guide

Find a guide or concept

42 guides

Consistent Hashing & Designing a Key-Value Store

Spread a key-value store across changing servers without moving nearly every key, then reason separately about replication and read correctness.

Consistent hashing · Virtual nodes · Quorum · Linearizability · Vector clocks · Merkle trees · Tombstones

Designing a Rate Limiter — A System Design Interview Guide

Turn a quota into an explicit admission rule, choosing whether it limits bursts, trailing-window traffic, or a long-run rate.

Token bucket · Time windows · Atomic Redis scripts · Wall and monotonic clocks · Backpressure and load shedding · Leases

Designing a Unique ID Generator — System Design Interview Guide

Encode distributed IDs while separating uniqueness, approximate timestamp order, and safe restart behavior.

Snowflake IDs · Wall and monotonic clocks · Leases · Fencing tokens · Optimistic concurrency and compare-and-set

Designing a URL Shortener — System Design Interview Guide

Build an atomic short-code mapping and a correct redirect path, including expiry, caching, and guessability.

Base62 encoding · Idempotency keys · Cache-aside and invalidation · Optimistic concurrency and compare-and-set · Replication

Designing a Web Crawler — A System Design Guide

Schedule a bounded web crawl without overwhelming websites, losing queued URLs, or assuming every duplicate test is exact.

Crawl frontier and politeness · Bloom filters · Deduplication · Transactional outbox · Leases · Backpressure and load shedding

Designing an Ad Click / Impression Counter — A System Design Interview Guide

Count impressions and clicks from a replayable event stream, while distinguishing provisional dashboard numbers from auditable billing.

Deduplication · Bloom filters · Offsets and checkpoints · Event time and watermarks · Rollups and weighted aggregation · Transactional outbox

Designing a Unique-User Counter — A System Design Interview Guide

Estimate distinct active users cheaply and understand why merging sketches is different from adding daily counts.

HyperLogLog · Cardinality · Event time and watermarks · Offsets and checkpoints · Deduplication

Designing a Logging / Analytics Pipeline — A System Design Interview Guide

Move structured events from applications to independent searchable, analytical, and archival sinks with a bounded loss/replay policy.

Pub/sub and durable queues · Offsets and checkpoints · Write-ahead log and fsync · Backpressure and load shedding · Deduplication · Transactional outbox

Designing a Metrics / Time-Series Store — A System Design Interview Guide

Store timestamped metric series while preserving the meaning of counters, gauges, and aggregated distributions.

Cardinality · Rollups and weighted aggregation · Write-ahead log and fsync · Inverted indexes and columnar storage · Event time and watermarks · Offsets and checkpoints

Designing a Trending Top-K System — A System Design Interview Guide

Find frequent items while separating approximate frequency error from missing candidate identities.

Count-Min Sketch · Top-k candidate discovery · Time windows · Offsets and checkpoints · Cardinality

Designing a Chat System — System Design Interview Guide

Deliver and synchronize messages across intermittent devices without confusing message identity with committed delivery order.

Sequence numbers and replay cursors · Idempotency keys · Fanout on write and read · Presence and failure detection · Transactional outbox · Pub/sub and durable queues

Designing Live Comments / Presence — A System Design Interview Guide

Broadcast a bounded live comment stream while keeping durable acceptance distinct from the subset shown to viewers.

Fanout on write and read · Pub/sub and durable queues · Sequence numbers and replay cursors · Presence and failure detection · Backpressure and load shedding · Token bucket

Designing a News Feed System — A System Design Guide

Choose push, pull, or hybrid feeds from measured amplification, then serve stable pages with current privacy rules.

Fanout on write and read · Cache-aside and invalidation · Sequence numbers and replay cursors · Transactional outbox · Backpressure and load shedding · Top-k candidate discovery

Designing a Notification System — A System Design Interview Guide

Accept notification intent reliably and distinguish provider acceptance, device delivery, and a user's observation.

Transactional outbox · Idempotency keys · Sagas and compensation · Backpressure and load shedding · Leases · Pub/sub and durable queues

Designing a Social Graph — A System Design Interview Guide

Maintain directed edges and reverse indexes without losing unfollow ordering or using stale edges for authorization.

Transactional outbox · Optimistic concurrency and compare-and-set · Replication · Fanout on write and read · Cache-aside and invalidation · Cardinality

Designing an Ad Auction

Allocate ads under specified pricing, deadlines, and spend/exposure accounting.

First-price, second-price, and GSP · Budget reservations and pacing · Token bucket · Deduplication · Backpressure and load shedding · Wall and monotonic clocks

Designing a Distributed Lock — A System Design Interview Guide

Coordinate work without letting expired, paused holders corrupt protected resources.

Leases · Fencing tokens · Quorum · Raft terms and commit rules · Optimistic concurrency and compare-and-set · Wall and monotonic clocks

Designing for Idempotency & Exactly-Once — A System Design Interview Guide

Make repeated API attempts produce one logical effect despite concurrent retries and uncertain remote outcomes.

Idempotency keys · Optimistic concurrency and compare-and-set · Transactional outbox · Sagas and compensation · Leases · Offsets and checkpoints

Designing a Payment / Wallet System — A System Design Interview Guide

Represent money as auditable postings and enforce balances, currency, and retries transactionally.

Double-entry ledger · Optimistic concurrency and compare-and-set · Idempotency keys · Sagas and compensation · Transactional outbox · CAP and consistency models

Designing a Ticket Booking System — A System Design Interview Guide

Hold scarce seats during checkout and reject stale payment or expiry callbacks.

Optimistic concurrency and compare-and-set · Leases · Idempotency keys · Sagas and compensation · Fencing tokens · Backpressure and load shedding

Designing Package / Delivery Tracking — A System Design Interview Guide

Turn messy carrier scans into a trustworthy shipment history and a reproducible current-state projection.

State machines and projections · Event time and watermarks · Deduplication · Optimistic concurrency and compare-and-set · Transactional outbox · ETA and uncertainty

Designing a Proximity Service — A System Design Interview Guide

Find nearby points by a conservative spatial covering, then refine and rank without missing boundary neighbors.

Geohash · Quadtree and adaptive spatial indexing · ETA and uncertainty · Inverted indexes and columnar storage · Cache-aside and invalidation

Designing a Ride Matching Service — A System Design Interview Guide

Use approximate location candidates but one authoritative state transition for exclusive trip assignment.

Geohash · ETA and uncertainty · Optimistic concurrency and compare-and-set · Leases · State machines and projections · Transactional outbox

Designing a Search Autocomplete System — A System Design Guide

Serve ranked prefix completions from a normalized, versioned snapshot without traversing a huge subtree on each keystroke.

Trie and cached prefix top-k · Top-k candidate discovery · Cardinality · Cache-aside and invalidation · DAG scheduling

Designing Collaborative Editing — A System Design Interview Guide

Explain how concurrent edits converge while separating a two-operation demo from a complete collaboration protocol.

Operational Transformation · Conflict-free Replicated Data Types · Sequence numbers and replay cursors · Idempotency keys · Presence and failure detection · Tombstones

Designing a Cloud File Storage / Sync Service — A Developer's Guide

Synchronize immutable file versions while keeping metadata publication, blob lifetime, and conflicts correct.

Resumable and multipart uploads · Content-defined chunking · Content addressing and garbage collection · Optimistic concurrency and compare-and-set · Cache-aside and invalidation · Transactional outbox

Designing a Video Platform — System Design Interview Guide

Turn a validated upload into compatible streaming renditions through a recoverable dependency graph.

Resumable and multipart uploads · DAG scheduling · Adaptive bitrate streaming · Content addressing and garbage collection · Transactional outbox · Backpressure and load shedding

Common Patterns — System Design

Choose reusable design mechanisms from requirements and explain their correctness costs before choosing products.

Cache-aside and invalidation · Optimistic concurrency and compare-and-set · Fencing tokens · Transactional outbox · Sagas and compensation · Geohash · Backpressure and load shedding · Idempotency keys

Designing a Capacity Forecasting System — A System Design Interview Guide

Forecast unconstrained demand and purchase enough surviving capacity before lead time runs out.

Forecast percentiles and headroom · Failure domains and redundant capacity · SLIs, SLOs, and error budgets · Cardinality · Backpressure and load shedding

Consensus: Raft & Paxos — A System Design Interview Guide

Understand the state and protocol rules that let crash-recovering nodes preserve one committed history.

Raft terms and commit rules · Quorum · Write-ahead log and fsync · Linearizability · CAP and consistency models · Fencing tokens

Designing a Distributed Tracing System — A System Design Interview Guide

Connect distributed operations through propagated identities and interpret incomplete, sampled traces honestly.

Spans and trace context · Head and tail sampling · Transactional outbox · Cardinality · SLIs, SLOs, and error budgets

Designing a Distributed Log Search Engine — A System Design Interview Guide

Build a searchable retained log with explicit visibility, durability, query completeness, and authorization boundaries.

Inverted indexes and columnar storage · Partition pruning and predicate pushdown · Write-ahead log and fsync · Offsets and checkpoints · Cardinality

Designing a Logs-to-Metrics Real-Time Alerting Pipeline — A System Design Interview Guide

Extract stable metrics from events and alert on user-relevant budget consumption without hiding missing data.

Event time and watermarks · Rollups and weighted aggregation · Cardinality · Burn-rate alerting · SLIs, SLOs, and error budgets · Offsets and checkpoints

Designing Global Multi-Datacenter Routing & Failover — A System Design Interview Guide

Recover from a lost or isolated region without promoting a stale or unauthorized writer.

RPO and RTO · Failure domains and redundant capacity · Quorum · Fencing tokens · Replication · CAP and consistency models

Designing a Unified Observability Platform — A System Design Interview Guide

Unify metrics, logs, and traces through shared context while budgeting storage, coverage, and query isolation.

Spans and trace context · Head and tail sampling · Cardinality · Inverted indexes and columnar storage · Rollups and weighted aggregation · Backpressure and load shedding · SLIs, SLOs, and error budgets

Zero Data Loss During a Network Partition — A System Design Interview Guide

Preserve acknowledged critical commits under network partitions while separating ordering, durability, and availability.

CAP and consistency models · Quorum · Raft terms and commit rules · Write-ahead log and fsync · Linearizability · Failure domains and redundant capacity · Fencing tokens

Designing a Petabyte-Scale Data Pipeline with Strong SLAs — A System Design Interview Guide

Reduce analytical bytes scanned and publish reproducible dataset versions despite task retries and late data.

Partition pruning and predicate pushdown · Inverted indexes and columnar storage · Offsets and checkpoints · Event time and watermarks · DAG scheduling · Transactional outbox

Designing a Highly Reliable Service — A System Design Interview Guide

Define reliability through user-visible outcomes, independent capacity, and bounded request-path behavior.

SLIs, SLOs, and error budgets · Burn-rate alerting · Failure domains and redundant capacity · Backpressure and load shedding · Idempotency keys · Wall and monotonic clocks

Scaling a System from 10× to 100× — A System Design Interview Guide

Scale the measured bottleneck while preserving data and failure semantics as traffic grows.

Cache-aside and invalidation · Consistent hashing · Replication · Backpressure and load shedding · Failure domains and redundant capacity · Transactional outbox

Designing a High-Volume Telemetry Ingestion Pipeline — A System Design Interview Guide

Accept heterogeneous signals into bounded durable pipelines with clear per-signal delivery and privacy policies.

Offsets and checkpoints · Backpressure and load shedding · Pub/sub and durable queues · Cardinality · Transactional outbox · Spans and trace context

Designing for Testability in Distributed Microservices — A System Design Interview Guide

Make distributed logic reproducible in fast tests while recognizing what mocks and toy stores cannot prove.

Dependency injection and test doubles · Optimistic concurrency and compare-and-set · Wall and monotonic clocks · Canaries, shadow traffic, and rollout gates · SLIs, SLOs, and error budgets · Idempotency keys

Zero-Downtime Deployment & Rollback — A System Design Interview Guide

Change code and data in compatible stages while preserving a real rollback horizon and measuring user impact.

Expand-contract migrations · Canaries, shadow traffic, and rollout gates · Optimistic concurrency and compare-and-set · Transactional outbox · SLIs, SLOs, and error budgets · Failure domains and redundant capacity

Download the Python concept models · Python 3.10+, no packages required.

Student clarity and correctness review · 19 October 2026