The interview problem
A customer's nightly CSV feed imports successfully, but leading-zero IDs, accented names and decimal values change. Establish a reliable file contract and migration plan.
Original practice, not a reported company interview. All scenarios and worked numbers are illustrative. Interview date: not applicable. Sources retrieved September 30, 2026.
1. Scope and assumptions
Parsing rows is not the same as understanding field types. Treat customer IDs as strings unless the source owner explicitly defines numeric semantics. Encoding, delimiter, quoting and locale must be specified.
2. Worked approach
raw bytes → dialect + typed schema → validated values / quarantine → approved replay
Preserve raw bytes and a file digest. Inspect a disputed row with the customer, then define encoding, delimiter, quote rules, newline handling, null representation and each column's type. Validate against a versioned schema before normalization.
Keep raw values alongside normalized values and error codes. Quarantine ambiguous rows with a reconciliation report rather than guessing decimal separators or replacing invalid bytes silently. Backfill from original files after the contract is approved; do not repair already-truncated identifiers by padding unless the source guarantees the width.
3. Calculate the example
Identifier 00123 parsed as integer 123 loses information: both 00123 and 123 collapse to the same representation. Text 1,234 can mean one thousand two hundred thirty-four or 1.234 depending on the agreed convention. If 9,800 of 10,000 rows pass validation, acceptance coverage is 98% and 200 rows remain unresolved. Reporting success because the parser produced 10,000 row objects hides the business failure.
4. Failure cases and trade-offs
A naive split on commas breaks quoted fields containing commas or newlines. Automatic encoding guesses may appear correct until rare names arrive. Empty string, missing field and literal NULL may have different meanings. Spreadsheet re-saving can alter identifiers before the integration sees them.
Strict validation creates an exception queue but prevents silent corruption. A permissive initial importer needs explicit confidence and reconciliation rather than unqualified success. A typed interchange format may reduce ambiguity, but the customer may need a staged migration from CSV.
5. Validate the result
Use fixtures with leading zeros, quoted newlines, non-ASCII characters, embedded delimiters and null variants. Have the source owner approve exact expected values and compare row-level keys and totals before replaying history.
6. Interview follow-ups and self-review
How would you detect a producer changing delimiter mid-file? Which raw artifacts allow a reversible repair?
Reward a typed contract, byte preservation, ambiguous-value handling and honest coverage reporting.
Sources and related practice
Technical reference: docs.python.org — Official CSV dialect and parsing reference; customer repair workflow is original.
Exact publication/update date not established in this review. Retrieved September 30, 2026. This reference supports the named technical concept; the proposed workflow and examples are original, not a documented vendor implementation or interview report.
Continue with Resolve unit and meaning mismatches in customer data; Retire a customer integration version.
Continue your preparation
Choose a connected learning path or browse more FDE interviews questions. Read our editorial method and attribution policy.