#325 Forward deployed engineer interviews 6.5 min
Parse a Messy CSV Live: Interview Round in Python
A messy file, five checks, five attempts. The first passes 1 of 5. The last passes all 5.
See what splitting on commas does
Copy the code folder first. In the folder run python -c "import steps; print(steps.step1()[0]); print(steps.step2()[0])". Compare the two printed rows field by field. Explain in one sentence why the first row has the wrong values in the 'joined' and 'amount' fields.
A hint
The first data row has commas inside quoted fields. In step 1 the name field holds only half of the name, and the later fields are shifted along.
Read dates month first
In steps.py, in the iso function, change "%d/%m/%Y" to "%m/%d/%Y". Predict how many checks pass at step 5. Then run python run.py and python -c "import steps; print([r['joined'] for r in steps.step5()])". Compare the dates with what you get from the original file.
A hint
The checks only test that dates are in ISO form. The original gives 2026-04-03 for Ben Jones and this change gives 2026-03-04, yet 5 of 5 pass.
Turn a missing amount into zero
Put the date format back. In steps.py, in the number function, change 'return None' to 'return 0.0'. Predict whether all five checks will still pass. Run python run.py and python -c "import steps; print([r['amount'] for r in steps.step5()])". Then explain why the video says this is a mistake.
A hint
Look at the last value in the printed list. The video says a missing amount and zero are different facts.
Write a month in full
Put number back. In messy.py change '4 Mar 2026' to '4 March 2026'. Predict which checks will fail at step 5 and what the run will do at the end. Run python run.py. Then look at the format codes in the iso function and say which one cannot read the new text.
A hint
One format code reads the short month name. I saw 4 of 5 checks pass at step 5, 'dates are ISO' failing, and the run stopping with an error.
These tasks are for you to try on your own machine. Nothing is checked or saved.
What this does not show
A tiny made-up file with five planted problems; 03/04/2026 is read day first by assumption; no large files, encodings or short rows.
Up next in Forward deployed engineer interviews
More in Forward deployed engineer interviews
- #302 Forward Deployed Engineer Interview: What Is Tested
- #303 The FDE Decomposition Round: Vague Ask to a Plan
- #304 Scope an AI Pilot: Metric, Baseline and Stop Rule
- #305 Retry a Flaky API Without Duplicates: Idempotency Keys
- #306 Webhooks Done Right: Signatures, Retries and Replays
- #307 Schema Drift: Map a Customer's Data and Catch Changes
Related videos
- #149 Missing Data in pandas: Drop, Fill or Model It? Python for data
- #151 Regex for Data Cleaning: Extract IDs and Phones in Python Python for data
- #302 Forward Deployed Engineer Interview: What Is Tested Forward deployed engineer interviews
- #303 The FDE Decomposition Round: Vague Ask to a Plan Forward deployed engineer interviews
