01 / The learning path

ML system design interview questions

Connect the product objective to data, models, and production. 139 worked examples, with the fundamentals linked where you need them.

Start here · Worked example

Design a video recommendation system

Turn an ambiguous interview prompt into a design with clear objectives, a retrieval and ranking pipeline, and a plan for evaluating it.

12 min readFoundations + advanced discussion
The serving path
RetrieveRankRe-rank
Each stage has a different job.
Your design should explain why.

Choose your starting point.

Same destination. Different depth.

Foundation path

Connect one concept at a time.

Start with evaluation metrics and the recommendation walkthrough. Then read class imbalance before tackling fraud detection.

Experienced path

Defend the decisions under pressure.

Outline your answer before reading each solution. Compare the fraud-policy follow-ups and the search-ranking trade-offs.

Worked design problems.

139 systems. Different objectives and constraints.

01

Design a video recommendation system

Objectives, data, retrieval, ranking, and production trade-offs.

12 min read
02

Fraud Detection System Design: Models, Decisions and Review

Design payment fraud detection with time-correct features, delayed labels, calibrated decisions and bounded review queues. Includes capacity and failure examples.

10 min read
03

Search Ranking System Design: Retrieval, Ranking and Evaluation

Design hybrid search ranking with lexical and semantic retrieval, exact-match handling, NDCG evaluation and deadline-aware fallbacks. Includes worked candidate budgets.

10 min read
04

Design an ad-click prediction system

Define the impression, score candidates efficiently, and keep probability calibration honest.

7 min read
05

Design a spam detection system

Build a recoverable message policy with reliable labels and a plan for changing campaigns.

7 min read
06

Design a document question-answering system

Retrieve authorized evidence, generate supported answers, and evaluate what citations actually prove.

7 min read
07

Design a demand forecasting system

Forecast the right horizon, distinguish observed sales from demand, and connect uncertainty to inventory decisions.

4 min read
08

Design an arrival-time prediction system

Define the prediction timestamp, handle unfinished trips, and separate route estimates from customer promises.

4 min read
09

Design a visual product-search system

Connect image embeddings to catalog freshness, attribute constraints, and relevance evaluation.

4 min read
10

Design a notification recommendation system

Optimize useful interruptions, enforce frequency caps, and measure outcomes beyond clicks.

4 min read
11

Design an anomaly detection system

Turn unusual measurements into actionable incidents with seasonality, alert budgets, and operator feedback.

4 min read
12

Design a feature platform

Keep historical training joins and low-latency serving consistent through explicit timestamps and versions.

4 min read
13

Design a model-serving platform

Balance deadlines, batching, version compatibility, and rollback across shared inference infrastructure.

4 min read
14

Design a near-duplicate detection system

Combine cheap candidate generation with careful verification, and keep similarity distinct from identity.

4 min read
15

Design a streaming LLM inference service

Budget tokens and memory, separate prefill from decoding, and protect interactive latency under load.

5 min read
16

Design an agent evaluation platform

Measure completed outcomes across repeated trials, while separating model failures from broken environments.

5 min read
17

Design a real-time voice assistant

Handle interruption, bounded audio buffers, and tool calls whose outcomes outlive the spoken response.

5 min read
18

Schedule large and small models for document review

Derive feasible GPU shares, prevent starvation, and distinguish cache hits from useful compute savings.

7 min read
19

Design a research assistant with parallel workers

Preserve claim provenance, coordinate durable tasks and enforce budgets before delegating more work.

6 min read
20

Route models under quality, cost and latency constraints

Choose eligible models, measure the value of escalation and evaluate the complete routing policy.

7 min read
21

Design training-data provenance and removal workflows

Versioned manifests, record membership, release gates and a worked invalidation case.

9 min read
22

Design retrieval over rapidly changing documents

Freshness budgets, chunk generations, permission checks, deletion and live index rebuilding.

9 min read
23

Design a human preference collection platform

Pair sampling, independent judgments, reviewer capacity and training-data lineage.

9 min read
24

Design a model rollout and rollback platform

Shadow traffic, cohort canaries, delayed labels and rollback capacity.

9 min read
25

