Design a Snake and Ladder Game
| Difficulty: Hard | Source: awesome-low-level-design |
Requirements
- Board with 100 numbered cells
- Predefined snakes and ladders
- Multiple players with unique pieces
- Roll dice to move forward
- Snake head -- slide to tail
- Ladder base -- climb to top
- First to final cell wins
- Support concurrent game sessions
Class Diagram

Classes, Interfaces and Enumerations
| Class/Interface | Description |
|---|---|
| Board | Size (100), snake/ladder positions; determine new position after move |
| Player | Name, current position |
| Snake | Start (head), end (tail) |
| Ladder | Start (base), end (top) |
| Dice | Roll returns random value 1-6 |
| SnakeAndLadderGame | Board, players, dice; game loop logic |
| GameManager | Singleton; manages multiple game sessions in separate threads |
Design Patterns Used
| Pattern | Application |
|---|---|
| Singleton | GameManager provides a single coordination point for managing multiple concurrent game sessions |
| Concurrency via Threading | Each game session runs in its own thread, allowing multiple games simultaneously |
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 |