Code Room
Code reviewMediumcr-g319
Subject Partial failureLevel Mid–Senior~18 minCommon in Distributed systems interviewsIndustries Software development

Question

Review this Python function that fans out a notification to many recipients. `send` calls an email provider and may raise on a single bad address or a transient error.

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 send(recipient, message):    resp = provider.send_email(to=recipient, body=message)    resp.raise_for_status()   # raises on 4xx/5xx def notify_all(recipients, message):    sent = 0    for r in recipients:        send(r, message)        sent += 1    logging.info("notified %d recipients", sent)    return sent
Run or narrate your approach, then ask the coach.