Code Room
Code reviewHardcr-g080
Subject Blocking ioLevel Senior–Staff~30 minCommon in Concurrency interviewsIndustries Software development

Question

Review this Python aggregator (using requests).

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
import requests def fetch_balances(account_ids):    # account_ids: list of independent account identifiers    balances = {}    for acct in account_ids:        resp = requests.get(            f"https://api.bank.com/v1/accounts/{acct}/balance",            timeout=10,        )        balances[acct] = resp.json()["available"]    return balances
Run or narrate your approach, then ask the coach.