Search
⌘K

Friend Recommendation System

Design and implement a friend recommendation system that suggests up to 5 potential friends for each user, excluding the user themselves and existing friends. Consider randomization strategies and comprehensive test case coverage.

Asked at:

Meta


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid March, 2026

Meta

Mid-level

Friends recommendation system. Brute force with random recommendation and I used BFS for best recommendation system with friends of friends. Initially starts with making pass all unit tests.

Early March, 2026

Meta

Manager

AI Enabled coding. Existing packages and code for a Friend recommendation system. There are user list, and user->user relation if they are already friends. The solution was to recommend max 5 friends for each users, with a condition that user1 itself cannot be its (user1's) friend, and user2 should not already be a friend of user1. Additionally, follow up questions - how do we randomly select recommended friends, and related test cases

Early February, 2026

Meta

Mid-level

Design fried recommendation system with two rule: 1. User can not be friend with himself/herself 2. we can not recommend the person who is already user's friend

Your account is free and you can post anonymously if you choose.