Adobe Interview Question
Country: India
Interview Type: In-Person
I think the optimal solution would we quad trees. And that is what your interviewer might be expecting.
A better solution than yours would be to have a virtual grid like structure.
Preprocessing: So basically you make buckets for x values and when given a random point to find search in that particular bucket using binary search.
You want a Range Tree or similar. If you haven't heard of it, it's a bit tough to expect you to come up with it in the interview.
- Anonymous July 18, 2016