101
0/304
Loading content...
A social graph analytics service records follow relationships as directed edges. Product and growth teams need a compact user-level snapshot of audience size.
Table: followers
Data guarantees:
Task: For each user_id present in the table, return how many followers that user has.
Output requirements:
Supported submission environments:
followers:
| user_id | follower_id |
|---------|-------------|
| 0 | 1 |
| 1 | 0 |
| 2 | 0 |
| 2 | 1 |[
{"user_id":0,"followers_count":1},
{"user_id":1,"followers_count":1},
{"user_id":2,"followers_count":2}
]User 0 is followed by {1}, user 1 by {0}, and user 2 by {0,1}.
followers:
| user_id | follower_id |
|---------|-------------|
| 50 | 10 |
| 50 | 11 |
| 50 | 12 |
| 90 | 40 |
| 90 | 42 |[
{"user_id":50,"followers_count":3},
{"user_id":90,"followers_count":2}
]Counts are computed per user_id; each row contributes exactly one follower to that target user.
followers:
| user_id | follower_id |
|---------|-------------|
| (no rows) |[]With no follow edges, no user has a measurable follower count.
Constraints