Code Room
Code reviewMedium
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.
Learn the concepts
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 outRun or narrate your approach, then ask the coach.