Interviews & offers
Machine Learning System Design Interview: A Step-by-Step Framework
By the AIJobDesk team · Updated
In a machine learning system design interview you design an end-to-end ML system, such as a feed ranker or fraud detector, in 45 to 60 minutes. Interviewers score how you frame the problem, choose metrics, design data and features, pick a model, plan serving and evaluation, and reason about tradeoffs.
A machine learning system design interview asks you to design a production ML system, like a recommendation feed or fraud detector, in about 45 to 60 minutes. You're scored on how you frame the problem, pick metrics, design data and features, choose and train a model, serve it and monitor it. There's no single right design. Interviewers reward clear structure and honest tradeoffs.
This guide gives you a seven-step framework, a worked example, common prompts and a prep plan.
What do interviewers look for?
Most interviewers score roughly the same signals, whatever the prompt:
- Problem framing. Do you turn a vague business goal into a concrete ML task with a label?
- Metrics. Do you pick offline metrics that predict the online business metric?
- Data and features. Do you know where labels come from, how noisy they are and which features matter?
- Modeling judgment. Do you start simple and justify added complexity?
- Production awareness. Latency, scale, training-serving skew, monitoring and retraining.
- Communication. Do you drive the conversation, check in with the interviewer and manage time?
Senior candidates are expected to go deeper on tradeoffs and failure modes. Junior candidates are mostly judged on framing and fundamentals.
A 7-step framework for any ML design question
Use this order. Say the steps out loud at the start so the interviewer knows where you're going.
1. Clarify requirements (5 minutes)
Ask about the business goal, scale and constraints:
- What are we optimizing: engagement, revenue, safety, user satisfaction?
- How many users and items? How many requests per second?
- Latency budget? Real-time or batch?
- Any constraints: fairness, privacy, cold start, regional rules?
Write the answers down. You'll refer to them later when justifying choices.
2. Frame it as an ML problem (5 minutes)
State the input, output and label in one sentence: "Given a user and a candidate video, predict the probability the user watches more than 50% of it." Decide whether it's classification, regression, ranking or retrieval. Explain why your label is a good proxy for the business goal, and its weaknesses (clicks reward clickbait, for example).
3. Define metrics (5 minutes)
Give both:
- Offline: for ranking, NDCG or recall@k; for classification, PR-AUC or recall at a fixed precision; for regression, MAE.
- Online: watch time, conversion rate, reports per thousand views, revenue per session. Plus guardrails like latency and complaint rate.
Mention that offline gains don't always transfer and that an A/B test decides launch.
4. Design data and features (10 minutes)
Cover:
- Label source: implicit feedback (clicks, watches), explicit (ratings), human labels, or delayed outcomes (chargebacks).
- Feature groups: user features, item features, context (time, device) and interaction features (user-item history).
- Freshness: which features need real-time updates via a feature store or streaming pipeline.
- Pitfalls: leakage, position bias, class imbalance, label delay.
5. Choose a model (10 minutes)
Start with a baseline: popularity, logistic regression or gradient-boosted trees. Then propose the production model and justify it. For large-scale recommendation, describe a two-stage design:
- Candidate generation: a two-tower embedding model with approximate nearest neighbor search narrows millions of items to hundreds.
- Ranking: a heavier model (gradient boosting or a deep network) scores those hundreds with rich features.
- Re-ranking: business rules for diversity, freshness and policy.
Discuss the loss function, how you handle imbalance and how often you retrain.
6. Serving and infrastructure (5 to 10 minutes)
Explain how predictions reach users: online inference behind an API, precomputed batch scores or a mix. Mention caching, model size versus latency, and how features are computed identically in training and serving to avoid skew.
7. Evaluation, monitoring and iteration (5 minutes)
- Offline evaluation on a time-based holdout.
- A/B test with a clear success metric and guardrails.
- Monitoring for feature drift, prediction drift and data pipeline breaks.
- Feedback loops: the model's own recommendations shape future training data, so add exploration.
End with what you'd improve next if you had more time.
Worked example: design a fraud detection system for card payments
Here's how the framework plays out in condensed form.
Clarify. Card transactions for an online payment processor, about 2,000 per second at peak. We must decide within 100 ms whether to approve, block or send for review. Fraud is about 0.1% of transactions. Blocking a good customer is costly too.
Frame. Binary classification: given a transaction, predict the probability it's fraudulent. Labels come from chargebacks and analyst reviews, which arrive days or weeks later.
Metrics. Offline: recall at a fixed false-positive rate (say 0.5%), and PR-AUC. Online: fraud losses per dollar processed, false decline rate, manual review volume.
Data and features. Transaction amount, merchant category, device fingerprint, IP geolocation, velocity features (transactions in the last minute, hour, day per card and per device), distance from the card's usual location, account age. Velocity features need a streaming pipeline and a low-latency feature store. Label delay means the most recent weeks are under-labeled, so train on data at least 30 days old or correct for it.
Model. Baseline: rules plus logistic regression. Production: gradient-boosted trees, which handle tabular data, missing values and mixed feature types well, with class weights for imbalance. Possibly a graph-based feature layer to catch fraud rings sharing devices or addresses.
Serving. Real-time scoring service with the model loaded in memory, features fetched from the feature store, p99 under 50 ms. Three outcomes by score threshold: approve, review queue, block. Thresholds tuned to analyst capacity.
Monitoring. Fraudsters adapt, so watch for drift in score distributions and feature values, retrain weekly, and keep a small random sample of transactions approved for unbiased labels.
That level of detail, delivered in a structured way, is what a strong answer looks like.
Common ML system design interview prompts
- Design a video or product recommendation system.
- Design a news feed ranking system.
- Design search ranking for an e-commerce site.
- Predict ad click-through rate.
- Detect spam or harmful content.
- Design "people you may know."
- Estimate delivery time for a food delivery app.
- Design a retrieval-augmented assistant over company documents.
The last one is now common at companies building with large language models. It shifts emphasis to retrieval quality, chunking, evaluation sets and cost per query. Our LLM interview questions guide covers that vocabulary.
What changes for senior and staff candidates?
At senior levels, a correct design is the starting point, not the bar. Interviewers expect you to:
- Raise risks unprompted: cold start, feedback loops, adversarial users, label delay, privacy rules on features.
- Quantify tradeoffs: "A deep ranker might add a point of NDCG but triples serving cost; I'd only switch if the A/B lift justifies it."
- Plan the rollout: shadow mode, a small traffic slice, then ramp, with a rollback plan.
- Think about the team: who owns labels, how the feature store is shared, what the on-call burden is.
- Prioritize: say what you'd build in the first month versus the first year.
A useful habit: after each step, name one thing that could go wrong and how you'd detect it. That single habit separates senior answers from mid-level ones more than any specific architecture.
How should you handle questions you can't answer?
You'll get pushed into an area you don't know well. Say so briefly, reason from first principles and keep moving: "I haven't built a streaming feature pipeline myself, but I'd expect we need windowed aggregates per card, so I'd look at a stream processor writing to a low-latency store." Interviewers respect honest reasoning far more than confident bluffing.
Mistakes to avoid
- Jumping to the model. Spending 30 minutes on architecture and 2 on data is the most common failure.
- No baseline. Always say what simple approach you'd beat first.
- Metric mismatch. Optimizing clicks when the goal is long-term satisfaction, without acknowledging it.
- Ignoring latency and cost. A 10-billion-parameter ranker scoring every item per request won't fly.
- Monologuing. Check in: "Should I go deeper on features or move to serving?"
- Forgetting feedback loops in recommendation and ranking systems.
How to prepare: a three-week plan
- Week 1: Learn the patterns. Read engineering blogs from companies that run recommendation, search and fraud systems, and work through a structured resource such as the Machine Learning System Design Interview book by Ali Aminian and Alex Xu.
- Week 2: Practice out loud. Do one prompt a day against a 45-minute timer, using the seven steps. Write a one-page summary afterward.
- Week 3: Mock interviews with peers. Swap roles; playing interviewer teaches you what clear answers sound like.
Refresh fundamentals alongside this with our machine learning interview questions. Some companies swap the live design round for a written exercise, so read up on AI take-home assignments too.
Next step
System design rounds are standard for mid-level and senior roles. Browse current machine learning engineer jobs, ML platform engineer roles and MLOps engineer openings to see which systems companies are hiring for, then practice prompts that match their products.
Ready to apply? Browse Machine Learning Engineer jobs
Frequently asked questions
- What is a machine learning system design interview?
- It's an open-ended interview round, usually 45 to 60 minutes, where you design a production ML system from a short prompt such as design a video recommendation system or detect fraudulent transactions. You talk through requirements, data, features, model choice, training, serving, evaluation and monitoring, while the interviewer probes your tradeoffs.
- How is ML system design different from regular system design?
- Regular system design focuses on services, databases, caching and scale. ML system design focuses on the learning problem: labels, features, models, offline and online metrics, training pipelines and feedback loops. You still need some infrastructure knowledge, such as how to serve predictions at low latency, but the core is the ML lifecycle.
- Is the Machine Learning System Design Interview book by Ali Aminian and Alex Xu worth reading?
- Many candidates find it useful because it works through common prompts like recommendations, search ranking and ad click prediction with a consistent structure. It's a good way to learn the patterns. Pair it with practice out loud and with real engineering blogs from companies that run these systems, since interviewers reward reasoning over memorized designs.
- Do entry-level ML candidates get system design interviews?
- Less often. New graduates and junior candidates usually face coding and ML fundamentals rounds, while system design becomes standard at mid-level and above. Some companies include a lighter version for juniors, focused on problem framing and metrics rather than large-scale serving. Ask your recruiter whether the loop includes it.
- What are the most common ML system design interview questions?
- Frequent prompts include designing a recommendation system (videos, products, people you may know), a news feed ranker, a search ranking system, ad click-through rate prediction, a fraud or spam detector, a content moderation system and, increasingly, a retrieval-augmented LLM assistant. Most share the same skeleton of candidate generation, ranking and feedback.
- How do I practice ML system design interviews alone?
- Pick a prompt, set a 45-minute timer and talk through the seven steps out loud while sketching on paper or a whiteboard tool. Record yourself, then review where you rushed or skipped tradeoffs. After a few solo runs, do mock interviews with a peer, since the back-and-forth with an interviewer is a skill of its own.