Skip to main content
LearnMLAcademy
Advanced10 min read

ML & AI System Design Interviews

Design scalable ML systems during interviews using proven structural frameworks, with skill checklists, worked cases, and role-specific interview drills.

What you will master in this lesson
Intuitive core mechanisms & practical real-world intuition
Step-by-step mathematical breakdown & visual diagrams
Runnable Python implementation & practical trade-offs

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.

UPDATED FOR 20268 current big-tech signals moved to the top

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.

16
system-design cases

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

Goal + metrics
Scale + data
Baseline
Model / retrieval
Offline pipeline
Online serving
Monitor + recover
How to read it: The framework keeps model choice connected to metrics, data time, serving constraints, recovery, and governance.

Separate offline learning from the online decision path

Versioned artifacts connect two different operating loops

Events + labels
OFFLINE
Features + training
OFFLINE
Registry + gates
BOUNDARY
Features + serving
ONLINE
Decision + log
ONLINE
Monitor + feedback
FEEDBACK
How to read it: The online path stays latency-bounded; logs and delayed labels feed the offline path without silently changing production.

The fourteen-part framework

Clarify before choosing architecture

Clarify before choosing architecture
StageQuestions
1–3. Goal, metrics, scaleWho decides what, what is success, traffic/data/latency?
4–6. Data, labels, baselineWhat is known at decision time and what simple floor exists?
7–9. Features/retrieval/model and pathsWhat belongs offline versus on the synchronous path?
10–11. Deployment and monitoringHow does a candidate release and how is behaviour observed?
12. Failure handlingWhat degrades, queues, retries, rolls back, or needs a human?
13. Security/privacyWhich data and actions are permitted and auditable?
14. Trade-offsWhat quality, latency, freshness, cost, and complexity exchange is accepted?

16 ML & AI system-design cases

Newer recommendation, search, ads, GPU serving, feature-platform and experiment-tracking cases are placed first.

2026 SIGNAL

Recent Meta MLE reports explicitly include TikTok-style recommendation design; Netflix and Google ML prep also emphasize recommendation/ranking.

9. Short-video recommendation feed

Requirements

Rank a personalized feed from millions of videos under a 150 ms p95 budget while balancing engagement, freshness, diversity, and safety.

Architecture

Event stream → offline/nearline features → candidate generators (follow graph, collaborative, content, trending) → retrieval → feature hydration → ranker → policy/diversity reranker → cache → impression/click/watch logging.

Success metrics

Offline recall/NDCG and calibration; online watch time, completion, return rate, diversity, complaints, latency and guardrails.

Capacity / bottleneck

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.

Major failure modes

Popularity feedback loops, stale features, filter bubbles, delayed labels, position bias, unsafe content, new-user/item cold start.

Trade-offs

Quality versus latency; engagement versus diversity/fairness; freshness versus confidence; exploration versus short-term reward.

Likely follow-up

How would you evaluate the system offline and online before full rollout?

2026 SIGNAL

Autocomplete/type-ahead appears in current ML system-design question banks and Netflix-style product design.

10. Search autocomplete / type-ahead

Requirements

Return useful suggestions within 50 ms as the user types, personalized when appropriate and robust to misspellings.

Architecture

Prefix index or FST/trie for fast candidate generation → spelling/normalization → popularity and context features → lightweight personalized ranker → policy filtering → cache hot prefixes.

Success metrics

Suggestion click-through, MRR, keystrokes saved, coverage, bad-suggestion rate, p95 latency.

Capacity / bottleneck

Every keystroke can trigger a request, so prefix lookup and caching must be extremely cheap.

Major failure modes

Stale trends, offensive suggestions, privacy leakage from personal history, misspellings, head-query domination.

Trade-offs

Freshness versus cacheability; personalization versus privacy; neural ranking quality versus latency.

Likely follow-up

How would you handle a brand-new query with no historical clicks?

2026 SIGNAL

Search-ranking and retrieval design recur in Google/Meta-style ML interviews.

11. Two-stage search ranking

Requirements

Search a corpus of hundreds of millions of items with relevant results under a 200 ms p95 budget.

Architecture

Query understanding → lexical/vector candidate retrieval → metadata/security filters → feature hydration → learned ranker → diversity/business-policy reranker → result cache and feedback logs.

Success metrics

