← All posts

Series

System Design Mastermind

Real products reverse-engineered for Senior system-design interviews. Start with Foundations (the core concepts, told as stories), then three tracks: the classics, platform and infrastructure, and AI/ML systems. Each one walks the flow, the numbers, the APIs, the databases and what happens when each piece fails, with every claim tagged as seen, inferred or unknown.

Start here: F01
Foundations
18/18
Classics
6/10
Platform & Infra
5/12
AI / ML systems
8/9
Published
37 · 12 coming

LLM and ML systems, where interviews are heading.

22

LLM serving platform system design (ChatGPT-style): tokens, GPUs and safe model changes

Chat API (auth, token limits, history, safety, SSE with resumable event ids) → router picks model (easy turns to a small one), version (registry canary split) and a replica with the prefix cached → vLLM-style engines batch continuously up to the time-per-token target. Admit by priority because GPUs take minutes to add; ship every model change through evals, shadow and canary, with rollback by one number.

34 min · interactive Preview
25

RAG assistant over company docs system design: retrieval, permissions and answers you can trust

Ingestion (change events + full sync → parse → chunk with a context line → embed only changed chunks) fills a versioned index of keywords, vectors and allowed principals. Serving rewrites the question, runs hybrid search with the permission filter inside it, reranks 150 → 8, answers only from numbered sources, checks grounding and re-checks cited docs. A golden set gates every change.

34 min · interactive Preview
28

AI agent platform system design: tools, durable runs, approvals and agents you can trust

A durable orchestrator runs each agent as workflow code: pin the version, call the model through a caching gateway, record every step so crashes resume. The model only proposes tool calls; a tool gateway validates, authorizes with the user's own token, adds idempotency keys and parks irreversible steps for approval. Budgets stop runaways; end-state evals with k tries gate every release.

35 min · interactive Preview
31

Offline GPU batch inference system design: millions of LLM calls by a deadline, on GPUs that can vanish

Validate the file, split it into ~20-minute shards, lease them to GPU workers on spot that load the model once and run hundreds of rows at a time with the shared prompt cached. Each attempt writes its own file; one conditional commit per shard makes output exactly-once. Golden set and canary shard gate every new version.

34 min · interactive Preview
34

Content moderation pipeline system design: hash matching, classifiers, LLM checks and human review at a billion items a day

Hash at upload against known-bad lists, score every policy with small classifiers in ~50 ms, two lines per policy: remove above, allow below, and the band between goes to an LLM that reads the policy, then a review queue ordered by severity × reach × likelihood. Every decision logged with a reason, appealable, and gated by golden set → shadow → canary.

34 min · interactive Preview
35

Recommendation system design (TikTok-style For You feed): candidates, ranking, freshness and A/B tests

Several sources (two-tower ANN search, like-your-likes, trending, a fresh pool) retrieve a few thousand items; a light ranker keeps a few hundred; a heavy multi-task ranker predicts finish, like, share and skip; a value model and re-rank add diversity, in ~200 ms. Events stream back to features in seconds and to incremental training in minutes; models ship via interleaving and A/B tests.

34 min · interactive Preview
36

LLM evaluation and guardrails platform system design: judges, guard latency, paired eval gates and safe rollouts

Every product calls an AI gateway: versioned config, input guards (PII mask, a small injection classifier, an LLM judge only when unsure), output guards on streamed chunks, a trace per request. Off the path: sampled traces judged online, people calibrating the judges, failures turned into regression tests, and every change gated by a paired eval with error bars, then shadow, canary and A/B.

33 min · interactive Preview
37

AI coding agent system design (Claude Code, Cursor, Codex): context, edits, sandboxes and evals

Three shapes, one backend: a small self-served Tab model per keystroke; an agent loop with a context engine (grep plus an optional index), a cached prompt to a frontier model, text-anchored edits or a fast apply model, permissions and an OS sandbox; and background agents in a container per task that open a PR. An eval harness gates every change on pass^k.

34 min · interactive Preview
··

Feature store and training platform

Coming next