Design Embedding-Based Retrieval for Facebook Groups Search
Last updated: November 29, 2026
Quick Overview
Keyword matching misses relevant Facebook Groups when users phrase queries differently from group names. Design an embedding-based retrieval system that finds semantically relevant groups and combines it with keyword retrieval.
Meta
November 29, 20260
0
0 solved
Keyword matching misses relevant Facebook Groups when users phrase queries differently from group names. Design an embedding-based retrieval system that finds semantically relevant groups and combines it with keyword retrieval.
Meta has invested heavily in embedding-based retrieval for social search, and this prompt checks whether a candidate understands two-tower training, hard negatives, ANN serving and the hybrid with term matching. The interviewer wants practical detail on training data and how to blend the two retrieval paths.
What the Interviewer Expects
- Trains a two-tower model with query and group towers on search click data
- Uses hard negative mining to improve precision
- Serves group embeddings from an ANN index with filters like privacy and language
- Blends semantic and keyword candidates before ranking
- Evaluates with recall at K on a held-out set and online tests
Key Topics to Cover
How to Approach This
- Start by mapping the business objective to a concrete ML objective and metric.
- Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
- Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
- Address the serving latency budget and whether batch or real-time inference is needed.
- Think about the data flywheel: how user feedback improves the model over time.
Possible Follow-up Questions
- How do you incorporate social context such as friends in the group into retrieval?
- How do you handle a group whose description changes?
- What happens to recall for very short queries like one word?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice ML System Design ProblemsSample Answer
Requirements
- Corpus: tens of millions of groups with names, descriptions, recent post text, member counts.
- Queries: short, often intent-like ("dog walkers near me", "used baby gear").
- Retrieval returns about...
High-Level Design
- Query tower: text encoder over the query plus user context features (location, language).
- Group tower: encoder over group name, description, top recent post titles, plus location and cat...