Day 34 of 133

Trad-ML pitfall drills (leakage, imbalance, calibration)

The three failure modes that show up in nearly every ML interview.

DSA · NeetCode Binary Search

  • Time Based Key Value StoreDSA · Binary Search

    Interview questions to prep

    1. State your loop invariant precisely — what must be true on every iteration?
    2. Why does the loop terminate, and how do you avoid infinite loops on the search-space update?
    3. Walk through edge cases: empty array, target smaller than min, target larger than max, duplicates.

ML · Cross-validation & evaluation

  • Interview questions to prep

    1. When does k-fold leak data, and what does TimeSeriesSplit do differently?
    2. Why is stratified k-fold important for imbalanced classification?
  • Train/val/test split & nested CVTraditional MLStatQuest

    Interview questions to prep

    1. Why do you need both a validation and a test set for hyperparameter tuning?
    2. What is nested cross-validation and when is it worth the cost?
    3. How would your split strategy change for time-series forecasting vs random tabular rows?
  • Interview questions to prep

    1. Walk through three common ways data leakage sneaks into an ML pipeline.
    2. How would you build a pipeline that prevents leakage when scaling features?

ML · Imbalanced classification

  • Resampling, class weights, SMOTETraditional MLimbalanced-learn

    Interview questions to prep

    1. Compare random oversampling, undersampling, SMOTE, and class weighting — when does each help?
    2. Why can SMOTE leak when applied before cross-validation?
  • Focal loss & cost-sensitive learningTraditional MLLin et al.

    Interview questions to prep

    1. Why does focal loss help with extreme imbalance in object detection?
    2. Compare focal loss vs class-weighted cross-entropy — when does focal actually win?
  • Interview questions to prep

    1. Why is accuracy a terrible metric for imbalanced classification?
    2. When do you reach for F1, F-beta, MCC, or PR-AUC?

References & further reading