An ML/AI system-design interview asks you to connect a user decision to data, models, software, scale, monitoring, failure handling, and trade-offs. Drawing boxes before clarifying the goal usually produces the wrong system.
Use the reusable framework first, then adapt it. The expanded case bank covers patterns that recur in current ML/AI loops: recommendation and ranking, search/autocomplete, ads, fraud, RAG, GPU serving, feature platforms, experiment tracking, and agentic systems.
This is the expanded interview-preparation version
Current, research-driven questions are shown first so you can immediately see what changed. Each question keeps the detailed answer, example, likely follow-up, and weak-answer warning.
What you will be able to do
- Apply a fourteen-part design framework
- Separate offline and online paths
- Estimate scale and latency
- Choose metrics and baselines
- Reason about failure, security, and cost
A reusable ML/AI system-design sequence
Move from product decision to observable operation
Separate offline learning from the online decision path
Versioned artifacts connect two different operating loops
The fourteen-part framework
Clarify before choosing architecture
16 ML & AI system-design cases
Newer recommendation, search, ads, GPU serving, feature-platform and experiment-tracking cases are placed first.
Recent Meta MLE reports explicitly include TikTok-style recommendation design; Netflix and Google ML prep also emphasize recommendation/ranking.
9. Short-video recommendation feed
Rank a personalized feed from millions of videos under a 150 ms p95 budget while balancing engagement, freshness, diversity, and safety.
Event stream → offline/nearline features → candidate generators (follow graph, collaborative, content, trending) → retrieval → feature hydration → ranker → policy/diversity reranker → cache → impression/click/watch logging.
Offline recall/NDCG and calibration; online watch time, completion, return rate, diversity, complaints, latency and guardrails.
Candidate generation and feature hydration must stay cheap enough for the ranking budget; cache reusable features and keep the heavy model only on a small candidate set.
Popularity feedback loops, stale features, filter bubbles, delayed labels, position bias, unsafe content, new-user/item cold start.
Quality versus latency; engagement versus diversity/fairness; freshness versus confidence; exploration versus short-term reward.
How would you evaluate the system offline and online before full rollout?
Autocomplete/type-ahead appears in current ML system-design question banks and Netflix-style product design.
10. Search autocomplete / type-ahead
Return useful suggestions within 50 ms as the user types, personalized when appropriate and robust to misspellings.
Prefix index or FST/trie for fast candidate generation → spelling/normalization → popularity and context features → lightweight personalized ranker → policy filtering → cache hot prefixes.
Suggestion click-through, MRR, keystrokes saved, coverage, bad-suggestion rate, p95 latency.
Every keystroke can trigger a request, so prefix lookup and caching must be extremely cheap.
Stale trends, offensive suggestions, privacy leakage from personal history, misspellings, head-query domination.
Freshness versus cacheability; personalization versus privacy; neural ranking quality versus latency.
How would you handle a brand-new query with no historical clicks?
Search-ranking and retrieval design recur in Google/Meta-style ML interviews.
11. Two-stage search ranking
Search a corpus of hundreds of millions of items with relevant results under a 200 ms p95 budget.
Query understanding → lexical/vector candidate retrieval → metadata/security filters → feature hydration → learned ranker → diversity/business-policy reranker → result cache and feedback logs.
Recall@k for retrieval, NDCG/MRR for ranking, zero-result rate, click/satisfaction metrics, latency and fairness slices.
Full-corpus scoring is impossible online; retrieve a few hundred or thousand candidates cheaply, then spend model compute on the shortlist.
Vocabulary mismatch, stale index, query drift, popularity bias, unauthorized results, click-position bias.
Recall versus retrieval cost; model complexity versus latency; personalization versus privacy; freshness versus index stability.
How would you train from clicks without learning only position bias?
Current Meta MLE question banks include ads-ranking evaluation and ranking-system design.
12. Ads ranking and evaluation
Rank eligible ads for each impression while balancing user experience, advertiser value, policy, and marketplace revenue.
Eligibility/policy filter → candidate retrieval → calibrated CTR/CVR/value models → auction/business constraints → ranker → frequency/diversity controls → impression/click/conversion logs.
AUC/calibration offline; revenue, conversions, user engagement/complaints, advertiser ROI, latency and fairness online.
High QPS plus strict auction latency; expensive features/models must be staged and cached.
Click bias, delayed conversions, feedback loops, policy violations, cold-start advertisers, budget pacing errors.
Short-term revenue versus user trust; exploration versus advertiser predictability; model quality versus auction latency.
How would you design an evaluation framework before launching a new ranker?
LTV prediction appears in current 2026 MLE system-design question banks.
13. Lifetime value prediction
Estimate 12-month customer value for acquisition and retention decisions with labels that arrive slowly.
Point-in-time customer/event snapshot → delayed-label builder → leakage-safe features → baseline survival/regression model → calibrated prediction intervals or quantiles → batch scoring → policy layer.
MAE/WAPE or ranking/lift by spend bucket, calibration, decision ROI, stability by cohort.
Long label horizon slows iteration and creates censoring; backtests must respect observation and outcome windows.
Future-spend leakage, survivorship bias, changing acquisition channels, treatment effects from past campaigns.
Long-horizon accuracy versus freshness; interpretable baseline versus flexible model; predictive LTV versus causal incremental value.
How would you evaluate new users before 12 months of labels exist?
Feature-store and real-time feature architecture are common senior ML-system-design themes.
14. Shared online/offline feature platform
Serve low-latency online features while reproducing point-in-time-correct training data for many models.
Versioned feature definitions → batch/stream computation → offline historical store + online low-latency store → point-in-time training joins → feature service with freshness metadata → lineage/quality monitoring.
Online p95 latency, freshness SLA, offline-online parity, availability, backfill correctness, adoption and cost.
Keeping definitions consistent across batch and streaming while supporting backfills and low-latency reads.
Training-serving skew, stale online values, late data, schema changes, duplicated definitions, incorrect time travel.
Centralization versus team autonomy; freshness versus cost; generic platform versus specialized features.
How do you guarantee point-in-time correctness during a historical backfill?
Amazon MLE candidate reports and current system-design banks include ML experiment-tracking platform design.
15. ML experiment tracking and analysis platform
Track thousands of training runs with parameters, metrics, artifacts, lineage, comparisons, and reproducibility across teams.
SDK/logging API → metadata service → artifact object store → metrics/time-series store → lineage links to code/data/environment → searchable UI → access control and retention policies.
Logging reliability, query latency, artifact durability, reproducibility rate, storage cost and adoption.
High-volume metrics and large artifacts have different storage/access patterns; separate metadata from artifact blobs.
Mutable runs, missing code/data versions, duplicate IDs, orphaned artifacts, secret leakage, incompatible metric schemas.
Rich lineage versus developer friction; long retention versus storage cost; centralized schema versus flexibility.
How would you compare two runs when datasets or metric definitions changed?
Current 2026 ML system-design banks explicitly include inference batching on a single GPU.
16. GPU inference batching service
Serve synchronous model requests while maximizing GPU utilization and keeping p95 latency within an interactive SLO.
Gateway → request normalization → queue by compatible model/shape → dynamic or continuous batch scheduler → GPU workers → response demultiplexing → autoscaling and per-stage telemetry.
Time to first token or first result, p50/p95 latency, tokens/items per second, GPU utilization, queue time, OOM rate and cost/request.
Batching improves throughput but waiting too long to form batches hurts tail latency; memory limits cap concurrent work.
OOM, head-of-line blocking, unfair tenants, long-sequence monopolization, cold model loads, retry storms.
Throughput versus latency; batch size versus memory; fairness versus utilization; model replicas versus cost.
What admission-control rule would you use during overload?
1. Real-time fraud detection
Score payment attempts at 2,000 requests/s with a 100 ms p95 decision and a manual-review option.
Validated request → idempotency check → online features → model score → threshold/rules → approve, review, or decline. Log asynchronously; join delayed labels offline; gate and canary model bundles.
Recall at a review-capacity precision, expected fraud cost, p95 latency, availability, slice performance.
Feature lookup and model call share the synchronous budget. At 250 requests/s per instance, 2,000/250=8 is a theoretical minimum; provision headroom beyond eight.
Stale features, model timeout, duplicate transaction, delayed label, incompatible rollback bundle.
Lower threshold catches more fraud but increases review and customer friction. A simpler model may satisfy the latency budget more reliably.
What safe decision occurs if the feature store is unavailable?
2. Recommendation or feed ranking
Personalize from millions of items under a 150 ms p95 while preserving diversity and safety.
Offline item/user representation training; online candidate sources retrieve hundreds; a richer ranker scores them; policy re-ranks for inventory, diversity, and safety; feedback logs feed evaluation.
Recall@K and NDCG offline; conversion, long-term satisfaction, diversity, and complaint guardrails online.
Candidate retrieval must cut millions to hundreds cheaply. Ranking 500 items at 0.2 ms each sequentially already uses 100 ms, so batch or vectorize.
Cold start, feedback loops, popularity collapse, stale inventory, filter bubbles.
Accuracy versus diversity, freshness versus compute, exploration versus short-term engagement.
How do you prevent position bias in labels?
3. Churn prediction
Score customers daily for a retention team with capacity for 5,000 interventions.
Batch point-in-time features → model → calibrated probabilities → top-risk eligible customers → experiment/control assignment → CRM queue → delayed outcome measurement.
Precision or lift at 5,000, incremental retention, intervention cost, calibration, segment fairness.
The scarce resource is intervention capacity, not endpoint latency; optimize the ranked operating point.
Target leakage, treating contacted customers as natural outcomes, stale eligibility, feedback from prior campaigns.
Predictive risk is not causal treatment effect; an uplift model may better allocate offers.
How would you prove the intervention caused lower churn?
4. Demand forecasting
Produce weekly store-item forecasts for replenishment with prediction intervals.
Time-aware data validation → seasonal baseline → hierarchical features/model → rolling backtests → reconciliation → forecasts and intervals → planner override log.
MAE or WAPE by hierarchy, bias, stockout/overstock cost, interval coverage.
Millions of sparse store-item series; group or global models may share signal better than one model per series.
Random split leakage, promotions unknown at forecast time, new items, holiday regime change.
Forecast accuracy versus interpretability and run time; aggregation stabilizes signal but loses local detail.
How do you evaluate intermittent demand?
5. Document RAG
Answer employee policy questions with citations and refuse when evidence is insufficient.
Versioned ingestion → parsing/chunking → embedding/index with access metadata → query rewrite/filter → retrieve → rerank → context assembly → grounded generation → claim/citation validation.
Retrieval recall, citation entailment, answer correctness, insufficiency accuracy, p95 latency, cost.
Context budget and reranking latency. Retrieve broadly, rerank narrowly, and send only authorized evidence.
Access leak, stale index, missing evidence, unsupported claim, prompt injection in documents.
Chunk size and top-k exchange context completeness, precision, latency, and tokens.
How do you distinguish retrieval failure from generation failure?
6. High-traffic LLM application
Serve 1,000 requests/s with streaming responses, a two-second first-token p95, and per-tenant budgets.
Gateway/auth → policy and routing → safe cache → tokenizer/queue → continuous batching → model replicas → output validation/stream → usage and quality logs.
Time to first token, tokens/s, p95 completion, quality regression, refusal rate, cost/request.
GPU memory and decode throughput. If average output is 200 tokens, requested generation is 200,000 tokens/s before headroom.
Queue growth, cache leakage, provider outage, prompt expansion, bad model rollout.
Model size versus quality/latency/cost; batching throughput versus individual waiting time.
How does admission control protect latency?
7. Content moderation
Classify text and images before publication with appeal and human-review paths.
Input validation → fast policy rules → modality models → calibrated risk scores → allow/review/block policy → explanation/evidence → audit and appeal workflow.
Recall for severe harm, precision and review load, slice fairness, appeal overturn rate, latency.
High-recall multimodal checks within publication latency; cascade cheap filters before expensive models.
Adversarial obfuscation, cultural/language bias, policy version mismatch, moderator overload.
Safety recall versus false positives and user expression; automation versus accountable review.
How do you version labels when policy changes?
8. Agentic workflow
Research and draft a report using approved tools with a five-minute and fixed-cost budget.
Goal intake → plan/state graph → scoped tool proposal → validation/authorization → execution/receipt → evidence store → verifier → human approval or final answer.
Task success, evidence coverage, unsupported claims, tool error recovery, steps, latency, cost.
Serial tool/model calls. Parallelize independent retrieval but bound fan-out and centralize accepted evidence.
Prompt injection, endless search, duplicate side effects, stale checkpoint, fabricated citation.
Autonomy versus predictability; more search versus latency/cost; richer memory versus privacy.
What exact stop conditions prevent looping?
Review the deeper lessons
Use these links when an interview question exposes a gap. The interview guide focuses on explanation and decision-making; the linked lesson teaches the full concept.
Keep the answer honest: role boundaries, interview processes, and project outcomes vary. Never invent experience, impact, salary, or certainty to make an answer sound stronger.
Summary / Key Takeaways
- Begin system design by clarifying the user decision, success metrics, scale, and latency.
- Data and labels must reflect what is available at the real decision time.
- A simple baseline reveals whether architectural complexity earns its cost.
- Offline training and online serving are distinct paths connected by versioned artifacts and feedback.
- Capacity estimates expose impossible latency or throughput assumptions before implementation.
- Failure handling, security, privacy, governance, and rollback are first-class design requirements.
- The strongest design explains explicit quality, latency, freshness, cost, and complexity trade-offs.