Code Room
Code reviewMedium
Question
Review this Python function that filters incoming events to those whose user is on an allowlist. The allowlist is loaded from config and can hold tens of thousands of ids.
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
def filter_allowed(events, allowlist): # allowlist is a list of user_ids loaded from config allowed = [] for e in events: if e.user_id in allowlist: allowed.append(e) return allowedRun or narrate your approach, then ask the coach.