Search
⌘K

Maze Solver with Path Printing

Implement a maze solving algorithm that finds a path from start to finish and prints the solution path. The solution should handle multiple test cases and clearly display the solved maze with the path marked.

Asked at:

Meta


Hello Interview Answer Key

Maze Solver

A detailed walkthrough of the Maze Solver problem, covering the approach, implementation, and optimization.

Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late May, 2026

Meta

Senior

Question had 5 parts: part 1 (debug): path printing was invalid; start and end were being added to the path part 2 (debug): revisiting same cell; use a visited set part 3 (implementation): Some cells are chutes (one way); need to update valid cell logic part 4 (implementation): Keys and Gates, acquires keys to pass through gates; update BFS to maintain key state. Discussed time/space complexity and optimization with bitmap (was not asked to ask implement bitmap, plenty of time was left) part 5a (implementation): Something to do with a medusa that you want to avoid. part 5b ????

Mid May, 2026

Meta

Senior

Interview had multiple extensions on a grid/BFS problem. * First, without AI help, I fixed a bug in `cell.Type` logic quickly. Interviewer pushed for a cleaner solution without hardcoded strings/constants. * Then AI was enabled. I identified and explained a BFS bug related to printing the solution path and fixed it with AI assistance. * Added support for direction characters like `<` and `>`, which AI implemented based on my instructions. * Next, implemented key-lock logic (`a -> A`, `b -> B`) by extending visited state to also track collected keys/state. * Final follow-up was only discussion based: avoiding movement toward a “Medusa” if in the same row/column. Final verdict: Not selected. Not sure if this round became a concern despite completing most parts.

Mid May, 2026

Meta

Senior

Your account is free and you can post anonymously if you choose.