Code RoomOffline-first form submission
HardPrep Room Coding #4452

Offline-first form submission

Vibe & agenticAlgorithms & data structuresSenior–Staff~20 min

Your team is building a field-service mobile web app used by technicians in basements, elevators, and rural sites with intermittent connectivity. A junior used an AI agent to build the 'submit job report' form and it works flawlessly in the office. You're reviewing the spec, not the code. What does an AI-generated happy-path form fundamentally not account for here, and what would you add to the prompt/spec to get it right?

Implement
replay_report_sync_states(events: list[str]) → list[str]
Examples
in[["submit=R1","ack=R1"]]out["R1:synced"]
in[["offline","submit=R2","online","ack=R2"]]out["R2:synced"]
in[["offline","submit=R3","submit=R3","online"]]out["R3:pending"]
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.