← Questions

Design an online Minesweeper platform

0
AmazonSystem designLast asked Nov 2025

A system design interview question asked in Amazon's system design round, last asked Nov 2025. It tests games, real-time and apis.

Design a platform where people play Minesweeper online. Players start a game at a chosen difficulty, reveal and flag cells, and win or lose; they can leave and resume later, and compete on leaderboards for fastest wins. Many players play at once, each on their own board.

Requirements

  • Functional: create a game (size, mine count, difficulty); reveal a cell (with the flood fill of empty regions), flag and unflag; detect win and loss; save and resume; per-difficulty leaderboards of fastest times; game history.
  • Non-functional: each move answered in tens of milliseconds; millions of games a day; no way for a client to learn mine positions or fake a fast win; games survive a server restart.

Clarifying questions

  • Single player only, or also head-to-head races on the same board?
  • Is the first click guaranteed to be safe?
  • How long do unfinished games stay resumable?
  • Do leaderboards need to be exact and real-time?

What a strong answer covers

  • Trust: the server generates the board and keeps mine positions; the client only ever receives revealed cells. Generating the board after the first click keeps it safe.
  • API: POST /games, POST /games/{id}/reveal {row, col}, POST /games/{id}/flag, GET /games/{id}, each returning only what changed.
  • Game state: board, revealed and flagged bitmaps, status, start time and move count; kept in memory or a fast store for active games and persisted to a database for resume and history.
  • Concurrency: one game's moves processed in order (a version number or per-game lock), so a double-click cannot reveal twice or race a loss.
  • Leaderboards: a sorted set per difficulty and period, written only for games the server verified; anti-cheat checks such as impossible move timings.
  • Scaling: stateless API servers routed by game id, a cache tier for active games, and cleanup of abandoned games.

Follow-ups

  • Add real-time races where two players play the same board.
  • How do you guarantee every board can be solved without guessing?
  • The leaderboard shows suspicious times. How do you detect bots?

Where it's asked

What it tests

games · real-time · apis

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing