Lesson 11 of 11 · 5 min
30 Interview Q&As
Q1: What is MLOps?
Machine Learning Operations — practices, tools, and culture for reliably deploying, monitoring, and maintaining ML models in production.
Q2: What problem does MLflow solve?
Track and compare experiments: which parameters, code version, and data produced which metrics. Makes experiments reproducible.
Q3: What is an MLflow run?
A single experiment execution with logged parameters, metrics, artifacts, and the model itself. Multiple runs exist within an experiment.
Q4: What is mlflow.log_param vs mlflow.log_metric?
log_param: single value per run (e.g., n_estimators=100). log_metric: can be logged across steps (e.g., loss at each epoch).
Q5: What is the MLflow Model Registry?
A centralised store for managing model versions, lifecycle stages (Staging/Production/Archived), and metadata.
Q6: What are the lifecycle stages in MLflow Model Registry?
None → Staging (candidate for production) → Production (serving live traffic) → Archived (deprecated).
Q7: What is FastAPI?
A modern Python web framework for building REST APIs. Automatically generates OpenAPI docs, uses type hints for validation, and is very fast (async).
Q8: What is Pydantic used for in FastAPI?
Defining request/response schemas with type validation. FastAPI uses Pydantic models to parse, validate, and serialize JSON automatically.
Q9: What is uvicorn?
An ASGI (Asynchronous Server Gateway Interface) server that runs FastAPI applications. Handles concurrent requests.
Q10: What is a Docker container?
A lightweight, isolated environment with the application and all dependencies. 'Runs the same everywhere' — eliminates 'works on my machine' problems.
Q11: What is a Dockerfile?
A text file with instructions to build a Docker image: base OS, install dependencies, copy code, set entry point.
Q12: What is the difference between a Docker image and container?
Image: the blueprint (static). Container: a running instance of an image.
Q13: What is model drift?
Degradation in model performance over time because the real-world data distribution has changed from the training distribution.
Q14: What is data drift vs concept drift?
Data drift: input feature distribution changes (e.g., sensor recalibrated). Concept drift: the relationship between features and labels changes.
Q15: What is the Kolmogorov-Smirnov test for drift detection?
Statistical test comparing two distributions. Low p-value (< 0.05) indicates the two samples likely come from different distributions — drift detected.
Q16: What is model serving?
Making a trained model accessible via an API endpoint that takes input features and returns predictions in real time.
Q17: What does @**app.post**('/predict') do in FastAPI?
Registers a function as the handler for HTTP POST requests to the /predict endpoint.
Q18: What is a health endpoint?
An API endpoint (usually /health) that returns 200 OK if the service is running. Used by load balancers and orchestrators (Kubernetes) to check service health.
Q19: What is mlflow.sklearn.log_model?
Logs a scikit-learn model as an MLflow artifact, saving it in a standard format that can be loaded later with mlflow.sklearn.load_model.
Q20: What is the registered_model_name parameter?
Registers the logged model in the MLflow Model Registry under the given name, enabling versioning and stage management.
Q21: What is A/B testing in MLOps?
Running two model versions simultaneously on real traffic, routing a fraction of requests to the new model, and comparing performance metrics.
Q22: What is CI/CD in MLOps?
Continuous Integration/Deployment: automated pipelines that test, validate, and deploy new model versions whenever code or data changes.
Q23: What is a prediction request schema?
A defined structure for API inputs that validates the correct data types, required fields, and ranges before the prediction runs.
Q24: How do you handle model loading latency at API startup?
Load the model once at startup (global variable) rather than per-request. Use a lifespan event in FastAPI for clean startup/shutdown.
Q25: What is feature store in MLOps?
A centralised repository for computed features, ensuring consistency between training and serving (no training-serving skew).
Q26: What is training-serving skew?
When the data preprocessing applied during training differs from what's applied at inference — causes degraded production performance.
Q27: What is model versioning?
Tracking different trained model versions so you can compare, roll back, or promote to production without losing previous models.
Q28: What is an ASGI server vs WSGI?
Wsgi: synchronous (Flask, Django). ASGI: asynchronous, handles concurrent requests without blocking (FastAPI + Uvicorn).
Q29: What is model explainability in production?
Providing interpretable reasons for predictions (SHAP, LIME) to satisfy regulatory requirements and build user trust.
Q30: What would a complete MLOps stack look like for a company?
Data versioning (DVC) + experiment tracking (MLflow) + model registry (MLflow) + serving (FastAPI+Docker) + orchestration (Kubernetes) + monitoring (Grafana/Evidently).
