Day 18 of 133

Cross-validation & data leakage + DSA Binary Search

k-fold, stratified, time-series CV, nested CV, leak prevention.

DSA · NeetCode Binary Search

  • Binary SearchDSA · Binary Search

    Interview questions to prep

    1. What's your binary-search template (left ≤ right, left < right) and which one are you using and why?
    2. Walk through the bug-prone bits: mid calculation overflow, off-by-one on bounds.
  • Search A 2d MatrixDSA · 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.
  • Koko Eating BananasDSA · 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?

References & further reading