Code RoomMonth arithmetic billing spec
MediumPrep Room Coding #4161

Month arithmetic billing spec

Vibe & agenticAlgorithms & data structuresMid–Senior~16 min

You're asking an AI agent to write a Rust function that computes 'the same day next month' for a subscription billing anniversary — e.g. given a signup date, find the next billing date one month later, for any start date. Write the spec that makes the month arithmetic correct. What edge cases and library behavior do you mandate, and what acceptance criteria prove it? Then describe what a naive prompt ('add one month to the date') produces that mis-bills customers.

Implement
billing_dates_from_anchor(signup_date: str, cycle_count: int) → list[str]
Examples
in["2026-01-31",3]out["2026-02-28","2026-03-31","2026-04-30"]
in["2024-01-31",2]out["2024-02-29","2024-03-31"]
in["2025-12-31",2]out["2026-01-31","2026-02-28"]
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.