AO
Back

Minesweeper: Number the Board, Then Reveal a Click

Phone ScreenPhone ScreenLast reported August 2026Low Frequency

Problem Overview

The round: three reports from Nuro coding rounds, March to August 2026; one was a phone screen and one an AI Platform intern interview. All three name Minesweeper. One report calls it BFS. The intern report gives two parts and the board encoding. In Part 1 nothing is clicked: you output the board with every cell revealed, which is mostly about the number each cell next to a mine should show. Part 2 is a click that reveals cells by DFS. That candidate got stuck on Part 2 because they had not pinned down when to keep spreading, finished part of it with the interviewer's help, and advises clarifying first: spread only from a cell that is empty and has no mine around it. Two graded parts.

The board (reported encoding)

  • -1 is a mine. 0 is an empty cell not revealed yet.
  • -2 is a revealed empty cell with no mine around it.
  • 1 to 8 is a revealed cell, showing how many of its 8 neighbours (including diagonals) are mines.

Part 1 — number the whole board

def number_board(board: list[list[int]]) -> list[list[int]]: ...
  • board holds only -1 and 0. Return a new board where every mine stays -1 and every other cell is revealed: its mine count 1 to 8, or -2 if it has no mine around it.
  • Any other value, or rows of different lengths, raises ValueError. An empty board gives [].

Part 2 — click a cell and reveal

def reveal(board: list[list[int]], row: int, col: int) -> list[list[int]]: ...
  • board uses the full encoding above. Return the board after clicking (row, col); do not change the board passed in.
  • Clicking an unrevealed cell with mines around it reveals just that cell, as its count.
  • Clicking an unrevealed cell with no mine around it marks it -2 and keeps going to all 8 neighbours. Unrevealed neighbours are revealed the same way, so the spread continues only through cells that are empty and have no mine around them. Numbered cells are revealed and stop the spread.
  • Clicking a mine or an already revealed cell returns the board unchanged. A click off the board raises ValueError.
  • One test (ours) clicks a 400 x 400 board that opens almost every cell, deeper than Python's recursion limit, so write the spread with an explicit stack or queue.

Notes: the two parts, the encoding and the rule for when to keep spreading are reported. The 8-neighbour rule is standard Minesweeper and is our reading. The function names, the 400 x 400 test, returning a new board, what a click on a mine does, and the ValueError rules are ours. Win detection and what happens after a mine is clicked are not reported. The reported count range reads 0 to 8; a revealed cell with no mine around it is -2, so here counts run 1 to 8.

What Reports Emphasize

What the reports say: Minesweeper in two parts. Part 1 numbers every cell without a click. Part 2 reveals a click by DFS (another report calls it BFS). The candidate who reported both parts got stuck on Part 2 and advises clarifying first: keep spreading only from a cell that is empty and has no mine around it. The reported encoding is -1 mine, 0 hidden, -2 revealed blank, and the count for a numbered cell.

Common mistakes (ours, not reported): Spreading from numbered cells; deep recursion on a big open board; counting 4 neighbours instead of 8; reusing 0 for a revealed blank.

Edge cases to test (ours): A click next to a mine; a click on a mine; edges and corners; a wall of numbers the spread must not cross.

Practice

Write your own against 11 test cases, or read the worked solution — approach, complexity, and code that runs.
Did this match your interview?

If you have had this round, tell us how close this page was. It is how we keep the pages accurate.

Prepping for Nuro with friends?

Send them this page. It is free to read, no account needed.

More Nuro Questions

Free preview

Every question in the Nuro catalog gets this depth

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.

$59/mo — or $50/mo with the 3-month pass · cancel anytime
Nuro · Phone Screen · Reported 3× across candidate reports
Is this helpful?