Amazon Interview Question

Closest pair of points problem

Interview Answers

Anonymous

Apr 24, 2012

You don't have to come up with the O(nlogn) solution. The naive approach (comparing every two points) in to nested for loops is good enough. explaining the O(nlogn) solution (divide and conquer) is a bonus, I don't think that anyone really expects you to be able to write an implementation during an interview.

1

Anonymous

Apr 18, 2012

Was able to explain the algorithm, but struggled in writing actual code

Anonymous

May 2, 2012

In Amazon they ask for real implementation over phone.