← Meta Interview Insights

Meta·Software Engineer·Onsite - Coding / Algorithms·Intermediate

IntermediatePrefer not to say
Apr 2026

Summary

Second coding round at Meta, which got a little weird when the interviewer realized his planned question was basically the same one I'd already done in round one. He pivoted on the fly to a friend recommendation system design. Kept me on my toes.

Questions Asked (1)

Q1

Design a Friend Recommendation system.

System DesignAlgorithms & Data Structures
Author's notes

The interviewer swapped to this mid-session after realizing his original question duplicated round one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then outline a high-level architecture that includes data collection, candidate generation, ranking, and serving. Dive into algorithmic details for candidate generation (e.g., friends-of-friends, graph embeddings) and ranking (e.g., ML models), and discuss trade-offs and scalability.

Pro tip: Emphasize the importance of evaluating the system with offline metrics (e.g., precision@k, recall) and online A/B tests, and discuss how to handle cold-start users by leveraging alternative signals like location or interests.

1. Clarify Requirements and Scale

Ask questions to understand functional and non-functional requirements: e.g., what defines a 'friend'? How many users? What latency is acceptable? What are privacy constraints?

2. High-Level Architecture

Sketch the main components: data ingestion (user actions, graph), offline processing (candidate generation, model training), online serving (ranking, API), and feedback loop.

3. Candidate Generation

Describe methods to generate a set of potential friends, such as friends-of-friends, graph traversal, community detection, or embeddings (e.g., node2vec). Discuss scalability and trade-offs.

4. Ranking and Personalization

Explain how to rank candidates using features (e.g., mutual friends, interactions, profile similarity) and machine learning models (e.g., logistic regression, GBDT, neural networks). Mention online/offline feature consistency.

5. Evaluation and Iteration

Discuss metrics (offline: precision, recall, NDCG; online: CTR, engagement), A/B testing, and how to handle cold-start and feedback loops.

Key Points to Mention

  • Graph algorithms: friends-of-friends, triangle counting, community detection
  • Machine learning models for ranking: logistic regression, gradient boosted trees, neural networks
  • Scalability: sharding the social graph, distributed processing (e.g., MapReduce, Spark), caching
  • Cold-start problem: using location, demographics, interests, or imported contacts
  • Evaluation metrics: precision@k, recall, NDCG, online A/B testing
  • Privacy and ethical considerations: user consent, data anonymization, bias mitigation

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.