ML System Design Interviews: The Quick Start
This lesson is for machine learning engineers, applied scientists and data scientists facing an ML system design round, and for software engineers who expect one. It covers how the round differs from general system design, a delivery framework with time budgets, and one worked example designed end to end. You do not need to be a researcher to do well; you need to show that you can turn a vague product goal into a model that ships, gets measured and stays healthy.
How this interview differs from general system design
In a general system design interview the hard parts are scale and consistency. In an ML system design interview the hard parts are earlier and later:
Earlier: is this an ML problem at all, what exactly is being predicted, and where do the labels come from?
Later: how do you know the model works, offline and in production, and what happens when the world changes underneath it?
The architecture still matters (serving, storage, pipelines), but an answer that draws a perfect serving stack around a model trained on the wrong labels scores poorly. Interviewers listen for the chain from business goal to ML objective to data to evaluation, and for whether you start simple.
SmartIntervu scores ML design prompts on the same system design rubric, and each dimension has an ML reading. Requirements covers the business goal, the label and the cost of each kind of error. High-level design covers the data, training and serving pipelines and how they connect. Deep dive and scalability is usually labels, evaluation and drift rather than sharding. Trade-offs means metric and threshold choices, model size against latency and cost, and rules against models. The interviewer probes the weakest link in that chain: "where do your labels come from?", "why that metric?", "how would you know it got worse?"
Much of what you know from general system design still applies; System Design Interviews: The Quick Start covers requirements and estimation.
A delivery framework for 45 minutes
Clarify the goal (about 5 minutes). Who uses this, what decision does the model support, what does success look like for the business, and what are the constraints (latency, volume, cost, regulation)?
Frame it as an ML task (about 5 minutes). Name the input, the output and the type of task: binary classification, ranking, regression, retrieval. Pick the offline metric that matches the business cost of errors.
Data and labels (about 7 minutes). Where labels come from, how noisy and biased they are, how much there is, and how you build a trustworthy evaluation set.
Features (about 5 minutes). The signals available at prediction time, grouped sensibly, and how they are computed the same way in training and serving.
Model (about 8 minutes). A baseline first, then the model you would actually ship and why. Training cadence.
Evaluation (about 5 minutes). Offline metrics, then online metrics and how you would run the experiment.
Serving and monitoring (about 7 minutes). Batch or real time, latency budget, fallbacks, drift and feedback loops.
Wrap-up (about 3 minutes). Risks, what you would do next, what you would measure first.
Hold yourself to the clock. The most common failure is spending 25 minutes on model architecture and never reaching evaluation or monitoring.
Framing: the step most candidates rush
Good framing turns "reduce harmful content" into something trainable and testable. Three questions do most of the work:
What is the unit of prediction? A comment, a user, a session, a pair of (user, item)?
What is the label, and is it the thing you care about? "Was reported by a user" is not the same as "is harmful". A click is not the same as satisfaction. Name the gap and how you will manage it.
What do errors cost? A false positive in content moderation silences a legitimate user; a false negative leaves abuse up. That asymmetry chooses your metric and your thresholds.
Also say when ML is the wrong tool. If a rule catches 90 percent of a problem with no false positives, ship the rule and use a model for the rest.
Data, labels and the evaluation set
Labels usually come from one of four places, each with a known weakness:
Human annotation: high quality, expensive, slow. Disagreement between annotators tells you how ambiguous the task is.
User actions (reports, clicks, purchases): plentiful but biased toward what users saw and chose to act on.
Past system decisions: biased toward whatever the previous system flagged.
Delayed outcomes (a chargeback, a churned account): accurate but arriving weeks later.
Always build an evaluation set that is not shaped by your own system: a random sample of traffic, labeled by people, refreshed regularly. Without it you cannot measure what the model misses, only what it catches.
For statistical traps here (selection bias, confounding, how much data a test needs), see the Statistics for Analysts practice interview.
Models: start with a baseline
Name a baseline you could ship in a week, then improve on it. For text classification that might be logistic regression on word and character n-grams; for ranking, a gradient-boosted tree model on hand-built features. Then propose the stronger model (a fine-tuned transformer, a two-tower retrieval model with a ranking stage) and justify the extra cost by what the baseline gets wrong.
Interviewers reward this ordering because it is how real teams work: the baseline sets the bar, exposes data problems early, and becomes the fallback when the big model is unavailable.
Worked example: a harmful comment classifier
Prompt: "Design a system that detects harmful comments on a social platform."
The weak answer
I'd fine-tune a BERT model on a public toxicity dataset, deploy it behind an API, and retrain it monthly. We should be able to get accuracy above 95 percent.
It never asks what this platform counts as harmful, so the public labels may not match its policy (requirements). Accuracy is the wrong metric for a rare class, as the numbers below show (trade-offs). There is no plan for the comments the model is unsure about, and nothing about how to notice it degrading (deep dive). The strong answer below works through the same prompt in order.
Goal and constraints
Ask, then state: the platform receives 50 million comments a day, about 580 a second on average. Policy defines harmful as harassment, hate and threats. Moderators can review about 20,000 items a day. The product wants harmful comments hidden before most people see them, and legitimate comments must not be delayed noticeably.
Framing
Binary classification per comment, with the comment text, the author and the context (the post, the thread) as input. Suppose roughly 0.5 percent of comments are harmful: 250,000 a day. That prevalence makes accuracy useless: a model that says "fine" every time scores 99.5 percent. Use precision and recall, and pick operating points:
Auto-hide when the score is very high, at a threshold chosen for about 95 percent precision.
Send to human review in a middle band sized so it produces at most about 20,000 items a day, the review capacity.
Publish the rest.
Offline, report recall at the auto-hide precision and precision-recall AUC over the whole curve.
Data and labels
Training labels come from past moderator decisions plus a stream of newly annotated samples. Moderator decisions over-represent reported content, so the evaluation set is a separate random sample of all comments, a few thousand a week, labeled by two annotators each, with disagreements resolved by a policy expert. That set measures true recall.
Features
Text: the comment itself, which a text model encodes.
Context: the parent post and the previous comment in the thread, because "you should leave" means something different in a moving-house thread.
Author signals: account age, past violations, recent posting rate.
Target signals: whether the comment mentions or replies to a user who has been targeted recently.
Compute author and target signals in one feature pipeline used by both training and serving, so the model is not trained on values it will never see live.
Model
Baseline: logistic regression on character n-grams plus the author features, which is fast and catches obvious abuse. Production model: a small fine-tuned transformer over comment plus context, with the structured features joined in a final layer. A distilled model of this size can score a comment in tens of milliseconds on modern hardware, which fits a synchronous budget.
Expect "why not just prompt a large language model with the policy?" It is a strong tool here, but in a supporting role: at 580 comments a second, its cost and latency make it a poor synchronous scorer. Use it to pre-label data for annotators to check, to judge the review band, and as a teacher whose labels train the small model. Naming that split scores on trade-offs.
Serving
Score synchronously when a comment is posted, within a budget of about 100 milliseconds, so auto-hide happens before anyone sees it. If the model service is slow or down, fall back to the baseline model rather than blocking comments. Run a heavier model asynchronously over recent comments to catch what the fast model missed and send those to review.
Evaluation online
A/B test by comment author or by thread rather than by viewer, since moderation decisions affect everyone who sees a thread. Online metrics: the prevalence of harmful comments viewed (measured by sampling viewed comments for human labeling), the rate at which hidden comments are restored on appeal, review queue size, and serving latency.
Monitoring and feedback loops
Drift: people adapt to evade the model (misspellings, new slang, images of text). Watch the score distribution and the weekly recall on the fresh random sample; a recall drop means retrain on newly labeled data.
Feedback loop: comments the model hides are never reported, so they never become new training data. The random evaluation sample breaks the loop because it is labeled whatever the model did.
Fairness: check error rates across languages and dialects; a model trained mostly on one dialect often flags another's ordinary speech as harmful.
What made it strong
Against the rubric: the prevalence, review capacity and latency budget pin down requirements; the pipeline from labels through serving and fallback is the high-level design; the random evaluation sample, the three-band thresholds and the feedback loop are the deep dive; and every choice (precision target, small model over large, synchronous plus asynchronous scoring) comes with its cost, which is what trade-offs rewards.
Follow-ups to expect
"Your precision is fine offline but users complain about removals." Look at appeals by slice (language, community), check the labels for those slices, and lower auto-hide aggressiveness there while you fix the data.
"How often do you retrain?" On a schedule (weekly here) plus a trigger when recall on the fresh sample drops, with the new model shadowed against the old one before rollout.
"How would you handle a new policy category?" Write guidelines, label a seed set, start with rules and human review, and add the category to the model once there are enough labels.
What changes with seniority
Mid-level: a sound framing, a sensible metric, a baseline and a stronger model, and a working serving path.
Senior: owns label quality and evaluation design, chooses thresholds from business costs and capacity, plans for drift and feedback loops, and keeps the fallback path in the design.
Staff: discusses the system around the model (annotation operations, experiment design with network effects, policy changes, cost per prediction) and the order to build things in.
Mistakes that cost points
Jumping to architecture. Framing, labels and metrics come first.
Accuracy on an imbalanced problem. State the prevalence and use precision and recall.
Evaluating only on data your system selected. Without a random sample you cannot measure misses.
No plan for after launch. Drift, feedback loops and retraining are part of the design.
Practice it
Take 15 minutes to frame two prompts on paper, for example "recommend videos on the home page" and "detect fraudulent sign-ups": for each, write the unit of prediction, the label source and its bias, the offline metric and the online metric. Then practice the statistical reasoning interviewers probe:
Practise this in a mock interview
Try what this lesson covers out loud: the AI interviewer asks one of these questions, follows up, and scores your answer.
- Design a Feature Store for Delivery-Time PredictionsSystem Design · Medium
- Design a Model Monitoring PlatformSystem Design · Medium
- Design Recommendations for a Handmade Goods MarketplaceSystem Design · Hard
- Design Real-Time Payment Fraud ScoringSystem Design · Hard
Read next
- System Design Interviews: The Quick Start
Know which system design interview you face and how depth expectations change by level, then deliver any design with a six-step, 45-minute framework whose estimates drive real decisions.
7 min read
- Thinking in Systems: From One Server to Millions of Users
Explain why each part of a typical web architecture exists by growing one app from a single server to millions of users, naming what broke and what each fix costs.
7 min read
- The Fundamentals First: Networking, APIs and Estimation
Choose between REST, gRPC, WebSockets and polling, use the latency numbers that matter, and turn a vague prompt into reads per second, storage and bandwidth with back-of-the-envelope estimation.
7 min read
- Core Building Blocks: Load Balancers, Caches, Queues, Databases and CDNs
Know when to add a load balancer, cache, queue, database, CDN or object storage, what each costs, and the follow-up questions to expect, then justify a full URL shortener design built from them.
7 min read
