Machine learning interview questions test if you can explain how models learn from data. They also check how you judge a model and keep it working once it ships. The topics that come up most are the bias-variance trade-off, overfitting, evaluation metrics, tree models and neural networks. So a candidate who can explain those with a small example, and then write a bit of Python, clears most first and second rounds.
The 100 questions that follow have short, spoken-style answers. They move from the basics to data prep, classic algorithms, metrics, tuning, deep learning, language models and production. First, a short section explains how ML interview loops are set up. Near the end, a worked case answer shows how to handle open questions.
What Machine Learning Interview Questions Cover in Each Round
Most ML hiring loops have four or five parts. First comes a recruiter or hiring manager screen about your projects. Then a coding round tests Python and data structures, often with NumPy or pandas. After that, an ML theory round asks questions like the 100 that follow. Many firms also add a case or ML system design round, where you plan a model for a real product, and a behavioral round.
The weight of each part depends on the job. For example, research roles go deep on math and papers. ML engineer roles care more about pipelines, serving and monitoring. Data scientist roles at product firms lean on statistics, metrics and A/B tests.
| Role | Rounds that carry most weight | Questions to study first |
|---|---|---|
| Data scientist | Stats, metrics, A/B tests, case | 1 to 24 and 47 to 72 |
| ML engineer | Coding, system design, serving | 25 to 46 and 93 to 100 |
| Deep learning or NLP engineer | Neural nets, papers, coding | 73 to 92 |
| Fresher or intern | Basics, one project in depth | 1 to 60 |
Demand for these skills keeps growing. In the US, data scientists earned a median of $120,230 a year in May of last year. The BLS also expects these jobs to grow 35% in the decade to 2035. For a wider look at pay in this field, see our list of the highest paying AI careers.
Machine Learning Basics
These questions open most theory rounds. Answer them in two or three sentences, then give one example.
1. What is machine learning?
Machine learning is a way to build programs that learn patterns from data, so you do not write every rule by hand. For example, a spam filter learns from millions of emails marked as spam or not spam. It then labels new emails on its own.
2. How do AI, machine learning and deep learning differ?
AI is the broad goal of making machines act smart. Machine learning is one way to reach it, by learning from data. Deep learning is a part of machine learning that uses neural networks with many layers. So every deep learning model is ML, but not every ML model is deep learning.
3. What is supervised learning?
In supervised learning, the training data has the right answers, called labels. The model learns to map inputs to those labels. Predicting house prices from size and location is supervised, because past sales give you the real prices.
4. What is unsupervised learning?
Unsupervised learning finds structure in data with no labels. Clustering groups similar customers, and dimension reduction squeezes many columns into a few. For instance, a shop might cluster buyers into groups and then design a campaign for each one.
5. What is reinforcement learning?
In reinforcement learning, an agent takes actions in an environment and gets rewards or penalties. Then, over many tries, it learns a policy that earns the most reward. Game-playing systems like DeepMind’s AlphaGo and robot control are classic examples.
6. What is semi-supervised learning?
Semi-supervised learning uses a small labeled set plus a large unlabeled set. Labels are costly, so the model learns structure from all the data and uses the few labels to steer it. Medical imaging often works this way, since expert labels are rare.
7. What is self-supervised learning?
Self-supervised learning creates labels from the data itself. For example, a language model hides a word and learns to guess it, or predicts the next word. This is how large language models are pre-trained on huge amounts of text without human labels.
8. What is the difference between classification and regression?
Classification predicts a category, such as fraud or not fraud. Regression predicts a number, such as next month’s sales. Some models do both. Logistic regression, despite the name, is a classification model.
9. What is the difference between parametric and non-parametric models?
A parametric model has a fixed number of parameters, no matter how much data you have. Linear regression is one example. A non-parametric model grows with the data, like k-nearest neighbors or a deep decision tree. Non-parametric models fit more shapes but need more data and can overfit.
10. What is the difference between generative and discriminative models?
A discriminative model learns the boundary between classes, written P(y | x). Logistic regression and SVMs are discriminative. A generative model learns how the data itself is made, P(x | y) or P(x), so it can create new samples. Naive Bayes, GANs and large language models are generative.
11. What are features and labels?
Features are the inputs a model uses, such as age, income and city. The label, by contrast, is the output you want to predict, such as loan default. In a table, each row is one example, the feature columns are X, and the label column is y.
12. Why split data into training, validation and test sets?
You train on the training set, tune settings on the validation set, and check the final model once on the test set. If you tune on the test set, your score looks better than real life. In scikit-learn, train_test_split holds out 25% for testing by default and shuffles the rows first.
Preparing Data and Features
Interviewers love data prep questions, because real projects spend most of their time here. So mention a real mess you cleaned if you can.
13. How do you handle missing values?
First, find out why values are missing, because the reason changes the fix. Then you can drop rows, fill with the mean or median, fill with the most common category, or use a model to fill them. Tree models like XGBoost can also handle missing values natively. Adding a “was missing” flag column often helps too.
14. How do you deal with outliers?
Plot the data first, since some outliers are errors and some are the most useful rows, like fraud. You can cap values at a percentile, use a log transform, or drop rows that are plain errors. You can also pick models that care less about outliers, such as tree models, or use MAE in place of MSE.
15. What is the difference between normalization and standardization?
Normalization, or min-max scaling, squeezes values into a range like 0 to 1. Standardization subtracts the mean and divides by the standard deviation, so values have mean 0 and spread 1. Distance-based models like KNN and SVM need scaled data. Tree models do not.
16. What is the difference between one-hot encoding and label encoding?
One-hot encoding makes a new 0 or 1 column for each category. Label encoding gives each category a number, like red = 0, blue = 1. Label encoding can trick linear models into seeing an order that does not exist, so use one-hot for those. For a column with thousands of values, try target encoding or embeddings.
17. What is feature engineering?
Feature engineering means making new inputs that help the model. For example, from a timestamp you can make hour of day, day of week and “is holiday”. From a price and an area, you can make price per square foot. Good features often help more than a fancier model.
18. What are the main ways to select features?
Filter methods score each feature alone, using tests like correlation or chi-square. Wrapper methods, like recursive feature elimination, try subsets with a model. Embedded methods pick features during training, as L1 regularization does when it pushes weights to zero.
19. How do you handle an imbalanced dataset?
Begin with a metric that handles rare classes, such as recall, precision or PR-AUC. Then try class weights, undersampling the big class, or oversampling the small one. SMOTE makes new minority rows by blending nearby real ones. Finally, tune the decision threshold for the business cost of each kind of mistake.
20. What is data leakage?
Data leakage happens when the training data has information that would not exist at prediction time. For example, a churn model that uses “account closed date” will score near 100% in tests but fail in real use. Leakage also happens when you scale or fill values using the full dataset before the split.
21. How do you stop preprocessing from leaking into the test set?
Fit every step, such as the scaler or the imputer, on the training data only. Then apply that fitted step to the validation and test data. In scikit-learn, a Pipeline does this for you inside cross-validation, so each fold is clean.
22. What is the curse of dimensionality?
As you add features, the space grows so fast that your data points become sparse. Distances between points start to look alike, so KNN and clustering get worse. You also need far more data to cover the space. Feature selection and dimension reduction help.
23. What is PCA?
Principal component analysis turns many correlated features into a few new ones called components. Each component is a direction of most variance, and each is at a right angle to the others. You keep the first few that explain most of the variance, such as 95%. PCA needs scaled data and makes features harder to explain.
24. When would you use t-SNE or UMAP over PCA?
PCA is linear and fast, and it keeps global structure. t-SNE and UMAP are non-linear and great for showing clusters in 2D plots. However, distances between clusters in a t-SNE plot mean little, so use them for viewing data, not as model inputs in most cases.
Read also: 100 Database Questions for Interview
Classic Machine Learning Algorithms
This is the biggest group, so practice explaining each model in plain words. Then add when you would use it and when you would not.
25. What does linear regression assume?
It assumes a straight-line link between features and the target. It also assumes errors are independent, have the same spread at every level (homoscedasticity) and are roughly normal. It also works best with little multicollinearity. Breaking these does not always ruin predictions, but it makes coefficients and p-values unreliable.
26. How does logistic regression work?
Logistic regression takes a weighted sum of the features. It then passes that sum through the sigmoid function, which squeezes it into a probability between 0 and 1. It is trained by minimizing log loss. You then pick a threshold, often 0.5, to turn the probability into a class.
27. What is gradient descent?
Gradient descent is a way to find model weights that make the loss small. It computes the slope of the loss with respect to each weight, then takes a small step downhill. It repeats this until the loss stops falling. The step size is the learning rate.
28. What is the difference between batch, stochastic and mini-batch gradient descent?
Batch gradient descent uses all the data for each step, so it is stable but slow. Stochastic gradient descent uses one example per step, so it is fast but noisy. Mini-batch uses small groups, such as 32 or 256 rows, and is the usual choice for neural networks.
29. What happens if the learning rate is too high or too low?
Too high, and the loss bounces around or blows up, because each step jumps past the low point. Too low, and training crawls or gets stuck. Learning rate schedules, warm-up and optimizers like Adam help.
30. How does a decision tree work?
A decision tree splits the data again and again on the feature and value that best separates the target. Each split makes the groups purer. Leaves give the prediction, such as the main class or the average value. Trees are easy to explain but overfit unless you limit depth or prune.
31. What is the difference between Gini impurity and entropy?
Both measure how mixed a node is. Gini impurity is 1 minus the sum of squared class shares. Entropy is the negative sum of each share times its log. They usually pick similar splits, and Gini is a bit faster to compute, so it is the default in scikit-learn trees.
32. How does a random forest work?
A random forest trains many decision trees, each on a bootstrap sample of the rows. At each split, a tree only looks at a random subset of features. The forest then votes or averages. In scikit-learn, the RandomForestClassifier defaults are 100 trees, Gini splits and the square root of the feature count at each split.

