NearGroup interview question

Some basic question from iOS development and then some puzzles problem then a machine test.