Code Room
Code reviewHardcr-g068
Subject Blocking ioLevel Senior–Staff~30 minCommon in Concurrency interviewsIndustries Software development

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'); app.get('/report/:id', (req, res) => {  const meta = JSON.parse(fs.readFileSync(`/data/${req.params.id}.json`));  const template = fs.readFileSync('/templates/report.html', 'utf8');  const rows = db.querySync('SELECT * FROM metrics WHERE report = ?', [req.params.id]);  const html = render(template, meta, rows);  res.send(html);});
Run or narrate your approach, then ask the coach.