#307 Forward deployed engineer interviews 6.2 min
Schema Drift: Map a Customer's Data and Catch Changes
A guessed fix for a changed export made two totals 100 times too big, with no error.
Read the drift report
Copy the code folder first. Run python run.py. For the four April problems, write down which of the three kinds of change each one is: a renamed column, a new column, or a changed format. You should see 0 problems for March and 4 for April.
A hint
Dates and amounts are changes in format.
Undo the rename
In exports.py, in the first line of APRIL, change customer to cust_name. Predict how many problems April has now and which line disappears, then run python run.py. With this change April has 3 problems, and both the missing column line and the hint are gone.
A hint
The check only looks for names that the mapping expects.
Fix the dates in one row
In exports.py change the first April date 03/04/2026 to 2026-04-03. Predict the count for order_date, then run it. With this change it says 4 of 5 values in order_date do not parse. Why does the report still flag order_date when one row now parses?
A hint
The check counts each value that fails to convert.
Test the tempting fix on good data
In exports.py change the April amounts "1.250,00", "80,00" and "310,00" to 1250.00, 80.00 and 310.00 without quotes. Predict what lenient_totals gives now, then run python run.py. With this change the amount problem disappears from the report, but the tempting fix now prints totals [125000.0, 8000.0, 4225.0, 31000.0, 1999.0]. Compare them with the expected line.
A hint
The fix removes every dot, so a normal decimal point is lost.
These tasks are for you to try on your own machine. Nothing is checked or saved.
What this does not show
Tiny made-up exports and mapping, five rows each. The rename hint is a spelling guess that a person must confirm. The check only counts values that fail to convert: a value that converts to the wrong number (1.250 meant as 1,250) passes. A program cannot settle day-first against month-first dates. Sources are vendor pages, not standards.
Up next in Forward deployed engineer interviews
More in Forward deployed engineer interviews
Related videos
- #305 Retry a Flaky API Without Duplicates: Idempotency Keys Forward deployed engineer interviews
- #308 Two Systems Edit One Record: Lost Updates Explained Forward deployed engineer interviews
- #309 Profile Messy Customer Data in SQL Before Any Model Forward deployed engineer interviews
- #107 Data Contracts: Stop Breaking Downstream Data engineering and pipelines
