Senior interview questionAsked at Snap · interview write-up
In your recommendation project, did you use embeddings, what counted as a positive label, and how did you retrain without exposure bias or leakage?
Model answer
Yes: a two-tower model with user and item embeddings, trained with in-batch negatives. A positive should mean value: a click with real dwell time or a save, never a bare impression.
Retrain on a time-based split, computing features only from data before each label's timestamp, so nothing leaks from the future. Exposure bias: the logs only hold what the old model chose to show, so keep a small exploration slice of randomised items, correct for popularity in sampled negatives, and weight by inverse propensity. Validate on the following day, then A/B test.
Practise the rest
17 Embeddings questions, 492 in all, each with a model answer. Free.
More from Snap interview questions.
More Embeddings interview questions
- What is an embedding table, and what does it mean for two embeddings to be similar?
- People say 'embedding' for three different things. What are they, and why does the difference matter?
- Your vector database only supports dot-product search, but your embedding model's documentation says to compare vectors with cosine similarity. What do you do, and why does it work?
- You're building search over medicine leaflets with a small English embedding model, and you plan to reply 'no answer found' whenever the top cosine score is below 0.5. What risks do you raise before this ships?
- Your team switches to a newer embedding model with the same 384 dimensions and starts embedding incoming queries with it. Search quality collapses, but nothing errors. Explain what happened and how you'd run the migration.
- Embedding models return 1,536 or 3,072 numbers per text. What do those sizes mean?