MLOps (Machine Learning Operations) has emerged as one of the most in-demand data science specialisations. As companies struggle to move models from notebooks to production and keep them working reliably at scale, MLOps engineers command some of the highest salaries in data. This guide covers the 35 most important MLOps interview questions with detailed answers — covering model deployment, CI/CD for ML, monitoring, drift detection, and the tools that power production ML systems in 2026.
MLOps Fundamentals
Q1. What is MLOps and why is it needed?
MLOps applies DevOps principles (automation, CI/CD, monitoring, collaboration) to the machine learning lifecycle. It is needed because ML has unique challenges that standard software engineering does not: models depend not just on code but on data; model quality degrades over time as the real world changes (model drift); training and serving pipelines are complex and error-prone; experiments need to be tracked and reproducible; and deploying a model safely requires validation that goes beyond unit tests. Without MLOps: models work in notebooks but fail in production; no one knows which model is deployed; re-training is manual and error-prone; production failures are discovered by users, not engineers. With MLOps: models are automatically retrained, tested, versioned, deployed, and monitored. The ML lifecycle becomes reproducible and reliable.
Q2. What is the ML lifecycle and what happens at each stage?
Data collection and validation — gather raw data, validate schema, check quality. Feature engineering — transform raw data into model-ready features, store in feature store. Model training — train multiple model variants with different hyperparameters. Experiment tracking — log metrics, parameters, and artifacts for every experiment. Model evaluation — validate on held-out test set, compare to baseline. Model registry — register the best model with its metadata, version it. Deployment — serve the model via REST API (batch inference or real-time endpoint). Monitoring — track prediction distributions, model accuracy, data drift, and system health. Retraining — trigger retraining when performance degrades or on a schedule. The key insight is that this is not a one-time process — it is a continuous loop. MLOps automates and monitors every stage.
Q3. What is the difference between model training, validation, and testing in production context?
Training set: data used to fit model parameters. Validation set: data used to tune hyperparameters and make model selection decisions during development — not used to fit parameters. Test set: held out completely until final evaluation — used once to estimate real-world performance. Shadow testing: deploy the new model alongside the current production model; the new model’s predictions are logged but not served to users, allowing comparison without user risk. A/B testing: route a percentage of real traffic to the new model and measure business metrics. Canary deployment: gradually increase traffic to the new model (1% → 5% → 25% → 100%) with automatic rollback if metrics degrade. Champion-challenger: the current best model (champion) is continuously challenged by new candidate models (challengers) in live traffic.
Q4. What is model drift and what are the different types?
Model drift is the degradation of model performance over time as the real world changes. Data drift (covariate shift): the distribution of input features changes — the types of customers sending transactions changes, making the fraud model’s features less representative. Label drift (concept drift, prior probability shift): the distribution of the target variable changes — fraud patterns evolve, making old labels less predictive. Concept drift (posterior drift): the relationship between features and target changes — a feature that used to predict churn no longer does because business conditions changed. Population shift: a different user population starts using the product, outside the training distribution. Seasonality: normal cyclical variation that models need to handle (holiday spike in transactions). Detecting: monitor feature distributions (PSI — Population Stability Index, KL divergence), prediction distributions, and actual vs predicted performance when ground truth becomes available.
Q5. What is PSI (Population Stability Index) and how is it used?
PSI measures how much the distribution of a feature (or prediction score) has shifted between a reference (training) distribution and a current (production) distribution. PSI = Σ (Actual% – Expected%) × ln(Actual% / Expected%) across bins. Interpretation: PSI < 0.1 — no significant shift, model stable. PSI 0.1-0.2 — slight shift, monitor. PSI > 0.2 — significant shift, investigate and consider retraining. PSI is commonly used in credit risk modelling and is now standard in ML monitoring systems. KL Divergence, Jensen-Shannon Divergence, and Kolmogorov-Smirnov test are alternative measures of distribution shift.
Model Deployment and Serving
Q6. What is the difference between batch inference and real-time inference?
Batch inference processes a large dataset of records at once, typically on a schedule (nightly or hourly). It pre-computes predictions and stores them in a database for lookup. Advantages: compute-efficient (amortise startup cost), can use large complex models, easy to implement. Disadvantages: predictions are stale (not based on the most current data). Use for: daily churn risk scores, weekly recommendation lists, monthly credit scores, any prediction that does not need to reflect events from the last few minutes. Real-time inference responds to individual requests in milliseconds. Advantages: predictions are based on the current context. Disadvantages: strict latency requirements (often < 100ms), model size and complexity are constrained, needs robust API infrastructure. Use for: fraud detection (must decide before approving the transaction), dynamic pricing, real-time content ranking.
Q7. What is a model serving framework and compare Flask, FastAPI, TorchServe, and Triton.
Flask: Python micro-framework. Simple to set up, good for prototyping and low-traffic APIs. Synchronous by default — one request blocks the next. Not suitable for high-throughput production. FastAPI: modern async Python framework. Automatic OpenAPI documentation, type validation via Pydantic, high performance with async I/O. Best for medium-traffic ML APIs. TorchServe: PyTorch’s native model server. Handles model versioning, A/B testing, multi-model serving, and RESTful management API. Optimised for PyTorch models. NVIDIA Triton Inference Server: production-grade, supports any framework (TensorFlow, PyTorch, ONNX, TensorRT). Dynamic batching (batches multiple requests to a single GPU call for throughput). Model ensemble support. Standard for high-throughput GPU serving in production. BentoML: Python-native, framework-agnostic, packages model + serving code + dependencies into a “bento” artifact that deploys anywhere.
Q8. What is ONNX and why is it useful for model deployment?
ONNX (Open Neural Network Exchange) is an open format for representing ML models, enabling interoperability between frameworks. A model trained in PyTorch can be exported to ONNX, then run with ONNX Runtime — which is often 2-5x faster than native PyTorch inference and supports hardware acceleration on CPU, GPU, and NPU. The key deployment advantage: you can train in any framework (PyTorch, TensorFlow, sklearn, XGBoost) and serve all models with a single ONNX Runtime inference engine, simplifying your production infrastructure. ONNX Runtime also applies graph optimisations (fusing operations, eliminating redundancies) automatically. For production deployment, the workflow is: train in PyTorch → export to ONNX → optimise with ONNX Runtime → serve with Triton or FastAPI + onnxruntime.
Q9. What is Kubernetes and why is it used for ML deployment?
Kubernetes (K8s) is a container orchestration platform that automates deployment, scaling, and management of containerised applications. For ML: it schedules model serving containers across a cluster of machines; scales replicas up when traffic increases and down when idle (HPA — Horizontal Pod Autoscaler); restarts failed pods automatically; performs rolling updates (replace old model containers with new ones without downtime); and manages GPU resources across nodes. MLflow + Kubernetes deploys models as K8s services. Kubeflow is an ML-specific platform built on Kubernetes that manages the full ML lifecycle: training jobs, hyperparameter tuning (Katib), model serving (KFServing/KServe), and pipelines. Seldon Core deploys ML models as K8s microservices with built-in A/B testing, canary deployment, and monitoring.
Experiment Tracking and Model Registry
Q10. What is MLflow and what are its four main components?
MLflow is an open-source platform for managing the ML lifecycle. MLflow Tracking: logs experiments — parameters, metrics, tags, and artifacts (model files, plots, data samples) for every training run. Compare runs in a web UI. MLflow Projects: packages ML code in a reproducible format with dependencies and entry points, runnable on any platform. MLflow Models: a standard format for packaging models with metadata about the framework, input/output schema, and dependencies. Models can be loaded for batch inference (mlflow.pyfunc.load_model) or deployed as REST APIs (mlflow models serve). MLflow Registry: a central model store with versioning, stage transitions (Staging → Production → Archived), and annotations. Enables model governance: who approved this model, what data was it trained on, what metrics did it achieve?
import mlflow
import mlflow.sklearn
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.metrics import roc_auc_score
mlflow.set_experiment('churn-prediction')
with mlflow.start_run(run_name='gbm-baseline'):
# Log parameters
params = {'n_estimators': 200, 'learning_rate': 0.05, 'max_depth': 4}
mlflow.log_params(params)
# Train
model = GradientBoostingClassifier(**params, random_state=42)
model.fit(X_train, y_train)
# Log metrics
auc = roc_auc_score(y_test, model.predict_proba(X_test)[:, 1])
mlflow.log_metric('test_auc', auc)
# Log model
mlflow.sklearn.log_model(model, artifact_path='model',
registered_model_name='churn-predictor')
print(f'Run ID: {mlflow.active_run().info.run_id}')
print(f'AUC: {auc:.4f}')
Q11. What is a feature store and what problem does it solve?
A feature store is a centralised system for storing, computing, and serving features to ML models. The problem it solves: training-serving skew — the feature computation logic in a Jupyter notebook (used for training) differs subtly from the code in the production API (used for serving), leading to silent model degradation. The feature store maintains a single definition of each feature that is used for both training (historical lookup from the offline store) and serving (real-time lookup from the online store, typically Redis or DynamoDB). Additional benefits: feature discovery and reuse across teams, computed once and used by many models, automatic monitoring of feature freshness and drift. Open-source: Feast. Managed: Tecton, AWS SageMaker Feature Store, Vertex AI Feature Store, Databricks Feature Store.
CI/CD for Machine Learning
Q12. What is CI/CD for ML and how does it differ from software CI/CD?
Standard software CI/CD: merge code → run unit tests → build artifact → deploy. The artifact (compiled binary or container) is deterministic given the source code. ML CI/CD: merge code or data changes → run unit tests on code → train model → evaluate model quality → validate data quality → compare to production model → deploy if better. The “artifact” is a trained model, which is not deterministic — two identical training runs with different random seeds or different hardware produce different models. This requires: automated model training and evaluation in the pipeline; performance thresholds that must be met before deployment; model comparison against the current production model (not just code tests); and data quality gates that validate the training data before training begins.
Q13. What are the key tests in an ML deployment pipeline?
Code tests: unit tests for data preprocessing functions, feature engineering, and inference code. Integration tests: end-to-end test with sample data through the full pipeline. Data tests: schema validation, range checks, null rate thresholds, volume checks (did we receive expected data?). Model tests: performance above minimum thresholds (AUC > 0.85), performance above or within X% of the current production model, invariance tests (predictions should not change drastically for minor input perturbations), directional expectation tests (when income increases, default probability should decrease), and bias checks (model performance should not vary significantly across demographic groups). Load tests: the serving API handles peak traffic within latency SLAs.
Q14–21 (MLOps rapid fire):
Q14. What is model versioning and why is it important? Tracking each iteration of a model (version 1.0, 1.1, 2.0) with its training data, code, hyperparameters, and performance metrics. Enables rollback to a previous version if a new deployment causes issues, reproducibility of past results, and audit trails for regulated industries.
Q15. What is blue-green deployment for ML models? Two identical production environments: blue (current) and green (new). Traffic is switched from blue to green atomically. If green fails, switch back to blue instantly. No gradual traffic shift — unlike canary deployment. Safer for critical systems but requires double the infrastructure during the cutover.
Q16. What is model explainability and why does it matter in production? The ability to explain why a model made a specific prediction. Required for: regulatory compliance (GDPR right to explanation, Fair Credit Reporting Act), debugging model failures, building user trust, and detecting bias. Tools: SHAP (SHapley Additive exPlanations) for local and global explanations, LIME for local linear approximations, integrated gradients for neural networks.
Q17. What is the difference between online learning and offline learning in production? Offline learning: train on a static dataset, deploy, retrain periodically on accumulated data. Simpler, stable, but slow to adapt. Online learning: model updates incrementally with each new data point or mini-batch in production. Adapts quickly to distribution shift but risks catastrophic forgetting and training instability if bad data arrives.
Q18. What is shadow mode in ML deployment? The new model runs in parallel with the production model — both receive the same requests, but only the production model’s predictions are returned to users. The new model’s predictions are logged and compared to the production model’s. Validates the new model on real traffic without user risk.
Q19. What metrics do you monitor for a deployed ML model? System metrics: latency (p50, p95, p99), throughput (requests per second), error rate, CPU/GPU utilisation, memory usage. ML metrics: prediction score distribution (PSI vs training), input feature distributions (drift), prediction volume, and outcome metrics when ground truth becomes available (accuracy, precision, recall).
Q20. What is Kubeflow? An open-source ML platform built on Kubernetes that handles the full ML lifecycle: Kubeflow Pipelines (orchestrate multi-step ML workflows), Katib (hyperparameter tuning, neural architecture search), KServe (model serving with auto-scaling), and Jupyter Hub (shared notebook environment). It is the open-source alternative to managed platforms like SageMaker and Vertex AI.
Q21. What is model compression and why is it important for deployment? Reducing model size and inference latency: quantisation (float32 → int8/int4, 4-8x smaller), pruning (remove near-zero weights, sparse model), knowledge distillation (train small student to mimic large teacher), and operator fusion (combine multiple operations into one kernel call). Critical for edge deployment (mobile, IoT) and cost-efficient cloud serving at scale.
Conclusion
MLOps interviews in 2026 test a combination of ML knowledge, software engineering skills, and DevOps familiarity. The key concepts that appear in every MLOps interview are: the difference between data drift and concept drift (and how to detect each), model registry and versioning with MLflow, deployment patterns (canary, blue-green, shadow mode), CI/CD for ML (what tests are needed beyond code tests), and feature stores. The strongest candidates have built and operated a production ML system — even a small personal project with MLflow tracking, a FastAPI serving endpoint, and a basic monitoring dashboard demonstrates far more than theoretical knowledge alone.



