Katkat

Implement Minesweeper click and print

Nash AISoftware Engineer · Technical Screen

Last updated

Implement Minesweeper click and print evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

Implement the Minesweeper click(row, col) operation and a function to print the board. Rules: (

  1. If the clicked cell is a mine, reveal it and indicate that the game is lost. (
  2. If the clicked cell has zero adjacent mines, recursively reveal all neighboring cells. (
  3. Otherwise, reveal the number of adjacent mines for that cell. Describe the data structures you will use to track states and neighbors, the traversal strategy (BFS or DFS) and how you prevent revisiting cells, and analyze time and space complexity.