Code RoomEmail regex validation without fuzzing
MediumPrep Room Coding #4013

Email regex validation without fuzzing

Vibe & agenticAlgorithms & data structuresMid–Senior~16 min

You asked an assistant to write a regex to validate and extract user emails from free-text comments in a JavaScript service. It produced one that matches every example you tried and the PR is otherwise clean. You don't deeply understand the pattern. How do you verify it's correct and safe before it goes in front of untrusted input — without just trusting that it 'works on the examples'?

Implement
is_plausible_email(candidate: str) → bool
Examples
in["user+tag@example.co.uk"]outtrue
in["user@@example.com"]outfalse
in["user@example"]outfalse
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 16 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.