Design a two-player tic-tac-toe game on a 3x3 board. Include features for move validation, win/draw detection, and player turn management.
Suggested time: 45 minutes
Loading the workspace...
Tic-tac-toe looks like a trivial game: two players, nine cells, three-in-a-row wins. But modeling it as an object-oriented system surfaces real design challenges. You need to enforce turn alternation, detect wins across rows, columns, and diagonals after every move, handle invalid moves gracefully, and ensure that two network players cannot corrupt the board with simultaneous submissions. The design challenge is modeling these rules so that illegal states are structurally impossible.
Place Mark on Board
Alternate Turns
Win, Draw, and Invalid Move Detection
Reset and Replay
Design a Deck of Cards (easy)
Design a Coffee Machine (easy)
Design a Parking Lot (easy)
Design a Stack and Queue (easy)
Design a Logger System (easy)