18. Geospatial Indexing
Interview questions
Interview questions (with the counter-questions you'll get)
Q1. How would you find all restaurants within 3 km of a user?
They're testing: the core geospatial pattern.
Think about your answer first, then open it.
Q2. Explain how geohash works.
They're testing: whether you understand the encoding, not just the name.
Think about your answer first, then open it.
Q3. Geohash vs quadtree: when do you use each?
They're testing: trade-offs.
Think about your answer first, then open it.
Q4. Why might Uber use hexagons (H3)?
They're testing: awareness beyond geohash.
Think about your answer first, then open it.
Q5. How do you handle millions of location updates from moving drivers?
They're testing: write-heavy design.
Think about your answer first, then open it.
Q6. How do you find the K nearest drivers, not just those within a radius?
They're testing: a common variation.
Think about your answer first, then open it.
Q7. How would you shard a geospatial service?
They're testing: combining Chapter 15 with geography.
Think about your answer first, then open it.
Q8. How do you compute the distance between two coordinates?
They're testing: a basic correctness detail.
Think about your answer first, then open it.
Q9. Two orders ask for the same nearest rider at the same moment. What happens?
They're testing: linking geospatial search to concurrency.
Think about your answer first, then open it.
Q10. Which database would you use for geospatial queries?
They're testing: practical knowledge.
Think about your answer first, then open it.