Code Room
Code reviewMediumcr-g293
Subject Missing cacheLevel Mid–Senior~18 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this Python function that converts amounts using live FX rates. It is called for every line item on every invoice render, and the rates barely change during a day.

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 to_usd(amount, currency):    rates = fetch_rates_from_api()        # network call, returns dict by currency    return amount * rates[currency]
Run or narrate your approach, then ask the coach.