Source: AMAZON INTERVIEW QUESTION
Given a point P and other N points in two dimensional space, find K points
You could use KD tree http://en.wikipedia.org/wiki/K-d_tree to partition space and given the point you will be able to gradually search for neighbors using binary search. Benefit of using this approach is that it easily scales up to online version when you receive points/queries in runtime one by one or in batches.