Build a small CSV quality checker

Translate validation rules into tested code

← All assignments

Assignment preview

This is the complete public sample: the brief, source notes, deliverables, checks, and review criteria below. Download the same materials to work offline. Confirmed paid assignment terms and submission tools are available only in the invited portal.

The brief

Write a small Python or JavaScript script that checks a fictional assignment CSV. It must print valid rows and a clear error for each invalid row, without silently fixing data. In Python, use the built-in csv module. In JavaScript you may split lines by hand; just note that quoted commas aren’t handled.

Your source packet

Fictional source notes for this exercise. No outside client data.

Required headers: id,minutes,score. ID must be nonempty and unique. Minutes must be a positive integer; score must be an integer from 0 to 100 inclusive. Blank scores are invalid.
Example:
id,minutes,score
A01,30,80
A02,0,90
A01,20,70
A03,15,

Expected categories: one valid row; invalid minutes; duplicate ID; missing score. Header errors should stop processing with a clear message.

What to deliver

  1. Source code and a README with input/output examples
  2. Tests for valid input, duplicate IDs, zero minutes, blank scores, and quoted CSV fields
  3. A short note explaining one design tradeoff

Check your understanding

  1. Why does splitting every line on commas fail for some valid CSV files?
  2. What happens if the header row is missing?

Request a beta invitation

Request early access