← Meta Interview Insights

Meta·Machine Learning Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
Jun 2026Remote

Summary

Meta ML engineer round with two parts: a conceptual discussion on friend-recommendation metrics and a live coding task with AI assistance allowed. The AI-assisted angle was genuinely interesting but also a bit disorienting since you still had to own everything the AI produced.

Questions Asked (2)

Q1

Given a User class with only an id and a list of current friends, how would you design evaluation metrics for a friend-recommendation algorithm? Which of those metrics are actually computable given only that data?

Product Analytics & MetricsA/B Testing & ExperimentationTechnical Trade-offs
Author's notes

This is the kind of question where you can ramble forever if you're not careful.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by outlining the ideal metrics for a friend-recommendation system, such as precision, recall, and engagement, then systematically evaluate which can be computed with only user IDs and friend lists. Emphasize that without interaction data, many metrics are not computable, and discuss potential proxies or data augmentation strategies.

Pro tip: Acknowledge the data limitation upfront and propose how additional data (e.g., interactions, impressions) would enable richer metrics, showing you understand the full lifecycle of ML systems.

1. Define Ideal Metrics

List metrics that would fully evaluate a friend-recommendation algorithm, such as precision@k, recall, NDCG, click-through rate, and user engagement.

2. Assess Computability

For each metric, determine if it can be computed using only user IDs and current friend lists, noting which require additional data like interactions or impressions.

3. Identify Computable Metrics

Select metrics that are computable, such as link prediction accuracy (e.g., AUC) using held-out edges, or graph-based metrics like common neighbors.

4. Propose Proxy Metrics

Suggest proxy metrics that approximate the ideal ones, such as friend request acceptance rate if available, or offline evaluation using historical friend additions.

5. Discuss Limitations and Extensions

Explain the limitations of the computable metrics and how additional data (e.g., interactions, impressions) would enable more comprehensive evaluation.

Key Points to Mention

  • Precision@k and recall are computable if we have a held-out set of future friendships.
  • AUC for link prediction can be computed using positive and negative edges from the graph.
  • Metrics like CTR or engagement require interaction data, which is not available.
  • Offline evaluation can use historical friend additions as ground truth.
  • Graph-based metrics (e.g., common neighbors, Jaccard similarity) can be computed but may not directly measure recommendation quality.
  • A/B testing would require online deployment and additional logging to measure business metrics.

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

Q2

Implement a mutualFriendsScore function that takes two users and returns a score based on mutual friends. Write unit tests for it. AI assistance is permitted, but you are responsible for reading, integrating, and validating whatever the AI outputs.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

The AI-allowed part sounds like a gift until you realize they're watching how you handle the output.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: what data structures represent users and friendships, what defines a 'mutual friend', and how the score should be computed (e.g., count, Jaccard similarity). Then design an efficient algorithm using hash sets for O(min(|A|, |B|)) intersection, implement it with clean code, and write comprehensive unit tests covering edge cases, performance, and correctness. Explicitly discuss how you would use AI assistance responsibly: generate initial code, then manually review, test, and integrate.

Pro tip: Demonstrate ownership by not just accepting AI-generated code: walk through how you'd validate it with tests, check for edge cases like empty friend lists or duplicate friendships, and consider scalability for large graphs. Mention that you'd also discuss trade-offs between different scoring methods (e.g., raw count vs. normalized) with the interviewer.

1. Clarify Requirements and Assumptions

Ask questions to define the input format (e.g., user objects with friend lists), the definition of mutual friends, and the desired scoring function (e.g., count, Jaccard index). Confirm edge cases like empty lists, self-friendship, and duplicate entries.

2. Design the Algorithm and Data Structures

Choose efficient data structures: represent each user's friends as a hash set for O(1) lookups. Compute the intersection of the two sets to find mutual friends, then apply the scoring formula. Discuss time and space complexity.

3. Implement the Function with AI Assistance

Use AI to generate a first draft, but manually review for correctness, style, and edge cases. Ensure the code is clean, well-commented, and handles all identified edge cases. Integrate the AI output thoughtfully, not blindly.

4. Write Comprehensive Unit Tests

Create tests covering normal cases, empty friend lists, no mutual friends, all mutual friends, duplicate friendships, and large inputs for performance. Use a testing framework like pytest or unittest, and include assertions for expected scores.

5. Validate and Discuss Trade-offs

Run tests, debug any failures, and explain how you validated the AI-generated code. Discuss alternative scoring methods (e.g., cosine similarity, weighted edges) and their implications for ML applications like friend recommendation.

Key Points to Mention

  • Definition of mutual friends and scoring metric (e.g., count, Jaccard similarity, cosine similarity)
  • Efficient set intersection using hash sets for O(min(|A|, |B|)) time complexity
  • Edge cases: empty friend lists, no mutual friends, all mutual friends, duplicate friendships, self-friendship
  • Unit testing best practices: arrange-act-assert, parameterized tests, mocking if needed
  • Responsible AI usage: reviewing, testing, and integrating AI-generated code, and understanding its limitations
  • Scalability considerations for large social graphs (e.g., using distributed computing or approximate algorithms)

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