Code RoomUnquoted variable in destructive command
MediumPrep Room Coding #4132

Unquoted variable in destructive command

Vibe & agenticAlgorithms & data structuresMid–Senior~15 min

An AI wrote this bash deploy script to "clean the release directory and copy the new build." It works in every test. One day on a host where the env var wasn't set, it wiped the wrong thing. What's the bug?

Implement
safe_release_target(app_name: str, build_id: str) → str
Examples
in["acme-site","20260131"]out"/var/www/acme-site/releases/20260131"
in["","20260131"]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 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.