33. What is the difference between bagging and boosting?
Bagging trains many models in parallel on random samples and averages them, which mainly cuts variance. Random forest is bagging. Boosting trains models one after another, with each new one fixing the errors of the last, which mainly cuts bias. Models like XGBoost often win on table data, but they are easier to overfit.
34. How does gradient boosting work?
Gradient boosting builds shallow trees one at a time. Each new tree fits the errors, or more exactly the negative gradient of the loss, left by the trees so far. A small learning rate shrinks each tree’s say. XGBoost, LightGBM and CatBoost are popular libraries for it.
35. How does AdaBoost differ from gradient boosting?
AdaBoost raises the weight of rows the last model got wrong, so the next model pays more attention to them. Gradient boosting, by contrast, fits each new model to the gradient of a loss function. AdaBoost is an early special case, while gradient boosting works with almost any loss.
36. How does a support vector machine work?
An SVM finds the boundary that leaves the widest gap, or margin, between two classes. Only the points nearest the boundary, the support vectors, decide where it goes, so the rest of the data barely matters. A soft margin, set by C, allows some mistakes. SVMs work well on mid-sized data with many features, such as text.
37. What is the kernel trick?
The kernel trick lets an SVM draw curved boundaries without building new features by hand. Instead, a kernel function computes how similar two points would be in a higher-dimensional space. The RBF and polynomial kernels are common choices.
38. How does k-nearest neighbors work?
KNN stores the training data. To predict, it finds the k closest rows to the new point and takes a vote or an average. It has no training step, so it is called a lazy learner. It slows down on big data and needs scaled features.
39. What is Naive Bayes, and why is it “naive”?
Naive Bayes applies Bayes’ theorem to pick the most likely class. It is naive because it treats every feature as independent of the others once you know the class. That is rarely true, yet it works well for spam filters and text tasks, and it trains very fast.
40. How does k-means clustering work?
K-means picks k centers, assigns each point to its nearest center, then moves each center to the mean of its points. It repeats until little changes. It needs k up front and likes round clusters of similar size. It also depends on the starting centers, so k-means++ is used to pick them well.
41. How do you choose k in k-means?
The elbow method plots the within-cluster sum of squares for many k values and looks for the bend. The silhouette score measures how well each point fits its own cluster against the next one, and higher is better. Business sense matters too, since five customer groups may be easier to act on than twelve.
42. How does hierarchical clustering work?
Agglomerative clustering starts with every point as its own cluster and merges the two closest clusters, again and again. The result is a tree called a dendrogram. You cut the tree at a height to get the number of clusters you want. It does not scale well past tens of thousands of points.
43. What is DBSCAN, and when is it better than k-means?
DBSCAN groups points that sit in dense areas, using a radius (eps) and a minimum number of neighbors. It finds clusters of any shape and labels sparse points as noise. So it beats k-means on odd-shaped clusters or data with outliers. It struggles when clusters have very different densities.
44. What are support, confidence and lift in association rules?
For a rule like “bread → butter”, support is the share of baskets with both items. Confidence is the share of bread baskets that also have butter. Lift divides confidence by butter’s normal rate. A lift above 1 means buying bread makes butter more likely. The Apriori algorithm finds such rules.
45. How do you model a time series?
Check first for trend, seasonality and stationarity, often with a plot and the ADF test. Classic models include ARIMA, where p, d and q set the lags, the differencing and the moving average part. You can also build lag features and use tree models like LightGBM. Always split by time, never at random.
46. How do recommender systems work?
Collaborative filtering recommends items liked by similar users, using past ratings or clicks. Content-based filtering, on the other hand, recommends items like ones you already liked, using item features. Most real systems mix both. Matrix factorization and two-tower neural networks are common methods, and the cold-start problem hits new users and items.
Measuring Model Performance
Metrics questions are easy to prepare and easy to lose points on. So learn the formulas and one example where each metric fails.
| Metric | Formula | Use it when |
|---|---|---|
| Accuracy | (TP + TN) / all | Classes are balanced |
| Precision | TP / (TP + FP) | False alarms are costly |
| Recall | TP / (TP + FN) | Missed cases are costly |
| F1 | 2 × P × R / (P + R) | You need one score for both |
| ROC-AUC | Area under TPR vs FPR curve | You rank by score |
| RMSE | Square root of mean squared error | Big misses hurt most |
47. What is a confusion matrix?
A confusion matrix is a table of predicted classes against real classes. So for two classes it has four cells: true positives, false positives, true negatives and false negatives. Every class metric, from precision to recall, comes from these four counts.
48. Why can accuracy mislead you?
Accuracy hides failure on rare classes. If 1% of payments are fraud, a model that always predicts “not fraud” scores 99% accuracy and catches nothing. So for imbalanced data, look at precision, recall and the PR curve.
49. What is precision?
Precision is the share of predicted positives that are truly positive: TP / (TP + FP). High precision means few false alarms. A spam filter needs high precision, because moving a real email to spam is costly.
50. What is recall?
Recall is the share of real positives the model catches: TP / (TP + FN). High recall means few misses. Cancer screening needs high recall, since missing a sick patient is worse than a false alarm that leads to a second test.
51. What is the F1 score?
F1 is the harmonic mean of precision and recall. It is high only when both are high. So if precision is 0.9 and recall is 0.1, F1 is about 0.18. A plain average would give 0.5. Use F-beta when recall matters more or less than precision.
52. What do the ROC curve and AUC tell you?
The ROC curve plots the true positive rate against the false positive rate at every threshold. AUC is then the area under it. An AUC of 0.5 is random guessing, and 1.0 means every positive ranks above every negative. AUC tells you how well the model ranks positives above negatives.
53. When is the precision-recall curve better than ROC?
Use the PR curve when positives are rare. With heavy imbalance, the false positive rate stays tiny even with many false alarms, so ROC-AUC looks great. The PR curve shows the real trade-off between catching cases and raising false alarms.
54. What is log loss?
Log loss, or cross-entropy loss, punishes confident wrong answers hard. If the model gives 0.99 to a case that turns out negative, the loss is large. Lower is better. It checks the quality of predicted probabilities, not just the final labels.
55. What are MAE, MSE and RMSE?
MAE is the average absolute error, so every unit of miss counts the same. MSE averages squared errors, which makes big misses count far more. RMSE is the square root of MSE, so it is back in the target’s units. Use MAE when outliers should not dominate.
56. What does R-squared mean?
R-squared is the share of the target’s variance the model explains. It equals 1 minus the sum of squared errors divided by the total sum of squares. An R² of 0.8 means the model explains 80% of the variance. Adding features never lowers plain R², so use adjusted R² to compare models.
57. What is k-fold cross-validation?
K-fold cross-validation splits the data into k parts. The model trains on k − 1 parts and tests on the last, and this repeats k times so every part is tested once. You then average the scores. Five or ten folds are common.
58. What is stratified k-fold?
Stratified k-fold keeps the class mix the same in every fold. If 5% of rows are fraud, every fold has about 5% fraud. Without it, a fold might have almost no positives, and its score would be noisy.
59. How do you validate a time series model?
Use a time-based split, where you train on the past and test on the future. Walk-forward validation, or scikit-learn’s TimeSeriesSplit, moves the cut point forward step by step. A random split leaks future data into training and makes results look too good.
60. Why build a baseline model first?
A baseline tells you if a complex model is worth it. For a classifier, the baseline might predict the most common class. For sales, it might be “same as last week”. If your neural net only beats that by 1%, the extra cost and risk may not pay off.
Overfitting, Regularization and Tuning
These questions check if you can make a model work on new data it has never seen. So expect follow-ups on how you would spot each problem.
61. What is the bias-variance trade-off?
Bias is error from a model that is too simple, so it misses the pattern. Variance is error from a model that is too sensitive to the training data, so it fits noise. Making a model more complex lowers bias but raises variance. You look for the level of complexity with the lowest total error on new data.
62. What are overfitting and underfitting?
Overfitting means the model does well on training data but badly on new data, because it learned noise. Underfitting means it does badly on both, because it is too simple. A big gap between training and validation scores points to overfitting.
63. How do you reduce overfitting?
Get more data, use fewer or better features, and add regularization. You can also simplify the model, such as limiting tree depth, and use cross-validation to tune. For neural networks, dropout, data augmentation and early stopping help too.
64. What is the difference between L1 and L2 regularization?
L1, used in Lasso, adds the sum of absolute weights to the loss. It pushes some weights to exactly zero, so it also selects features. L2, used in Ridge, adds the sum of squared weights. It shrinks all weights toward zero but rarely to zero, which helps when features are correlated.
65. What is Elastic Net?
Elastic Net mixes L1 and L2 penalties. It can drop useless features like Lasso, while keeping groups of correlated features like Ridge. You tune the total strength and the mix between the two.
66. What is early stopping?
Early stopping halts training when the validation score stops getting better for a set number of rounds. It saves time and prevents the model from fitting noise late in training. Libraries like XGBoost and neural network frameworks both support it.
67. What is the difference between parameters and hyperparameters?
Parameters are learned during training, such as the weights of a linear model. Hyperparameters, by contrast, are set before training, such as tree depth, learning rate or the number of clusters. You tune hyperparameters with validation data.
68. How do grid search, random search and Bayesian search compare?
Grid search tries every combination in a set grid, which gets slow fast. Random search samples combinations and often finds good ones sooner, since only a few settings usually matter. Bayesian search, used in tools like Optuna, learns from past trials to pick the next one, so it needs fewer runs.
69. What do learning curves show?
Learning curves plot training and validation scores as the training set grows. If both are low and close, the model underfits, so more data will not help much. If the gap is wide, the model overfits, and more data or regularization will help.
70. What is stacking?
Stacking trains several different models, then trains a final model on their predictions. The final model learns which base model to trust in which case. To avoid leakage, the base predictions for training the final model must come from out-of-fold data.
71. Why and how would you change the decision threshold?
The default 0.5 threshold assumes both errors cost the same. In fraud or medical cases, they rarely do. So you plot precision and recall against the threshold and pick the point that gives the lowest business cost, or the recall you must hit.
72. What is probability calibration?
A calibrated model’s scores match real rates. If it gives 0.7 to 100 cases, about 70 should be positive. Random forests and XGBoost models are often poorly calibrated. Platt scaling and isotonic regression fix this, and a reliability plot shows how well it worked.
Neural Networks and Deep Learning
Deep learning rounds test the core math plus a few named designs. So keep the answers simple and be ready to draw a diagram.
73. What is a neural network?
A neural network is a stack of layers of simple units. Each unit takes a weighted sum of its inputs and adds a bias. Then it passes the result through an activation function. With enough layers and data, the network can learn very complex patterns, such as faces in photos.
74. Why do neural networks need activation functions?
Without them, a stack of layers is just one big linear function, no matter how deep it is. So activation functions add non-linearity. ReLU outputs max(0, x) and is the usual default in hidden layers. Sigmoid fits binary outputs, and softmax turns scores into class probabilities.
75. How does backpropagation work?
Backpropagation finds how much each weight added to the error. It runs the input forward to get a prediction and the loss. Then it uses the chain rule to pass the error backward, layer by layer, to get every weight’s gradient. An optimizer then updates the weights.
76. What is the vanishing gradient problem?
In deep networks, gradients can shrink as they flow back through many layers, so early layers barely learn. Sigmoid and tanh make this worse, since their slopes are small at the ends. ReLU, careful weight setup, batch normalization and skip links, as in ResNet, all help.
77. What does batch normalization do?
Batch normalization rescales each layer’s inputs within a mini-batch to mean 0 and spread 1, then lets the model learn its own scale and shift. It makes training faster and less sensitive to the learning rate. At test time, it uses running averages saved during training.
78. What is dropout?
Dropout turns off a random share of units, such as 20% or 50%, at each training step. The network cannot rely on any single unit, so it learns sturdier features. At test time, all units are used. It is a simple and common way to cut overfitting.
79. How does a convolutional neural network work?
A CNN slides small filters over an image to detect local patterns, like edges in early layers and shapes in later ones. The same filter weights are reused across the image, which cuts the number of parameters. CNNs are the classic choice for image tasks.
80. What does pooling do in a CNN?
Pooling shrinks the feature maps by taking the max or the average over small windows, such as 2 × 2. As a result, it cuts compute and makes the model less sensitive to small shifts in position. Max pooling is the most common type.
81. What are RNNs and LSTMs?
An RNN reads a sequence one step at a time and carries a hidden state forward, so it can model text or time series. Plain RNNs forget long-range links because of vanishing gradients. LSTMs add input, forget and output gates that control what to keep, so they remember longer.
82. What is a transformer, and why did it replace RNNs?
A transformer is a network built on self-attention, which lets every token look at every other token at once. It came from the 2017 paper “Attention Is All You Need” by Google researchers. Since it does not read step by step, it trains in parallel on GPUs, and it handles long-range links better than RNNs.
83. What is self-attention in simple terms?
For each word, self-attention scores how much it should look at every other word in the sentence. It then builds a new version of the word as a weighted mix of the others. So in “the bank of the river”, the word “bank” pulls meaning from “river”. Multi-head attention runs several of these in parallel.
84. What are embeddings?
Embeddings are dense lists of numbers that stand for words, products or users. Similar items end up close together in that space. For example, “king” and “queen” have nearby word vectors. Models learn embeddings during training, and you can reuse them in search and recommendations.
85. What is transfer learning?
Transfer learning reuses a model trained on a big task as the starting point for your smaller task. For example, you take an image model trained on ImageNet and fine-tune the last layers on 2,000 photos of your own products. It saves time and data.
86. What does the Adam optimizer do?
Adam keeps a running average of past gradients, like momentum, and a running average of squared gradients, like RMSProp. Then it uses both to set a separate step size for each weight. It works well out of the box, which is why it is the common default for deep learning.
Language Models and Text Data
Many teams now ask at least a few NLP and LLM questions, even for general ML roles. So keep answers grounded in how you would use them.
87. What is tokenization?
Tokenization breaks text into units the model can read. Old methods split on spaces. Modern models use subword methods like byte-pair encoding, so “unhappiness” might become “un”, “happi” and “ness”. This keeps the vocabulary small and handles new words.
88. What is TF-IDF?
TF-IDF scores how important a word is in one document compared with the whole collection. Term frequency counts the word in the document. Inverse document frequency lowers the score of words that appear everywhere, like “the”. TF-IDF with logistic regression is still a quick baseline for text tasks.
89. How does word2vec learn word vectors?
Word2vec trains a small network on a fake task. Skip-gram predicts nearby words from a word, and CBOW predicts a word from its neighbors. After training, the learned weights become the word vectors. Words used in similar contexts end up with similar vectors.
90. What is a large language model?
A large language model is a transformer trained on huge amounts of text to predict the next token. With billions of parameters, it learns grammar, facts and some reasoning. After pre-training, it is usually tuned with instruction data and human feedback, so it follows requests.
91. What is retrieval-augmented generation?
RAG fetches relevant documents from your own data and adds them to the prompt before the model answers. First, documents are split into chunks, turned into embeddings and stored in a vector index. At query time, the closest chunks are pulled in. RAG cuts made-up answers and keeps facts current without retraining.
92. How do you evaluate an LLM feature?
Build a test set of real prompts with good answers or grading rules. Then score outputs with exact checks where you can, human review for a sample, and a second model as a judge with care. Track made-up facts, refusals, cost per request and latency, and test again after every prompt or model change.
Putting Models Into Production
Senior and ML engineer rounds spend real time here, because the goal is to show you know a model’s life does not end at training.
93. How do you deploy a machine learning model?
Save the trained model and its preprocessing steps together, then serve them behind an API or run them in batch jobs. Package the code in a container so it runs the same everywhere. Next, add logging, a shadow or canary release, and a quick way to roll back.
94. What is the difference between data drift and concept drift?
Data drift means the inputs change, such as more young users signing up after a campaign. Concept drift means the link between inputs and the target changes, such as fraud patterns shifting after a new scam. Both lower accuracy, so you track input stats and live performance.
95. What would you monitor for a model in production?
Watch input data quality, missing values and feature ranges. Then track the prediction mix, latency and error rates. When true labels arrive, track the real metric, such as precision. Set alerts on each, and plan retraining on a schedule or when drift crosses a limit.
96. What is a feature store?
A feature store is a shared system that computes, stores and serves features for training and live predictions. Because both use the same logic, it prevents training-serving skew. Feast is an open-source example, and cloud ML platforms offer their own.
97. What does MLOps cover?
MLOps applies DevOps habits to ML. So it covers version control for code, data and models, automated training pipelines, testing, deployment and monitoring. Tools like MLflow track experiments and models. The goal is to retrain and ship models safely and often.
98. How do you explain a model’s predictions?
For simple models, read the coefficients or the tree. For complex ones, however, SHAP values split each prediction into the push from every feature, based on Shapley values from game theory. Permutation importance and partial dependence plots show global effects. In credit and hiring, explanations are often a legal need.
99. How do you check a model for bias and fairness?
Compare error rates and outcomes across groups, such as gender or region, using metrics like equal opportunity or demographic parity. Check the training data for gaps. Then fix issues by rebalancing data, removing proxy features or adjusting thresholds per group where the law allows it, and record the trade-offs.
100. Walk me through an end-to-end ML project.
Pick one real project and tell it in order. First, define the business goal and the metric. Explain where the data came from and how you cleaned it. Describe the baseline, the model you chose and why, and how you validated it. End with deployment, the result in business terms and what you would do better.
Read also: 200 React Interview Questions With Answers
A Worked Answer to an ML Case Question
Case rounds often sound like this: “Build a model to flag fraud on card payments.” So a good answer moves step by step and names trade-offs out loud.
First, define the goal. Fraud might be 0.2% of payments, so accuracy is useless. The bank cares about money saved. So the metric is recall on fraud at a fixed false alarm rate, such as one review per 500 payments.
Next, list the data: amount, merchant type, time, device, distance from home and the card’s past behavior. Build features like “spend in the last hour against this card’s normal hour”. Then split by time, so the model never sees the future.
After that, pick a model. XGBoost or LightGBM handle mixed table features well and train fast. So they make a sensible first choice over a deep network. Use class weights for the imbalance and tune the threshold on the validation month.
Finally, cover production. Scoring must take a few milliseconds, labels arrive weeks later when customers dispute charges, and fraud patterns drift. So you monitor input drift daily and retrain monthly. Ending on these points shows you think past the notebook.
How Much Math, Code and Project Work ML Interviews Need
How much math do I need for an ML interview?
For most job roles, you need basic linear algebra, slopes and the chain rule, and probability up to Bayes’ rule. Research roles ask for more. So if you can work out the slope of the log loss by hand, you are in good shape.
Which Python tools should I know?
Know NumPy and pandas for data work, and scikit-learn for classic models. Then learn one deep learning tool, most often PyTorch. You should be able to write a train and test loop from memory. If you are still new to Python, our list of free websites to learn coding is a good place to begin.
Do I need Kaggle medals or papers?
No, but you do need one project you can talk about in depth. Pick one with real, messy data and a result you can measure. Interviewers will ask why you made each choice, so a small project you know inside out beats a big one you copied.
Can a data analyst move into machine learning?
Yes, and many do. Analysts already know SQL, metrics and the business side. So the gap is mostly Python, model theory and how to ship models. Our guide on becoming a data analyst without a degree covers the first step on that path.




















































































































