SevyDevy

Design snake and ladder

PremiumLow-level designEasy

  • Board games
  • Strategy pattern
  • Dependency injection

Quick answer

This low-level design interview question asks you to design snake and ladder. Aim for a design that is modelled as clear classes, interfaces and relationships that can handle new requirements without a rewrite. Interviewers want to see how you name responsibilities, keep classes small and reason about change.

The problem

Snake and Ladder low level design: build the object model for the board game where 2 to 6 players roll a die and race to the last square, sliding down snakes and climbing ladders. The hard parts are a configurable board, O(1) jump lookup, rule variants and a dice you can replace in tests.

Players take turns rolling a die and moving their token forward. Landing on the head of a snake sends the token down to its tail; landing on the bottom of a ladder sends it up to the top. The first player to reach the last square wins.

What must the system do?

  • Board: A square board of N × N cells numbered 1 to N². The default is 10 × 10 (100 cells).
  • Snakes and ladders: A snake goes from a higher cell to a lower one; a ladder from a lower cell to a higher one. No cell is the start of two jumps, and no jump starts or ends on cell 1 or on the last cell.
6 more requirementsUnlock to see all

How well must it do it?

  • Correct: A token can never be on a cell outside 0 to N²; jump lookup must be O(1).
  • Deterministic in tests: With a fixed sequence of dice values, the game must play out the same way every time.
2 more requirementsUnlock to see all

What scale should you design for?

Use these numbers in your estimates.

The scale numbers unlock with this questionUnlock

Key concepts

  • Board games
  • Strategy pattern
  • Dependency injection
  • Game loop
  • Randomness injection
  • Object oriented design

How you’ll practise

6 short steps · save and come back any time
  1. Requirements
  2. Core objects
  3. Class relationships
  4. Key flows
  5. Extensibility
  6. Wrap-up

Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.

What do interviewers look for?

In any low-level design round.

  • Lists the use cases before writing classes
  • Gives each class one clear responsibility
  • Uses interfaces where behaviour is likely to change
  • Applies a design pattern only when it solves a real problem
  • Handles edge cases and invalid states explicitly
  • Walks through one use case end to end with the model

Questions people ask about this interview question

Which design type is this question?
It is a low-level design question. You design snake and ladder and explain your choices the way you would in an interview.
Is this question asked at entry level?
It is marked Easy, so it suits engineers who are new to low-level design interviews. It is also a good warm-up before harder questions.
What should I cover first?
Start with the use cases and the core entities, then the responsibilities of each one. Agree on scope with the interviewer before you design anything.
Can I practise it for free?
It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.

Related questions

Updated · Written by the SevyDevy team

Premium questionSign up free, then unlock it