AO
AceOffer
·
Back

CSV Data Processing and Formatting

Phone ScreenPhone ScreenSoftware Engineer, Machine Learning EngineerLast reported April 2026Low Frequency

Problem Overview

Given a CSV-formatted string (header row + data rows, e.g.
Full problem statement
Given a CSV-formatted string (header row + data rows, e.g. "col1,col2,col3,col4\nvalue1,value2,value3,value4\n"), design and implement a function in pure Python (no external packages such as pandas) that parses and formats the data into a structure usable by other engineering teams. The requirements are intentionally open-ended; the interviewer provides only a single example row and leaves the output format largely up to the candidate. A follow-up then introduces corrupted data: assume headers are always correct, but data rows may have missing values or extra values. The solution must detect and flag invalid rows (e.g. via an is_valid boolean field) so downstream consumers can filter or investigate them.

Follow-up Arc

Interviewers escalate through these phases. The order varies, but most candidates see at least one from each bucket.
Trade-off discussion · 3
Trade-off discussion
How would you handle corrupted data in the CSV? Assume the header row is always correct.
Probes for: After candidate implements clean-data parsing
Can you implement this from scratch using only pure Python, without any external packages?
Probes for: Candidate proposes using pandas or another library
What are the trade-offs of different output formats (column-oriented dict, list-of-dicts, row-index-keyed dict)?
Probes for: Candidate proposes a single output format

Approach Trade-offs

Approaches actually attempted in reports — including ones that lost candidates time. Pick deliberately.
ApproachNotes
Column-oriented dict {col_name: [values]}Simple to construct and easy to access all values for a single column; harder to attach per-row metadata like is_valid.
Row-oriented list of dicts [{col_name: value, ..., is_valid: bool}]Natural fit for per-row validation flags and easy filtering; slightly more verbose to build.
Row-index-keyed dict {row_index: {col_name: value, is_valid: bool}}Preserves original row index for debugging corrupted rows; less idiomatic than a list of dicts.

Practice

Open the editor to write a solution against test cases, then return here to compare against the follow-ups.
Open Editor →
Waymo · Phone Screen · Reported 2× across candidate reports