Code Room
Code reviewMediumcr-g615
Subject Storage streaming downloadLevel Mid–Senior~18 minCommon in Storage & CDN · Distributed systems interviewsIndustries Software development, Technology

Question

Review this Node endpoint that proxies a file download.

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
app.get("/files/:id", async (req, res) => {  const obj = await s3.getObject({ Bucket: BK, Key: req.params.id }).promise();  const body = obj.Body;          // entire object buffered in memory  res.setHeader("Content-Type", obj.ContentType);  res.setHeader("Content-Length", body.length);  res.send(body);});
Run or narrate your approach, then ask the coach.