Code RoomPrompt clarity for order totaling
EasyPrep Room Coding #4338

Prompt clarity for order totaling

Vibe & agenticAlgorithms & data structuresEntry–Mid~10 min

You're a junior on a Python team and need a small utility: a function that takes a list of order dictionaries and returns the total revenue, skipping any order whose status is "refunded". You're about to ask an AI assistant to write it. Write the prompt you'd give. Then explain: what would a vague prompt like "write a function to total orders" likely get wrong here, and how does your prompt prevent that?

Implement
total_revenue(orders: list[str]) → float
Examples
in[["amount=12.50,status=paid","amount=7.25,status=refunded","amount=30.00,status=paid"]]out42.5
in[["amount=19.99,status=paid"]]out19.99
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 10 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.