HARDasked at 1 company

Escape a Large Maze

A hard-tier problem at 35% community acceptance, tagged with Array, Hash Table, Depth-First Search. Reported in interviews at UiPath and 0 others.

Founder's read

Escape a Large Maze is a HARD problem with a 35% acceptance rate that's been asked at UiPath. The title sounds simple but the trap is immediate: a naive BFS or DFS will time out or run out of memory on large grids. You're given a maze represented as an array, and the obvious approach of exploring every cell will fail. This is exactly the kind of problem where candidates blank during an OA because the pattern isn't grid-traversal 101. If you hit this live and your first solution TLEs, StealthCoder surfaces a working solution in seconds, invisible to the proctor.

Companies asking
1
Difficulty
HARD
Acceptance
35%

Companies that ask "Escape a Large Maze"

If this hits your live OA

Escape a Large 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 Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code.

Get StealthCoder
What this means

The trick here is recognizing that you can't brute-force every cell in a truly large maze. Standard Depth-First Search and Breadth-First Search work on small grids, but the problem name and difficulty hint at a constraint: the maze itself is so large that even storing the visited set becomes expensive. The key insight is often boundary-based or expansion-limited search, where you explore only reachable regions or use a hash table to track visited states efficiently instead of a 2D array. Pitfall: treating this like a standard maze problem and implementing textbook BFS on the full grid. Many candidates waste time optimizing search order instead of changing the data structure. StealthCoder handles the exact implementation when the pattern isn't clicking.

Pattern tags

The honest play

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

Escape a Large Maze recycles across companies for a reason. It's hard-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 Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Escape a Large Maze interview FAQ

Is this actually a BFS/DFS problem or is the trick something else?+

It's labeled as both, but the 'large' in the title is the giveaway. Standard BFS and DFS are the algorithmic family, but the optimization layer matters. A hash table to store visited coordinates instead of a 2D array is often the difference between passing and timing out. The core traversal logic stays the same; the memory strategy changes.

Why is acceptance so low at 35% for a problem that sounds basic?+

Because the naive approach (explore the whole grid) doesn't work. Candidates write clean BFS code that passes small test cases, then hits TLE on larger ones. They either don't optimize the visited storage or they miss a boundary condition that limits exploration. Knowing the pattern matters more than coding skill here.

What's the most common wrong approach?+

Using a 2D visited array on a very large grid, then iterating through every cell. Works on 100x100, fails on 10000x10000. The second mistake is not recognizing that you may not need to visit all reachable cells, only those that matter for the escape path. Think about what makes a cell relevant before exploring it.

Do I need to know advanced graph theory for this?+

No. It's Array, Hash Table, and basic DFS/BFS. The trick is the optimization layer: using a hash table (or coordinate set) for visited tracking instead of a 2D array. That alone often unlocks the problem. You don't need Dijkstra or A* unless the problem adds weighted edges, which isn't mentioned here.

Has UiPath asked this recently, or is it an older problem?+

It's in their reported history, so it's fair game in their OAs and take-homes. Interview problems rarely disappear; they rotate. If you're on UiPath's pipeline, practicing this exact problem is insurance against blanking when it appears. That's where StealthCoder's safety-net role kicks in.

Want the actual problem statement? View "Escape a Large 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.