Requirements
You receive a small Python maze project containing S for the start, E for the destination, # for walls, and . for traversable cells. The interviewer provides solver.py, a printing helper, and a tests/ directory. The exercise advances through four or five stages.
- Q1 — Repairing a defect; AI is generally not permitted. The rendered route may replace the
S or E markers, or the diff-like display may be incorrectly formatted. Correct the printing behavior so the start and end glyphs take precedence.
- Q2 — Preventing BFS / DFS from looping forever. The search currently lacks a
visited set. Add one and remove duplicate states before they are enqueued.
- Q3 — One-way directional gates. A
> or < cell restricts the direction of the following move. Update get_neighbors / move so the glyph in the current cell is taken into account.
- Q4 — Collectible keys and locked doors. Lowercase characters represent keys, while uppercase characters represent doors. Search state must grow from
(x, y) to (x, y, collected_keys_bitmask). A location may therefore need to be visited again after additional keys have been collected.
- Q5 (added in April 2026) — Bomb mechanics. A bomb removes walls inside a fixed area, commonly either a radius-2 Chebyshev neighborhood or a one-cell
+ shape. Add a get_affected_area(x, y) helper, include the set of destroyed walls in the search state, and determine whether a blast occurs once or remains persistent.
- Q5 alternative — Energy-aware shortest paths. When cells have energy costs, find an exit path with the minimum total energy. The expected technique is Dijkstra's algorithm. Some versions use this variant instead of bombs.
Trap to watch
A candidate has reported that the Q1 starter includes a deliberately invalid test that must be commented out before the display fix can be checked. The intended response is to identify that bad test rather than alter the implementation to accommodate it. If the Q1 test continues failing after an apparently correct fix for more than 30 minutes, ask whether one of the tests is incorrect.
Examples
A reported run uses an 8×10 grid in the style of S.....#...E. Q1 prevents the * route marker from covering S; Q2 adds visited tracking to BFS; Q3 blocks leftward movement from > cells; Q4 adds matching a/A and b/B pairs; and Q5 puts a single bomb in the maze that clears a 5×5 wall block when triggered. Several reports describe seven hidden tests, with passing the first four stages as the threshold.
Notes
- Since mid-March, the AI assistant has been able to edit the CoderPad workspace directly in a Cursor-like manner. The model selector offers Claude Opus 4.6, GPT-5.x, and Sonnet, with Opus 4.6 commonly regarded as the strongest choice for this prompt.
- You will be asked to explain the code the AI produces. A solution that runs correctly but cannot be explained is a frequent reason for rejection.
- Completing Q4 is generally considered the strong-performance benchmark; Q5 is an advanced extension introduced in April 2026.
- The bomb rules are intentionally underspecified. Before asking the AI for help, clarify whether bombs activate when entered, when left, or when triggered from an adjacent cell.
Preparation
- First practice the standard Q1–Q4 progression manually, so you can state the algorithm to the AI instead of accepting generated code without understanding it.
- Use a public maze-practice harness with the same class organization and an interactive AI panel to rehearse.
- Repeat this prompting pattern: choose the algorithm independently, divide the work into small functions, request help one function at a time, then read and explain every change. Having the AI complete the entire exercise without review often leads to failure during the explanation follow-up.
- For Q5, prepare a mental pattern for radius-
N blast geometry and for adding a bitmask-like state component, so you do not need to derive either idea from scratch during the interview.