Python data engineering interview problem. Difficulty: intermediate. Pattern: Strings. About 15 minutes. Part of the Pro drill bank.
A CSV column is supposed to be numeric but contains junk. Ingest should convert what it can and skip or default the rest without crashing the job.
Safely parse a batch of numeric strings.
Input: parse_numbers(['1', '2.5', 'no']) Output: {'ok': [1.0, 2.5], 'bad': ['no']} This input follows the stated rules and produces this output.
Topics: lakebench, python, error-handling.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Convert a list of strings to numbers, collecting which entries failed instead of crashing.
Safely parse a batch of numeric strings.