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. Fit a line to the points (1,2), (2,4), (3,5) and compute R squared.

    Slope = 1.5, intercept = 0.667, so y = 0.667 + 1.5x. R squared = 1 - 0.1667/4.6667, about 0.964: the line explains about 96% of the variation in y.

    IntermediateQuick answer1 min read
  2. What are the main assumptions of linear regression?

    Linearity between features and target, independent errors, constant error variance (homoscedasticity), roughly normal errors (needed mainly for confidence intervals), and no severe multicollinearity among features.

    IntermediateQuick answer1 min read
  3. What is multicollinearity, and how do you detect and fix it?

    Multicollinearity means two or more features are strongly correlated, so a linear model cannot tell their effects apart and coefficients become unstable. Detect it with a correlation matrix or VIF above about 5-10. Fix it by dropping or combining features, PCA, or ridge regression.

    IntermediateQuick answer1 min read