I recently had phone screen for Amazon Sr SWE role.
Design an object oriended model for Social Network also design an algorithm to show the connections between the friends.
What would be the efficient way to find the relation between two users?
Constraints:
There can be millions of users on this network. Each user can have several friends (had to consider the mutual friends as well)
Note: Question was vague and had to ask lots of details. No inputs/outputs given and all needed to be designed from scratch.