23 geometry interview questions, asked at Google, Applied Intuition, Uber and 8 more companies. Last asked Oct 2026.
Merge overlapping collinear segments in the planeCodingSegments in 2D each carry an ordered list of points. Merge segments that lie on the same line and overlap, keeping every point, and take care with vertical segments and…
Last asked Oct 2026
Route requests to the nearest healthy data centerCodingBuild a router that processes commands: register a data center with its latitude, longitude and capacity, mark data centers up or down, report the great-circle distance between…
Last asked Sep 2026
Largest rectangle from a point set, any orientationCodingYou get distinct points with integer coordinates. Choose four of them that are the corners of a rectangle, where the sides do not have to be parallel to the axes. Return the…
Last asked Sep 2026
Count squares formed by vertical and horizontal segmentsCodingYou get a set of vertical and a set of horizontal line segments. Every point where a vertical and a horizontal segment cross or touch is an intersection. Count the squares whose…
Last asked Sep 2026
+1
Lowest horizontal line that splits squares into equal areasCodingSeveral axis-aligned squares are given by their bottom-left corner and side length. Find the lowest horizontal line y = h such that the total square area below the line equals the…
Last asked Sep 2026
Locate vehicles with a square-region query APICodingAn API answers whether any vehicle lies inside a given square region. Use it to find every vehicle's location. Clarify the search bounds, how precise positions must be and how to…
Last asked Sep 2026
K closest points to a query locationCodingGiven a list of 2D points and a query location, return the k points closest to it by Euclidean distance. Compare sorting, a size-k max-heap and quickselect, and say which you…
Last asked Aug 2026
Count clusters of 2D points within a radiusCodingTwo points belong to the same cluster when they are within a given distance of each other, and clusters chain through shared neighbors. Given the points and the distance, count…
Last asked Jul 2026
Step a set of moving vehicles until the first collisionCodingEach vehicle is a circle with a position, heading, constant speed and turn rate. Advance them in small fixed time steps and stop at the first time two of them touch, reporting…
Last asked Jun 2026
Stream of points: remove any pair within a distanceCodingPoints arrive one at a time. When a new point is within a given distance of a point already stored, remove that pair; otherwise store the new point. Keep each step fast as the…
Last asked Jun 2026
Horizontal line that splits the area of rectangles in halfCodingGiven axis-aligned rectangles, find the lowest horizontal line y = c for which the total rectangle area above the line equals the total area below it. Discuss how overlapping…
Last asked Jun 2026
Group 3D points within a distance thresholdCodingGiven points in 3D and a distance threshold, group them so that two points closer than the threshold end up in the same group, directly or through a chain of close points. Return…
Last asked May 2026
Largest axis-aligned rectangle from pointsCodingYou are given a list of distinct points on a 2D integer grid. Each point is a pair x, y. Return the largest area of a rectangle whose sides are parallel to the x and y axes and…
Intersection of two line segmentsCodingGiven two line segments in the plane, each by its two endpoints, decide whether they intersect and return the intersection point (or the overlapping piece when they are collinear…
Last asked Feb 2026
Max points on a lineCodingGiven points on a plane, return the largest number of them that lie on one straight line. Explain how you represent slopes exactly (reduced fractions, not floats) and handle…
Last asked Feb 2026
Place K pickup points to minimize total L1 distanceCodingGiven the coordinates of N people, choose K shuttle pickup locations so that the sum of each person's Manhattan (L1) distance to their nearest pickup is as small as possible…
Last asked Dec 2025
K closest points to the originCodingGiven points in the plane and k, return the k points nearest to the origin in any order. Start simple (sort by distance), then improve with a size-k max-heap or quickselect and…
Last asked Oct 2025
Find a way out of a restricted map zoneCodingGiven a starting latitude and longitude and a function that says whether a point is inside a premium zone, return a path that leaves the zone, or a nearby point outside it…
Last asked Oct 2025
Distance to the nearest waypoint along a routeCodingYou are writing part of a car's navigation software. A route is a polyline: an ordered list of 2D waypoints coordinates, connected by straight segments from each waypoint to the…
Last asked Aug 2025
Random point in non-overlapping squaresCodingDefine a class for a square on the plane and return a uniformly random point inside it. Follow-up: given many non-overlapping squares, return a point that is uniformly random over…
Last asked Jul 2025
Largest square from 1x1 and 2x2 tilesCodingYou have M small tiles of size 1×1 and N large tiles of size 2×2. Build the largest possible square: every cell of the square must be covered by exactly one tile, with no gaps, no…
Route a request along diagonal server redirectsCodingServers sit at distinct integer points on an infinite 2D grid. locationsi = x, y is the position of server i. A request starts at server 0, which counts as visited. You are given…