Classical Machine LearningFoundational18 min read5 questions

Machine Learning Fundamentals: The Screening Round

The five questions that open almost every ML interview. Answer them with diagnostics and trade-offs instead of definitions and you clear the screen in ten minutes.

Covers: Supervised vs unsupervised, overfitting, train/val/test splits, cross-validation, data leakage, learning curves

These questions look easy, which is exactly why they filter so many candidates out. Everyone can define overfitting. Very few can say how they detected it last time, what they tried first, and why. The gap between those two answers is the gap between a rejection and an onsite.

Filter
0/5 mastered
FoundationaltaxonomyllmpretrainingAsked at Most ML screens, OpenAI

30-second answer

Supervised learns from labelled pairs; unsupervised finds structure with no labels; self-supervised manufactures labels from the data itself (predict the next token, the masked patch); RL learns from a reward signal through interaction. LLMs use all three in sequence: self-supervised pre-training, supervised fine-tuning on instruction pairs, then RL from human feedback.

FoundationaloverfittingregularizationdiagnosticsAsked at Amazon, Meta

30-second answer

That gap is textbook overfitting, but before touching the model I check for leakage or a distribution mismatch between the splits, because both fake this signature. Then, in order of expected value: more or augmented data, stronger regularisation, early stopping, a smaller model, and ensembling. I plot learning curves to decide whether more data will actually help.

Advancedcross-validationleakagetime-seriesAsked at Two Sigma, Capital One

30-second answer

Plain k-fold assumes rows are i.i.d. and exchangeable. It is wrong for time series (it trains on the future), grouped data such as multiple rows per patient or user (the same entity appears in train and val), and heavily imbalanced targets. Use time-based/rolling splits, GroupKFold, and StratifiedKFold respectively โ€” and nest CV when you are also tuning hyperparameters.

AdvancedleakagefeaturesproductionAsked at Capital One, Stripe

30-second answer

Leakage is any information in training that will not be available at prediction time. The main types are target leakage (a feature computed from the label or after the event), train/test contamination (preprocessing fitted on the full dataset, or duplicate rows), and temporal leakage (using future information). Detect it with suspiciously high scores, feature-importance outliers, a time-based holdout, and a strict point-in-time feature store.

Intermediatemodelingnaive-bayesgenerativeAsked at Microsoft, Adobe

30-second answer

Discriminative models learn P(y|x) โ€” the decision boundary directly. Generative models learn P(x, y) or P(x), so they can sample new data and can be inverted to classify via Bayes. Discriminative usually wins on pure classification accuracy given enough data; generative wins with scarce data, when you need to sample, handle missing features, or detect out-of-distribution inputs.

Showing 5 of 5 questions for machine-learning-fundamentals-interview.

Check your understanding

5 questions ยท no sign-up, nothing stored

0/5 answered
Question 1

1.Next-token prediction on raw web text is best described as:

Question 2

2.Training accuracy 0.98, validation 0.71, and the validation curve is still rising with more data. Best next action?

Question 3

3.You have 5 hospital visits per patient. Using plain KFold on the rows will:

Question 4

4.Adversarial validation returns an AUC of 0.93 between your train and test sets. This means:

Question 5

5.With only 50 labelled examples, which is more likely to perform better?

Hands-on challenge

Build it โ€” this is what you talk about in a deep-dive round.

Build a leakage-proof evaluation harness

Given a dataset with user ids, timestamps and a forward-looking label, build an evaluation pipeline that cannot leak.

Requirements

  • A `Pipeline` where every transformer (scaler, imputer, target encoder) is fitted inside the CV fold.
  • A splitter that is simultaneously time-ordered and group-aware, with a configurable purge gap.
  • An automated leakage report: single-feature AUC screen, cross-split entity overlap, adversarial validation AUC.
  • Learning curves that state explicitly whether more data or less capacity is the recommended action.

Stretch goals

  • Add nested CV and quantify the optimism of the naive tuned-CV estimate.
  • Add near-duplicate detection with MinHash or embedding cosine similarity across splits.