Code Room
Code reviewMedium
Question
Review this Node.js diagnostics endpoint on a network appliance.
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.
Learn the concepts
const { exec } = require('child_process'); app.post('/api/ping', (req, res) => { const host = req.body.host; exec(`ping -c 3 ${host}`, (err, stdout) => { if (err) return res.status(500).json({ error: 'ping failed' }); res.json({ output: stdout }); });});Run or narrate your approach, then ask the coach.