Code RoomAsync storage saves stale data
HardPrep Room Coding #4206

Async storage saves stale data

Vibe & agenticAlgorithms & data structuresSenior~18 min

An AI wrote this React Native multi-step form that saves progress so users don't lose work if the OS kills the backgrounded app. It works when the dev manually navigates back, but real users report their answers are blank after Android kills the app in the background and they reopen it. What's wrong and how would you fix it?

Implement
restore_wizard_answers(update_lines: list[str], save_after_update: bool, parse_on_restore: bool) → list[str]
Examples
in[["name=Ada","email=ada@x.io","role=eng"],true,true]out["email=ada@x.io","name=Ada","role=eng"]
in[["name=Ada","email=ada@x.io","role=eng"],false,true]out["email=ada@x.io","name=Ada"]
in[["name=Ada","email=ada@x.io"],true,false]out[]
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.