Skip to content
tezvyn:
Menu

How would you build CI/CD for an ML model?

Source: interviewMediumHow cards are made

Summary

MLOps maturity beyond app deployment.

Key points

data and model versioning, automated training plus evaluation gates, model registry, deployment with monitoring and retraining triggers.

WHAT THIS TESTS This probes whether you understand MLOps as a superset of software CI/CD. A senior answer treats the model, the data, and the code as three artifacts that all need versioning, testing, and deployment, and explains the continuous-training feedback loop.

A GOOD ANSWER COVERS Start with continuous integration: lint and unit-test the code, then validate the data schema and statistics. Continuous training is the new stage. A pipeline pulls fresh data, retrains, and evaluates the candidate model against the current production baseline on a holdout set. Only if it passes quality and fairness gates does it get registered in a model registry with its metrics and lineage. Continuous delivery then promotes the registered model through canary or shadow deployment. Finally, continuous monitoring watches prediction distributions and drift, and can trigger the whole loop again.

COMMON WRONG ANSWERS Describing a plain build-test-deploy code pipeline. Forgetting data versioning, so retraining is not reproducible. Skipping the evaluation gate that compares candidate against baseline, which lets a worse model ship. Treating monitoring as ordinary uptime checks rather than statistical drift detection.

LIKELY FOLLOW-UPS How do you version terabyte-scale datasets? How do you guarantee training and serving features match to avoid skew? What triggers retraining, and how do you avoid retraining on bad data? How do you roll back a model?

ONE CONCRETE EXAMPLE On Vertex AI or SageMaker Pipelines you define a DAG: ingest, validate data with TensorFlow Data Validation, train, evaluate against the deployed model, and a conditional step that registers the model only when AUC improves by a threshold. A trigger fires the DAG on new data arrival or when a CloudWatch drift metric breaches a bound, and an endpoint serves the latest approved version with traffic splitting for canary rollout.

Interview question

Which stage most clearly distinguishes an ML CI/CD pipeline from a traditional software one?

  • a.Running unit tests on application code before merge
  • b.Tagging a release in version control
  • c.Continuous training that retrains and validates the model against a baseline on fresh dataCorrect
  • d.Compiling source code into a deployable artifact
Why?

Continuous training, with data validation and a candidate-versus-baseline evaluation gate, is unique to ML pipelines. Unit tests, compilation, and tagging exist in any software pipeline and do not address data or model quality.

Just read this? Test yourself on what you have been reading.

Read the original → docs.cloud.google.com

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on mlops — each one lists the topics its interview covers.

See open roles