Code RoomModal accessibility defects
HardPrep Room Coding #4453

Modal accessibility defects

Vibe & agenticAlgorithms & data structuresMid–Senior~18 min

An AI agent built this modal dialog component. It opens and closes correctly with the mouse and looks right. A keyboard-only and a screen-reader user file complaints in the same week. Find the accessibility defects.

Implement
trap_modal_focus(focusable_ids: list[str], trigger_id: str, keys: list[str]) → list[str]
Examples
in[["close","save"],"openBtn",["Tab","Tab","ShiftTab"]]out["close","save","close","save"]
in[["email","submit","close"],"trigger",["Escape","Tab"]]out["email","trigger","trigger"]
in[[],"openBtn",["Tab","Escape"]]out["dialog","dialog","openBtn"]
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 18 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.