Design an active-learning annotation loop

Uncertainty, diversity, exploration, labeling budgets and fair learning-curve comparisons.

9 min read
26

Design a deadline-aware batch inference service

Work partitioning, deadline capacity, attempt isolation and manifest publication.

10 min read
27

Delayed Conversion Labels: Maturity, Bias and Monitoring

Handle delayed conversion labels with mature cohorts and age-aware evaluation. Separate slower reporting from lower conversion rates using a worked example.

9 min read
28

Design cross-language enterprise retrieval

Hybrid candidates, multilingual representations, language-pair evaluation and safe fallbacks.

11 min read
29

Resolve customer entities across noisy records

Blocking, calibrated pair scores, constrained clusters and versioned merge recovery.

13 min read
30

Extract structured tables from enterprise documents

Merged cells, OCR alignment, semantic validation and versioned corrections.

12 min read
31

Attribute speakers in recorded meetings

Diarization pipelines, overlap-aware metrics, chunk reconciliation and corrections.

12 min read
32

Detect rare manufacturing defects from images

Multi-view inspection, anomaly localization, review budgets and camera drift.

13 min read
33

Reconcile forecasts across product hierarchies

Hierarchical forecasts, weighted reconciliation, coherent publishing and quantile pitfalls.

13 min read
34

Recommendation Diversity: MMR, Constraints and Evaluation

Rerank recommendations with MMR while preserving hard creator limits. Calculate candidate feasibility and evaluate relevance, diversity and user outcomes.

11 min read
35

Route uncertain predictions to human experts

Human error, selective risk, benefit-based deferral and reviewer queues.

14 min read
36

Cache semantically similar model requests

False semantic hits, dependency invalidation and cache economics.

14 min read
37

Design content moderation with appeals

Appeal selection bias, staffing calculations, versioned decisions and trustworthy training feedback.

14 min read
38

Evaluate synthetic training data before use

Real holdouts, matched ablations, rare-intent trade-offs and synthetic-data lineage.

13 min read
39

Forecast demand when observed sales are censored

Stockout likelihoods, identifiability limits, availability data and inventory-policy evaluation.

13 min read
40

Product Attribute Extraction: Evidence, Units and Abstention

Extract attributes from product descriptions and datasheets with evidence spans, unit normalization and variant checks. Evaluate precision and abstention separately.

10 min read
41

Evaluate a domain translation service

Blinded review, terminology diagnostics, critical slices and uncertainty-aware release gates.

13 min read
42

Deduplicate image datasets before model training

Candidate recall, graph chaining, group-aware splits and contamination arithmetic.

14 min read
43

Recommend from short anonymous sessions

Session state, prefix training, intent decay and ranking metrics.

14 min read
44

Route search queries across specialized indexes

Ambiguous intent, selective fan-out, unsupported queries and routing evaluation.

14 min read
45

Recommend practice that improves retained learning

Prerequisite-aware practice, Bayesian evidence and delayed-outcome evaluation.

14 min read
46

Design recommendations for new marketplace sellers

Cold-start priors, exploration budgets, logged probabilities and two-sided evaluation.

14 min read
47

Detect suspicious training-data contributions

Base rates, review budgets, behavioral tests and recovery from affected checkpoints.

14 min read
48

Detect acoustic events in continuous audio

Temporal labels, event formation, false alerts per hour and edge deployment.

14 min read
49

Predict useful links in a collaboration graph

Temporal graph snapshots, negative sampling, retrieval recall and degree bias.

14 min read
50

Classify products into an evolving taxonomy

Hierarchical probabilities, ancestor decisions, partial labels and category migrations.

14 min read
51

Retrieve evidence across page layout and text

Hybrid page retrieval, coordinate provenance, multi-page evidence and cost.

14 min read
52

Forecast intermittent spare-part demand

Occurrence and size models, sparse histories, cumulative uncertainty and inventory costs.

15 min read
53

Find equivalent questions in a technical forum

Constraint-aware retrieval, canonical answer drift, abstention and honest evaluation.

14 min read
54

Gate low-quality uploads before downstream inference

Task-specific image quality, retake utility, abandonment and device-shift evaluation.

