Code RoomDecimal arithmetic port verification
MediumPrep Room Coding #4231

Decimal arithmetic port verification

Vibe & agenticCode quality & reviewMid–Senior~20 min

Your team is porting a Python service that computes per-customer billing rollups to Go for throughput. You point an AI agent at the Python module and ask it to produce an idiomatic Go port. The math involves summing thousands of Decimal line items and rounding to cents. How do you scope this port for the agent, and how do you guarantee the Go output produces byte-for-byte identical totals to the Python version before you cut over?

Implement
sum_amounts_half_even(amounts: list[str]) → str
Examples
in[["10.005","10.005"]]out"20.01"
in[["0.125"]]out"0.12"
in[["1.005","2.005","-0.01"]]out"3.00"
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.