Code Room
Code reviewHardcr-g114
Subject SerializationLevel Senior–Staff~30 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this Node.js code that reads a 64-bit ID from a JSON API and echoes it back.

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
async function relayId(req, res) {  const body = await req.json();      // { "id": 9007199254740993, ... }  const id = body.id;  const row = await db.query('SELECT * FROM events WHERE id = $1', [id]);  res.json({ id, found: row.length > 0 });}
Run or narrate your approach, then ask the coach.