Code Room
Code reviewMediumcr-g090
Subject Timeout handlingLevel Mid–Senior~25 minCommon in Networking & APIs interviewsIndustries Software development

Question

Review this JavaScript service-to-service call.

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 reviewjs
const INV_BASE = "https://inv.internal"; async function fetchInventory(sku) {  const res = await fetch(`${INV_BASE}/sku/${sku}`);  if (!res.ok) {    throw new Error(`inventory ${res.status}`);  }  return res.json();} async function checkout(cart) {  const stock = await Promise.all(    cart.items.map((i) => fetchInventory(i.sku))  );  return reserveAll(cart, stock);}
Run or narrate your approach, then ask the coach.