Code Room
Code reviewMediumcr-g495
Subject Error handlingLevel Mid–Senior~16 minCommon in Distributed systems · Code quality & review interviewsIndustries Software development

Question

Review this Python data-loader. The caller needs to retry on a transient `ConnectionError` but give up on a `SchemaError`.

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_partition(part):    try:        return store.read(part)    except Exception as e:        raise RuntimeError(f"failed to load {part}: {e}") def run(parts):    for p in parts:        try:            load_partition(p)        except ConnectionError:            retry_later(p)        except SchemaError:            quarantine(p)
Run or narrate your approach, then ask the coach.