Code RoomQuadtree boundary objects unreachable
HardPrep Room Coding #4304

Quadtree boundary objects unreachable

Vibe & agenticAlgorithms & data structuresSenior–Staff~19 min

An AI assistant wrote a quadtree for 2D collision culling in JavaScript. Most objects are found correctly, but objects whose center lands exactly on a quadrant divider get inserted into the wrong child and then never returned by queries that overlap them. Review the child-index logic and find the boundary off-by-one.

Implement
overlapping_quadrants(node: list[int], range_box: list[int]) → list[int]
Examples
in[[0,0,100,100],[10,10,5,5]]out[0]
in[[0,0,100,100],[50,50,0,0]]out[0,1,2,3]
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 19 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.