Out-of-Stock Products

Easy
Filtering

Out-of-Stock Products

The inventory table stores the current stock for each product.

Return product_id, product_name for products with zero stock. Sort by product_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.inventory5 rows
product_id (int)product_name (string)stock (int)
1Notebook0
2Pen5
3Marker0
4Folder12
5Stapler0

Return these columns

product_id(int)
product_name(string)

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.