← Walmart Interview Insights

Walmart·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Phone screen for a software engineer role, just one coding question the whole time. Pretty short, nothing surprising if you've seen the forum posts about it.

Questions Asked (1)

Q1

Implement a tic-tac-toe game.

Algorithms & Data Structures
Author's notes

This one gets mentioned a lot on forums so I'd seen it before.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (e.g., board size, win condition, input method) and then design a clean object-oriented solution with separate classes for Board, Player, and Game. Implement core methods for making moves, checking wins/draws, and switching turns, and discuss how to extend or optimize the solution.

Pro tip: Demonstrate test-driven development by outlining test cases for win conditions, invalid moves, and draws before coding. This shows you prioritize correctness and edge cases, which is highly valued in production code.

1. Clarify Requirements

Ask about board size (standard 3x3?), win condition (3 in a row?), number of players (2 human? AI?), and input/output expectations. This ensures you build the right solution.

2. Design Classes and Interfaces

Define a Board class to manage state and check wins, a Player class (or enum) for symbols, and a Game class to control flow. Consider using an enum for cell states and a 2D array for the board.

3. Implement Core Logic

Write methods for placing a mark, checking for a win (rows, columns, diagonals), detecting a draw, and switching turns. Ensure input validation and error handling.

4. Test and Validate

Walk through test cases: horizontal, vertical, diagonal wins, draw, invalid move, and move after game over. Mention unit testing frameworks like JUnit.

5. Discuss Extensions and Optimizations

Talk about scaling to NxN, adding an AI opponent (minimax), or optimizing win detection with counters. This shows forward-thinking and adaptability.

Key Points to Mention

  • Use of 2D array or list to represent the board and enum for cell states.
  • Win detection by checking rows, columns, and diagonals after each move.
  • Draw detection when board is full and no winner.
  • Input validation to prevent overwriting occupied cells or out-of-bounds moves.
  • Separation of concerns: Board handles state, Game handles flow, Player handles input.
  • Extensibility: how to adapt for larger boards or AI players.

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