Code Room
Code reviewMedium
Question
Review this Python in-memory rate counter shared across request threads (CPython, with the GIL).
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
class Limiter: def __init__(self): self.counts = {} def allow(self, key, limit): n = self.counts.get(key, 0) if n >= limit: return False self.counts[key] = n + 1 return TrueRun or narrate your approach, then ask the coach.