Same-Day Multiple Orders

Medium
Aggregation
Filtering

Same-Day Multiple Orders

The orders table records order day per customer.

Return customer_id for customers who placed more than one order on the same day. Return each customer once, sorted by customer_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.orders10 rows
order_id (int)customer_id (int)order_day (int)
11011
21011
31012
41021
51022
61033
71033
81044
91051
101052

Return these columns

customer_id(int)

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.