Design an Advertising or Recommendation Model End to End
Company: Snapchat
Role: Machine Learning Engineer
Category: ML System Design
Difficulty: hard
Interview Round: Onsite
Design an advertising or recommendation model end to end, then defend the data, features, sampling, model, loss, tuning, and evaluation choices. Begin by choosing one concrete prediction and ranking objective for the discussion.
### Constraints & Assumptions
- The report describes an open-ended ad/recommendation case without a specific product or scale. State the chosen case as a model-answer assumption.
- Keep eligibility rules and the candidate supply separate from model ranking unless the interviewer expands the scope.
- Explain metric definitions and their trade-offs, including which online outcome validates the offline model.
### Clarifying Questions to Ask
- What action or user value should the ranking improve, and what guardrails constrain it?
- Which candidates and user/context features are available at serving time?
- Are labels delayed, selectively observed, or affected by the previous ranking policy?
### What a Strong Answer Covers
- Timestamp-correct examples, labels, negative sampling, and leakage checks.
- User, item, context, and interaction features with cold-start behavior.
- A justified baseline, model inputs/outputs, loss, and tuning process.
- Precise evaluation metrics and why a single aggregate metric is insufficient.
- Online serving, controlled experiments, monitoring, and debugging.
```hint Tie every metric to a decision
AUC, log loss, ranking quality, and product outcomes answer different questions. State which failure each metric would detect and which it could miss.
```
### Follow-up Questions
- What changes if negative sampling improves training cost but distorts predicted probabilities?
- How would you investigate an offline improvement that fails in an online experiment?
Overview: Design a recommendation model from labels and sampling through features, loss, ranking metrics, online experiments, and production debugging.
Read the full Snapchat Machine Learning Engineer interview experience this question came from