5 exercises — practice structuring strong English answers to data science and ML engineering interview questions: model drift, precision vs recall, model explainability, overfitting, and feature engineering.
How to structure ML interview answers
Drift questions: always distinguish data drift (P(X) changes) from concept drift (P(Y|X) changes) — most candidates miss this
Metrics questions: give the formula → explain the threshold mechanism → give contrasting real-world scenarios with reasoning
Explainability questions: three layers — frame as a decision, translate metrics to business language, use SHAP for specific predictions
Overfitting questions: give the loss curve signature → remedies with mechanism → connect to bias-variance trade-off
Feature engineering questions: open with domain knowledge → structured categories (temporal, encoding, interaction) → feature selection to prune noise
0 / 14 completed
1 / 14
The interviewer asks: "How do you detect and handle model drift in a production ML system?" Which answer best demonstrates ML engineering maturity?
Option B is the strongest: it makes the critical distinction between data drift and concept drift (most candidates conflate them), names specific statistical tests (PSI, KS test) rather than just saying "monitor statistics", explains what drift looks like in practice (output distribution shift), and gives a complete set of response options including roll-back — showing that retraining is not always the only answer. Data drift vs concept drift — the key distinction: Data drift (covariate shift) — the distribution of X (input features) changes: P(X) changes, but P(Y|X) stays the same. Example: a new device type appears in traffic; the model was never trained on it. Concept drift — the relationship between features and the target changes: P(Y|X) changes. Example: the definition of a "fraudulent transaction" shifts as fraud patterns evolve. Detection tools: PSI (Population Stability Index) — industry standard for feature drift; PSI > 0.25 = major drift. KS test (Kolmogorov-Smirnov) — statistical test for distributional differences. ADWIN, Page-Hinkley — drift detection algorithms for streaming data. Response options hierarchy: 1. Retrain on fresh data (most common). 2. Retrain with time-decayed weights (emphasise recent data). 3. Roll back while investigating. 4. Feature engineering to capture the drifted dimension. Option D is also strong (mentions shadow deployments which is a production ML deployment pattern) but misses the data/concept drift distinction.
2 / 14
The interviewer asks: "Explain the difference between precision and recall, and describe a real-world scenario where you would optimise for one over the other." Which answer demonstrates the deepest understanding?
Option B is the strongest: it gives the precise formulas with TP/FP/FN notation, explains the mechanism of the trade-off (the decision threshold), gives two contrasting real-world scenarios with the reasoning behind each choice, and addresses the imbalanced dataset problem — a key practical issue that exposes ML depth. The formulas — always know these for interviews: $\text{Precision} = \frac{TP}{TP + FP}$ (of what I predicted positive, how many were right?), $\text{Recall} = \frac{TP}{TP + FN}$ (of all actual positives, how many did I find?), $\text{F1} = \frac{2 \times \text{Precision} \times \text{Recall}}{\text{Precision} + \text{Recall}}$ (harmonic mean). The threshold mechanism: every classifier outputs a probability. At threshold 0.5, above = positive. Lowering to 0.3 catches more positives (recall up) but with more false positives (precision down). Raising to 0.8 is very conservative (precision up, recall down). Imbalanced datasets: with 99% negative class, a model that always predicts negative has 99% accuracy but 0% recall — useless. Use precision-recall AUC, not accuracy. Scenario decision framework: False negative is more costly → optimise recall (medical, fraud, security). False positive is more costly → optimise precision (spam, content moderation, legal).
3 / 14
The interviewer asks: "How would you explain your machine learning model and its predictions to a non-technical stakeholder?" Which answer demonstrates the best communication strategy?
Option B is the strongest: it presents a systematic three-layer approach (framing, performance translation, explainability), gives concrete before/after examples for each translation, names SHAP specifically (the industry-standard tool for ML explainability), and — critically — includes the transparency about model limitations, which builds genuine stakeholder trust. ML communication framework for interviews: Layer 1: Frame in terms of decisions — connect the model output to the action the stakeholder will take. "The model gives you a ranked list of customers to call" is more useful than "the model outputs a probability vector." Layer 2: Translate metrics — precision/recall → business hit rate language. AUC → lift over baseline. "If we use the model we reach 75% of churners by contacting 10% of customers; without the model we'd need to contact 50% to reach the same 75%." This is called the lift. Layer 3: Explainability tools — SHAP (SHapley Additive exPlanations): assigns a contribution value to each feature for each individual prediction. Answers "why was this specific customer predicted to churn?" LIME: local approximation — builds a simple interpretable model around a single prediction. Feature importance (global): which features the model uses most across all predictions. Trust through limitations — always telling stakeholders where the model performs less well builds more confidence than hiding limitations. Options C and D are competent but less structured and miss the three-layer framework.
4 / 14
The interviewer asks: "What is the difference between overfitting and underfitting, and how do you address each?" Which answer demonstrates the clearest mental model?
Option B is the strongest: it gives both the error pattern signatures (training vs. validation), prescribes the learning curve as the diagnostic tool, provides a comprehensive remedy list for each with the mechanism of each fix, and precisely maps the problem to the bias-variance trade-off framework — which is the theoretical foundation that interviewers are often probing for. Bias-variance trade-off — the theoretical framework: Bias — error from wrong model assumptions. A linear model fitting a quadratic relationship has high bias. Variance — error from sensitivity to small fluctuations in training data. A deep tree that perfectly fits 100 training points has high variance. Total error = Bias² + Variance + Irreducible noise. Underfitting = high bias. Overfitting = high variance. Regularisation remedies explained: L2 (Ridge) — adds λ·Σw² to the loss; penalises large weights, drives them towards zero but not exactly zero. L1 (Lasso) — adds λ·Σ|w| to the loss; drives some weights exactly to zero (sparse solutions, feature selection). Dropout — randomly sets neurons to zero during training, forcing the network to learn redundant representations. Diagnosis sequence: 1. Plot training loss vs. validation loss. 2. If gap is large → overfitting. 3. If both are high → underfitting. 4. Learning curve also shows whether more data would help (overfitting curves converge with more data; underfitting curves don't).
5 / 14
The interviewer asks: "How do you approach feature engineering, and what techniques do you commonly use?" Which answer best demonstrates practical ML experience?
Option B is the strongest: it opens with an important framing statement ("feature engineering is often more impactful than model selection" — a widely cited practitioner wisdom), structures the answer by technique categories with concrete examples tied to a specific problem domain (churn model), gives decision criteria for encoding choices (why target encoding for high cardinality), and includes the important counter-point that more features is not always better. Feature engineering vocabulary: Temporal features — time-since events, rolling window aggregations, trend/velocity. Critical for user behaviour models. Encoding strategies:Label encoding — ordinal categories only (e.g., small/medium/large → 0/1/2). One-hot encoding — nominal categories with low cardinality (< ~20 values). Creates binary columns. Target encoding — replace category with mean target value; handles high cardinality but risks target leakage — use cross-validation or add smoothing. Entity embeddings — learned dense representations for very high cardinality (neural networks). Interaction features — explicit multiplication/division when domain knowledge suggests a ratio or product is meaningful. Tree models find these automatically; linear models need them explicit. Feature selection — SHAP feature importance (model-agnostic), recursive feature elimination (RFE), Pearson/Spearman correlation for linear feature-target relationships. Curse of dimensionality: many irrelevant features add noise, hurt generalisation, and slow training — especially in distance-based models (KNN, SVM).
6 / 14
Sarah (Senior ML Engineer) comments on your PR: 'This feature uses a complex custom loss function. Can you elaborate on why you chose this over the standard Huber loss? Also, have you considered monitoring its performance in production—we need to ensure it's actually improving predictions and not introducing bias.'
This question assesses your ability to respond constructively during a code review. It highlights the importance of justifying technical choices, proactive monitoring for potential issues (like bias), and engaging in dialogue with senior engineers. Option 2 reflects this by acknowledging the need for further discussion while maintaining code quality.
7 / 14
Mark (Data Scientist) sends a Slack message: 'Hey team, we're seeing a significant drop in prediction accuracy on new customer data. The model was trained on historical data up to Q3 2023. Initial investigation suggests seasonality might be impacting feature values. Thoughts?'
This scenario tests your ability to respond to a critical alert. Mark's proactive identification of seasonality demonstrates good investigative skills and the need for collaboration. The key is recognizing potential causes beyond just the obvious (model drift) and seeking input from colleagues.
8 / 14
Sarah (Senior ML Engineer) comments on your PR: 'This feature uses a complex custom loss function. Can you elaborate on why you chose this over the standard Huber loss? Also, have you considered monitoring its performance in production—we need to ensure it's actually improving predictions and not introducing bias.'
This question assesses your ability to respond constructively during a code review. It highlights the importance of justifying technical choices, proactive monitoring for potential issues (like bias), and engaging in dialogue with senior engineers. Option 2 reflects this by acknowledging the need for further discussion while maintaining code quality.
9 / 14
Mark (Data Scientist) sends a Slack message: 'Hey team, we're seeing a significant drop in prediction accuracy on new customer data. The model was trained on historical data up to Q3 2023. Initial investigation suggests seasonality might be impacting feature values. Thoughts?'
This scenario tests your ability to respond to a critical alert. Mark's proactive identification of seasonality demonstrates good investigative skills and the need for collaboration. The key is recognizing potential causes beyond just the obvious (model drift) and seeking input from colleagues.
10 / 14
Code Review Comment: 'The unit tests for this API endpoint are missing assertions to verify the data types returned. Could you add some to ensure we're receiving what we expect?'
Which of the following best describes your response to this comment?(Focus on proactive communication and addressing concerns proactively)
The correct answer demonstrates understanding that code reviews are about improving quality and catching potential issues. Simply acknowledging the feedback is insufficient; you need to outline a concrete plan for action. Option A shows avoidance, option B prioritizes speed over best practices, and option D shifts responsibility inappropriately.
11 / 14
Slack Message: '@team - We've noticed a spike in false positives for our fraud detection model. The rate has increased by 15% over the last week. Initial analysis points to a change in user behavior – potentially new account types.
What is the most appropriate next step to take when addressing this issue?(Focus on immediate investigation and mitigation)
Rolling back the model is a rapid response that directly addresses the problem. While monitoring is important long-term, immediate action to mitigate the spike is crucial. Options A and B are too high-level or reactive without investigation, and option C lacks urgency.
12 / 14
PR Description: 'Implemented a new feature to calculate customer lifetime value (CLTV) using cohort analysis. This involved aggregating transaction data over time and applying a discount rate to estimate future revenue. The model is trained weekly on the latest data.
Which of the following best describes the key elements this PR description should include to be most effective?(Focus on clarity, context, and impact)
A strong PR description should focus on *why* the change was made and its potential impact. Simply listing technical details (options A, B, and D) doesn't convey the value or context of the feature. Option C clearly states the benefit.
13 / 14
Stand-up Update: 'Yesterday, I was working on improving the accuracy of our churn prediction model. I've been experimenting with different feature engineering techniques, specifically adding interaction terms between customer demographics and usage data.
Which of the following is the most effective way to communicate this update during a daily stand-up meeting?(Focus on concise information and key takeaways)
The correct answer provides a concise summary of the work's purpose and technique. It avoids jargon and focuses on the *why* behind the effort – highlighting the potential impact on churn prediction. Options A and B are too vague or technical for a stand-up, and option D is overly broad.
14 / 14
API Response: The following API endpoint response was received after querying the model for a specific user:
{
"prediction": 0.85,
"confidence": 0.92,
"feature_importance": {
"age": 0.3,
"transaction_volume": 0.45,
"location": 0.2
}
What does this response primarily communicate to a data analyst?(Focus on interpreting the key metrics and their implications)
The response provides crucial information about feature importance. While confidence is also present, understanding which features drive the prediction is paramount for further investigation and potential action. Option A focuses solely on confidence, and option D simply confirms the success of the API call.
What does "Data Scientist / ML Engineer Interview Questions — IT English Practice" cover?
Practice answering data science and ML engineer interview questions in English: model drift, precision vs recall, model explainability, overfitting, and feature engineering. 5 exercises.
How many questions are in this interview set?
This set has 14 exercises, each with a full explanation.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to use with no account, sign-up, or paywall.
Do these exercises include model answers?
Yes. Each interview question gives you several possible responses and asks you to pick the one that communicates most clearly and completely — the explanation then breaks down exactly why that answer works, including the specific vocabulary a strong candidate would use.
What if I choose an answer that isn't the strongest one?
You'll see which option was correct and read a full explanation of why it's stronger than the alternatives, plus the key vocabulary and phrasing worth reusing in a real interview.
Can I retry the questions?
Yes — use the "Try again" button on the results screen to reset and go through the set again.
Is this the same as a real technical or behavioural interview?
No — it's focused practice for the language side of interviewing: recognising which phrasing sounds precise and confident versus vague, and knowing the vocabulary interviewers expect for this role. It won't replace mock interviews, but it builds the vocabulary you'll need in one.
Where can I find interview prep for other roles?
Browse the full Interview exercises hub for 170+ modules covering behavioural, technical, and system design rounds across dozens of IT roles, or check the "Next up" link below to continue.
Do I need an account, and is my progress saved?
No account is needed. Progress is tracked only for your current visit — reloading or leaving the page resets the counter.
Who writes these interview questions?
Every question is written by the CoderSlingo team based on real technical interview patterns for this role, then reviewed for accuracy and clarity.