Lantern Maze
Fix a grid game's failing checks, write its path finder and speed up its lighting count.
Task
Lantern Maze is a small grid game. A level is a map of walls, floor, a start, an exit and lanterns. The rules engine has checks that fail, a path finder that was never written, and a lighting count that is too slow for large maps. Work through it in three stages: make the failing checks pass, write the path finder, then make the lighting count fast.
Requirements
- play(lines, request) takes a map and one request, and returns a small object. A map is a nonempty list of nonempty strings of equal length (ValueError containing map otherwise). # is a wall; every other character is an open cell. The edge of the map is the edge of the world. Do not change the arguments.
- Stage 1. {op: "size"} returns {rows, cols}. {op: "neighbors", cell: [row, col]} returns {neighbors}: the open cells one step up, down, left and right of the cell, in that order, each as [row, col]. A cell outside the map raises ValueError containing cell. Any other op raises ValueError containing op.
- Stage 2. {op: "path"} returns {steps}: the fewest steps from S to E, moving one open cell at a time, or -1 when E cannot be reached. The map must have exactly one S and one E (ValueError containing map otherwise).
- Stage 3. {op: "lit", radius} returns {lit}: how many open cells are within radius steps of at least one lantern (L), walking through open cells only, so walls block light. A lantern lights its own cell. radius is a non-negative integer (ValueError containing radius otherwise). The count must finish on a 150 by 150 map with thousands of lanterns.
How you are graded
- Decomposition 15%
- Prompting the assistant 15%
- Verification 20%
- Judgment about AI output 15%
- Correctness 25%
- Communication 10%
Scores use evidence from your session. A short or incomplete session may not provide enough evidence for every skill. See a sample scorecard
Interview guidance
This is a small grid game. First make the failing checks pass. Then implement the stubbed path finder. Then make the lighting count fast enough for large maps. Use the AI assistant however you like. Before you change anything, run the checks and tell me which failures you think share a cause.
- AI is allowed and expected: your own Claude, OpenAI or Gemini key, or the free in-browser model.
- You are graded on how you drive and check the AI, not on how much you prompt.
- Run the checks; read what fails.
- A new requirement will arrive partway through.
- Too little AI use is reported as “not enough to grade”, never as a fail.
You will answer 7 debrief questions at the end
- What did you delegate to the AI, and why?
- Name one AI suggestion you rejected or changed, and why.
- Choose one block the AI helped write. Explain what each line does and which test verifies it.
- What is still risky, and what would you test or ship next?
- Which Stage 1 failures shared a cause, and how did you find it? What did the assistant miss at first, if anything?
- Why is one search from every lantern at once enough for the lighting count? What does it cost compared with one search per lantern?
- Once doors exist, why can the same cell be worth visiting twice?