← Questions

Number of islands as land is added

0
GoogleUberCodingLast asked Oct 2026

A coding interview question asked in Google's first round (coding) and at Uber, last asked Oct 2026. It tests union-find and grids.

A grid of m rows and n columns has land (1) and water (0). An island is a group of land cells connected up, down, left or right; cells touching only at a corner are separate.

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

  • Google · First round: coding · Last asked Oct 202645 min · Coding in a Google Doc, no syntax highlighting or autocomplete · No AI
  • Uber · Coding · Last asked Sep 202660 min · Two rounds; one is often object-oriented design (a parking lot, a meeting scheduler, an expression evaluator) · No AI, except a newer AI-assisted debugging round in some senior loops

What it tests

union-find · grids

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