Code RoomFloating point equality in reconciliation
MediumPrep Room Coding #4337

Floating point equality in reconciliation

Vibe & agenticAlgorithms & data structuresMid–Senior~16 min

You inherit a data-quality check and ask an AI to explain this pandas snippet. The agent says: "It flags any transaction row where the recomputed total doesn't equal the stored total — a solid reconciliation check that'll catch every mismatch." You're about to gate a financial export on it. What does the explanation overlook, and how do you verify it actually catches what it claims?

Implement
find_total_mismatches(quantities: list[int], unit_prices: list[str], stored_totals: list[str]) → list[str]
Examples
in[[3,2,1],["0.10","19.99","5.00"],["0.30","39.98","5.01"]]out["2=mismatch"]
in[[1,2],["1.00","2.00"],["","nan"]]out["0=missing","1=missing"]
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 16 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.