Recall@k for retrieval, NDCG/MRR for ranking, zero-result rate, click/satisfaction metrics, latency and fairness slices.

Capacity / bottleneck

Full-corpus scoring is impossible online; retrieve a few hundred or thousand candidates cheaply, then spend model compute on the shortlist.

Major failure modes

Vocabulary mismatch, stale index, query drift, popularity bias, unauthorized results, click-position bias.

Trade-offs

Recall versus retrieval cost; model complexity versus latency; personalization versus privacy; freshness versus index stability.

Likely follow-up

How would you train from clicks without learning only position bias?

2026 SIGNAL

Current Meta MLE question banks include ads-ranking evaluation and ranking-system design.

12. Ads ranking and evaluation

Requirements

Rank eligible ads for each impression while balancing user experience, advertiser value, policy, and marketplace revenue.

Architecture

Eligibility/policy filter → candidate retrieval → calibrated CTR/CVR/value models → auction/business constraints → ranker → frequency/diversity controls → impression/click/conversion logs.

Success metrics

AUC/calibration offline; revenue, conversions, user engagement/complaints, advertiser ROI, latency and fairness online.

Capacity / bottleneck

High QPS plus strict auction latency; expensive features/models must be staged and cached.

Major failure modes

Click bias, delayed conversions, feedback loops, policy violations, cold-start advertisers, budget pacing errors.

Trade-offs

Short-term revenue versus user trust; exploration versus advertiser predictability; model quality versus auction latency.

Likely follow-up

How would you design an evaluation framework before launching a new ranker?

2026 SIGNAL

LTV prediction appears in current 2026 MLE system-design question banks.

13. Lifetime value prediction

Requirements

Estimate 12-month customer value for acquisition and retention decisions with labels that arrive slowly.

Architecture

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.

Success metrics

MAE/WAPE or ranking/lift by spend bucket, calibration, decision ROI, stability by cohort.

Capacity / bottleneck

Long label horizon slows iteration and creates censoring; backtests must respect observation and outcome windows.

Major failure modes

Future-spend leakage, survivorship bias, changing acquisition channels, treatment effects from past campaigns.

Trade-offs

Long-horizon accuracy versus freshness; interpretable baseline versus flexible model; predictive LTV versus causal incremental value.

Likely follow-up

How would you evaluate new users before 12 months of labels exist?

2026 SIGNAL

Feature-store and real-time feature architecture are common senior ML-system-design themes.

14. Shared online/offline feature platform

Requirements

Serve low-latency online features while reproducing point-in-time-correct training data for many models.

Architecture

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.

Success metrics

Online p95 latency, freshness SLA, offline-online parity, availability, backfill correctness, adoption and cost.

Capacity / bottleneck

Keeping definitions consistent across batch and streaming while supporting backfills and low-latency reads.

Major failure modes

Training-serving skew, stale online values, late data, schema changes, duplicated definitions, incorrect time travel.

Trade-offs

Centralization versus team autonomy; freshness versus cost; generic platform versus specialized features.

Likely follow-up

How do you guarantee point-in-time correctness during a historical backfill?

2026 SIGNAL

Amazon MLE candidate reports and current system-design banks include ML experiment-tracking platform design.

15. ML experiment tracking and analysis platform

Requirements

Track thousands of training runs with parameters, metrics, artifacts, lineage, comparisons, and reproducibility across teams.

Architecture

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.

Success metrics

Logging reliability, query latency, artifact durability, reproducibility rate, storage cost and adoption.

Capacity / bottleneck

High-volume metrics and large artifacts have different storage/access patterns; separate metadata from artifact blobs.

Major failure modes

Mutable runs, missing code/data versions, duplicate IDs, orphaned artifacts, secret leakage, incompatible metric schemas.

Trade-offs

Rich lineage versus developer friction; long retention versus storage cost; centralized schema versus flexibility.

Likely follow-up

How would you compare two runs when datasets or metric definitions changed?

2026 SIGNAL

Current 2026 ML system-design banks explicitly include inference batching on a single GPU.

16. GPU inference batching service

Requirements

Serve synchronous model requests while maximizing GPU utilization and keeping p95 latency within an interactive SLO.

Architecture

Gateway → request normalization → queue by compatible model/shape → dynamic or continuous batch scheduler → GPU workers → response demultiplexing → autoscaling and per-stage telemetry.

Success metrics

