Day 105 of 133
RecSys foundations + two-tower + ranking + sequential
MF, two-tower, MMoE/PLE, position bias (PAL), SASRec / BERT4Rec.
DSA · NeetCode Heap / Priority Queue
- Last Stone WeightDSA · Heap / Priority Queue
Interview questions to prep
- Why is a heap the right structure? Could a balanced BST or sorted list work — why is heap better?
- Explain the heap-of-k pattern: keep size k, push new, pop if over k. What's the resulting complexity?
- What does the comparator look like, and how would you tweak it to flip min/max behaviour?
Specialization · RecSys foundations
Interview questions to prep
- Walk through matrix factorization for recommendations and how SGD trains it.
- What's the cold-start problem in CF and how do hybrid models fix it?
Interview questions to prep
- How did Restricted Boltzmann Machines model user-item interactions in early recommender systems?
- When would matrix factorization or two-tower retrieval beat an RBM-style recommender today?
- How do similarity metrics and bias terms change nearest-neighbor or collaborative-filtering recommendations?
Interview questions to prep
- Compare content-based vs collaborative filtering — when does each fail?
- How would you blend content and CF signals — what's the failure mode of naive averaging?
Interview questions to prep
- Compare nDCG, MAP, MRR, and Recall@k — when do you use each?
- Why do offline metrics often disagree with online A/B test results in recsys?
Specialization · Two-tower retrieval
Interview questions to prep
- Walk through the YouTube two-tower paper — what does sampling-bias correction fix?
- Why is in-batch negative sampling biased, and how do you correct for it?
Interview questions to prep
- How would you serve a billion-item two-tower retrieval system at sub-50ms?
- How do you keep the item embedding index fresh as new items are added every minute?
Interview questions to prep
- How would you incorporate item freshness without hurting long-term relevance?
- What's the right way to encode time-of-day and day-of-week signals in a recsys?
Specialization · Ranking & multi-task
Interview questions to prep
- Walk through MMoE — how does it handle conflicting tasks?
- Compare MMoE vs PLE — what does PLE fix?
Interview questions to prep
- What is position bias in CTR ranking, and how does PAL correct for it?
- How would you measure how much position bias is contaminating your training labels?
Interview questions to prep
- Why is calibration important even when only ranking matters?
- Compare Platt scaling, isotonic regression, and temperature scaling — when does each fit?
Specialization · Sequential & LLM-based recsys
Interview questions to prep
- Compare SASRec and BERT4Rec — when does each win?
- What is causal masking in sequential recsys and why does it matter for next-item prediction?
Interview questions to prep
- What's the case for and against using LLMs directly for recommendation?
- How would you serve an LLM-based recsys at billion-user scale without exploding cost?
Interview questions to prep
- Walk through off-policy evaluation for a recsys without rolling out a new model.
- How would you account for selection bias when training on logged user clicks?
References & further reading
- YouTube two-tower (sampling-bias-corrected) ↗Google
- Restricted Boltzmann Machines for Collaborative Filtering ↗University of Toronto
- YouTube multi-task ranking ↗Google
- Eugene Yan — applied ML writing ↗Eugene Yan