Career · Machine Learning · Interview Prep
Top 20 Machine Learning Career Questions
Quick summary — the top 20 ML career questions
Junior machine learning interviews test the same twenty questions in slightly different words. Five check your fundamentals (supervised vs unsupervised, overfitting, bias–variance, cross-validation, handling missing data). Five check your algorithm judgment (when to use trees vs linear models, how boosting works, bagging vs boosting, evaluation metrics, precision vs recall). Four check your project experience (walk through a project, imbalanced data, feature engineering, a failure). Six check career fit (explaining to stakeholders, staying current, why ML, prioritising accuracy vs business impact, DS vs ML engineer, and your next learning step). Prepare structured answers to all twenty and you will cover roughly 90% of junior ML interview ground.
In this guide you will get:
- All 20 questions grouped into four categories.
- Model answers you can adapt to your own experience.
- What each question actually tests, so you answer the signal, not the words.
- A structure for answering project and behavioral questions.
- Common mistakes that turn good candidates into rejections.
SECTION 01Fundamentals — Q1 to Q5
These five questions check whether your basics are solid. They are usually asked first, and shaky answers here colour the rest of the interview.
Q1What is the difference between supervised and unsupervised learning?
What it tests: whether you can define the basic problem types without reciting a textbook.
Model answer: Supervised learning uses labelled data — each example has an input and the correct output — and the model learns a mapping from input to output. Regression and classification are supervised problems. Unsupervised learning works with unlabelled data and looks for structure — clustering and dimensionality reduction are examples. Semi-supervised sits between the two, using a small labelled set and a large unlabelled set. The practical question is not "which is better" but "do I have labels, and if not, what structure do I need to find?"
Q2What is overfitting, and how do you prevent it?
What it tests: whether you understand generalisation, not just training accuracy.
Model answer: Overfitting is when a model learns the training data too well — including its noise — and performs poorly on unseen data. You detect it when training performance is strong but validation performance is weak. I prevent it with a combination of: a held-out validation set or k-fold cross-validation, regularisation (L1/L2 or tree depth limits), early stopping, simpler models when appropriate, and more or better data. The right response depends on the cause — if the gap is small, regularisation is enough; if it is large, the model may be too complex or the data too small.
Q3Explain the bias–variance tradeoff.
What it tests: whether you can reason about why models fail, not just report metrics.
Model answer: Bias is error from a model that is too simple to capture the underlying pattern — it underfits. Variance is error from a model that is too sensitive to the training data — it overfits. Total error is roughly bias² + variance + irreducible noise. As you increase model complexity, bias falls and variance rises. The sweet spot depends on the problem and the data size — small datasets prefer higher bias and lower variance, larger datasets tolerate more variance. In practice you diagnose which one dominates by comparing training and validation error.
Q4What is cross-validation, and why use it?
What it tests: whether you know how to evaluate models honestly.
Model answer: Cross-validation splits the training data into k folds, trains on k−1 folds, validates on the remaining fold, and rotates until every fold has been used for validation. The average score gives a more reliable estimate of performance than a single train–test split, especially on small datasets. For time series you must use time-aware splits instead of random k-fold, otherwise you leak future information. I use k-fold when data is limited and I want a stable estimate; I use a single hold-out when data is plentiful and speed matters.
Q5How do you handle missing data?
What it tests: whether you can think through data quality rather than applying a default.
Model answer: First I ask why the data is missing. Missing completely at random is different from missing because of a pattern — e.g., high-income users refusing to disclose income. If the missingness is informative, dropping rows introduces bias. My order of preference is: (1) check if the missingness itself is a feature worth keeping, (2) impute with a simple rule (mean, median, or mode) for small missing rates, (3) use model-based imputation (KNN or iterative imputer) when relationships matter, and (4) only drop rows or columns if the missing rate is very high and the column is not essential. I always record the decision — reviewers and interviewers care about the reasoning more than the method.
SECTION 02Algorithms and modeling — Q6 to Q10
These test judgment: can you pick a model, compare models, and evaluate them sensibly?
Q6When would you use a decision tree vs logistic regression?
What it tests: whether you choose models based on the problem, not on hype.
Model answer: Logistic regression is my default for interpretable binary classification with roughly linear decision boundaries — credit risk, churn, medical screening — because coefficients are readable and the model is fast and stable. Decision trees are better when the relationship is non-linear and involves interactions, and when stakeholders want a visual rule set. Single trees overfit easily, so I usually prefer a gradient-boosted ensemble when accuracy matters more than interpretability, and logistic regression when auditability matters more than the last few points of accuracy.
Q7How does gradient boosting work?
What it tests: whether you understand the algorithm you are using, not just the library call.
Model answer: Gradient boosting builds an ensemble of weak learners — usually shallow trees — sequentially. Each new tree is trained on the residual errors of the current ensemble, which is equivalent to following the negative gradient of the loss function. Learning rate controls how much each tree contributes, and early stopping prevents overfitting. XGBoost, LightGBM, and CatBoost are engineering-optimised versions of the same idea. I use boosting when tabular accuracy matters and explainability is secondary; I tune learning rate, depth, and number of estimators together because they interact.
Q8What is the difference between bagging and boosting?
What it tests: conceptual clarity between two related but different ensemble strategies.
Model answer: Bagging trains many models in parallel on bootstrap samples of the data and averages their predictions — this reduces variance. Random Forest is the classic example. Boosting trains models sequentially, each one focusing on the errors of the previous — this reduces bias. Bagging is easier to parallelise and more robust to noisy labels; boosting can reach higher accuracy but is more sensitive to outliers and hyperparameters. In interviews I try to say explicitly which source of error each method targets, because that is the real difference.
Q9How do you evaluate a classification model?
What it tests: whether you use metrics that reflect the business problem.
Model answer: Accuracy alone is misleading on imbalanced data. I start with a confusion matrix, then report precision, recall, and F1, plus ROC-AUC or PR-AUC depending on class balance. I choose the headline metric based on cost of errors — for fraud detection I weight recall heavily; for spam filtering I weight precision. For multi-class problems I use macro or weighted averages depending on whether all classes matter equally. Finally I look at calibration when predicted probabilities will drive decisions, not just the class label.
Q10Explain precision vs recall — when do you prioritise one over the other?
What it tests: whether you can translate metrics into business consequences.
Model answer: Precision is the fraction of predicted positives that are actually positive; recall is the fraction of actual positives the model catches. If false positives are expensive — spam filters, promotional targeting — I prioritise precision. If false negatives are expensive — fraud detection, disease screening — I prioritise recall. In practice you tune the threshold to the point where the cost of errors is minimised, and report the full precision–recall curve rather than a single number.
SECTION 03Projects and experience — Q11 to Q14
These are the questions that separate candidates who have shipped projects from candidates who have only finished courses.
Q11Walk me through your most impactful ML project.
What it tests: whether you can structure a technical story for a mixed audience.
Model answer: I use a four-part structure: problem, approach, result, and what I learned. For example: "The problem was predicting customer churn for a subscription business where the team suspected price was the main driver. I cleaned two years of customer and billing data, built a logistic baseline and a gradient-boosted comparison, and found that contract length mattered more than price — a finding that shifted the recommendation from discounting to a contract-length incentive. The model hit a ROC-AUC of 0.81 on the hold-out set, and the analysis fed into a retention initiative. The biggest lesson was that the feature engineering — deriving contract-age buckets — moved the metric more than changing the model."
Q12How did you handle an imbalanced dataset?
What it tests: whether you know that accuracy is the wrong metric on skewed data.
Model answer: First I quantify the imbalance and pick a metric that reflects the business cost of errors — usually recall or PR-AUC. I try class weighting before resampling, because it is simpler and preserves the original data distribution. If I resample, I do it inside cross-validation folds only, to avoid leakage. I also try threshold tuning at evaluation time — often the model does not need resampling, it needs a lower decision threshold. For extreme imbalance I look at anomaly detection framing instead of classification.
Q13How do you approach feature engineering?
What it tests: whether you can create signal rather than just feeding raw columns to a model.
Model answer: I start with domain reasoning — what would a human expert look at? Then I build three kinds of features: (1) transforms, like log or bucket versions of skewed numeric columns, (2) interactions, where two variables jointly matter, and (3) time-based aggregates, like rolling averages or recency. I validate every new feature with a quick ablation — does the model improve when I add it, and does it survive on the hold-out set? I document the reasoning in the notebook, because a feature without a reason is a maintenance burden later.
Q14Tell me about a project that failed and what you learned.
What it tests: whether you can be honest about failure and whether you extract lessons from it.
Model answer: I worked on a project where the model performed well offline but the team did not deploy it. The failure was not technical — the business sponsor had not defined what "good enough" meant, and the model's predictions required a workflow change no one had agreed to. What I learned was that ML projects fail on framing and adoption far more often than on model choice. Since then I always start a project by writing down the decision the model will change, who owns it, and what the success metric looks like before I touch a notebook.
SECTION 04Career and behavioral — Q15 to Q20
These questions decide whether the interviewer sees you as a future colleague, not just a technical candidate.
Q15How do you explain a technical ML concept to a non-technical stakeholder?
What it tests: whether you can communicate, which is the most common gap in junior ML candidates.
Model answer: I start with the decision the stakeholder has to make, not with the model. I say what the model does in one sentence, what it does not do, and the confidence level. If the concept is abstract, I use a concrete comparison from their own world — for example, comparing overfitting to memorising the practice test instead of learning the material. I avoid jargon unless the stakeholder uses it first, and I finish with the one thing I need from them — a decision, a data access, or a validation.
Q16How do you keep up with ML research?
What it tests: whether you have a real habit, not just an answer you rehearsed.
Model answer: I follow a small set of sources rather than everything — a few newsletters, a few researchers on social media, and one or two papers a month that I try to implement or summarise. I do not try to read every paper; most are not relevant to my work. When I see a claim I care about, I check the reproducibility — code, data, and whether the baseline is fair. The habit I care about is turning reading into something I can actually use, not accumulating bookmarks.
Q17Why do you want to work in machine learning?
What it tests: whether your motivation is durable or just trend-driven.
Model answer: I want to work in ML because it is the point where my interest in reasoning about systems meets something that changes decisions. I built projects because I wanted to understand why a model was wrong, not just run the code — and the moments I learned most were when the data surprised me. I am drawn to roles where models affect real outcomes: churn, risk, recommendations. I know it is not all modelling; much of the work is data quality and communication, and that is exactly the part I find interesting.
Q18How do you prioritise between model accuracy and business impact?
What it tests: whether you think like an engineer who ships value, not like a competitor who maximises a metric.
Model answer: Business impact comes first. A model that is one point less accurate but ships in a week, and that the team actually trusts, is worth more than a model that is perfect but never deployed. I start by defining the decision the model will change and the cost of errors, then choose the simplest model that clears the bar. If a more complex model would meaningfully change the outcome, I invest in it — but I check that assumption with the stakeholder before spending weeks tuning.
Q19What is the difference between a data scientist and an ML engineer?
What it tests: whether you know which role you are actually applying for.
Model answer: A data scientist focuses on framing questions, exploring data, building and evaluating models, and communicating findings. An ML engineer focuses on getting models into production reliably — data pipelines, training at scale, monitoring, retraining, and serving. In practice the roles overlap a lot, especially in smaller teams. Junior DS roles lean toward analysis and experimentation; junior ML engineer roles lean toward engineering, MLOps, and writing code that other engineers will maintain. I have prepared for the specific role I applied to, but I can talk about both.
Q20What would you learn next to grow in ML?
What it tests: whether you have self-awareness about your gaps and a plan.
Model answer: I want to get stronger at the parts that are hard to learn from courses — deployment, monitoring, and the feedback loops after a model ships. Concretely: learn enough MLOps to package and monitor a model end to end, and deepen my understanding of experimentation and causal inference, because I have seen too many models that look good offline and fail in the real world. I also want to read more code written by senior engineers so I stop writing notebooks that only I can run.
SECTION 05How to structure every answer
The best answers follow the same shape, whatever the question. Here is the structure that consistently works:
| Step | What to Say | Why It Works |
|---|---|---|
| 1. Frame | Restate the question in your own words and the decision it affects | Shows you understood the point, not just the words |
| 2. Structure | Give a one-sentence map of your answer before details | Signals organised thinking and helps the interviewer follow |
| 3. Answer | Two or three concrete points with examples from your own work | Keeps the answer grounded and specific |
| 4. Trade-off | Name one limitation or alternative you considered | Shows judgment, not just knowledge |
| 5. Close | Return to the question — one line summarising the answer | Makes the answer easy to score |
# Cross-validation setup — the pattern interviewers
# expect when they ask "how do you evaluate models?"
from sklearn.model_selection import StratifiedKFold, cross_val_score
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
import numpy as np
pipe = Pipeline([
("scale", StandardScaler()),
("clf", LogisticRegression(max_iter=1000)),
])
cv = StratifiedKFold(n_splits=5, shuffle=True, random_state=42)
scores = cross_val_score(pipe, X, y, cv=cv, scoring="roc_auc")
print("Fold scores:", np.round(scores, 3))
print("Mean ROC-AUC:", round(scores.mean(), 3))
print("Std dev:", round(scores.std(), 3))
# What this proves in an interview:
# - You use a Pipeline so preprocessing can't leak
# - You stratify, so folds respect class balance
# - You report mean and variance, not just one number
# - You know that a stable score is more trustworthy
# When asked "how do you evaluate?", this is the
# pattern to describe — not just "I use accuracy".
# Handling imbalanced data — the pattern most
# candidates get wrong.
from sklearn.utils.class_weight import compute_class_weight
import numpy as np
# Option 1: class weighting — simplest, try this first
weights = compute_class_weight(
class_weight="balanced",
classes=np.unique(y_train),
y=y_train,
)
print(dict(zip(np.unique(y_train), weights)))
# Option 2: threshold tuning — often better than resampling
from sklearn.metrics import precision_recall_curve
prec, rec, thresholds = precision_recall_curve(y_val, proba)
# Pick the threshold that satisfies the business constraint:
# e.g. maximise recall while keeping precision above 0.7
mask = prec[:-1] >= 0.7
best_threshold = thresholds[mask][np.argmax(rec[:-1][mask])]
print("Threshold:", round(best_threshold, 3))
# What this proves in an interview:
# - You try class weighting before resampling
# - You tune the decision threshold, not just the model
# - You tie the choice to a business constraint
# - You avoid resampling outside CV (no leakage)
# In the answer, say WHY you picked each option —
# the reasoning is what is being tested.
# Precision vs recall — report the right metrics
# for the problem, not just accuracy.
from sklearn.metrics import (
classification_report,
confusion_matrix,
roc_auc_score,
average_precision_score,
)
print(confusion_matrix(y_test, preds))
print(classification_report(y_test, preds, digits=3))
print("ROC-AUC:", round(roc_auc_score(y_test, proba), 3))
print("PR-AUC:", round(average_precision_score(y_test, proba), 3))
# What this proves in an interview:
# - You always look at the confusion matrix first
# - You report precision/recall, not just accuracy
# - You know PR-AUC is better than ROC-AUC on
# heavily imbalanced data
# - You can say which metric you optimise and why
# In your answer, name the cost of a false positive
# vs false negative for this specific business —
# that's the actual test.
SECTION 06Common answer mistakes to avoid
These are the mistakes that turn a technically strong candidate into a rejection:
| Mistake | Why It Hurts | What to Do Instead |
|---|---|---|
| Reciting textbook definitions | Signals memorisation, not understanding | Define the concept in your own words, then give an example from your work |
| Answering with only tools | "I used XGBoost and got 0.87" says nothing about judgment | Explain why you chose the model and how you evaluated it |
| Claiming perfect results | Interviewers know real projects fail; perfect stories read as invented | Include a limitation, a failure, or a next step — honesty builds trust |
| Long unstructured monologues | Makes it hard to score you and eats time you need for follow-ups | Use the 5-step structure: frame, map, answer, trade-off, close |
| Avoiding "I don't know" | Guessing makes a wrong answer worse than admitting a gap | Say what you do know, say what you would check, and move on |
SECTION 07Interview Q&A — preparing for these questions
Q1How many of these 20 questions should I prepare word-for-word?
None of them word-for-word. Prepare the structure of your answer and one concrete example per question. Word-for-word answers sound rehearsed and fall apart on the first follow-up. What you should memorise is the shape — frame, map, answer, trade-off, close — and the specific examples you will use.
Q2What if I do not have real work experience for the project questions?
Use a project you built on your own — a Kaggle competition with your own approach, a personal project with a real question, or a course project that you extended. The interviewer is testing whether you can structure a technical story, not whether the project was paid. Be honest about the context, and focus on the decisions you made.
Q3How technical should the fundamentals answers be?
Start with a plain-language definition, then go one level deeper only if the interviewer asks. Juniors who recite mathematics they cannot explain sound weaker than juniors who explain the concept simply and add one concrete example. Leave space for the interviewer to go deeper — that signals confidence.
Q4Should I say "I don't know" if I am stuck?
Yes — but not immediately. Try to reason out loud first. Say what you do know, then what you would check or look up. A candidate who reasons toward an answer is stronger than one who guesses, and far stronger than one who pretends to know and then gets caught.
Q5How do I know I am ready?
You are ready when you can answer all twenty questions in under two minutes each, with a concrete example and one trade-off — and when your five project stories are written down and rehearsed out loud. Do two mock interviews with a friend or mentor before the real one. If you can survive those, the real interview will feel like a conversation.
SECTION 08Test yourself — ML career questions
Five questions. No sign-up.
0 / 5Pick an answer to see why it is right or wrong.
SECTION 09Frequently asked questions
How many of these 20 questions actually get asked?
Most junior ML interviews draw from this set — not always the exact wording, but the underlying concepts. You will typically see four to eight questions from this list across two rounds, plus company-specific variations and follow-ups.
Do I need to know deep learning for junior ML interviews?
Usually not deeply. Most junior interviews weight classical ML, statistics, and practical project reasoning. If you are targeting a deep learning role, you will get additional questions on neural networks, training, and architecture — but the twenty here still matter as the foundation.
How much maths do I need for these questions?
Enough to reason, not enough to derive proofs. You should be comfortable with probability, basic statistics, and what a derivative means — enough to explain gradient descent in words. Interviewers rarely ask you to solve proofs on a whiteboard at the junior level.
What if I forget an answer during the interview?
Pause, say what you do remember, and reason from there. Most interviewers prefer a candidate who thinks out loud to one who delivers a memorised answer that falls apart on the first follow-up. Recovery is a positive signal, not a negative one.
Should I bring a portfolio or project links?
Yes. Bring links to your GitHub and any dashboards or demos. Even if you are not asked for them, having them ready lets you say "I can show you" when the interviewer asks about a project. It also signals preparation.
SECTION 10Related reads
Classroom & online · Noida
Prepare for all 20 questions — with Uncodemy
Our Machine Learning Training Course covers the fundamentals, algorithm judgment, project work, and interview preparation behind all twenty of these questions — with guided projects, mock interviews, and answer reviews.
₹38,000 · full programme- Core ML + evaluation
- 3 guided projects
- Mock interviews
- Weekday & weekend batches