Interview Q&A / Machine Learning

INTERVIEW Q&A · 55 QUESTIONS

Machine Learning interview questions

Supervised vs unsupervised learning, overfitting, metrics and the classic models, explained simply.

  1. How do you handle missing values in a dataset?

    First understand why values are missing. Then drop rows or columns if few are affected, or impute with mean, median, mode, a constant, or a model-based estimate. Adding a 'was missing' flag often helps. Fit the imputer on training data only.

    BeginnerQuick answer1 min read
  2. Why do we scale features, and which algorithms need it?

    Scaling puts features on comparable ranges. Distance-based and gradient-based models (KNN, SVM, k-means, PCA, neural networks, regularised regression) need it. Tree-based models do not.

    BeginnerQuick answer1 min read
  3. How can scaling or imputing before the train-test split cause data leakage?

    If you compute the mean or maximum on the full dataset, information from test rows leaks into training. Always fit scalers and imputers on the training set only, then apply them to the test set. A scikit-learn Pipeline does this automatically.

    IntermediateQuick answer1 min read