A driver payout service under-pays short deliveries. Fix it, then add live totals, payout cutoffs and peak concurrency.
45 minute budget71.3% acceptancedebugging · time math · aggregation
How this problem works
A small TypeScript library with a bug. Part 1: make the failing tests pass without touching tests/. Parts 2 to 4 unlock in order as each part's public tests pass. In a mock interview the product owner asks for a plan before each part, and the grader reads your answer.
1Fix short-shift pay
2Live total
3Pay up to a cutoff
4Peak simultaneous drivers
Part 1: Fix short-shift pay
01Drivers report that very short deliveries pay nothing, and a shift a little over a minute long pays for exactly one minute.
02Pay is the shift's full duration in seconds times the hourly rate in cents, divided by 3600, rounded to the nearest cent.
03The duration shown on the dashboard is still meant to be whole minutes. Do not change how it is displayed.
What the hidden tests check in Part 1
A 59-second and a 61-second shift pay different amounts.
Half-cent amounts round to the nearest cent.
A shift that crosses midnight is paid for its full length.
A ten-hour shift pays exactly ten times the hourly rate.
Hints for Parts 2 to 4 appear in the workspace as each part unlocks.