15 min read
55

Query Rewriting for RAG: Constraints, Retrieval and Evaluation

Design query rewriting for RAG without losing entities, versions or negation. Compare original-query retrieval, gated rewrites, latency and evaluation.

12 min read
56

Retrieve code by natural-language intent

Retrieve version-specific code, preserve permissions, and distinguish similar snippets from evidence of the requested behavior.

14 min read
57

Extract actionable commitments from meetings

Distinguish suggestions from commitments, ground owners and deadlines, and reconcile later corrections before creating tasks.

15 min read
58

Forecast demand for newly launched products

Transfer evidence from comparable launches, update sparse sales carefully, and separate promotional lift from baseline demand.

15 min read
59

Match catalog products across merchants

Distinguish exact variants from visual lookalikes using multimodal evidence, calibrated linking and reversible decisions.

15 min read
60

Predict equipment failure with censored records

Predict actionable equipment failures while accounting for incomplete follow-up, preventive replacement and technician capacity.

15 min read
61

Verify generated answers against evidence

Verify claims and citation support, preserve missing prerequisites, and measure errors that survive the release gate.

15 min read
62

Predict search failure before answering

Estimate initial retrieval failure, separate fallback benefit from risk, and choose actions under latency and cost constraints.

15 min read
63

Personalize search while preserving explicit intent

Use history without overriding explicit intent, prevent profile leakage, and evaluate personalization beyond aggregate clicks.

15 min read
64

Correct search typos without changing the requested entity

Noisy-channel scoring, exact-entity protection and correction precision.

14 min read
65

Design a live meeting transcription system

Live and final paths, optional speech separation, revision protocols and transcript evaluation.

16 min read
66

Predict product returns to offer better purchase guidance

Predict a return within 30 days using information available before purchase.

6 min read
67

Predict support escalations before a service deadline

Use a snapshot at ticket creation or a separately defined hourly scoring time.

6 min read
68

Route short multilingual messages without forcing one language

Language identification is not translation.

6 min read
69

Read handwritten form fields with reviewable uncertainty

Assume authorized scanned forms and a known initial set of layouts.

6 min read
70

Remove video-call backgrounds without erasing fine detail

Predict an alpha matte between zero and one, not merely a binary person mask.

6 min read
71

Find action intervals inside long videos

This is temporal localization in untrimmed video, not recommendation or a whole-video classifier.

6 min read
72

Forecast short-horizon solar generation ramps

Forecast available generation separately from dispatched output.

6 min read
73

Detect land-cover changes from satellite image pairs

Predict observable land-cover change, not ownership or legal use.

6 min read
74

Train keyboard suggestions across intermittent devices

Federated learning changes where training happens; it does not automatically guarantee privacy.

6 min read
75

Segment warehouse objects in sparse point clouds

This is semantic point labeling for inventory assistance, not autonomous motion control.

6 min read
76

Serve a multimodal model when an input is missing

Assume image-only, text-only and paired examples are legitimate input states.

6 min read
77

Estimate which training data improves a model

Define the learner, training randomness, validation population and utility before assigning value.

6 min read
78

Generate image descriptions without inventing details

Assume authors can edit drafts before publication.

6 min read
79

Count products on warehouse shelves

Design a camera-based shelf counting service that reports inventory estimates without treating occluded products as absent.

5 min read
80

Recover reading order from complex documents

Design a model that orders text blocks in newsletters with columns, captions and sidebars before downstream summarization.

5 min read
81

Detect road-surface damage from fleet video

Design a service that turns fleet-camera video into a deduplicated road-repair inspection queue.

5 min read
82

Align supplied subtitles to speech

Design a service that timestamps an existing transcript against an audio recording and flags text that was never spoken.

5 min read
83

Generate bounded pronunciation practice feedback

Design pronunciation feedback for a language-learning exercise with a known target sentence.

5 min read
84

Segment speech and music in long recordings

Build an offline segmentation service that identifies speech-only, music-only, overlap and silence regions.

5 min read
85

Track anonymous objects through a camera view

Design single-camera tracking that counts objects crossing a line without counting the same object every frame.

5 min read
86

