Code Room
Vibe codingHardvc-g394
Subject Ai bug rootcauseLevel Senior–Staff~22 minCommon in Algorithms & data structures interviewsIndustries Software development, Technology

Question

A Node.js service's memory climbs steadily until it OOMs every few days. You give an AI agent the heap-growth graph and your event-emitter setup code; it concludes: "Classic listener leak — you're calling emitter.on() in a request handler without removeListener, so listeners accumulate. Move the .on() to module scope and it's fixed." The diagnosis sounds textbook. How do you verify it's the real cause before refactoring hot-path code?

What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it — tests, edge cases, reading critically — and how you’d re-prompt or decompose to get it right.

Describe your solution

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.