← Amazon Interview Insights

Amazon·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
May 2026

Summary

Amazon SWE onsite design round where the candidate picked Minesweeper as their game design topic. Covers object-oriented design, flood-fill algorithms, persistence, and multi-device sync. The round doubles as a system design probe so there's more to it than just drawing a Cell class.

Questions Asked (6)

Q1

Design a game of your choice from scratch, covering core rules, object model, and how you'd extend it.

System DesignProduct Sense & IdeationTechnical Trade-offs
Author's notes

Picked Minesweeper because I could narrate the state machine fast.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Choose a simple, well-understood game (e.g., Tic-Tac-Toe, Connect Four, or a basic card game) to keep the focus on design principles rather than game complexity. Structure your answer by first clarifying requirements and scope, then walking through the core rules, object model, and extension points, while highlighting trade-offs and Amazon leadership principles like Customer Obsession and Ownership.

Pro tip: Explicitly state your assumptions and scope early, and tie design decisions back to Amazon's leadership principles (e.g., 'I'm choosing a simple game to prioritize delivering a working design quickly, which reflects Bias for Action'). This shows you understand Amazon's culture and can make pragmatic trade-offs.

1. Clarify Requirements and Scope

Ask clarifying questions to define the game's target audience, platform, and constraints (e.g., single-player vs. multiplayer, real-time vs. turn-based). State your assumptions and choose a simple game to keep the discussion focused.

2. Define Core Rules and Mechanics

Outline the game's objective, rules, win/loss conditions, and player interactions. Keep it concise and ensure the rules are unambiguous.

3. Design the Object Model

Identify key entities (e.g., Game, Player, Board, Move) and their relationships, responsibilities, and interfaces. Use UML-like diagrams or clear verbal descriptions to illustrate the model.

4. Discuss Extensibility and Trade-offs

Explain how you would extend the game (e.g., new rules, AI opponents, multiplayer support) and the design patterns or architectural choices that enable this. Highlight trade-offs between simplicity and flexibility.

5. Summarize and Connect to Amazon Principles

Recap the design, emphasizing how it aligns with Amazon's leadership principles (e.g., Customer Obsession, Ownership, Invent and Simplify). Invite feedback and discuss potential improvements.

Key Points to Mention

  • Clear separation of concerns (e.g., game logic vs. UI vs. persistence) to enable testability and maintainability.
  • Use of design patterns like State, Strategy, or Observer to handle game states, player strategies, and event notifications.
  • Scalability considerations: how the design would handle multiple concurrent games or players (e.g., stateless services, sharding).
  • Data model for storing game state and moves, including serialization for persistence or network transmission.
  • Extension points: pluggable AI players, configurable rules, and support for new game variants without modifying core logic.
  • Trade-offs between over-engineering and future-proofing, with a focus on delivering a minimal viable product first.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How would you implement the flood-fill reveal mechanic when a player clicks an empty cell?

Algorithms & Data Structures
Author's notes

BFS over DFS, and say it out loud before writing anything.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem: flood-fill reveals contiguous empty cells and their adjacent numbered cells. Then describe a BFS/DFS algorithm with a queue or stack, marking visited cells to avoid cycles, and discuss time/space complexity. Finally, mention optimizations like iterative BFS to avoid recursion limits and early termination when no empty cells remain.

Pro tip: Emphasize that you would use an iterative BFS with a queue to prevent stack overflow in large grids, and that you would only enqueue empty cells while revealing adjacent numbered cells without enqueuing them. This shows awareness of production constraints and edge cases.

1. Clarify the problem and constraints

Confirm that clicking an empty cell should reveal all connected empty cells and their adjacent numbered cells. Ask about grid size, recursion limits, and whether diagonal connections count.

2. Choose an algorithm

Select BFS or DFS for traversal. Explain that BFS with a queue is often preferred for large grids to avoid recursion depth issues, but DFS with an explicit stack is also valid.

3. Outline the algorithm steps

Describe initializing a queue with the clicked cell, marking it visited, and while the queue is not empty: dequeue a cell, reveal it, and for each neighbor, if empty and unvisited, mark and enqueue; if numbered, reveal but do not enqueue.

4. Analyze complexity and edge cases

State that time complexity is O(N) where N is the number of cells in the connected region, and space is O(N) for the queue/visited set. Mention edge cases like clicking a numbered cell (no flood fill) or already revealed cells.

