def cluster_points(points: list[tuple], k: float) -> list[list[int]]:
The round: three reports, from Nuro phone screens in January, August and September 2026, one of them for an AI Platform new-grad role. You are given point coordinates. Points closer than a distance k belong to the same group, and grouping carries through chains: if A is close to B and B is close to C, all three are one group. One report has 3D points and asks you to return every cluster. Two reports give the same follow-up: there are very many points and they are sparse, so how do you cut the computation? One candidate used union-find. One reply complains that 45 minutes leaves no time to optimize or debug. Two graded parts.
Part 1 — group points closer than k
def cluster_points(points: list[tuple], k: float) -> list[list[int]]: ...
points[i] is a tuple of coordinates. All points have the same number of coordinates: 2 or 3. One report has 3D points; the other two only say coordinates, so 2D is our reading.i and j are close when their Euclidean distance is less than k. Groups are the chains of close points.k must be a positive number. Points with different numbers of coordinates raise ValueError, and so does k <= 0. No points gives [].points = [(0, 0), (1, 0), (5, 5), (2, 0), (9, 9)], k = 1.5
-> [[0, 1, 3], [2], [4]] (0-1 and 1-3 are close; 0-3 is 2 apart but chained)
Notes: the transitive grouping under a distance, the 3D version and the sparse follow-up are reported. The strict "less than" is the reported wording. No report names the distance; Euclidean is our choice. The signatures, returning indexes, the output order and the ValueError rules are ours. No report gives an answer to the follow-up: bucketing points into a grid is our approach, and a k-d tree is another.
Speed is not graded here: the editor cannot time your code, so the tests check only the groups. Part 2's point is the reported ask to beat comparing every pair; say what your version costs.
Three reports from Nuro phone screens in 2026, one for an AI Platform new-grad role. Two give the same statement word for word, with the same follow-up about many sparse points; one describes the problem as a known repeat question. The third has 3D points and asks for every cluster. One candidate used union-find and moved on to the onsite. No report says what answer the interviewer wanted for the follow-up, and one reply complains that 45 minutes leaves no time to optimize or debug, so get Part 1 done fast.
What the reports say: points closer than k join a group, and grouping chains. One report asks it in 3D. Two reports follow up on many sparse points: how do you cut the computation? One candidate used union-find. Rounds are 45 minutes, so leave time for the follow-up.
Common mistakes (ours, not reported): Grouping only direct neighbours; using <= for a strict threshold; a grid that checks only its own cell; int() instead of floor for negative coordinates.
Edge cases to test (ours): Points exactly k apart; a long chain; duplicate points; close points on either side of a cell edge.
Also reported as 3D Point Clustering
The round: three reports, from Nuro phone screens in January, August and September 2026, one of them for an AI Platform new-grad role. You are given point coordinates. Points closer than a distance k belong to the same group, and grouping carries through chains: if A is close to B and B is close to C, all three are one group. One report has 3D points and asks you to return every cluster. Two reports give the same follow-up: there are very many points and they are sparse, so how do you cut the computation? One candidate used union-find. One reply complains that 45 minutes leaves no time to optimize or debug. Two graded parts.
Part 1 — group points closer than k
def cluster_points(points: list[tuple], k: float) -> list[list[int]]: ...
points[i] is a tuple of coordinates. All points have the same number of coordinates: 2 or 3. One report has 3D points; the other two only say coordinates, so 2D is our reading.i and j are close when their Euclidean distance is less than k. Groups are the chains of close points.k must be a positive number. Points with different numbers of coordinates raise ValueError, and so does k <= 0. No points gives [].points = [(0, 0), (1, 0), (5, 5), (2, 0), (9, 9)], k = 1.5
-> [[0, 1, 3], [2], [4]] (0-1 and 1-3 are close; 0-3 is 2 apart but chained)
Part 2 — many sparse points
def cluster_points_fast(points: list[tuple], k: float) -> list[list[int]]: ...
Notes: the transitive grouping under a distance, the 3D version and the sparse follow-up are reported. The strict "less than" is the reported wording. No report names the distance; Euclidean is our choice. The signatures, returning indexes, the output order and the ValueError rules are ours. No report gives an answer to the follow-up: bucketing points into a grid is our approach, and a k-d tree is another.
Speed is not graded here: the editor cannot time your code, so the tests check only the groups. Part 2's point is the reported ask to beat comparing every pair; say what your version costs.
If there are very many points and they are sparse, how do you reduce the computation?
What the reports say: points closer than k join a group, and grouping chains. One report asks it in 3D. Two reports follow up on many sparse points: how do you cut the computation? One candidate used union-find. Rounds are 45 minutes, so leave time for the follow-up.
Common mistakes (ours, not reported): Grouping only direct neighbours; using <= for a strict threshold; a grid that checks only its own cell; int() instead of floor for negative coordinates.
Edge cases to test (ours): Points exactly k apart; a long chain; duplicate points; close points on either side of a cell edge.
If you have had this round, tell us how close this page was. It is how we keep the pages accurate.
Send them this page. It is free to read, no account needed.
What you just read — canonical solution, follow-up arc, what passing candidates actually did — exists for all 27 Nuro questions, refreshed monthly from new candidate reports.