Day 6 of 133

Sampling, bias, resampling — and pattern review

Random/stratified/cluster/importance sampling. Selection/survivorship bias.

DSA · NeetCode Sliding Window

  • Best Time TO Buy And Sell StockDSA · Sliding Window

    Interview questions to prep

    1. Walk through the one-pass min-so-far trick. Why is it correct?
    2. What if you can buy and sell unlimited times? What about with a cooldown or fee?
  • Interview questions to prep

    1. Why is this a sliding window? What's the invariant inside the window?
    2. What if the alphabet is huge (Unicode) vs tiny (ASCII)? Does that change your data structure?

Math · Sampling & survey design

  • Interview questions to prep

    1. Compare simple random sampling vs stratified sampling — when does stratification reduce variance?
    2. What is importance sampling and where does it show up in ML?
  • Interview questions to prep

    1. Give an example where selection bias silently broke a model deployment.
    2. What is survivorship bias and where does it hurt model evaluation?
  • Interview questions to prep

    1. What's the difference between bootstrapping for uncertainty vs resampling for imbalance?
    2. When does oversampling the minority class help and when does it leak?

References & further reading