Code Room
Code reviewHard
Question
Review this Node.js connection-pool checkout.
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
class Pool { constructor(conns) { this.idle = conns; this.waiters = []; } async acquire() { while (this.idle.length === 0) { await new Promise(res => this.waiters.push(res)); } return this.idle.pop(); } release(conn) { this.idle.push(conn); const w = this.waiters.shift(); if (w) w(); }}Run or narrate your approach, then ask the coach.