Tax withholding calculation
Your team needs to implement the tax-withholding calculation for payroll across several jurisdictions — gnarly, rule-heavy logic with legal consequences if it's wrong. A teammate suggests just having the agent write the whole thing from the statutes. Would you reach for an AI assistant here, and if so for what exactly? What failure modes make it the wrong tool for parts of this?
Implement
compute_withholding_cents(bracket_floors_cents: list[int], bracket_rates_bp: list[int], taxable_cents: int) → intExamples
in
[[0,1000000,5000000],[1000,2000,3000],2500000]out400000in
[[0],[2500],400000]out100000in
[[0,1100000,4472500],[1000,1200,2200],0]out0What 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 15 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.
Run or narrate your approach, then ask the coach.