FastPrepMinesweeper Board Update
Problems/Minesweeper Board Update

Minesweeper Board Update

Uber logoUber● MediumFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The interview report names the usual Minesweeper board update task and a first step before breadth-first search. It leaves out the board symbols, how a click is given, and the limits. Those usual details are spelled out below. Our version is about 90% the same as the reported question.

You are given a rectangular Minesweeper board containing unrevealed empty cells E and unrevealed mines M, plus a clicked coordinate [row, column].

  • If the clicked cell is a mine, change it to X and return the board.
  • Otherwise reveal the clicked empty region. For an unrevealed empty cell, count mines in all eight neighboring positions.
  • If the count is positive, replace the cell with the digit 1 through 8 and do not expand through it.
  • If the count is zero, replace the cell with B and continue revealing all adjacent unrevealed empty cells.

Mutate and return the board after the click.

Function

updateBoard(board: char[][], click: int[]) → char[][]

Examples

Example 1

board = [["E","E","E","E","E"],["E","E","M","E","E"],["E","E","E","E","E"],["E","E","E","E","E"]]click = [3,0]return = [["B","1","E","1","B"],["B","1","M","1","B"],["B","1","1","1","B"],["B","B","B","B","B"]]
board
012340EEEEE1EEMEE2EEEEE3EEEEE
→
return
012340B1E1B1B1M1B2B111B3BBBBB
Moved or new

The click opens a zero-mine region. Numbered boundary cells stop expansion, and the unrevealed cell behind the mine remains E.

Example 2

board = [["M","E"],["E","E"]]click = [0,0]return = [["X","E"],["E","E"]]
board
010ME1EE
→
return
010XE1EE
Moved or new

Clicking the mine marks only that cell as X.

Example 3

board = [["M","E"],["E","E"]]click = [1,1]return = [["M","E"],["E","1"]]
board
010ME1EE
→
return
010ME1E1
Moved or new

The clicked cell touches one mine, so it becomes 1 and expansion stops immediately.

Constraints

  • 1 <= board.length, board[0].length <= 300
  • Every row has the same length.
  • Each board cell is E or M.
  • click contains a valid board coordinate.

More Uber Onsite Interview questions

  • Earliest Time All Users Are ConnectedPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Online Meeting Scheduler with Fixed RoomsONSITE INTERVIEW · Seen Oct 2026
  • Minimum Meeting Rooms with AssignmentsPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Serialize and Deserialize an N-Ary TreeONSITE INTERVIEW · Seen Oct 2026
  • Longest Continuous Subarray Within an Absolute-Difference LimitONSITE INTERVIEW · Seen Oct 2026
  • K Smallest Squares from a Sorted ArrayONSITE INTERVIEW · Seen Sep 2026
  • Grid Robot Route with Charging PrioritiesPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Shortest Increasing Path to a TargetONSITE INTERVIEW · Seen Sep 2026
  • My Calendar IONSITE INTERVIEW · Seen Sep 2026
  • Per-Element Hit CounterONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Minesweeper Board UpdateClay · ONSITE INTERVIEW
  • Minesweeper Board UpdateAirbyte · ONSITE INTERVIEW
  • Process Minesweeper Game OperationsAmperity · PHONE SCREENAmperity interview questions
  • Drop and Eliminate Adjacent PiecesSnowflake · PHONE SCREENSnowflake interview questions
  • Number of IslandsFleetx · ONSITE INTERVIEW
  • Spiral MatrixAthenahealth · ONSITE INTERVIEW
  • Minimum Time to Spread Through a GridAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Number of IslandsIntuit · ONSITE INTERVIEWIntuit interview questions
  • Rotting OrangesSalesforce · ONSITE INTERVIEWSalesforce interview questions
  • Explore an Unknown Grid and Find a PathLinkedIn · ONSITE INTERVIEWLinkedIn interview questions
All Uber interview questionsSee Uber hiring insights
Saved
class Solution {
    public char[][] updateBoard(char[][] board, int[] click) {
      // write your code here
    }
}
Checking account…