Code Room
Code reviewHardcr-g484
Subject Blocking ioLevel Mid–Senior~22 minCommon in Code quality & review interviewsIndustries Software development, Technology

Question

Review this Node.js Express handler.

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 reviewjavascript
const fs = require("fs");const dns = require("dns"); app.get("/report", (req, res) => {  const cfg = JSON.parse(fs.readFileSync("./report.json", "utf8"));  const addr = dns.lookupSync ? dns.lookupSync(cfg.host) : require("dns").lookup;  const data = fs.readFileSync(cfg.path, "utf8");  res.send(render(cfg, data));});
Run or narrate your approach, then ask the coach.