Learning to Rank Search Results From Position Biased Clicks

Last updated: November 29, 2026

Quick Overview

Flipkart wants to train its product search ranking model from click and purchase logs. Users click top results more just because they are on top. How would you train and evaluate a ranker that corrects for this position bias?

Flipkart
Machine Learning
Machine Learning Engineer
Flipkart
November 29, 2026
Machine Learning Engineer
Onsite
Machine Learning
Hard

0

0

0 solved


Flipkart wants to train its product search ranking model from click and purchase logs. Users click top results more just because they are on top. How would you train and evaluate a ranker that corrects for this position bias?

Search ranking is one of Flipkart's core ML problems, and logged clicks are heavily shaped by the current ranker and position. Onsite ML rounds use this to test unbiased learning to rank: propensity estimation, inverse propensity weighting, choice of labels and offline metrics like NDCG.

What the Interviewer Expects
  • Explain position bias and the examination hypothesis
  • Estimate position propensities using randomization or interleaving data
  • Apply inverse propensity weighting to the loss
  • Choose labels, for example graded relevance from click, add to cart and purchase
  • Pick ranking losses (pairwise or listwise) and metrics like NDCG@k
  • Validate with online interleaving or A/B tests
Key Topics to Cover
learning to rank
position bias
inverse propensity weighting
NDCG
click models
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
  • How would you estimate propensities without hurting the user experience much?
  • IPS weights at low positions can explode; what do you do?
  • How do sponsored listings complicate the training data?
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
  • Data: query, shown list with positions, clicks, add to cart, purchase.
  • Goal: rank by true relevance and purchase likelihood, not by past position.
  • Metric: purchase weighted NDCG@10 offline, conv...
Approach

Under the examination hypothesis, a click happens if the user examines the position and finds the item relevant: P(c=1∣q,d,k)=θk⋅P(r=1∣q,d)P(c=1 \mid q, d, k) = \theta_k \cdot P(r=1 \mid q, d), where θk\theta_k is the ex...


Submit Your Answer
Markdown supported