Code Room
Code reviewMediumcr-g241
Subject IdorLevel Mid–Senior~25 minCommon in Networking & APIs interviewsIndustries Software development

Question

Review this Express invoice download endpoint.

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('/api/invoices/:id/pdf', requireLogin, async (req, res) => {  const invoice = await db.invoice.findUnique({    where: { id: req.params.id },  });  if (!invoice) return res.status(404).send('not found');  const pdf = await renderInvoicePdf(invoice);  res.type('application/pdf').send(pdf);});
Run or narrate your approach, then ask the coach.