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.

Google
Machine Learning
Machine Learning Engineer
Google
November 29, 2026
Machine Learning Engineer
Onsite
Machine Learning
Medium

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
Watch time prediction
Weighted logistic regression
Odds
Ranking objectives
YouTube
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. 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 Prep
Sample Answer
Clarify

Confirm that each training example is an impression, positives are clicked impressions with watch time TiT_i, 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....


Submit Your Answer
Markdown supported