Rate limiting decomposition
You're handed a vague ticket: "Add rate limiting to the public API." You want to drive an AI agent through it but the ticket is too big for one prompt. Break this into agent-sized steps, each with a verifiable checkpoint, and say what you'd confirm before letting the agent move to the next step. The service is a Go HTTP server behind a load balancer with three replicas.
Implement
count_allowed_shared_vs_replica(timestamps_ms: list[int], replica_ids: list[int], window_ms: int, limit: int) → list[int]Examples
in
[[0,100,200,300,400,500],[0,1,2,0,1,2],1000,5]out[5,6]in
[[0,500,1000,1500],[0,0,0,0],1000,2]out[4,4]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 18 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.