Code RoomDistributed rate limiter spec
HardPrep Room Coding #3971

Distributed rate limiter spec

Vibe & agenticNetworking & APIsConcurrencySenior–Staff~22 min

You're delegating a distributed rate limiter to an AI agent: it must cap each API key to N requests per rolling minute across a fleet of stateless Go servers backed by Redis. Write the spec. Which algorithm and which guarantees do you pin down, and what would an underspecified prompt let the agent quietly choose wrong?

Implement
sliding_window_allow(timestamps_ms: list[int], limit: int, window_ms: int) → list[bool]
Examples
in[[0,100,200,900,1050],2,1000]out[true,true,false,false,true]
in[[59000,59500,60000,60500],2,60000]out[true,true,false,false]
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 22 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.