PrepPilotPractise free

ML Fundamentals interview questions

Supervised/unsupervised, bias-variance, evaluation, features

17 questions · fit() · updated November 2026

Practise these as flashcards. One or two lines each; the ones you miss come back first.

Start free

Core questions

What is the difference between supervised and unsupervised learning?

Supervised learning uses labeled data to train models to predict outcomes, like classifying emails as spam or not. Unsupervised learning finds patterns or groups in data without labels, such as clustering customers by behavior.

Why do we split data into train, validation, and test sets?

We split data to train the model, tune hyperparameters, and evaluate final performance on unseen data. This helps prevent overfitting and gives a realistic estimate of how the model will perform in production.

What is overfitting?

Overfitting happens when a model learns noise or details specific to the training data, performing well on it but poorly on new, unseen data. It's often caused by models that are too complex for the dataset.

What is accuracy, and when might it be misleading?

Accuracy is the proportion of correct predictions out of all predictions. It can be misleading in imbalanced datasets, where a model could predict only the majority class and still achieve high accuracy.

Intermediate questions

Explain the bias-variance trade-off.

The bias-variance trade-off describes how models with high bias are too simple and underfit, while high variance models are too complex and overfit. The goal is to find a balance where the model generalizes well to new data.

How does regularization help prevent overfitting?

Regularization adds a penalty to the loss function for large weights or complex models, discouraging the model from fitting noise in the training data. L1 (lasso) and L2 (ridge) are common regularization techniques.

What is cross-validation and why is it useful?

Cross-validation, such as k-fold, splits the data into several folds and rotates the validation set, providing a more robust estimate of model performance. It helps ensure the model's results are not dependent on a particular train-test split.

When would you use precision and recall instead of accuracy?

Precision and recall are preferred when classes are imbalanced or when the cost of false positives and false negatives differs. For example, in medical diagnosis, missing a disease (low recall) is more serious than a false alarm.

How do you handle class imbalance in a classification problem?

I can use techniques like resampling (oversampling the minority or undersampling the majority class), adjusting class weights, or using metrics like F1-score or ROC-AUC that are less sensitive to imbalance.

What is feature scaling, and why is it important?

Feature scaling transforms features to a similar range, such as zero mean and unit variance. It's important for models like SVMs, k-NN, or neural networks, which are sensitive to the scale of input features.

What is data leakage and how can you prevent it?

Data leakage occurs when information from outside the training set is used to create the model, leading to overly optimistic performance. To prevent it, I ensure that feature engineering and scaling are done only on training data and applied to validation/test sets separately.

What is ROC-AUC and when is it useful?

ROC-AUC measures the area under the ROC curve, which plots true positive rate against false positive rate at various thresholds. It's useful for evaluating classifiers on imbalanced datasets, as it considers all possible thresholds.

Senior questions

Compare random forests and gradient boosting machines.

See the answer in the app, free

How would you design a pipeline to prevent data leakage when using cross-validation?

See the answer in the app, free

How do you select evaluation metrics for a new business problem?

See the answer in the app, free

What are some common pitfalls in feature engineering for tree-based models?

See the answer in the app, free

How do you debug a neural network that is not learning?

See the answer in the app, free

More Machine Learning & AI topics