ML System Design · Module 42 of 47 · 11 concepts · about 12 min

Capstone Project

Build a complete ML system yourself: a trip-duration and demand service on public city taxi data, from problem statement to data pipeline, feature store, model, training pipeline, serving, safe release, monitoring through real drift, and a design document you can present.

At work: The project that turns this course into evidence. A working, documented end-to-end system is one of the strongest things to show in an ML engineering interview.

The brief

What it is

Build TripTime: a service that predicts how long a taxi trip will take when it is booked, for a city ride-hailing app, using public New York City taxi trip records. It must:

  • return a predicted duration (and a high-percentile 'promise') through an API within 50 ms;
  • use features about the trip, the time, and recent demand in the pickup area;
  • be trained by an automated pipeline, with tracked runs, a registry and a promotion gate;
  • be released safely and monitored, including through months where travel patterns changed sharply (the data includes 2020).

Why it matters

The brief is chosen to exercise every part of the course:

  • a precise target and an asymmetric cost of error (modules 3 and 29);
  • large, real data with quality problems (modules 5 and 8);
  • batch and near-real-time features with point-in-time correctness (modules 9 to 11);
  • real, dramatic drift to monitor and recover from (modules 21 and 22).

In the real world: Hiring managers say a project like this, with a design document and a monitoring dashboard, tells them more than any certificate.

Visual example

Capstone

Each builds on the last.

Nine milestones

  1. Build the data side

    Frame and estimateProblem statement, metrics, numbers
  2. Data pipelineLoad, validate, partition, version
  3. FeaturesBatch and recent-demand; point-in-time joins
  4. Build the model side

    Model and reportBaseline, model, percentile, evaluation
  5. Training pipelineTracking, registry, gate
  6. Run it for real

    ServingAPI, batch, fallback, load test
  7. ReleaseShadow and canary with rollback
  8. MonitoringDrift through 2020; retraining
  9. Design documentWrite it up and present it

Spending most of the time on the model. Model work is one milestone of nine; the system around it is the point.

Milestone 1: frame and estimate

What it is

Write the problem statement before any code.

Why it matters

Each milestone produces something that the next one builds on.

  • Finish its checks before moving on; problems left here are harder to find later.
  • Keep notes of every decision and why: milestone 9 turns them into a design document.

In the real world: Every ML project at a well-run company starts with this page; reviewers reject designs that cannot fill it in.

Your task. A one-page problem statement for TripTime, in the framework of module 1.

Steps

  1. State the business goal, the users, and how the prediction is used (shown at booking as an estimate and a promise).
  2. Define the target precisely: minutes from pickup to drop-off; decide how to treat zero-length and multi-hour trips.
  3. Choose offline metrics (MAE, share of trips longer than the promise, pinball loss) and online metrics you would use in a real launch.
  4. Estimate requests a second for a city with 500,000 trips a day and a peak factor of 3, and the training-data size for a year.
  5. Write a latency budget for the 50 ms API.
  6. Write a rule-based baseline.

You are done when

  • A reader can say exactly what the model outputs and how success is measured.
  • Your estimates trace back to stated assumptions.
  • Your baseline could ship without ML.

Skipping the asymmetric cost: a late arrival at the airport is far worse than an early one.

Milestone 2: data pipeline

What it is

Turn raw monthly trip files into clean, validated, versioned tables.

Why it matters

Each milestone produces something that the next one builds on.

  • Finish its checks before moving on; problems left here are harder to find later.
  • Keep notes of every decision and why: milestone 9 turns them into a design document.

In the real world: Data engineers on ML teams build exactly this before any model work starts.

Your task. A re-runnable pipeline from raw files to a clean trips table, partitioned by day.

Steps

  1. Download at least 18 months of yellow-taxi trip records, including early 2020.
  2. Write load, clean and write steps as separate, idempotent functions taking a date (module 8).
  3. Add validation: schema, row counts per day, durations and distances in sane ranges, valid zone IDs, no duplicates.
  4. Record how many rows each check removes per month, and investigate one month where many are removed.
  5. Store the output in a versioned format (Parquet with a version folder, or Delta Lake).

You are done when

  • Re-running any day gives identical output.
  • A deliberately corrupted file is caught by a named check.
  • You can say which data version any later model was trained on.

Cleaning by deleting everything unusual. Long trips at night are real; check before dropping.

Milestone 3: features and a feature store

What it is

Build batch and recent-demand features with point-in-time correctness.

Why it matters

Each milestone produces something that the next one builds on.

  • Finish its checks before moving on; problems left here are harder to find later.
  • Keep notes of every decision and why: milestone 9 turns them into a design document.

