Skip to content
learn
  1. Learn
  2. Machine Learning
  3. ML System Design Case Studies

ML-M17

ML system design case studies

ML system design explained through eight case studies, from fraud detection to visual search, plus a repeatable framework for interviews and design reviews.

8 lessonsabout 160 min

ML system design is turning a business decision into a machine learning system that makes it well, at scale, and keeps making it well after launch. Knowing algorithms is the smaller part. A real system starts with a decision, a metric that says whether it was made well, and labels that arrive late, noisy or biased. Only then come features, a model, a serving path with a latency budget, and the monitoring that keeps it honest.

A repeatable ML system design framework

Every case study here follows the same order, and it works for an ML system design interview too:

  1. Clarify the problem and the metric. What decision, for whom, and which business and offline metrics say it worked? See Framing ML problems for products.
  2. Data and labels. Where examples come from, how labels are produced, how late and how biased they are.
  3. Features. What is known at prediction time, how fresh it must be, and how training and serving compute it the same way.
  4. Model. A simple baseline first, then the model that fits the data and the latency budget.
  5. Offline evaluation. The metric that matches the decision, on a split that mirrors production.
  6. Serving and latency. Batch or real time, the request path, feature lookups and a budget for each step.
  7. Online evaluation. An A/B test on the business metric, because offline gains do not always survive real users. See Offline vs online evaluation and A/B tests.
  8. Monitoring and retraining. Drift, label delay, feedback loops and when to retrain. See Monitoring, drift and retraining.

The eight case studies

The same few patterns keep coming back in different forms: rules plus models, candidate generation plus ranking, and fast signals plus slow labels.

Lessons

  1. ML-17.01 Design a fraud detection system A fraud detection system scores each transaction in milliseconds before approving it. Advanced 22 min
  2. ML-17.02 Design an ETA prediction system An ETA system predicts arrival times. Advanced 20 min
  3. ML-17.03 Design a feed ranking system A feed ranking system retrieves candidate posts from many sources, scores them with a model predicting several engagement signals and combines those into a final ranking, then re-ranks for diversity and freshness. Advanced 22 min
  4. ML-17.04 Design a search ranking system A search ranking system understands the query, retrieves candidates with keyword and embedding search, and ranks them with a learning-to-rank model using query, document and user features. Advanced 22 min
  5. ML-17.05 Design an ad click-through-rate prediction system An ad click prediction system estimates the probability that a user clicks an ad, which feeds directly into auction prices. Advanced 20 min
  6. ML-17.06 Design a spam / content moderation classifier A content moderation system classifies text, images and video for policy violations. Advanced 18 min
  7. ML-17.07 Design a demand forecasting system A demand forecasting system predicts demand per product, store or area and time period so the business can plan inventory and staffing. Advanced 18 min
  8. ML-17.08 Design a visual search system A visual search system lets users find items by image. Advanced 18 min

Start with lesson 1