InterviewDB Question

Spatial Index: Implement a 2D Grid Index for Efficient Proximity Queries

Question Details

Problem Design a spatial index that supports storing 2D points and efficiently answering proximity queries. Implement: nearest returns the k closest point IDs by Euclidean distance. range_query returns all points within the given bounding box. Example Follow-ups Compare a grid-bucket approach vs. a k-d tree for this workload. When does each win? How do you handle points clustered in a small area causing one bucket to dominate? What changes if points are moving (e.g., tracking vehicles in real ti…

Full Details

🔒

Unlock all Palantir questions

Full insider details, leaked discussions, and candidate experiences.

or every company, $100/year →

About This Question

This is a reported interview question from a palantir interview during the onsite round.

It covers the following topics: Coding, Onsite, Matrix .