Code RoomBilling engine math limits
HardPrep Room Coding #5009

Billing engine math limits

Vibe & agenticCode quality & reviewSenior–Staff~20 min

A product manager asks you to have an AI agent build the money-math core of a new billing engine in Python: proration on mid-cycle plan changes, tax application, rounding to currency minor units, and credit-note generation. When would you NOT delegate this to the agent, and what makes AI the wrong tool for the load-bearing parts here?

Implement
prorate_invoice_minor(plan_price_minor: int, days_used: int, days_in_cycle: int, tax_basis_points: int) → list[int]
Examples
in[10000,15,30,0]out[5000,0,5000]
in[10000,15,30,875]out[5000,438,5438]
in[999,1,30,2000]out[33,7,40]
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 20 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.