Design a MLOps Pipeline

Hard45 min
1 / 30
understanding11 min read

Problem Statement: CI/CD for a System That Learns

Frames MLOps as continuous integration of data and models, not merely code, and separates the four architectural planes.

Problem statement

Design an MLOps platform that automates the entire ML lifecycle: data ingestion, feature engineering, training, offline validation, model packaging, deployment to test and production environments, and continuous monitoring for performance decay, data drift, and anomalies. The platform must make every promoted model reproducible, every deployment reversible, and every production behavior attributable to an exact combination of code, data, configuration, and environment.

This is not generic CI/CD with a model artifact swapped in. In classical software, the build is deterministic: the same source produces the same binary, and tests are written against fixed expectations. In ML, the compiled artifact depends on a moving input distribution. A pipeline can be fully green—code compiles, unit tests pass, training converges—while producing a model that is already stale because the training snapshot no longer matches serving traffic. Therefore the design must treat data as a first-class build input: versioned, hashed, validated, and pinned to every run, exactly like source code.

Why the problem is distinctive

Three properties separate MLOps from DevOps. First, there are two artifacts to integrate: code and data, plus a third derived artifact, the model. Continuous integration must therefore validate schema, statistics, and label quality before a single GPU spins up. Second, tests are probabilistic: a model can regress without any code change, so the gate between staging and production is an evaluation contract—metrics on held-out slices—not a boolean test suite. Third, deployment is not the end of verification; the model degrades in production as the world changes, so monitoring is part of the pipeline and can re-trigger training. The loop data → features → train → validate → deploy → monitor → retrain is continuous training, and the architecture must close that loop with human-approved or policy-approved gates.

The four architectural planes

  1. Data plane: ingestion, validation, feature engineering, point-in-time correct datasets, and the online/offline feature store.
  2. Training plane: orchestration of DAGs, hyperparameter search, distributed training, checkpointing, and experiment tracking.
  3. Serving and release plane: model registry, packaging, environment promotion, canary and shadow deployment, automated rollback.
  4. Governance and learning plane: lineage, drift and performance monitoring, retraining triggers, audit, model cards, and release evidence.

A strong interview answer keeps these planes separate, states which decisions are automated versus human-approved, and makes reproducibility and rollback architectural invariants rather than aspirational policies. The attached brief requires orchestration with hyperparameter search, a versioned registry, automatic deployment to test and prod, and monitoring for drift, performance, and anomalies; every number below that is not cited is an explicitly labeled design assumption.

Key Highlights

  • MLOps integrates three artifacts: code, data, and the derived model; all three must be versioned and pinned per run.
  • Tests are probabilistic: promotion gates are evaluation contracts on held-out slices, not boolean suites.
  • Monitoring is part of the pipeline: drift and performance decay re-trigger training, closing the continuous-training loop.
  • The architecture has four planes: data, training, serving/release, and governance/learning.
  • Reproducibility and one-command rollback are invariants, not policies.
Lead With Data as a Build Input
State in the first two minutes that the pipeline compiles code AND data into a model, so both must be versioned, hashed, and validated before training. This instantly separates an MLOps answer from a generic CI/CD answer.
Do Not Trust a Green Pipeline
A fully green build can ship a stale model when the training distribution no longer matches serving traffic. Promotion must compare fresh evaluation slices and serving-time freshness, not only unit tests.

Section Rescue Kit

Buzzwords to use:

Continuous TrainingTraining/Serving Skew

Safe statements:

  • "Let me separate the four planes before choosing services, because monitoring and governance change the training loop itself."
  • "Before drawing boxes, I will state that code, data, and environment are all versioned inputs to every run."
Design a MLOps Pipeline - System Design | WinJob | WinJob