← Questions

Shortest bridge between two islands

0
TeslaAppleMetaCodingLast asked Jun 2026

A coding interview question asked in Tesla's second technical round and at Apple and Meta, last asked Jun 2026. It tests bfs, dfs and grids.

A square binary grid contains exactly two islands. An island is a group of 1 cells connected up, down, left or right.

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

  • Tesla · Second technical round · Last asked Jun 202645 min · Coding, often combined with team fit
  • Apple · Coding · Last asked Jan 2026
  • Meta · Technical phone screen · Last asked Jul 202545 min · Two coding problems in CoderPad, about 20 minutes each · Usually no AI; some newer screens are AI-assisted

What it tests

bfs · dfs · grids

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