Imagine we have data for users of a social network. Users can befriend other users of the network.
We want to implement a feature where a user Alice visiting another user Bob, would see which friends Alice and Bob have in common.
Write a script/function/program in your preferred programming language that takes two user names and gives back a list of the common friends between those users.
You can get the data for the users from:
The data follows this format:
[ { "id": 5, "name": "Alice", "friends": [ 4, 6 ] }
, { "id": 9, "name": "Bob", "friends": [ 6, 8 ] }
]
- Find common friends between "Herminia Wyman" and "Melisa Lowe"
We will aim to spend ~25' on this, so try to get to a solution first, and worry about other things later. Please try to speak up as you go trying to explain why and what you are doing.