In the real world: Point-in-time correct training sets are the most common thing ML platform interviewers ask candidates to explain.

Your task. Features for each trip computed only from information available at booking time, served from a feature store.

Steps

  1. Compute on-demand features: distance between zone centres, hour, weekday, holiday flags.
  2. Compute batch features: each pickup zone's median duration to each borough over the previous 28 days.
  3. Compute recent-demand features: trips started in the pickup zone in the previous 15 and 60 minutes, using only earlier trips (module 10).
  4. Register them in Feast with an offline and an online store, and build the training set with point-in-time joins (module 11).
  5. Write a replay test comparing online feature values with the offline ones for 1,000 trips.

You are done when

  • No feature uses information from after the trip's pickup time.
  • The replay test shows matching values for stable features.
  • You can show a leaky join and how much it inflates offline scores.

Using drop-off time or actual distance travelled as features. Both are only known after the trip.

Practise it: Design a Demand Forecasting Platform, Design a Predictive Maintenance System, Design a Recommendation System, Diagnose Training-Serving Skew, Design a Real-Time Fraud Detection System, Design an ML Feature Store

Milestone 4: model and offline evaluation

What it is

Climb the model ladder and write the evaluation report.

Why it matters

Each milestone produces something that the next one builds on.

  • Finish its checks before moving on; problems left here are harder to find later.
  • Keep notes of every decision and why: milestone 9 turns them into a design document.

In the real world: This report is what a real model review asks for, almost line for line.

Your task. A chosen model with a percentile promise and a one-page evaluation report (module 16).

Steps

  1. Evaluate the rule baseline.
  2. Train linear regression and LightGBM on a time split (train on twelve months, validate on the next, test on the one after).
  3. Train LightGBM quantile models at 0.5 and 0.85 for the estimate and the promise.
  4. Report MAE, share of trips over the promise and pinball loss overall and by borough, hour and trip length.
  5. Run error analysis on the 200 worst predictions and add one feature that fixes a group of them.
  6. Add bootstrap intervals for the difference between your model and the baseline.

You are done when

  • Your model beats the baseline with an interval that excludes zero.
  • The promise is exceeded on about 15% of trips across most slices.
  • Error analysis led to at least one measured improvement.

Random splits. They hide drift and overstate accuracy (module 7).

Milestone 5: training pipeline, registry and gate

What it is

Automate training so a new model can be produced and judged without you.

Why it matters

Each milestone produces something that the next one builds on.

  • Finish its checks before moving on; problems left here are harder to find later.
  • Keep notes of every decision and why: milestone 9 turns them into a design document.

In the real world: This is what MLOps level 1 (module 24) looks like in practice.

Your task. A pipeline that trains, evaluates, compares with the champion and registers a winner.

Steps

  1. Move configuration into a file and steps into functions; run them from Airflow, Dagster or Prefect (or a single script with clear stages).
  2. Log runs to MLflow with parameters, per-slice metrics, data version and commit.
  3. Write a gate: the challenger must beat the champion on the latest month with no borough worse by more than 3%, and predict in under 5 ms.
  4. Run it on successive monthly snapshots and record which challengers are promoted.

You are done when

  • A deliberately worse challenger (for example trained on one week of data) is rejected with a clear reason.
  • The champion can be rebuilt exactly from its registry entry.

Practise it: Design an ML Training Pipeline, Design a Model Serving Platform, Design an ML Feature Store, Design Continuous ML Deployment

Milestone 6: serving

What it is

Serve the model online and in batch, with a fallback.

Why it matters

Each milestone produces something that the next one builds on.

  • Finish its checks before moving on; problems left here are harder to find later.
  • Keep notes of every decision and why: milestone 9 turns them into a design document.

In the real world: A service like this, with a real fallback and a load test, is concrete proof of production skills.

Your task. A FastAPI service returning estimate and promise in under 50 ms at p99, plus a nightly batch job for zone-to-zone estimates.

Steps

  1. Load the production model from the registry with a checksum check (module 20).
  2. Fetch online features from the feature store in one call; compute on-demand ones from the request.
  3. Return the estimate, the promise and the model version; log features and outputs with a request ID.
  4. Add a timeout falling back to the batch zone-to-zone table, then to the rule baseline.
  5. Load-test with Locust; record p50, p99 and requests a second; profile and fix the slowest step.

You are done when

  • p99 under 50 ms at your target load.
  • Stopping the feature store produces fallback answers, not errors.
  • Every response can be traced to its logged features and model version.

