Code Room
CodingEasycod-g1004
Subject SecurityLevel Entry–Mid~12 minCommon in Security interviewsIndustries Software development

Question

Implement safe structural email validation for a registration form. Return True only if `email` is a single local part, exactly one '@', and a domain with a dot-separated TLD of at least two letters. Specifically it must match: local part of [A-Za-z0-9._%+-]+, then '@', then a domain of [A-Za-z0-9.-]+, then a literal dot, then a TLD of 2+ letters, anchored to the whole string. Reject anything with zero or multiple '@'. Empty string is invalid.

Implement
is_valid_email(email: str) → bool
Examples
in["alice@example.com"]outtrue
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.