HDFC UPI Cashback Payout

Easy
Arithmetic
Banking
HDFC Bank

HDFC UPI Cashback Payout

An HDFC-style UPI rewards team pays cashback on eligible transactions.

Return txn_id, cashback_amount, where cashback is amount * cashback_pct / 100, rounded to 2 decimal places. Sort by txn_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.transactions6 rows
txn_id (int)merchant (string)amount (double)cashback_pct (double)
1Swiggy4505
2BigBasket12002.5
3Uber30010
4Amazon25001.5
5Electricity8002
6Local Store1500

Return these columns

txn_id(bigint)
cashback_amount(double)

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.