learning-it by example

Back to the video

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.

Video #325 ยท Forward deployed engineer interviews

Steps in the video

  1. 0:00 A messy file, five checks, and five small fixes
  2. 0:31 The idea
  3. 1:00 Setup
  4. 1:22 The file
  5. 1:55 The five checks
  6. 2:20 Attempts one and two
  7. 2:47 Attempt three: dates
  8. 3:20 Attempt four: amounts
  9. 3:40 Attempt five: one row per id
  10. 3:58 Run all five
  11. 4:46 What this does not show
  12. 5:14 Mistakes to avoid
  13. 5:40 My take and next steps
  14. 6:06 Recap

Files

  • checks.py (36 lines)
  • messy.py (8 lines)
  • run.py (14 lines)
  • steps.py (54 lines)

Download the code (zip)

Tested with

Python 3.12.15

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.

Sources

Learning IT by Example.