Meta·Machine Learning Engineer·Technical Phone Screen
- Design and implement a Top-K friend recommendation system using mutual friends as the ranking signal. For a given user, score each non-friend candidate by the number of friends they share, then return the K highest-scoring candidates. Walk through your implementation using the existing User class, and discuss time and memory complexity.
- You're allowed to use AI assistance here. Ask it to propose alternative ranking signals beyond mutual friends, such as Adamic-Adar or Jaccard similarity, then analyze the trade-offs between them.
“I went straight to set intersection and it felt clean enough.”