Code Room
Code reviewHardcr-g595
Subject Http unbounded readLevel Senior–Staff~20 minCommon in Networking & APIs interviewsIndustries Software development, Technology

Question

Review this Node.js handler that proxies a file from an upstream URL into memory.

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 https = require('https'); function download(url) {  return new Promise((resolve, reject) => {    https.get(url, (res) => {      const chunks = [];      res.on('data', (c) => chunks.push(c));      res.on('end', () => resolve(Buffer.concat(chunks)));      res.on('error', reject);    });  });}
Run or narrate your approach, then ask the coach.