PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/System Design/Nash AI

Design OOD for probabilistic Minesweeper

Last updated: Mar 29, 2026

Quick Overview

This question evaluates object-oriented design skills with emphasis on probabilistic modeling, deterministic versus random initialization, clear class responsibilities, state management, and testability within a Minesweeper-like system.

  • medium
  • Nash AI
  • System Design
  • Software Engineer

Design OOD for probabilistic Minesweeper

Company: Nash AI

Role: Software Engineer

Category: System Design

Difficulty: medium

Interview Round: Technical Screen

Design an object-oriented Minesweeper game. The board is a grid of cells. During initialization, each cell is passed a parameter prob indicating the probability that the cell is a mine; explain how these per-cell probabilities are used to generate the initial mine layout and initialize cell states. Define the core classes (e.g., Game, Board, Cell) and their responsibilities, the relationships among them, and the public APIs to (a) print the current board state and (b) process a user click. Specify expected state transitions for a click at a high level (lose on mine, otherwise reveal logic handled by algorithms), handling of invalid or duplicate clicks, and how the design supports maintainability and testing.

Quick Answer: This question evaluates object-oriented design skills with emphasis on probabilistic modeling, deterministic versus random initialization, clear class responsibilities, state management, and testability within a Minesweeper-like system.

Related Interview Questions

  • Design real-time delivery tracking with async updates - Nash AI (medium)
Nash AI logo
Nash AI
Jul 26, 2025, 12:00 AM
Software Engineer
Technical Screen
System Design
4
0

Object-Oriented Design: Minesweeper with Per-Cell Mine Probabilities

Context

Design an object-oriented Minesweeper game. The board is a grid of cells. On initialization, each cell is given a probability prob that it contains a mine. The system should use these probabilities to generate the mine layout and initialize cell states deterministically when needed (for testing) and randomly otherwise.

Assume prob can be provided as either:

  • A single scalar applied to all cells, or
  • A 2D grid of probabilities (same shape as the board).

Requirements

  1. Explain how the per-cell probabilities are used to generate the initial mine layout and initialize cell states.
  2. Define the core classes (e.g., Game, Board, Cell), their responsibilities, relationships, and public APIs to:
    • (a) print the current board state
    • (b) process a user click
  3. Specify expected state transitions for a click at a high level (lose on mine; otherwise reveal logic handled by standard Minesweeper algorithms).
  4. Describe handling of invalid or duplicate clicks.
  5. Explain how the design supports maintainability and testing.

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Nash AI•More Software Engineer•Nash AI Software Engineer•Nash AI System Design•Software Engineer System Design
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.