Time to first token or first result, p50/p95 latency, tokens/items per second, GPU utilization, queue time, OOM rate and cost/request.

Capacity / bottleneck

Batching improves throughput but waiting too long to form batches hurts tail latency; memory limits cap concurrent work.

Major failure modes

OOM, head-of-line blocking, unfair tenants, long-sequence monopolization, cold model loads, retry storms.

Trade-offs

Throughput versus latency; batch size versus memory; fairness versus utilization; model replicas versus cost.

Likely follow-up

What admission-control rule would you use during overload?

1. Real-time fraud detection

Requirements

Score payment attempts at 2,000 requests/s with a 100 ms p95 decision and a manual-review option.

Architecture

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.

Success metrics

Recall at a review-capacity precision, expected fraud cost, p95 latency, availability, slice performance.

Capacity / bottleneck

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.

Major failure modes

Stale features, model timeout, duplicate transaction, delayed label, incompatible rollback bundle.

Trade-offs

Lower threshold catches more fraud but increases review and customer friction. A simpler model may satisfy the latency budget more reliably.

Likely follow-up

What safe decision occurs if the feature store is unavailable?

2. Recommendation or feed ranking

Requirements

Personalize from millions of items under a 150 ms p95 while preserving diversity and safety.

Architecture

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.

Success metrics

Recall@K and NDCG offline; conversion, long-term satisfaction, diversity, and complaint guardrails online.

Capacity / bottleneck

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.

Major failure modes

Cold start, feedback loops, popularity collapse, stale inventory, filter bubbles.

Trade-offs

Accuracy versus diversity, freshness versus compute, exploration versus short-term engagement.

Likely follow-up

How do you prevent position bias in labels?

3. Churn prediction

Requirements

Score customers daily for a retention team with capacity for 5,000 interventions.

Architecture

Batch point-in-time features → model → calibrated probabilities → top-risk eligible customers → experiment/control assignment → CRM queue → delayed outcome measurement.

Success metrics

Precision or lift at 5,000, incremental retention, intervention cost, calibration, segment fairness.

Capacity / bottleneck

The scarce resource is intervention capacity, not endpoint latency; optimize the ranked operating point.

Major failure modes

Target leakage, treating contacted customers as natural outcomes, stale eligibility, feedback from prior campaigns.

Trade-offs

Predictive risk is not causal treatment effect; an uplift model may better allocate offers.

Likely follow-up

How would you prove the intervention caused lower churn?

4. Demand forecasting

Requirements

Produce weekly store-item forecasts for replenishment with prediction intervals.

Architecture

Time-aware data validation → seasonal baseline → hierarchical features/model → rolling backtests → reconciliation → forecasts and intervals → planner override log.

Success metrics

MAE or WAPE by hierarchy, bias, stockout/overstock cost, interval coverage.

Capacity / bottleneck

Millions of sparse store-item series; group or global models may share signal better than one model per series.

Major failure modes

Random split leakage, promotions unknown at forecast time, new items, holiday regime change.

Trade-offs

Forecast accuracy versus interpretability and run time; aggregation stabilizes signal but loses local detail.

Likely follow-up

How do you evaluate intermittent demand?

5. Document RAG

Requirements

Answer employee policy questions with citations and refuse when evidence is insufficient.

Architecture

Versioned ingestion → parsing/chunking → embedding/index with access metadata → query rewrite/filter → retrieve → rerank → context assembly → grounded generation → claim/citation validation.

Success metrics

Retrieval recall, citation entailment, answer correctness, insufficiency accuracy, p95 latency, cost.

Capacity / bottleneck

Context budget and reranking latency. Retrieve broadly, rerank narrowly, and send only authorized evidence.

Major failure modes

Access leak, stale index, missing evidence, unsupported claim, prompt injection in documents.

Trade-offs

Chunk size and top-k exchange context completeness, precision, latency, and tokens.

Likely follow-up

How do you distinguish retrieval failure from generation failure?

6. High-traffic LLM application

Requirements

Serve 1,000 requests/s with streaming responses, a two-second first-token p95, and per-tenant budgets.

Architecture

Gateway/auth → policy and routing → safe cache → tokenizer/queue → continuous batching → model replicas → output validation/stream → usage and quality logs.

Success metrics

Time to first token, tokens/s, p95 completion, quality regression, refusal rate, cost/request.