5. Discuss optimizations and production considerations

Mention using a boolean array for visited instead of a set for efficiency, early termination if all empty cells are revealed, and potential for iterative deepening if memory is a concern.

Key Points to Mention

  • BFS vs DFS trade-offs: iterative BFS avoids stack overflow, DFS may be simpler but risky for large grids.
  • Visited tracking: use a 2D boolean array or modify the grid in-place to mark revealed cells.
  • Neighbor handling: only enqueue empty cells; reveal numbered cells without enqueuing.
  • Time and space complexity: O(N) time and O(N) space where N is the size of the connected region.
  • Edge cases: clicking a numbered cell, clicking an already revealed cell, and grid boundaries.
  • Optimization: use a queue with efficient enqueue/dequeue (e.g., collections.deque in Python) and avoid recursion.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

What's the correct win condition in Minesweeper, and how do you track it efficiently?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

I said 'all mines are flagged' at first and the interviewer just waited.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify that the win condition is revealing all non-mine cells without detonating any mine. Then discuss efficient tracking by maintaining a counter of remaining safe cells, decrementing on each reveal, and checking for zero to declare victory in O(1) time.

Pro tip: Mention that the counter approach avoids scanning the board after each move, which is crucial for large boards and aligns with Amazon's leadership principle of 'Invent and Simplify'.

1. Define the win condition

State that the player wins when all non-mine cells are revealed and no mine has been detonated. Emphasize that revealing all mines is not required.

2. Identify the naive approach

Explain that one could check after each move whether any unrevealed non-mine cell remains, but this would be O(N) per move, leading to O(N^2) overall.

3. Propose an efficient tracking method

Introduce a counter initialized to the total number of non-mine cells. Decrement it each time a safe cell is revealed, and when it reaches zero, the game is won.

4. Analyze complexity and trade-offs

Highlight that the counter approach gives O(1) win detection per move and O(1) extra space. Discuss edge cases like first move or auto-reveal of empty regions.

5. Connect to Amazon principles

Relate the solution to Amazon's focus on customer obsession (fast, responsive game) and ownership (considering scalability and efficiency).

Key Points to Mention

  • Win condition: all non-mine cells revealed, no mine detonated.
  • Naive check: scanning board after each move is O(N) per move.
  • Efficient tracking: maintain a counter of remaining safe cells.
  • Counter decrements on each safe reveal; win when counter hits zero.
  • Time complexity: O(1) per move for win detection, O(1) space.
  • Edge cases: first move safety, auto-reveal of empty regions, and flagging mines.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

How would you handle the case where the player's first click lands on a mine?

Product Sense & IdeationTechnical Trade-offs
Author's notes

Didn't even think about this until it came up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints, then propose a solution that guarantees a safe first click by relocating the mine or regenerating the board. Discuss trade-offs between different approaches and justify your choice based on user experience and technical feasibility.

Pro tip: Mention that this is a common UX pattern in Minesweeper and that the first click should always be safe to avoid frustrating players. Also, consider edge cases like when the board is too dense to relocate a mine.

1. Clarify Requirements

Ask questions to understand the expected behavior: should the first click always be safe? Are there constraints on board size or mine density? This shows you think before coding.

2. Propose Solutions

Outline possible approaches: (a) relocate the mine to another cell, (b) regenerate the board until the first click is safe, (c) delay mine placement until after the first click. Discuss pros and cons of each.

3. Choose and Justify

Select the best approach based on trade-offs. For example, delaying mine placement is efficient and guarantees safety, while relocation might be simpler if mines are already placed.

4. Handle Edge Cases

Consider scenarios like when all other cells are mines (impossible to relocate) or when the board is very small. Explain how you would handle these gracefully.

5. Implementation Details

Briefly describe how you would implement the chosen solution, including data structures and algorithms, and how it integrates with the rest of the game logic.

Key Points to Mention

  • User experience: first click should never be a mine to avoid frustration.
  • Trade-offs: relocation vs. regeneration vs. delayed placement in terms of time/space complexity and randomness.
  • Edge cases: board with maximum mines, small boards, and ensuring the relocated mine doesn't create an immediate loss.
  • Randomness and fairness: ensuring the game remains random and not biased by the safe first click.
  • Testing: how to verify the solution works correctly, including unit tests for edge cases.
  • Scalability: ensuring the solution works for large boards without performance degradation.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q5

