KatInterview

Designing a Sponsored Product Ranking System for Search

Machine LearningModel answer
HardModel answerMachine Learningads rankingrecommendation systemsmulti-task learning

Last updated

Design an end-to-end ML pipeline that selects and ranks paid listings in e-commerce search results, balancing advertiser value, user relevance, and platform revenue.

Background

You work on the monetization team at a large e-commerce marketplace. Every time a shopper runs a search, the platform needs to decide which sponsored listings to show, how to order them, and how much to charge the advertisers. Done well, this drives revenue while keeping the shopping experience useful. Done poorly, it annoys users and trains advertisers to waste their budgets.

Your Task

Walk through a high-level design for this sponsored listing ranking system. Cover each of the following areas in your answer:

  1. Utility and Objective Formulation How do you define what makes a single ad slot "good"? The platform cares about revenue, the shopper cares about relevance, and the advertiser cares about return on spend. Describe a scoring formula that balances these three, and explain the auction mechanism you would use to translate scores into prices.

  2. ML Model Architecture What model structure would you use to predict click-through rate (CTR) and conversion rate (CVR) for a given (user, query, ad) triple? Describe the features, network design, and how you would handle the fact that conversions are only observable for ads that were clicked.

  3. Retrieval and Multi-Stage Ranking With tens of millions of active ads and a strict latency budget, you cannot score every candidate with a heavy model. Describe the funnel you would use to go from the full ad inventory down to the handful of slots on the results page.

  4. Position Bias Ads shown in the top slot receive more clicks simply because of their position, not because they are more relevant. Explain why this poisons your training data and describe at least one concrete technique to correct for it.

  5. Experimentation and Launch Criteria How would you evaluate a new model version offline, and what would a safe online rollout look like? Call out any experiment design risks specific to an ads marketplace.

There is no single correct answer. Interviewers evaluate whether you can reason coherently across the full pipeline and whether you understand the parts that are unique to ads systems: calibrated probabilistic predictions, auction mechanics, and biased logged feedback.

Hints

Hint 1

Start by writing out the scoring formula explicitly: score = bid × predicted probability (plus any relevance term). This forces you to separate the prediction problem (what is pCTR/pCVR?) from the optimization problem (how does the auction use those predictions?), which is the central distinction in ads ranking.

Hint 2

Conversions are only logged for items a user clicked. If you train a CVR model only on clicks, it sees a biased subset of impressions and learns the wrong thing. Look up ESMM (Entire Space Multi-task Model) or think about how to reformulate the target so you can train on all impressions instead of just clicked ones.

Hint 3

Position bias creates a feedback loop: high-slot ads get more clicks, the model thinks they are better, so they keep winning the top slot. The PAL (Position-Aware Learning) approach handles this by adding a shallow 'examination' tower trained on position, then dropping it at serving time so scores reflect quality alone, not position.