Skip to main content

Rate Limiter

Challenge on lesson: Checkpoint: Scope & Storage

CHALLENGE
Difficulty: beginner+25 XP

Implement int allow_request(void) using a static local: it returns 1 for the first 3 calls and 0 for every call after (a fixed budget of 3). Also implement void limiter_reset(void) that makes the next 3 calls allowed again โ€” two functions sharing one file-scope static int used;.

Back to lesson: Checkpoint: Scope & Storage