Restore scanned images without inventing evidence

Design a scan-cleanup service that removes noise while preserving small text and original content.

5 min read
87

Find reused image crops across a collection

Design retrieval for copied subregions of images despite resizing, cropping and compression.

5 min read
88

Segment operating regimes in sensor histories

Design an offline service that separates normal operating modes before analysts compare equipment behavior.

5 min read
89

Train a classifier from conflicting labeling rules

Design a training pipeline when experts provide noisy rules instead of a large hand-labeled dataset.

5 min read
90

Control confirmation bias in pseudo-labeling

Design a semi-supervised training loop that uses unlabeled images without amplifying its own mistakes.

5 min read
91

Balance competing tasks in one model

Design a shared model that predicts product category and shipping weight without letting one objective dominate training.

5 min read
92

Add new classes without forgetting old ones

Design a classifier update process that introduces new product categories while preserving old-category accuracy.

5 min read
93

Choose which edge images to upload for learning

Design an edge-camera sampling policy under a strict upload budget while keeping an unbiased evaluation stream.

5 min read
94

Design a vision cascade with early exits

Serve easy image classifications cheaply while routing difficult examples to a larger model under a latency budget.

5 min read
95

Recognize known products and reject unknown ones

Design visual product recognition that can say unknown when a package is outside the training catalog.

5 min read
96

Evaluate learned image compression for a product

Design an image-compression experiment that reduces storage without damaging text, edges or downstream recognition.

5 min read
97

Discover and name emerging support themes

Design an analyst tool that groups support messages into emerging themes without treating generated cluster names as ground truth.

5 min read
98

Mine hard negatives without training on false negatives

Design a retrieval-training data pipeline that improves difficult distinctions while protecting genuinely relevant alternatives.

5 min read
99

Distill a slow reranker into a retrieval model

Design a training and evaluation plan to transfer a costly query-document scorer into a low-latency first-stage retriever.

5 min read
100

Ground visual answers in image regions

Design a question-answering assistant that points to supporting image regions and abstains when visual evidence is insufficient.

5 min read
101

Serve tabular models when missingness patterns change

Design a release gate for a tabular predictor when a newly onboarded source omits fields that were usually present in training.

5 min read
102

Serve forecast intervals with coverage monitoring

Design an operational forecasting service that exposes calibrated intervals rather than only point predictions.

5 min read
103

Migrate an embedding model without mixing vector spaces

Design a safe rollout from one document embedding model to another while search remains available.

5 min read
104

Design an always-on wake-word detector

Design an on-device detector that wakes a voice assistant without constantly activating on television audio.

5 min read
105

Remove loudspeaker echo without removing the user

Design echo cancellation for a voice assistant that must hear a person while playing audio.

5 min read
106

Enhance noisy speech for transcription

Build a noise-reduction stage for uploaded interview recordings while preserving names and quiet syllables.

5 min read
107

Verify a consenting enrolled speaker

Design a speaker-verification feature that checks a claimed enrolled identity and provides a non-biometric fallback.

5 min read
108

Estimate motion between video frames

Design a batch optical-flow service for an editor that needs per-pixel motion and uncertainty masks.

5 min read
109

Detect audio and video synchronization drift

Design a quality gate that flags out-of-sync talking-head uploads before publication.

5 min read
110

Serve monocular depth with honest scale limits

Design depth estimates from a single photograph for background effects, without promising reliable distances in meters.

5 min read
111

Design stereo depth from calibrated cameras

Design a stereo-depth service for a fixed camera rig and explain the effect of disparity error.

5 min read
112

Design a mask-controlled image repair tool

Build a tool that fills a user-selected damaged region while preserving every unmasked pixel.

5 min read
113

Design a panorama stitching service

Combine overlapping travel photographs into a panorama and reject inconsistent geometry gracefully.

5 min read
114

Colorize grayscale images without claiming factual recovery

Design a colorization tool that offers plausible alternatives and preserves the original grayscale asset.

5 min read
115

Detect cuts and gradual transitions in video

Design shot segmentation for a media library with hard cuts, fades and camera flashes.

5 min read
116

Choose contrast preprocessing for document OCR