How would you add persistence so a player can resume a game later, and sync state across multiple devices?

System DesignData ModelingAPI & Integrations
Author's notes

Went with an immutable snapshot of game state plus an append-only event log of reveal/flag/unflag actions.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: what game state needs to persist, how often it changes, and the consistency/latency trade-offs. Then propose a design that uses a cloud-based store (e.g., DynamoDB) with a well-defined data model, versioning for conflict resolution, and an API layer for sync. Finally, discuss how to handle offline play and multi-device conflicts, and how to scale the solution.

Pro tip: Emphasize idempotency and conflict resolution early—Amazon cares about correctness at scale. Also, mention that you'd start with a simple last-write-wins approach but be prepared to evolve to CRDTs or operational transforms if the game requires it.

1. Clarify Requirements

Ask about the game type, state size, update frequency, offline support, and consistency needs. Determine if real-time sync is required or if eventual consistency suffices.

2. Design Data Model

Define a schema for game state that supports versioning and partial updates. Consider using a document store like DynamoDB with a primary key of userId+gameId and a version attribute.

3. Define Sync API

Design REST or WebSocket endpoints for saving and loading state. Include mechanisms for conflict detection (e.g., version checks) and resolution (e.g., last-write-wins, merge).

4. Handle Offline and Conflicts

Describe how the client caches state locally and syncs when online. Explain conflict resolution strategies and how to handle merge conflicts for complex state.

5. Address Scalability and Reliability

Discuss partitioning, replication, and backup strategies. Mention how to ensure low latency and high availability across regions.

Key Points to Mention

  • Use of a cloud database like DynamoDB with appropriate partition and sort keys for efficient queries.
  • Versioning (e.g., optimistic concurrency control) to detect and resolve conflicts.
  • Idempotent write operations to handle retries safely.
  • Client-side caching and offline-first design with background sync.
  • Conflict resolution strategies: last-write-wins, CRDTs, or operational transforms based on game needs.
  • API design: REST vs. WebSocket for real-time sync, and authentication/authorization.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q6

Define the API surface for your Minesweeper service: what methods does it expose and what does each return?

API & IntegrationsSystem Design
Author's notes

Pretty straightforward once the object model is clear.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scope: is this a REST API for a single-player game, or does it support multiplayer? Then define a minimal, resource-oriented API that covers game creation, move execution, and state retrieval. For each method, specify the HTTP verb, path, request body, and response structure, including status codes and error handling.

Pro tip: Emphasize idempotency and statelessness: design the API so that repeated identical requests (e.g., revealing a cell) produce the same result, and avoid server-side session state by using game IDs. This aligns with Amazon's leadership principles like 'Customer Obsession' and 'Ownership' by ensuring reliability and scalability.

1. Clarify Requirements and Scope

Ask clarifying questions to determine if the API is for a single-player or multiplayer game, and whether it needs to support features like flags, timers, or leaderboards. This ensures you design the right surface.

2. Identify Core Resources and Operations

Define the main resources: Game and Move. Determine the operations: create a game, make a move (reveal or flag), get game state, and possibly reset or delete a game.

3. Design RESTful Endpoints

Map operations to HTTP methods and paths. For example: POST /games to create, GET /games/{id} to retrieve state, POST /games/{id}/moves to reveal or flag a cell, and DELETE /games/{id} to end a game.

4. Define Request and Response Payloads

Specify the JSON structure for requests (e.g., move action, coordinates) and responses (e.g., game board, status, error messages). Include HTTP status codes for success and failure cases.

5. Discuss Error Handling and Edge Cases

Explain how to handle invalid moves, game over conditions, and concurrency. Mention idempotency keys or versioning if needed to ensure robustness.

Key Points to Mention

  • Use of RESTful principles: resource-oriented URLs, HTTP verbs, and status codes.
  • Idempotency of move operations to prevent duplicate actions.
  • Statelessness: each request contains all necessary information (e.g., game ID).
  • Clear separation of concerns: game creation, move execution, and state retrieval.
  • Error handling: 400 for bad requests, 404 for missing games, 409 for conflicts.
  • Scalability considerations: using game IDs to avoid server-side session state.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.