KatInterview

Ranking Sponsored Posts in a Feed: Objective, Features, Evaluation

Machine LearningModel answer
MediumModel answerMachine Learningads-rankingcalibrationfeature-engineering

Last updated

Design a sponsored-post ranking system for a social feed: define the objective, choose features, evaluate offline, and monitor in production under a tight latency limit.

Scenario

You work on the data and modeling team of a social network. Your team owns the system that chooses which sponsored posts appear in each user's feed. The business wants to grow ad revenue without making the product worse for the people using it.

What to cover

  1. Objective. Specify what the ranker optimizes. Explain how you trade off advertiser revenue against user-experience signals such as clicks, engagement, hides, and reports.
  2. Features. Propose user-side, ad-side, and context features that predict ad performance. Say how you handle brand-new ads and brand-new users.
  3. Offline evaluation. Describe how you would validate a candidate model using historical data before it reaches users, and how you would connect those results to an online experiment.
  4. Production monitoring. Describe how you would detect performance degradation, data problems, and unfair or biased delivery once the model is live.

Constraints

  • Ranked results must be returned in under 100 ms.
  • You have historical logs of impressions, clicks, and conversion events.
  • Focus on reasoning and trade-offs, not on implementation code.

Hints

Hint 1

Rank by a single value expressed in money: expected advertiser value (bid times predicted action probabilities) plus a priced term for user experience, such as a penalty for hides. Ask what makes the probabilities safe to multiply.

Hint 2

The 100 ms limit rules out running a heavy model over every ad. Think in stages: cheap retrieval and filtering first, then progressively more expensive rankers on fewer candidates.

Hint 3

For evaluation, split by time rather than randomly, look at calibration as well as ranking quality, slice results by segment, and treat an online A/B test with guardrail metrics as the final judge.