Python data engineering interview problem. Difficulty: intermediate. Pattern: Strings. About 15 minutes. Part of the Pro drill bank.
CRM stores phone numbers in whatever format sales typed. Billing needs a normalized form so the same customer is not stored twice.
Normalize a batch of phone numbers to a single comparable form.
Input: normalize_phones(['(415) 555-1212', '14155551212', '99']) Output: ['415-555-1212', '415-555-1212', None] This input follows the stated rules and produces this output.
Topics: lakebench, python, data-transformation.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Reformat a list of inconsistently formatted phone numbers into one standard shape.
Normalize a batch of phone numbers to a single comparable form.