Code Room
Code reviewMediumcr-g325
Subject TimezoneLevel Mid–Senior~18 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this Python helper that decides whether a webhook event has expired (events are valid for 5 minutes).

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
from datetime import datetime, timedelta, timezone MAX_AGE = timedelta(minutes=5) def is_expired(event):    # event['created'] is an ISO-8601 string with offset, e.g. '2026-06-22T19:05:00+00:00'    created = datetime.fromisoformat(event['created'])    return datetime.now() - created > MAX_AGE
Run or narrate your approach, then ask the coach.