Code RoomVerify heap-growth root cause
HardPrep Room Coding #4331

Verify heap-growth root cause

Vibe & agenticAlgorithms & data structuresSenior–Staff~22 min

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?

Implement
rank_heap_growth(labels: list[str], before_counts: list[int], after_counts: list[int], min_growth: int) → list[str]
Examples
in[["EventEmitter","String","Buffer","Closure"],[120,5000,40,900],[131,41000,38,5200],100]out["String=36000","Closure=4300"]
in[["Zebra","Alpha","Zebra"],[0,0,0],[5,10,5],1]out["Alpha=10","Zebra=10"]
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.

0:00 of about 22 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.