Code Room
Code reviewMediumcr-g067
Subject Inefficient data structureLevel Mid–Senior~20 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this Python access-control filter.

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.

Talk through your review
Code to reviewpython
def load_blocklist(path):    # ~100k banned user ids, one per line    with open(path) as f:        return [line.strip() for line in f] def filter_allowed(events, path):    blocklist = load_blocklist(path)    allowed = []    for ev in events:        if ev.user_id not in blocklist:            allowed.append(ev)    return allowed
Run or narrate your approach, then ask the coach.