Which pattern implements a fixed-window rate limiter of 100 requests per minute per user?
- A INCR on a key including the minute, with EXPIRE 60 on first increment (correct answer)
- B LPUSH then LLEN
- C SETNX only
- D ZADD with the timestamp as score
Shortcut: INCR on a key such as rl:{user}:{minute} is atomic; setting EXPIRE when the counter is first created makes the window self-cleaning. A sorted set supports sliding windows at higher cost.