Code RoomPhone number regex verification
EasyPrep Room Coding #4492

Phone number regex verification

Vibe & agenticAlgorithms & data structuresEntry–Mid~12 min

An AI agent wrote a 40-character Python regex to validate and parse international phone numbers for a signup form, and it works on every example you tried. You don't fully understand the regex — the lookaheads and the optional country-code group are opaque to you. It's about to gate every new user. How do you verify it's correct and safe before merging, without just trusting that it parsed your handful of test numbers correctly?

Implement
validate_phone_numbers(raw_numbers: list[str]) → list[bool]
Examples
in[["+14155552671","415-555-2671","+1-800-FLOWERS"]]out[true,true,false]
in[[""]]out[false]
in[["+1 415 555 2671","+0123456789","+"]]out[true,false,false]
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 12 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.