Prevent Label Leakage From Click Count Features in a Ranking Model
Last updated: November 29, 2026
Quick Overview
A Search ranking model uses features like a document's historical click-through rate, and offline NDCG looks excellent but the launch is flat. Explain how count features can leak labels and how to compute them safely.
0
0
0 solved
A Search ranking model uses features like a document's historical click-through rate, and offline NDCG looks excellent but the launch is flat. Explain how count features can leak labels and how to compute them safely.
Google ranking models rely heavily on aggregated behavioral features, and computing them over the wrong time window is a common source of inflated offline wins. The interviewer wants you to find the leak, explain the overfitting it causes, and design point-in-time correct features.
What the Interviewer Expects
- Explain how including the current example's click in its own CTR feature leaks the label
- Explain temporal leakage: features computed over a window that overlaps or follows the label time
- Propose point-in-time joins: features computed only from data strictly before the event
- Address leakage through training data reuse, e.g. out-of-fold counts
- Mention smoothing for low-count documents and train-serve consistency
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
- How would you detect this kind of leakage without knowing where to look?
- What latency of feature updates does serving have, and how should training mimic it?
- How do you handle documents with only a few impressions?
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
Ask how the CTR feature is computed (window, refresh cadence), how training examples are timestamped, and whether the same impressions that become training labels are counted in the feature....
Approach
Find the overlap between the label and the feature, explain the overfit it creates, then design features that match what serving would have known....