MEDIUMasked at 5 companies

The Maze

A medium-tier problem at 60% community acceptance, tagged with Array, Depth-First Search, Breadth-First Search. Reported in interviews at Block and 4 others.

Founder's read

The Maze is a medium-difficulty pathfinding problem that appears in live assessments at Block, Snap, Pinterest, Uber, and Walmart Labs. You're given a matrix, a starting position, and a destination. The catch: the ball doesn't stop when you roll it. It slides until it hits a wall. This isn't a standard shortest-path problem, and the naive approach will fail. About 60% of candidates solve it, which means 40% don't. If you haven't drilled the sliding-until-wall mechanic, you'll burn 20 minutes on the OA. StealthCoder surfaces a working solution in seconds if you blank on the exact state-space reduction.

Companies asking
5
Difficulty
MEDIUM
Acceptance
60%

Companies that ask "The Maze"

If this hits your live OA

The Maze is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an engineer at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share.

Get StealthCoder
What this means

The trick is recognizing that you can't treat each cell as a state. Instead, each state is a position where the ball has stopped (after sliding from a direction until hitting a wall). Standard BFS or DFS explores cells; The Maze explores stopped positions. You need to simulate the ball sliding in each direction from your current stopped position, updating only when it hits a wall. Most candidates either try to explore cell-by-cell (wrong), or they implement the sliding logic incorrectly (off-by-one on wall collision). The problem combines Array and Matrix iteration with Depth-First Search or Breadth-First Search, but the actual bottleneck is the sliding simulation. If the pattern clicks during prep, it's routine; if not, it's a trap door on test day. StealthCoder is the hedge if you freeze on the state-space design.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

The Maze recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an engineer at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share. Works on HackerRank, CodeSignal, CoderPad, and Karat.

The Maze interview FAQ

Is The Maze still asked at big tech companies?+

Yes. Block, Snap, Pinterest, Uber, and Walmart Labs all report it. Acceptance rate sits at 60%, which means it's neither a gimme nor a filter. It shows up enough that you should see it once before your OA.

What's the main trick everyone misses?+

Treating each cell as a state instead of each stopped position. The ball slides until it hits a wall, so you can't just check adjacent cells. You have to simulate rolling in all four directions and mark only the walls where it stops.

Should I use BFS or DFS for this?+

Either works. BFS finds the shortest path in terms of stopped positions. DFS is simpler to code. Both require the same sliding logic. Pick whichever you're faster at and focus on the simulation, not the search.

How does The Maze relate to standard pathfinding?+

It's pathfinding with a twist: you can't stop at will. State is not 'cell', it's 'cell where ball stopped'. This changes how you explore neighbors. Confusing the two costs most candidates their first attempt.

Is this a hard medium or an easy medium?+

It depends on whether you've seen the sliding mechanic. If you have, it's routine. If not, the 60% acceptance rate suggests half the test-takers struggle. The wall-to-state mapping is not obvious cold, which is why StealthCoder is a practical safety net for live OA.

Want the actual problem statement? View "The Maze" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.