SponsorGitHub

Almost every design decision is one of four trades.

Worked documents on distributed systems: concept modules built from the ground up, pages on the technologies they name, and full designs with architecture diagrams, trade-offs and the follow-up questions that actually get asked.

01

Now or later

Precompute or compute on demand

Do the work when data is written and reads become instant but can go stale. Do it when data is read and results stay fresh, but every request pays the cost.

NowInstant readsStaleness, storage, write amplification
LaterAlways fresh, cheap writesSlower, costlier reads
02

One copy or many

Speed and availability, paid for in consistency

Replicas and caches put data closer to readers and survive failures, but every extra copy can lag behind the source of truth. The real question is how stale a read the product can tolerate.

One copyAlways consistentBottleneck, single point of failure
Many copiesFast, resilient readsReplication lag, conflicts
03

One machine or many

Capacity, paid for in coordination

A bigger machine keeps everything simple until it hits a ceiling. Splitting data and traffic across machines removes the ceiling, but adds routing, rebalancing, hot keys and queries that span shards.

One machineSimple, transactionalHard capacity ceiling
Many machinesNear-unlimited scaleCoordination, partial failure
04

Correct or available

What you give up during a partition

When the network splits, a node either refuses requests it cannot guarantee or answers with data that may be stale. Payments and seat inventory lean correct; feeds and like counts lean available.

CorrectNever wrongErrors and timeouts while split
AvailableAlways answersStale reads, reconcile later

Spot which one a novel prompt is really about, pick a side, and defend it with the product requirement. That is the skill being tested.

Concepts

10

Read in order. Foundations first, then the patterns everything else is built from.

01

Foundations

Latency versus throughput, percentiles and tail amplification, scaling directions, load balancing, and estimation that ends in a decision.

EstimationReliabilitySharding
02

Data Storage

Picking a database from access patterns, how indexes really cost you, replication lag, sharding strategies, and consistent hashing.

ShardingReplicationConsistent hashingPostgres
03

Consistency and Distributed Systems

CAP stated correctly, PACELC, the consistency spectrum, quorums, Raft, idempotency, sagas, and the outbox pattern.

ConsistencyIdempotencySagaOutbox
04

Caching

Cache patterns and eviction, why hit rate dominates latency, invalidation, and the three named failure modes with fixes for each.

CachingRedisCDN
05

Async Messaging and Event-Driven Architecture

Queues versus pub/sub, Kafka partitions and consumer groups, delivery semantics, retries with jitter, dead letter queues, CQRS and event sourcing.

Event-drivenKafkaCQRSIdempotency
06

Fan-out, Feeds and Timelines

Push versus pull, the read/write cost asymmetry, the celebrity problem, and the hybrid that resolves it. The most reused pattern in the field.

Fan-outCachingCassandra
07

APIs and Real-Time Communication

REST, gRPC and GraphQL compared; polling through WebSockets; cursor pagination; API gateways; and four rate limiting algorithms.

Real-timeWebSocketsPaginationRate limiting
08

Reliability and Operations

Error budgets, failover and split-brain, timeouts and circuit breakers, graceful degradation, observability, and safe schema migration.

ReliabilityCircuit breakerObservability
09

Specialized Building Blocks

Inverted indexes, object storage, batch versus stream processing, Bloom filters, Snowflake IDs, and geospatial indexing.

SearchBloom filterStream processingGeospatial
10

The Interview Playbook

The 45-minute framework with a time budget, prompts mapped to concepts, sentences that score, what loses points, and the rubric you're graded against.

Estimation

Key Technologies

15

The systems you will actually name in a round. What each one is, what it is good at, and the moment it becomes the right answer.

01

PostgreSQL

Relational store

The relational default: transactions, joins and constraints on one primary, until scale forces you off it.

PostgresConsistencyConcurrencyReplication
02

Redis

In-memory store

Sub-millisecond memory with useful data structures: caches, counters, locks, leaderboards and rate limits.

RedisCachingRate limitingConcurrency
03

Memcached

Cache

A cache that does nothing but get and set — fewer features than Redis, and that is the argument for it.

MemcachedCachingConsistent hashing
04

Cassandra

Wide-column store

Masterless, write-optimised storage that scales linearly — as long as every query is known in advance.

CassandraShardingReplicationConsistency
05

DynamoDB

Managed KV store

Key-value and document storage with flat latency at any size, as long as you design for the key.

DynamoDBShardingIdempotencyConsistency
06

Elasticsearch

Search index

An inverted index with relevance ranking — a derived view of your data, never the source of truth.

ElasticsearchSearchPaginationCQRS
07

OLAP stores

Analytics store

Columnar databases — ClickHouse, Druid, BigQuery — that aggregate billions of rows and cannot do point updates.

OLAPStream processingCQRSEstimation
08

Kafka

Event log

A durable, replayable, partitioned log — the backbone of nearly every asynchronous design.

KafkaEvent-drivenStream processingOutbox
09

Flink

Stream processor

Stateful computation over unbounded streams: windows, joins and aggregates that survive a crash.

FlinkStream processingEvent-drivenConsistency
10

Object storage

Blob store

S3-style storage for bytes: effectively unlimited, extremely durable, and never in the request path.

Object storageChunkingCDNEvent-driven
11

