
Supervised Learning
Classification, regression, evaluation and the classic bias-variance interview questions.
Introduction
Supervised learning is the workhorse of applied machine learning: you have labeled examples (X, y) and want a model that predicts y from X. The core interview themes are (1) the bias-variance tradeoff, (2) choosing the right metric — accuracy is rarely what you actually want, (3) handling messy data (imbalance, leakage, scaling), and (4) knowing when to reach for a linear model, a tree ensemble, or a neural network.
This chapter walks through the interview-ready essentials, from evaluation to model choice. Read it top to bottom the first time, then use the Interview mode to test your recall and the Quiz to check yourself.
The 18 sections
Each section is a short read on one subject, with every answer written out. Work through them in order, or jump to the one you are weakest on.
- 01Fundamentals & theoryWhat is the bias-variance tradeoff?39 questions9 easy26 medium4 hard
- 02Linear & regularized regressionL1 vs L2 regularization — what's the difference?35 questions8 easy18 medium9 hard
- 03Logistic regression & classification basicsPrecision vs recall — when do you optimize each?29 questions8 easy18 medium3 hard
- 04Naive Bayes, LDA & KNNWhy is Naive Bayes still a solid baseline for text classification?8 questions3 easy4 medium1 hard
- 05Decision trees & random forestsRandom forest vs gradient boosting — which do you pick and why?13 questions2 easy10 medium1 hard
- 06Gradient boostingIn one sentence, what is Gradient Boosting?12 questions1 easy7 medium4 hard
- 07SVMs & kernelsWhy do SVMs use kernels?5 questions1 easy4 medium
- 08Ensembling & stackingHow does stacking work and when does it help?3 questions1 easy1 medium1 hard
- 09Classification metricsWhen should you use PR-AUC instead of ROC-AUC?6 questions6 medium
- 10Regression metricsRMSE vs MAE — how do you pick?6 questions1 easy3 medium2 hard
- 11Cross-validation & data splittingLeave-One-Out CV — when is it a good idea, and when is it a bad idea?10 questions2 easy5 medium3 hard
- 12Feature engineering & encodingWhich models need feature scaling and which don't?19 questions7 easy9 medium3 hard
- 13Feature selectionHow does Recursive Feature Elimination (RFE) work?6 questions1 easy5 medium
- 14Imbalanced dataHow do you handle class imbalance in a dataset?5 questions1 easy2 medium2 hard
- 15Missing data & outliersMCAR, MAR, MNAR — what are these and why do they matter?3 questions2 medium1 hard
- 16Hyperparameter tuningGrid search vs random search for hyperparameter tuning — which do you use?5 questions1 easy4 hard
- 17Pipelines & leakageWhy should preprocessing live inside a scikit-learn Pipeline rather than being applied manually before?8 questions1 easy4 medium3 hard
- 18Interview scenariosName three situations where you should NOT reach for machine learning.3 questions2 medium1 hard