Systems
End-to-end builds — from a naive implementation to a production-grade design, step by step.
Caching & Flow Control
Counting, Analytics & ML Serving
Feeds & Social Systems
Real-time ranked scores: a sorted set for O(log n) rank and range queries, tie-breaking and best-score semantics, score-bucketed sharding for cheap global rank, multiple materialized boards, and a cached hot top-N.
Aggregate and rank posts per user: fan-out on read vs write, the celebrity hot-partition, a hybrid delivery path, denormalized ranking signals, and a bounded materialized timeline.
Messaging & Reliability
Send, receive, and store mail reliably: a durable queue, exponential backoff retries, a dead-letter path, idempotent accept and delivery, and hot/cold storage tiering.
Reliably call customer endpoints: at-least-once delivery over a durable queue, backoff-and-jitter retries, a dead-letter path with replay, signed payloads for receiver idempotency, and per-endpoint circuit breakers.
Money, Identity & Correctness-Critical
Networking
Resolve names to addresses: a recursive resolver built as a TTL-bound cache over the delegation walk, with negative caching, anycast PoPs, and serve-stale to keep the cold path off the network.
Accept, route, and serve requests: a few event-loop workers multiplexing tens of thousands of connections, pooled upstream connections, graceful drain on reload, and backpressure so the loop never outruns its memory.
Operability & Dev Infrastructure
Storage Engines
Chunked, replicated storage with a metadata master: range-partitioned chunks, a master that stays out of the data path, chunk replication and heartbeat-driven re-replication, lease-based write ordering, and master high-availability over an operation log.
A schema-flexible document store with secondary indexes, walked from a single in-memory collection up through leader-follower and leaderless quorum replication.
Ingest and query high-volume metrics: append-only columnar chunks, delta-of-delta + XOR compression, time-based block pruning, a label inverted index, and cardinality control.
An embedded, crash-safe KV store built on an LSM tree: WAL durability, memtable flushes, Bloom-filtered reads, compaction, and MVCC snapshots.