CDN

Edge cache

Caches near the user that cut latency, absorb read spikes, and shift most traffic off your origin.

CDNCachingReliabilitySecurity
12

API gateway

Edge tier

The front door: TLS, routing, auth, rate limits and timeouts, in one place instead of every service.

API gatewayRate limitingSecurityCircuit breaker
13

WebSockets

Push transport

Persistent connections for server push — and the stateful tier, routing and reconnect story they drag in.

WebSocketsReal-timeFan-outReliability
14

gRPC

Internal RPC

Typed, binary, streaming RPC over HTTP/2 — the default for service-to-service calls behind the edge.

gRPCObservabilityCircuit breakerAPI gateway
15

ZooKeeper

Coordination service

A small, strongly consistent store for the decisions a cluster must agree on: who leads, who is alive, who owns what.

ZooKeeperConsistencyReliabilityConcurrency

Designs

15

Worked problems, ranked by how often they come up. The first five cover most of what gets asked.

01

Twitter / Instagram Feed

A home timeline serving 150k reads per second, where one post can reach a hundred million followers.

The celebrity problem. A design that only works for the median user fails — fan-out cost is bimodal and the code path has to split.

Fan-outCachingCassandraPagination
02

Chat / Slack

Fifty million concurrent sockets, ordered message delivery, and users who go offline mid-conversation.

You have fifty stateful gateway nodes and a message for Alice. How does the sender find the node holding her socket, and what happens when she's offline?

Real-timeWebSocketsCassandraIdempotency
03

URL Shortener

A hundred million links a day and a hundred to one read skew. The classic estimation warm-up.

Generating short, unique, non-guessable keys without a central bottleneck — and recognising this is a cache problem, not a database problem.

EstimationCachingRedisSharding
04

Distributed Rate Limiter

One global limit enforced across a fleet of stateless API servers, at a million requests per second.

Enforcing a global limit without a synchronous Redis round trip on every request — and deciding what happens when the limiter's own store is down.

Rate limitingRedisConcurrencyReliability
05

Notification System

Events from many producers, matched to recipients, delivered in-app, by email and by push, without losing any.

Third-party delivery channels fail constantly and are rate limited. Nothing may be lost, nothing visibly duplicated, and one flaky provider must not take down the rest.

Event-drivenKafkaFan-outIdempotencyCircuit breaker
06

Search and Typeahead

A billion documents, a hundred thousand queries a second, and autocomplete firing on every keystroke.

Search is a scatter-gather, so your latency is your slowest shard. And the index is not the source of truth — you have to explain how it stays in sync and that it lags.

SearchElasticsearchShardingCaching
07

Uber / Delivery Tracking

Five million drivers publishing position every four seconds, matched to riders in real time.

Two problems glued together: 1.25M location writes per second that destroy any disk-backed index, and a matching step where two riders must never get the same driver.

GeospatialRedisConcurrencyReal-timeSaga
08

Video Streaming

Upload, transcode and deliver video at twenty-five terabits per second of egress.

Video bytes never touch your application servers — not on upload, not on playback. What you actually build is a metadata service and a transcoding pipeline.

Object storageCDNChunkingStream processing
09

Web Crawler

Ten billion pages, ten thousand fetches a second, without hammering any single domain.

Politeness. Crawling fast is easy; crawling fast without overloading one host forces a queue design grouped by host rather than FIFO. Then dedupe at a scale where you can't store what you've seen.

Bloom filterDeduplicationConsistent hashingRate limiting
10

Payment System

Charges, captures, refunds and payouts across an unreliable external processor, with a ledger that has to balance.

The one design where consistency beats availability, and where at-least-once plus idempotent stops being a slogan and becomes the mechanism preventing double charges.

ConsistencyIdempotencySagaOutboxPostgres
11

Ticketmaster / Booking

Fifty thousand people wanting the same hundred seats in the same second.

This is contention, not scale. Row lock contention breaks first, not throughput — so the answer is admission control in front of the application tier, not a bigger cluster.

ConcurrencyConsistencyPostgresSaga
12

Dropbox / File Sync

Syncing files across devices without re-uploading a two gigabyte file because one paragraph changed.

Bandwidth efficiency through content-defined chunking and delta sync — plus a coherent story for two clients that edited the same file offline.

ChunkingDeduplicationObject storageConsistency
13

Ad Click Aggregation

A million events a second aggregated into dashboards that are fast and billing numbers that are exact.

Event time. Clicks arrive late, out of order and duplicated. Aggregating by arrival time is easy and wrong, and advertisers are billed from these numbers.

Stream processingFlinkOLAPKafkaDeduplication
14

Distributed Cache

Building Redis: a hundred nodes holding a terabyte of hot data with sub-millisecond reads.

Rebalancing. Naive modulo hashing invalidates eighty percent of the cache when you add a node and stampedes the origin. And consistent hashing does not solve hot keys.

Consistent hashingCachingRedisReplication
15

Google Docs

Many people typing into one document at once, with no perceptible lag and no lost edits.

Convergence. Two users edit the same sentence with no coordination. Both must end up with an identical document and neither edit may be silently lost — so last-write-wins is catastrophically wrong.

CRDT / OTConsistencyWebSocketsReal-time