KatInterview

Build a Conversion Prediction System for Programmatic Ad Auctions

Machine LearningModel answer
MediumModel answerMachine Learningmachine-learningclassificationimbalanced-data

Last updated

Design an ML pipeline to forecast user conversion probability in real-time programmatic advertising, covering labeling, features, modeling, and production deployment.

You're building a machine learning system for a platform that purchases digital advertising inventory through automated auctions. When an advertising opportunity becomes available, your platform has milliseconds to decide whether to participate in the auction, determine a competitive price, and select which advertisement to display.

Your task is to design a system that predicts the probability a user will complete a desired action (like purchasing a product) after seeing an ad. You have access to historical logs containing:

  • Auction participation records: timestamps, user and device characteristics, website or app information, geographic data, auction details, your submitted prices, and whether you won
  • Engagement events: records of users clicking advertisements (infrequent)
  • Action completions: records of users completing desired actions like purchases (very rare)

Design your approach addressing these aspects:

  1. Auction mechanics: Describe how automated ad purchasing works. What entities participate, and what decisions must your platform make within the time limit?

  2. Prediction target: Define exactly what you're predicting. What time window will you use? How do you assign credit when multiple ads might have influenced a user? How do you handle the fact that recent data hasn't had time to show results yet?

  3. Input signals: What information can you use to make predictions? Organize your features into categories and identify potential data leakage risks.

  4. Algorithm selection: Compare simpler linear models against tree-based ensemble methods for this use case. What are the practical tradeoffs?

  5. Training objective: What mathematical function should guide learning? Why is this choice important for a system that determines auction prices?

  6. Handling rarity: Desired actions occur in perhaps 0.01-0.1% of cases. How do you train effectively with such extreme imbalance? How do your choices affect probability estimates?

  7. Performance measurement: How do you evaluate your system both offline and in production? Which metrics matter most and why?

  8. Error consequences: In this business context, what's worse: overestimating or underestimating conversion probability? How would you choose an operating threshold?

  9. Scalability and deployment: Discuss the engineering challenges of training and serving predictions at scale. How would you deploy changes safely?

  10. Model reliability: What causes models to perform poorly in production, and how do you prevent or detect these issues?

Provide a complete system design with clear reasoning and tradeoffs.

Hints

Hint 1

Start by thinking about what happens in the milliseconds between a user loading a page and an ad appearing - who decides what, and when?

Hint 2

The choice of attribution window directly affects your training labels and how stale your training data must be.

Hint 3

Consider which features exist at decision time versus which only become available after you've already made your choice.

Hint 4

Calibrated probabilities matter more than ranking when your bid price is directly proportional to your prediction.