The Register: Week 3

The Weekly · Week 3 · Stream

The Register

Next drop Monday Oct 5, 16:00 UTC

Week 3

hosted bydatadriven

Results

next drop

14 scored

46 submissions

first in sandy_boar_3612, 3h 23m

The challenge

You're a data engineer at an electric utility. Each half hour, every smart meter reports the energy it used and its register, the total it has counted since it was installed. A feed forwards each report as 1 JSON line, and billing needs 1 clean row per meter per half hour from it. Write the code that turns the feed into that table.

The mess

The meters came from 3 makers over 12 years, and each maker's system reports in its own way. Meters that lose signal keep their reads and send them when it returns. Every line crosses a message queue on its way to you. A collector that times out sends its whole batch again. Some collectors assemble lines by hand, and a few were cut short.

Streamed record examplesline 1 of 10
01{
02"meter_id": "M-0231257",string
03"interval_end": "2026-10-29T23:00:00Z",string
04"kwh": 1.872,number
05"register": 41310.757,number
06"quality": "A"string
07}

1,000,000 messages

Output schema

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 meter per 30 minute interval.
  • For the same interval, an actual read beats an estimate.
  • collector, received_at and other head-end extras are bookkeeping.
  • Corrections are copied from the meter database as change events.

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.
Drops Mon 28 Sep 16:00 UTC · freezes Sun 04 Oct 16:00 UTC · results post at the freeze · next drop Mon 05 Oct 16:00 UTC. Submit as often as you like; the last one counts. Questions go in this week's thread.