Build a Tic-Tac-Toe App
WhatnotSoftware Engineer · Technical ScreenLast updated
This question evaluates proficiency in interactive UI development and stateful game logic, including turn management, board state representation, win/draw detection, input validation, and reset flow.
Implement a simple Tic-Tac-Toe mobile app that can be completed in a 45-minute coding interview.
Requirements:
- Display a 3x3 board.
- Support two local players,
XandO, taking alternating turns. - A player can place a mark only in an empty cell.
- After every move, detect whether either player has won by completing a row, column, or diagonal.
- Detect a draw when the board is full and there is no winner.
- Prevent additional moves after the game is over.
- Show the current game status: current player, winner, or draw.
- Provide a reset button to start a new game.
Focus on clean state management, readable UI code, and correctness rather than visual polish.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.