GamifiedGamified challengesPracticeRaceLeaderboardPricing

Learn data structures by watching them move, then doing it yourself. Press M anytime to toggle sound.

A product of Amypo Technologies, Coimbatore.

Learn

  • All topics
  • Learning path
  • How it works
  • About dotprep

Practice

  • Practice arena
  • Daily challenge
  • Gamified challenges
  • Race mode
  • Leaderboard

Interview prep

  • Java interview
  • Coding questions
  • Company questions
  • System design
  • Jobs & careers

You

  • Dashboard
  • Settings
  • Pricing
  • Create account

© 2026 dotprep

Content last updated 20 November 2026

GamifiedGamified challengesPracticeRaceLeaderboardPricing
Log inStart free
Gamified challengesCrate Pusher

Gamified challenge · BFS over states

Crate Pusher

Each row of level is a string: # is a wall, . is floor, P is the worker, C the crate and T the target mark (floor). The worker moves one cell U, D, L or R per move. Walking into the crate pushes it one cell the same way, which only works if the cell beyond it is floor (or the target). The worker can't walk through walls or pull the crate.

Write pushMoves(level) (Python: push_moves(level)) that returns the worker's moves as a string so that the crate ends on the target, using the fewest moves in total (walking steps and pushes each count 1). Any shortest answer passes. If the crate can never reach the target, return "impossible".

Example: ["######", "#T.CP#", "######"] → "LL": both moves push the crate left, and the second puts it on T.

Sign in to play Crate Pusher

This game is part of the paid plans. Sign in, then pick a plan to write your answer, watch it play out, and step through the algorithm with its guide.

Sign in with Google

or log in with email · create an account