Code RoomAndroid main thread freeze
MediumPrep Room Coding #4200

Android main thread freeze

Vibe & agenticConcurrencyMid–Senior~15 min

An AI generated this Android settings-screen code to read a config file and JSON-decode it before showing the UI. It works on the emulator, but QA reports the screen freezes for ~1s on older devices and you get ANR reports in production. What's wrong and how would you catch it?

Implement
audit_main_thread_work(op_lines: list[str], blocking_kinds: list[str], anr_limit_ms: int) → list[str]
Examples
in[["main|disk_read|800","main|json_parse|250","io|network|1200"],["disk_read","network","database"],5000]out["blocking:disk_read:800","jank:1050"]
in[["io|disk_read|800","main|bind_ui|4"],["disk_read"],5000]out["ok:4"]
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.