The Basket: Week 9

The Basket

Next drop Monday Nov 16, 16:00 UTC

Week 9

hosted bydatadriven

Results

next drop

5 scored

8 submissions

first in coral_mesa_9943, 12h 35m

Your DAG2026-11-14 · night 30 of 30

order_events42,594 rows
scans223,859 rows
prices33,555 rows
order_events_history
scans_history
prices_history
order_charges
order_charges
  • order_idTEXT
  • statusTEXT
  • delivered_atTEXT
  • itemsINTEGER
  • subtotalNUMERIC
  • tipNUMERIC

The challenge

You're a data engineer at a grocery delivery app. A customer orders from a store's shelves in the app, a shopper walks the aisles picking each item and scanning it into the bags, and a driver brings them to the door. Finance needs 1 clean row per order: whether it was delivered, how many items it charged, what they cost, and the tip. The order service provides order_events, a live table with a row each time an order is placed, changed or delivered. The shopper app provides scans, a log with a row for every item scanned into an order. The merchandising system provides prices, a nightly snapshot of the stores' price list. Write the DAG that builds finance's table of the orders placed from to .

The mess

Shoppers run 2 releases of the shopper app, each with its own scanner. The stores check every day's scans against the register overnight. The driver app saves a delivery on the phone until it has signal. 3 apps write to the order service, each with its own words and clock. The copy job was patched under pressure more than once.

Raw tables

order_events
prices
scans

Target table

order_charges

Click a column for what it holds, or click the bottom of a sheet to see its sample rows.

Notes from finance

  • An item's price in force is in the latest price list copied before the order.
  • An item not on the price list yet takes the first price listed for it.
  • A replacement is charged unless the customer last turned it down.
  • A day of scans sent again replaces that day as it was first sent.
  • The older app release is still on many shoppers' phones.

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.
Questions go in this week's thread.