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

Question

Review this Node.js password-reset token generator.

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 crypto = require('crypto'); function createResetToken(userId) {  const seed = Date.now() + ':' + userId;  const token = crypto.createHash('md5').update(seed).digest('hex');  resets.set(token, { userId, exp: Date.now() + 3600_000 });  return token;}// emailed as https://app/reset?token=<token>
Run or narrate your approach, then ask the coach.