Code Room
Code reviewHardcr-g368
Subject Leaky abstractionsLevel Senior–Staff~25 minCommon in Distributed systems interviewsIndustries Software development, Technology

Question

Review this TypeScript gateway handler that calls an internal payments microservice and relays its result to the public client.

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 reviewtypescript
app.get('/balance', async (req, res) => {  const upstream = await fetch(    `http://payments-svc/internal/accounts/${req.query.acct}/balance`,  );  const data = await upstream.json();  // mirror the internal service's status + body to the client  res.status(upstream.status).json(data);});
Run or narrate your approach, then ask the coach.