Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Friend Suggestions

Suggest accounts for user 1: accounts followed by people user 1 follows, excluding user 1 and anyone user 1 already follows. Return the suggested user and the number of followed people who follow them, ordered by that count descending then id.

Table schema

Follows(follower INT, followee INT)

Sample data

follower | followee
1 | 2
1 | 3
2 | 4
3 | 4
3 | 5
2 | 1

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.