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.
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.
Your design should explain why.
Choose your starting point.
Same destination. Different depth.
Worked design problems.
139 systems. Different objectives and constraints.
Design a video recommendation system
Objectives, data, retrieval, ranking, and production trade-offs.
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.
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.
Design an ad-click prediction system
Define the impression, score candidates efficiently, and keep probability calibration honest.
Design a spam detection system
Build a recoverable message policy with reliable labels and a plan for changing campaigns.
Design a document question-answering system
Retrieve authorized evidence, generate supported answers, and evaluate what citations actually prove.
Design a demand forecasting system
Forecast the right horizon, distinguish observed sales from demand, and connect uncertainty to inventory decisions.
Design an arrival-time prediction system
Define the prediction timestamp, handle unfinished trips, and separate route estimates from customer promises.
Design a visual product-search system
Connect image embeddings to catalog freshness, attribute constraints, and relevance evaluation.
Design a notification recommendation system
Optimize useful interruptions, enforce frequency caps, and measure outcomes beyond clicks.
Design an anomaly detection system
Turn unusual measurements into actionable incidents with seasonality, alert budgets, and operator feedback.
Design a feature platform
Keep historical training joins and low-latency serving consistent through explicit timestamps and versions.
Design a model-serving platform
Balance deadlines, batching, version compatibility, and rollback across shared inference infrastructure.
Design a near-duplicate detection system
Combine cheap candidate generation with careful verification, and keep similarity distinct from identity.
Design a streaming LLM inference service
Budget tokens and memory, separate prefill from decoding, and protect interactive latency under load.
Design an agent evaluation platform
Measure completed outcomes across repeated trials, while separating model failures from broken environments.
Design a real-time voice assistant
Handle interruption, bounded audio buffers, and tool calls whose outcomes outlive the spoken response.
Schedule large and small models for document review
Derive feasible GPU shares, prevent starvation, and distinguish cache hits from useful compute savings.
Design a research assistant with parallel workers
Preserve claim provenance, coordinate durable tasks and enforce budgets before delegating more work.
Route models under quality, cost and latency constraints
Choose eligible models, measure the value of escalation and evaluate the complete routing policy.
Design training-data provenance and removal workflows
Versioned manifests, record membership, release gates and a worked invalidation case.
Design retrieval over rapidly changing documents
Freshness budgets, chunk generations, permission checks, deletion and live index rebuilding.
Design a human preference collection platform
Pair sampling, independent judgments, reviewer capacity and training-data lineage.
Design a model rollout and rollback platform
Shadow traffic, cohort canaries, delayed labels and rollback capacity.
Design an active-learning annotation loop
Uncertainty, diversity, exploration, labeling budgets and fair learning-curve comparisons.
Design a deadline-aware batch inference service
Work partitioning, deadline capacity, attempt isolation and manifest publication.
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.
Design cross-language enterprise retrieval
Hybrid candidates, multilingual representations, language-pair evaluation and safe fallbacks.
Resolve customer entities across noisy records
Blocking, calibrated pair scores, constrained clusters and versioned merge recovery.
Extract structured tables from enterprise documents
Merged cells, OCR alignment, semantic validation and versioned corrections.
Attribute speakers in recorded meetings
Diarization pipelines, overlap-aware metrics, chunk reconciliation and corrections.
Detect rare manufacturing defects from images
Multi-view inspection, anomaly localization, review budgets and camera drift.
Reconcile forecasts across product hierarchies
Hierarchical forecasts, weighted reconciliation, coherent publishing and quantile pitfalls.
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.
Route uncertain predictions to human experts
Human error, selective risk, benefit-based deferral and reviewer queues.
Cache semantically similar model requests
False semantic hits, dependency invalidation and cache economics.
Design content moderation with appeals
Appeal selection bias, staffing calculations, versioned decisions and trustworthy training feedback.
Evaluate synthetic training data before use
Real holdouts, matched ablations, rare-intent trade-offs and synthetic-data lineage.
Forecast demand when observed sales are censored
Stockout likelihoods, identifiability limits, availability data and inventory-policy evaluation.
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.
Evaluate a domain translation service
Blinded review, terminology diagnostics, critical slices and uncertainty-aware release gates.
Deduplicate image datasets before model training
Candidate recall, graph chaining, group-aware splits and contamination arithmetic.
Recommend from short anonymous sessions
Session state, prefix training, intent decay and ranking metrics.
Route search queries across specialized indexes
Ambiguous intent, selective fan-out, unsupported queries and routing evaluation.
Recommend practice that improves retained learning
Prerequisite-aware practice, Bayesian evidence and delayed-outcome evaluation.
Design recommendations for new marketplace sellers
Cold-start priors, exploration budgets, logged probabilities and two-sided evaluation.
Detect suspicious training-data contributions
Base rates, review budgets, behavioral tests and recovery from affected checkpoints.
Detect acoustic events in continuous audio
Temporal labels, event formation, false alerts per hour and edge deployment.
Predict useful links in a collaboration graph
Temporal graph snapshots, negative sampling, retrieval recall and degree bias.
Classify products into an evolving taxonomy
Hierarchical probabilities, ancestor decisions, partial labels and category migrations.
Retrieve evidence across page layout and text
Hybrid page retrieval, coordinate provenance, multi-page evidence and cost.
Forecast intermittent spare-part demand
Occurrence and size models, sparse histories, cumulative uncertainty and inventory costs.
Find equivalent questions in a technical forum
Constraint-aware retrieval, canonical answer drift, abstention and honest evaluation.
Gate low-quality uploads before downstream inference
Task-specific image quality, retake utility, abandonment and device-shift evaluation.
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.
Retrieve code by natural-language intent
Retrieve version-specific code, preserve permissions, and distinguish similar snippets from evidence of the requested behavior.
Extract actionable commitments from meetings
Distinguish suggestions from commitments, ground owners and deadlines, and reconcile later corrections before creating tasks.
Forecast demand for newly launched products
Transfer evidence from comparable launches, update sparse sales carefully, and separate promotional lift from baseline demand.
Match catalog products across merchants
Distinguish exact variants from visual lookalikes using multimodal evidence, calibrated linking and reversible decisions.
Predict equipment failure with censored records
Predict actionable equipment failures while accounting for incomplete follow-up, preventive replacement and technician capacity.
Verify generated answers against evidence
Verify claims and citation support, preserve missing prerequisites, and measure errors that survive the release gate.
Predict search failure before answering
Estimate initial retrieval failure, separate fallback benefit from risk, and choose actions under latency and cost constraints.
Personalize search while preserving explicit intent
Use history without overriding explicit intent, prevent profile leakage, and evaluate personalization beyond aggregate clicks.
Correct search typos without changing the requested entity
Noisy-channel scoring, exact-entity protection and correction precision.
Design a live meeting transcription system
Live and final paths, optional speech separation, revision protocols and transcript evaluation.
Predict product returns to offer better purchase guidance
Predict a return within 30 days using information available before purchase.
Predict support escalations before a service deadline
Use a snapshot at ticket creation or a separately defined hourly scoring time.
Route short multilingual messages without forcing one language
Language identification is not translation.
Read handwritten form fields with reviewable uncertainty
Assume authorized scanned forms and a known initial set of layouts.
Remove video-call backgrounds without erasing fine detail
Predict an alpha matte between zero and one, not merely a binary person mask.
Find action intervals inside long videos
This is temporal localization in untrimmed video, not recommendation or a whole-video classifier.
Forecast short-horizon solar generation ramps
Forecast available generation separately from dispatched output.
Detect land-cover changes from satellite image pairs
Predict observable land-cover change, not ownership or legal use.
Train keyboard suggestions across intermittent devices
Federated learning changes where training happens; it does not automatically guarantee privacy.
Segment warehouse objects in sparse point clouds
This is semantic point labeling for inventory assistance, not autonomous motion control.
Serve a multimodal model when an input is missing
Assume image-only, text-only and paired examples are legitimate input states.
Estimate which training data improves a model
Define the learner, training randomness, validation population and utility before assigning value.
Generate image descriptions without inventing details
Assume authors can edit drafts before publication.
Count products on warehouse shelves
Design a camera-based shelf counting service that reports inventory estimates without treating occluded products as absent.
Recover reading order from complex documents
Design a model that orders text blocks in newsletters with columns, captions and sidebars before downstream summarization.
Detect road-surface damage from fleet video
Design a service that turns fleet-camera video into a deduplicated road-repair inspection queue.
Align supplied subtitles to speech
Design a service that timestamps an existing transcript against an audio recording and flags text that was never spoken.
Generate bounded pronunciation practice feedback
Design pronunciation feedback for a language-learning exercise with a known target sentence.
Segment speech and music in long recordings
Build an offline segmentation service that identifies speech-only, music-only, overlap and silence regions.
Track anonymous objects through a camera view
Design single-camera tracking that counts objects crossing a line without counting the same object every frame.
Restore scanned images without inventing evidence
Design a scan-cleanup service that removes noise while preserving small text and original content.
Find reused image crops across a collection
Design retrieval for copied subregions of images despite resizing, cropping and compression.
Segment operating regimes in sensor histories
Design an offline service that separates normal operating modes before analysts compare equipment behavior.
Train a classifier from conflicting labeling rules
Design a training pipeline when experts provide noisy rules instead of a large hand-labeled dataset.
Control confirmation bias in pseudo-labeling
Design a semi-supervised training loop that uses unlabeled images without amplifying its own mistakes.
Balance competing tasks in one model
Design a shared model that predicts product category and shipping weight without letting one objective dominate training.
Add new classes without forgetting old ones
Design a classifier update process that introduces new product categories while preserving old-category accuracy.
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.
Design a vision cascade with early exits
Serve easy image classifications cheaply while routing difficult examples to a larger model under a latency budget.
Recognize known products and reject unknown ones
Design visual product recognition that can say unknown when a package is outside the training catalog.
Evaluate learned image compression for a product
Design an image-compression experiment that reduces storage without damaging text, edges or downstream recognition.
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.
Mine hard negatives without training on false negatives
Design a retrieval-training data pipeline that improves difficult distinctions while protecting genuinely relevant alternatives.
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.
Ground visual answers in image regions
Design a question-answering assistant that points to supporting image regions and abstains when visual evidence is insufficient.
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.
Serve forecast intervals with coverage monitoring
Design an operational forecasting service that exposes calibrated intervals rather than only point predictions.
Migrate an embedding model without mixing vector spaces
Design a safe rollout from one document embedding model to another while search remains available.
Design an always-on wake-word detector
Design an on-device detector that wakes a voice assistant without constantly activating on television audio.
Remove loudspeaker echo without removing the user
Design echo cancellation for a voice assistant that must hear a person while playing audio.
Enhance noisy speech for transcription
Build a noise-reduction stage for uploaded interview recordings while preserving names and quiet syllables.
Verify a consenting enrolled speaker
Design a speaker-verification feature that checks a claimed enrolled identity and provides a non-biometric fallback.
Estimate motion between video frames
Design a batch optical-flow service for an editor that needs per-pixel motion and uncertainty masks.
Detect audio and video synchronization drift
Design a quality gate that flags out-of-sync talking-head uploads before publication.
Serve monocular depth with honest scale limits
Design depth estimates from a single photograph for background effects, without promising reliable distances in meters.
Design stereo depth from calibrated cameras
Design a stereo-depth service for a fixed camera rig and explain the effect of disparity error.
Design a mask-controlled image repair tool
Build a tool that fills a user-selected damaged region while preserving every unmasked pixel.
Design a panorama stitching service
Combine overlapping travel photographs into a panorama and reject inconsistent geometry gracefully.
Colorize grayscale images without claiming factual recovery
Design a colorization tool that offers plausible alternatives and preserves the original grayscale asset.
Detect cuts and gradual transitions in video
Design shot segmentation for a media library with hard cuts, fades and camera flashes.
Choose contrast preprocessing for document OCR
Design a preprocessing decision stage that improves faint scans without destroying already readable text.
Transcribe mathematical formulas into structured markup
Design formula OCR that preserves fractions, superscripts and symbol relationships in scanned lecture notes.
Recognize deliberate hand gestures as commands
Design a webcam gesture interface that avoids accidental repeated commands while a hand remains in position.
Count exercise repetitions from pose trajectories
Design a general fitness repetition counter that explains uncertainty without giving medical assessments.
Upscale video with temporal consistency
Design a video upscaling service that improves viewing quality while avoiding flicker and invented readable detail.
Design a constrained text-to-SQL assistant
Let analysts ask questions of approved datasets without executing arbitrary generated SQL.
Redact sensitive spans from customer text
Design a redaction pipeline for support logs that preserves useful context while minimizing missed sensitive spans.
Route document regions to the right OCR model
Design OCR routing for pages containing multiple writing systems and mixed orientation.
Predict flaky tests without hiding real regressions
Design a model that recommends which failing CI tests to rerun rather than automatically dismissing failures.
Rank likely causes of build failures
Design a developer assistant that groups failed builds and suggests likely causes with evidence links.
Forecast demand for proactive capacity changes
Design a forecasting layer that prepares capacity before a service load spike, with a reactive fallback.
Extract evidence-backed relations from documents
Build a pipeline that extracts organization–supplier relationships while preserving the sentence that supports each claim.
Estimate sound direction from microphone delays
Design a microphone-array feature that points toward an active speaker without claiming to identify them.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.