Amazon Prime Late Deliveries

Easy
Filtering
Logistics
Amazon

Amazon Prime Late Deliveries

An Amazon-style delivery team compares promised and actual delivery days.

Return shipment_id, delay_days for shipments delivered after the promised day. Sort by shipment_id ascending.

Browser Engine: Evaluates PySpark DataFrame & SQL logic locally in Pyodide WebAssembly.

Input data

1 DataFrame

These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].

df.shipments7 rows
shipment_id (int)promised_day (int)delivered_day (int)
123
244
313
455
534
668
722

Return these columns

shipment_id(bigint)
delay_days(bigint)

Column names and order must match. Sort order is specified in the question.

Browser engine
Loading Python editor…
Click Run to try the sample cases, or Submit to check the hidden cases. First run caches the browser Python engine (~8–15s once); all code stays on your device.