Meta
Recommendation Lab
Friend recommendation, feed ranking, trending algorithm, product recommendation
Walkthrough
How Meta Recommendations Work
Step-by-step from social graph to personalized feed
Users & Social Graph
Meta's social graph connects users through friendships, follows, and interactions. Each node is a user, each edge represents a relationship. This graph has billions of nodes and trillions of edges.
Algorithms
Log
Algorithm
BFS traverses the social graph level by level.
Start → direct friends → their unvisited neighbors = recommendations.
Complexity
Interview Qs
Design friend recommendation for 2B users.
Graph partitioning, BFS with depth limit, ANN search.
Rank a feed with 1000+ signals per post.
ML ranker + priority queue. Consider fairness & diversity.
Design real-time trending topics.
Sliding window + max-heap per time bucket. Shard by geography.
Build e-commerce product recommendation.
Collaborative + content-based filtering. Matrix factorization.