Capacity / bottleneck

GPU memory and decode throughput. If average output is 200 tokens, requested generation is 200,000 tokens/s before headroom.

Major failure modes

Queue growth, cache leakage, provider outage, prompt expansion, bad model rollout.

Trade-offs

Model size versus quality/latency/cost; batching throughput versus individual waiting time.

Likely follow-up

How does admission control protect latency?

7. Content moderation

Requirements

Classify text and images before publication with appeal and human-review paths.

Architecture

Input validation → fast policy rules → modality models → calibrated risk scores → allow/review/block policy → explanation/evidence → audit and appeal workflow.

Success metrics

Recall for severe harm, precision and review load, slice fairness, appeal overturn rate, latency.

Capacity / bottleneck

High-recall multimodal checks within publication latency; cascade cheap filters before expensive models.

Major failure modes

Adversarial obfuscation, cultural/language bias, policy version mismatch, moderator overload.

Trade-offs

Safety recall versus false positives and user expression; automation versus accountable review.

Likely follow-up

How do you version labels when policy changes?

8. Agentic workflow

Requirements

Research and draft a report using approved tools with a five-minute and fixed-cost budget.

Architecture

Goal intake → plan/state graph → scoped tool proposal → validation/authorization → execution/receipt → evidence store → verifier → human approval or final answer.

Success metrics

Task success, evidence coverage, unsupported claims, tool error recovery, steps, latency, cost.

Capacity / bottleneck

Serial tool/model calls. Parallelize independent retrieval but bound fan-out and centralize accepted evidence.

Major failure modes

Prompt injection, endless search, duplicate side effects, stale checkpoint, fabricated citation.

Trade-offs

Autonomy versus predictability; more search versus latency/cost; richer memory versus privacy.

Likely follow-up

What exact stop conditions prevent looping?

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.

Apply this concept in a real hands-on project

You have studied the idea. Now use it in working Python code, see the calculation and output, and explain what changed. Each project includes step-by-step instructions, full source and tests.

Practice challenge: predict an outcome first, run the code, and explain the difference.

Track Your Progress0% curriculum done

Finished "ML & AI System Design Interviews"?

Mark this lesson as completed to update your progress bar and track your milestones across the full curriculum.

Overall Progress0 / 167 lessons

Was this tutorial helpful?

Your feedback helps us continuously refine and improve our open-access tutorials.

Knowledge Check

Progress: 0/5

Test your active recall. Choose one answer for each question, then check it to reveal the step-by-step reasoning.

Question 1 of 5numerical/formula
Peak traffic is 2,000 requests/s and one instance safely handles 250. What is the theoretical minimum?
Question 2 of 5practical selection
What should happen before choosing a model architecture?
Question 3 of 5application/scenario
A retention team can contact only 5,000 customers. Which metric is directly useful?
Question 4 of 5conceptual
Which work belongs off the synchronous fraud-decision path?
Question 5 of 5debugging/diagnostic
Why keep rollback as a compatible bundle?

Knowledge Check Review & Explanations

Review the questions, verified correct answers, and conceptual explanations for this lesson.

1Peak traffic is 2,000 requests/s and one instance safely handles 250. What is the theoretical minimum?▼

Correct Answer: 8

2,000/250=8. Production capacity still needs headroom for bursts and failure.

2What should happen before choosing a model architecture?▼

Correct Answer: Clarify goal, metrics, scale, and constraints

The product decision and operating constraints determine which model and system are appropriate.

3A retention team can contact only 5,000 customers. Which metric is directly useful?▼

Correct Answer: Lift or precision at 5,000

The operating capacity makes ranked quality at the top 5,000 more useful than an unconstrained aggregate.

4Which work belongs off the synchronous fraud-decision path?▼

Correct Answer: Monthly retraining and delayed-label analysis

Training and delayed analysis do not need to block the live payment decision.

5Why keep rollback as a compatible bundle?▼

Correct Answer: Model, features, preprocessing, policy, and runtime must agree

Restoring only model bytes can fail when surrounding contracts belong to a different release.

Keep moving through the path

Continue Learning

Free Download: ML/AI System Design Interview Handbook

Detailed ML and AI system-design cases covering requirements, architecture, data and feature pipelines, serving, scale, metrics, failure modes and trade-offs. Enter your email to download it instantly.

Next