← Questions

Minimum triggers to clear linked balls on a grid

0
UberCodingLast asked Jun 2026

A coding interview question asked in Uber's online assessment, last asked Jun 2026. It tests union-find, graphs and sorting.

You are given n balls on a 2D grid. balls[i] = [x_i, y_i] is the position of ball i, and you are also given a non-negative integer d. Two balls are linked when they lie on the same row (equal y) or the same column (equal x) and the…

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Uber · Online assessment · Last asked Jun 202690 min · Two problems on a HackerRank-based platform, camera and screen share on · No AI

What it tests

union-find · graphs · sorting

Your code and the AI tutor open when you unlock this question.