Design a preprocessing decision stage that improves faint scans without destroying already readable text.

5 min read
117

Transcribe mathematical formulas into structured markup

Design formula OCR that preserves fractions, superscripts and symbol relationships in scanned lecture notes.

5 min read
118

Recognize deliberate hand gestures as commands

Design a webcam gesture interface that avoids accidental repeated commands while a hand remains in position.

5 min read
119

Count exercise repetitions from pose trajectories

Design a general fitness repetition counter that explains uncertainty without giving medical assessments.

5 min read
120

Upscale video with temporal consistency

Design a video upscaling service that improves viewing quality while avoiding flicker and invented readable detail.

5 min read
121

Design a constrained text-to-SQL assistant

Let analysts ask questions of approved datasets without executing arbitrary generated SQL.

5 min read
122

Redact sensitive spans from customer text

Design a redaction pipeline for support logs that preserves useful context while minimizing missed sensitive spans.

5 min read
123

Route document regions to the right OCR model

Design OCR routing for pages containing multiple writing systems and mixed orientation.

5 min read
124

Predict flaky tests without hiding real regressions

Design a model that recommends which failing CI tests to rerun rather than automatically dismissing failures.

5 min read
125

Rank likely causes of build failures

Design a developer assistant that groups failed builds and suggests likely causes with evidence links.

5 min read
126

Forecast demand for proactive capacity changes

Design a forecasting layer that prepares capacity before a service load spike, with a reactive fallback.

5 min read
127

Extract evidence-backed relations from documents

Build a pipeline that extracts organization–supplier relationships while preserving the sentence that supports each claim.

5 min read
128

Estimate sound direction from microphone delays

Design a microphone-array feature that points toward an active speaker without claiming to identify them.

5 min read
129

Consolidate agent memory without turning guesses into facts

An assistant accumulates notes across projects. Design a memory consolidation service that retains useful preferences while handling contradictions, expired facts and deletion requests.

3 min read
130

Design tenant-isolated LLM prefix caching

A hosted model repeatedly processes shared instructions and private customer documents. Design a prefix cache that saves prefill work without reusing incompatible or unauthorized state.

3 min read
131

Decide when speculative decoding helps serving latency

A small draft model proposes tokens for a larger target model to verify. Design a serving policy that enables speculation only when it improves latency without changing the intended sampling distribution.

3 min read
132

Admit LLM requests using a KV-cache memory budget

A model fits on a GPU but long concurrent requests cause out-of-memory failures during decoding. Design admission control around growing attention key/value state.

3 min read
133

Serve many LoRA adapters on a shared model fleet

A service hosts hundreds of customer adapters on one base model family. Design routing and adapter caching so a cold adapter does not stall every tenant or contaminate another tenant’s output.

3 min read
134

Separate LLM prefill and decode without losing the handoff

Long prompts disrupt token streaming for existing requests. Design separate prefill and decode pools, including transfer of attention state and recovery from failed handoffs.

3 min read
135

Retrieve nearest neighbors under selective filters

A vector search must return ten relevant documents that match tenant, language and access filters. Design retrieval when only a tiny fraction of the index is eligible.

3 min read
136

Recommend compatible accessories rather than substitutes

A customer viewing a camera wants useful accessories, not more cameras. Design recommendations that distinguish complements from substitutes and enforce product compatibility.

3 min read
137

Explain search results using verifiable evidence

A search product wants to show why a document matched a query. Design concise explanations that stay truthful when ranking uses embeddings, popularity and personalized signals.

3 min read
138

Detect when a speaker has finished their turn

A voice assistant interrupts users during pauses yet feels slow after short commands. Design endpointing that decides when to respond, rather than merely whether speech is present.

3 min read
139

Translate live speech with a bounded delay

A live event needs translated captions before each speaker finishes a sentence. Design a streaming translation pipeline that controls latency without repeatedly rewriting committed text.

3 min read

Strengthen the foundations.

Trust the data.

Audit leakage before believing an offline gain. Prediction time and feature availability matter in every walkthrough.

Trust the evaluation.

Use learning curves and model-selection discipline to decide whether more complexity actually helps.