Code RoomState update during render
MediumPrep Room Coding #4083

State update during render

Vibe & agenticAlgorithms & data structuresMid–Senior~15 min

An AI wrote this component to derive a label and report it upward. It crashes with 'Too many re-renders' or logs a warning about updating a component during render. Spot the antipattern.

Implement
audit_render_body(statements: list[str]) → list[str]
Examples
in[["compute:label","call_prop:on_label","set_state:seen","return jsx"]]out["1:side-effect-in-render","2:state-update-in-render"]
in[["compute:label","return jsx"]]out[]
in[["set_state:seen","return jsx","call_prop:on_label"]]out["0:state-update-in-render"]
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 15 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.