Q:

Identifying Friends

You are given an array containing information regarding n people. Each person is described using a string (their name) and a number (their position along a number
  line). Each person has 3 friends, which are the 3 people whose number is nearest their own. Describe an algorithm to identify each person’s 3 friends.

A:

Assume this:
1 BOB , 2 Alice, 3 Ryan, 4 John, 5 Mike, 6 Jack, 7 Jane, 8 Rick, 9 Sam
Say, Bob's friends are Alice, Ryan and John. Alice's friends are Bob, Ryan and John. Ryan friends are Bob, Alice, John. So far everything seems fine. But when you go to John, his friends must either be Alice, Ryan and Mike, or Ryan, Mike and Jack. In both cases it is wrong because John is Bob's friend and there is NO WAY that Bob can be John's friend according to the question's condition. 
It could be an assignment given to you by your professor but it either misses something or just wrong. It is not feasible UNLESS if you have 3 friends it is not conditional for them to have you as friend, making it okay that Bob has John as friend while John doesn't have Bob as friend and this makes another problem of HOW TO SELECT the friends, are they the previous 2 plus the next 1? or previous 1 plus the next 2? That's also not clear. 
Revise the question.

