Code RoomECS component removal during iteration
HardPrep Room Coding #4294

ECS component removal during iteration

Vibe & agenticAlgorithms & data structuresSenior–Staff~20 min

An AI agent implemented a damage-resolution system for a custom C++ ECS. Under load — many overlapping AoE hits — the game crashes intermittently and sometimes a unit takes damage twice or skips its death. Review the system and explain the structural bug.

Implement
resolve_damage(healths: list[int], hits: list[list[int]]) → list[int]
Examples
in[[10,10,10],[[0,4],[0,7],[2,10]]]out[0,2]
in[[5],[]]out[]
in[[3,3],[[1,1],[1,1],[1,1],[1,1]]]out[1]
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 20 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.