Concurrent requests exceed rate limit
An AI assistant wrote this TypeScript function to sync issues from a third-party API that enforces 60 requests/minute and returns rate-limit headers. It worked in testing against a handful of issues. In production it gets the integration's API token throttled and then banned for an hour.
What's the failure, and how do you make this respect the contract?
Implement
plan_request_schedule(request_count: int, requests_per_minute: int, max_burst: int) → list[int]Examples
in
[5,60,2]out[0,0,1,1,2]in
[4,3,2]out[0,0,1,60]in
[3,60,60]out[0,0,0]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.