InterviewDB
Question
Location Query: SQL Queries to Find Nearby Locations and Compute Distance-Based Rankings
phone
Question Details
Problem You have a locations table storing points of interest with latitude and longitude. Write queries to: (1) find all locations within 10 km of a given point, (2) return the 5 nearest locations to a given point, and (3) for each user in a users table, find the nearest location of each category. Distance approximation (flat-earth for small areas): Example: Follow-ups What is wrong with using a distance function in WHERE vs. HAVING? Does it affect index usage? How do PostGIS extensions change…
Full Details
🔒
Unlock all Axon questions
Full insider details, leaked discussions, and candidate experiences.
Get full access — $100 a year, unlimited accessAbout This Question
This is a reported interview question from a axon interview during the phone round.
It covers the following topics: Onsite, Sql, Phone, Coding .