Employee Bonus Amount

Easy
Arithmetic

Employee Bonus Amount

The employees table contains salary and bonus percentage.

Return employee_id, bonus_amount, where the bonus is salary * bonus_pct / 100, rounded to 2 decimal places. Sort by employee_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.employees6 rows
employee_id (int)salary (double)bonus_pct (double)
15000010
2620007.5
3450000
48000012.5
53000020
6550005

Return these columns

employee_id(int)
bonus_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.