← Goldman Sachs questions

Closest City with Shared Coordinates

Filed under Goldman Sachs

Given city names and their (x, y) coordinates, answer queries for a city name by finding the closest city that shares either the same x or y coordinate. If multiple exist, return the lexicographically…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Goldman Sachs questions

Collected from public candidate posts and coding forums. Updated Nov 2026.