Senior interview questionAsked at Snap · interview write-up
A model predicts several engagement outcomes, some of which follow a conditional funnel. How do you represent the labels and choose the loss?
Model answer
Outcomes aren't exclusive, so give each its own binary head on a shared trunk with sigmoid cross-entropy, not one softmax.
For a funnel like impression, click, purchase, model the chain: p(click) times p(purchase given click) equals p(click and purchase). Supervise p(click) and the product on all impressions, as ESMM does, so the conditional head is learned over the whole space instead of only clicked items, avoiding sample-selection bias. Weight the task losses, watch for one task dominating the shared gradients, and check each head's calibration.
Practise the rest
35 Training questions, 492 in all, each with a model answer. Free.
More from Snap interview questions.
More Training interview questions
- Implement masked cross-entropy in NumPy that stays numerically stable, with label smoothing and a temperature.
- Build a pipeline that finds math documents in web crawls and scores their quality.
- Explain KL divergence for language models: which direction is which, what happens when supports don't match, and how it's used as a regulariser.
- When would you use mean squared error versus cross-entropy? And what is LoRA?
- Explain Adam and its bias correction, and why AdamW decouples weight decay.
- Explain policy types in RL and modern policy-gradient methods such as TRPO, PPO and GAE, then compare linear attention and grouped-query attention.