Code RoomFlutter camera black screen
HardPrep Room Coding #4212

Flutter camera black screen

Vibe & agenticAlgorithms & data structuresSenior–Staff~18 min

An AI wrote this Flutter widget for a video-call screen that should re-acquire the camera and resume the call when the user returns from a backgrounding (e.g., took a phone call). It works if you stay in the app, but when the OS suspends and resumes the app, the camera preview stays black and the call doesn't reconnect. What's wrong and how would you fix it?

Implement
count_black_preview_resumes(lifecycle_events: list[str], observes_lifecycle: bool) → int
Examples
in[["inserted","paused","resumed"],false]out1
in[["inserted","paused","resumed"],true]out0
in[["inserted","paused","resumed","paused","resumed"],false]out2
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.