The Switchboard: Week 11
The Switchboard
Freeze Sunday Nov 29, 16:00 UTC3 inThe challenge
You're a data engineer at a phone company. Every call a customer places leaves a record on the switch that carried it: who called whom, when, and how the call ended. A collection job logs each record as 1 JSON line, and billing needs 1 clean row per call from that log. Write the code that turns the log into that table.
The mess
The network grew by buying smaller carriers, and each one kept its switches. 2 software releases are live on the newer switches. Phones and office phone systems fill in the number fields themselves. A switch writes a record for everything it handles, into the same feed. A switch that restarts sends its last files again.
1,000,000 messages
Click a column for its requirements, or click the bottom of the sheet to see the 10 sample rows to produce.
Notes from billing
- 1 row per call a customer placed, whichever switch carried it.
- A time with an offset is local time; the table is in UTC.
- collected_at, file and other collection extras are bookkeeping.
- The older switches close a long call's record every 15 minutes.
How you're scored
- +1the right value. A right null counts.
- 0null where the source held a value. Silence is free.
- −1a wrong value. Silent corruption costs.
- −2a row that should not exist: no matching key, or a second row for the same key. The last row for a key is the one scored.