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 the amount check so large expenses are flagged
2Per-expense rules
3Trip aggregation
4Composite rules
Part 1: Fix the amount check so large expenses are flagged
01Finance reports that a 1,200 dollar team dinner sailed past the 500 dollar meal limit without a flag.
02The same afternoon a 9 dollar coffee was flagged against a 100 dollar limit.
03Amounts come in exactly as the employee typed them, like "12.50" or "1,200.00".
04Part 1's public tests reproduce both complaints. Make them pass without breaking the money helpers.
What the hidden tests check in Part 1
An expense exactly at the limit is allowed.
A single-digit amount is under a two-digit limit.
Amounts with thousands separators such as "1,200.00" parse and compare correctly.
Negative amounts throw a RangeError.
Hints for Parts 2 to 4 appear in the workspace as each part unlocks.