SkillLynk Skill Lynk connect skills with opportunities
Menu
Interview Questions

Machine Learning Interview Questions and Answers

ML interviews test both conceptual understanding (bias-variance, evaluation metrics) and judgment -- knowing which metric or model actually fits a given real-world problem.

Example: Why accuracy alone can be misleading

A fraud-detection model that predicts "not fraud" for every single transaction achieves 99.5% accuracy on a dataset where only 0.5% of transactions are actually fraudulent -- because accuracy just measures overall correctness, and the classes are wildly imbalanced. That model is useless despite the impressive-looking accuracy number, which is exactly why precision, recall, and F1 score exist as complementary metrics.

Frequently Asked Questions

Bias is error from a model being too simple to capture real patterns in the data (underfitting). Variance is error from a model being too sensitive to the specific training data, including its noise (overfitting). Reducing one often increases the other -- the practical goal is finding the right model complexity for your data, not minimizing either one to zero.
Precision answers "of everything the model flagged as positive, how much was actually positive" (minimizing false positives matters). Recall answers "of everything that was actually positive, how much did the model catch" (minimizing false negatives matters). Which one to prioritize depends on the cost of each type of error -- missing a real fraud case (low recall) vs. flagging a legitimate transaction as fraud (low precision) have very different real-world costs.
K-fold cross-validation splits the data into K parts, trains on K-1 of them and validates on the remaining one, and repeats this K times with a different part held out each time, then averages the results. It gives a more reliable estimate of how a model will perform on unseen data than a single train/test split, which can be unusually lucky or unlucky depending on which specific rows happened to land in the test set.
Classification predicts a discrete category (spam/not-spam, which of 5 product categories). Regression predicts a continuous numeric value (a house price, tomorrow's temperature). The choice of algorithm, evaluation metric, and how you frame the problem all follow from which of these two you're actually solving.
Transforming raw data into features that better represent the underlying pattern for a model to learn from -- e.g. extracting "day of week" from a raw timestamp, since a model can't easily infer that relationship from the raw number alone. Even with powerful modern algorithms, good feature engineering often has a bigger impact on real-world model performance than switching algorithms.
A technique that adds a penalty for model complexity during training, discouraging the model from fitting the training data too closely and helping it generalize better -- L1 (Lasso) and L2 (Ridge) regularization are common examples for linear models, and dropout serves a similar purpose in neural networks.
It depends on the data size, whether interpretability matters (a decision tree is far easier to explain to a stakeholder than a neural network), how much labeled data is available, and the specific tradeoffs of the problem. In practice, most practitioners start with a simple, fast, interpretable baseline model, and only reach for something more complex if it demonstrably outperforms that baseline by enough to justify the added complexity.

Related Guides

Sign in required

Sign in