Practise it: Design Feature Monitoring, Diagnose Training-Serving Skew, Design a Model Serving Platform, Design an ML Feature Store

Milestone 7: safe release

What it is

Release a new model through shadow and canary with automatic rollback.

Why it matters

Each milestone produces something that the next one builds on.

  • Finish its checks before moving on; problems left here are harder to find later.
  • Keep notes of every decision and why: milestone 9 turns them into a design document.

In the real world: Release automation is a core part of ML platform roles, and few portfolio projects show it.

Your task. A release controller that shadows, canaries and rolls back a model on its own.

Steps

  1. Run the challenger in shadow on replayed traffic and compare its predictions with the champion's.
  2. Route 5%, then 25%, 50% and 100% of requests to it, consistently per rider ID.
  3. Roll back automatically if errors, p99 latency or the average predicted duration differ from the champion by more than set limits.
  4. Release a deliberately broken model (predictions × 1.4) and confirm rollback.
  5. Keep an audit log of every stage and rollback.

You are done when

  • A healthy model reaches 100% without intervention.
  • The broken model is rolled back with no errors needed to trigger it.

Milestone 8: monitoring through real drift

What it is

Replay 2019 to 2021 through your system and watch it cope with a sudden change in the world.

Why it matters

Each milestone produces something that the next one builds on.

  • Finish its checks before moving on; problems left here are harder to find later.
  • Keep notes of every decision and why: milestone 9 turns them into a design document.

In the real world: Being able to show how your system behaved through a real, sudden shift is a rare and memorable interview story.

Your task. Monitoring that detects the 2020 shift in travel patterns, and a retraining policy that recovers.

Steps

  1. Replay months of trips through the service in order, with the model trained on 2019.
  2. Track system, data, prediction and accuracy layers (module 21): feature PSI, prediction distribution, MAE and share over promise per month and per borough.
  3. Write alert rules with persistence and see which fire, and when, in March and April 2020.
  4. Compare three policies: never retrain, retrain monthly on the last 12 months, retrain on a drift trigger with a short window.
  5. Decompose any change in overall error into mix and within-segment effects (module 23).

You are done when

  • Your alerts fire within days of the shift, not weeks.
  • You can show which retraining policy recovered fastest, and its cost.
  • Your decomposition separates traffic-mix change from model decline.

Retraining on the first week of the shift with a long window. The new pattern is drowned out by a year of old data.

Milestone 9: design document and presentation

What it is

Write it up as a design document and present it in twenty minutes.

Why it matters

Each milestone produces something that the next one builds on.

  • Finish its checks before moving on; problems left here are harder to find later.
  • Keep notes of every decision and why: milestone 9 turns them into a design document.

In the real world: Interviewers often ask candidates to walk through a past project in depth; this document is that conversation, prepared.

Your task. A design document a reviewer could approve, and a talk you could give in an interview.

Steps

  1. Write the document to the eight steps of module 1, with your real numbers, choices and the alternatives you rejected.
  2. Include diagrams of the architecture, the training pipeline and the release path.
  3. Add a section on failures you hit and how you found them.
  4. Add a model card (module 24) with per-borough performance and limitations.
  5. Present it aloud in twenty minutes to someone who asks questions; note the questions you struggled with and improve those parts.

You are done when

  • Every design choice in the document has a stated reason and a rejected alternative.
  • You can answer 'what would you do differently with ten times the traffic?' and 'what breaks first?'.

How the capstone is judged

What it is

Use this rubric to judge your own work, or ask a friend to:

  • framing: is the target precise, and are metrics tied to the goal?
  • data and features: is everything point-in-time correct and validated?
  • model and evaluation: is there a baseline, a time split, slices and intervals?
  • operations: can the system retrain, release, roll back and alert without you?
  • communication: could a reviewer approve it from the document alone?

Why it matters

The rubric mirrors how ML system design interviews are scored (module 43).

  • Strength in every row beats brilliance in one.

In the real world: Engineers who complete projects like this report that interview conversations shift from 'what would you do?' to 'tell me what you did', which is far easier to answer well.

Visual example

Rubric

Aim for 'strong' in every row.

Self-assessment rubric
areaweakstrong
FramingVague target; accuracy onlyPrecise target; asymmetric cost; business metrics
Data and featuresRandom joins; no checksPoint-in-time joins; validation; replay test
EvaluationRandom split; one numberTime split; slices; intervals; error analysis
OperationsManual stepsPipeline, gate, canary, rollback, alerts
CommunicationCode onlyDesign document, model card, clear talk

Polishing the model while the release and monitoring milestones are unfinished. An average model in a complete system is worth far more.