Design Tic Tac Toe Game
| Difficulty: Medium | Source: awesome-low-level-design |
Requirements
- 3x3 grid
- Two players alternate placing X and O
- Three in a row (horizontal, vertical, or diagonal) wins
- All cells filled with no winner is a draw
- Display grid and accept moves
- Handle turns and validate moves
- Detect winner or draw
Class Diagram

Classes, Interfaces and Enumerations
| Class/Interface | Description |
|---|---|
| Player | name, symbol (X or O) |
| Board | 3x3 grid; methods to make moves, check winner, check if full |
| Game | Game flow, turn handling, move validation, outcome detection |
Design Patterns Used
| Pattern | Application |
|---|---|
| OO Decomposition | Clear separation of Player, Board, and Game responsibilities |
| MVC-like Separation | Board manages state, Game controls logic, display is separated from data |
Code Implementations
| Language | Source Code |
|---|---|
| Java | View on GitHub |
| Python | View on GitHub |
| C++ | View on GitHub |
| C# | View on GitHub |
| Go | View on GitHub |