Predict Expected Watch Time With Weighted Logistic Regression
Last updated: November 29, 2026
Quick Overview
YouTube wants to rank videos by expected watch time per impression but trains with a logistic output. Explain how weighting positive examples by watch time makes the learned odds approximate expected watch time, and the assumptions behind it.
0
0
0 solved
YouTube wants to rank videos by expected watch time per impression but trains with a logistic output. Explain how weighting positive examples by watch time makes the learned odds approximate expected watch time, and the assumptions behind it.
YouTube's deep ranking work popularized this trick for turning a classification head into a watch-time estimator. The interviewer checks that you can derive why the odds equal expected watch time and spot when the approximation breaks.
What the Interviewer Expects
- Set up the training: clicked impressions weighted by watch time, unclicked impressions weight 1
- Derive that learned odds approximate $E[T](1+P)$, close to $E[T]$ when click probability is small
- Explain why ranking by $e^{z}$ ranks by expected watch time
- Discuss the small-probability assumption and when it fails
- Compare with direct regression and discuss heavy-tailed watch times
Key Topics to Cover
How to Approach This
- Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
- Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
- Feature engineering is often more impactful than model selection.
- Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
- Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
- What goes wrong for surfaces where click-through rate is high, like autoplay?
- How would you prevent very long videos from dominating the ranking?
- Why not just regress on watch time with squared error?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Explore ML Interview PrepSample Answer
Clarify
Confirm that each training example is an impression, positives are clicked impressions with watch time , negatives are unclicked impressions, and serving ranks candidates by a single score....
Approach
Work out what odds the weighted classifier learns, then check the assumptions....