Code Room
Code reviewMediumcr-g473
Subject Repeated workLevel Mid–Senior~18 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

Review this Python function that filters records out of a raw config blob.

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
import json def matching_rules(raw_config_json, event_types):    out = []    for etype in event_types:        config = json.loads(raw_config_json)   # raw_config_json is the same string every iteration        for rule in config["rules"]:            if rule["on"] == etype:                out.append(rule)    return out
Run or narrate your approach, then ask the coach.