Code RoomMoney rounding and currency allocation
HardPrep Room Coding #4311

Money rounding and currency allocation

Vibe & agenticAlgorithms & data structuresSenior–Staff~18 min

You need to implement the core money-rounding and currency-allocation logic for a payments split (e.g. divide $100.00 across 3 payees so the cents always reconcile to the total). An agent has produced two plausible Java implementations on two tries; both pass the happy-path tests but you're uneasy about edge cases. When do you stop prompting and just write this yourself, and how do you justify that call?

Implement
allocate_amount_evenly(total_minor_units: int, payee_count: int) → list[int]
Examples
in[10000,3]out[3334,3333,3333]
in[100,3]out[34,33,33]
in[7,7]out[1,1,1,1,1,1,1]
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 18 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.