InterviewDB Experience

Points Query: SQL to Find All Points Within a Given Radius of a Location

Interview Experience

Problem You have a table of geographic points. Write a SQL query to return all points within a given radius (in kilometers) of a target latitude/longitude, ordered by distance ascending. Example query parameters: target_lat=37.7749, target_lon=-122.4194, radius_km=10 Expected columns: id, name, lat, lon, distance_km Follow-ups Why must you use HAVING instead of WHERE when filtering on the computed distance_km alias? At what scale would this full-table scan become a bottleneck, and what index typ…

Full Details

🔒

Unlock all Applied Intuition questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a candidate experience report from a applied intuition interview during the phone round.

It covers the following topics: Onsite, Sql, Phone, Coding .