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
ML System Design
Machine Learning Engineer
Meta
November 29, 2026
Machine Learning Engineer
System Design Round
ML System Design
Medium

0

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
two-tower model
hard negatives
ANN index
hybrid retrieval
recall at K
How to Approach This
  1. Start by mapping the business objective to a concrete ML objective and metric.
  2. Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
  3. Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
  4. Address the serving latency budget and whether batch or real-time inference is needed.
  5. 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 Problems
Sample 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
  1. Query tower: text encoder over the query plus user context features (location, language).
  2. Group tower: encoder over group name, description, top recent post titles, plus location and cat...

Submit Your Answer
Markdown supported