Machine Learning Engineer Interview Questions & Answers
40 questions for Machine Learning Engineer interviews — 6 easy, 31 medium, 3 hard.
About the Machine Learning Engineer role
A machine learning engineer builds and runs models in production. The role sits between data science and software engineering: training pipelines, feature engineering at scale, model serving, monitoring and retraining. Interviews test strong Python and coding fundamentals, ML algorithms and evaluation, system design for ML services, and MLOps topics like Docker, CI/CD, drift monitoring and latency trade-offs. Expect a coding round and an ML system design round.
How do you profile and speed up slow Python code?
Show answer
What is the difference between == and is?
Show answer
How do list comprehensions work and why use them?
Show answer
Tell me about a time you created documentation that helped your team work with data.
Show answer
How do you pivot data in Pandas?
Show answer
How do you detect and treat concept drift?
Show answer
Write Pandas code to read a large CSV in chunks and compute total sales per city.
Show answer
Write Python code to compute the Population Stability Index for a feature to detect drift.
Show answer
What is feature scaling and which models need it?
Show answer
What is calibration of a classifier?
Show answer
Explain the KNN algorithm and its drawbacks.
Show answer
Pandas: compute a 7-day rolling average of daily sales for each store.
Show answer
You assign values to a filtered DataFrame and Pandas shows a SettingWithCopyWarning. What is going on and how do you fix it?
Show answer
Explain train, validation and test sets.
Show answer
How would you structure a data science codebase so notebooks do not become unmaintainable?
Show answer
Your notebook runs on your laptop but fails on a colleague's machine. How do you make the work reproducible?
Show answer
Soon after a new model version went live, customer complaints spiked. How do you roll back safely and learn from it?
Show answer
What should you log for a production prediction service?
Show answer
What is the difference between apply, map and applymap in Pandas?
Show answer
Your random forest is accurate but too slow at prediction time for a real-time API. What do you do?
Show answer
What is binning and when is it useful?
Show answer
Write Python code that validates prediction requests with Pydantic before passing them to a model.
Show answer
What is the difference between iterators and iterables in Python?
Show answer
What is recursive feature elimination?
Show answer
How do you evaluate clustering when you have no labels?
Show answer
Tell me about a GenAI project you built and what you learned from it.
Show answer
Pandas: merge vs join vs concat?
Show answer
How does linear regression work and what are its assumptions?
Show answer
Difference between loc and iloc in Pandas?
Show answer
What is the randomisation unit in an experiment, and why does it matter?
Show answer
How do you use groupby with multiple aggregations?
Show answer
Tell me about a time you deployed a model under a tight deadline.
Show answer
Random forest vs a single decision tree?
Show answer
How would you optimise a slow Pandas pipeline on a 5 GB file?
Show answer
What are precision and recall trade-offs in practice?
Show answer
Pandas: find customers whose monthly spend increased for three consecutive months.
Show answer
Write scikit-learn code to calibrate a gradient boosting classifier's probabilities and check the result.
Show answer
Write scikit-learn code to get precision, recall and a confusion matrix at a custom threshold of 0.3.
Show answer
Your credit model has good overall AUC but performs much worse for applicants from one region. What do you do?
Show answer
Frequently asked questions
What does a Machine Learning Engineer do?
A machine learning engineer builds and runs models in production. The role sits between data science and software engineering: training pipelines, feature engineering at scale, model serving, monitoring and retraining. Interviews test strong Python and coding fundamentals, ML algorithms and evaluation, system design for ML services, and MLOps topics like Docker, CI/CD, drift monitoring and latency trade-offs. Expect a coding round and an ML system design round.
Which skills are tested in a Machine Learning Engineer interview?
Expect questions on Production Python, Model serving with APIs, Docker and CI/CD, Feature pipelines, Model monitoring. Most rounds also ask you to explain a project and solve one practical problem live.
How do I prepare for a Machine Learning Engineer interview?
Revise Machine Learning, Feature Engineering, MLOps and Model Deployment, Python for Data Science first using the topic sheets, practise the questions on this page aloud, then do one full mock interview to practise timing.