Code Room
Vibe codingHardvc-g092
Subject Ai prompt iterationLevel Senior–Staff~21 minCommon in Algorithms & data structures interviewsIndustries Software development, IT services

Question

You ask an AI to fix a Java service throwing intermittent `OutOfMemoryError` under load. It suggests bumping `-Xmx` from 2g to 4g; OOM comes back. You re-prompt, it adds `System.gc()` calls 'to free memory sooner'; no change. Third try it switches the GC to G1 and bumps heap to 8g; OOMs still recur, just less often. The model is treating every OOM as 'not enough heap.' How do you recognize it's stuck and reset?

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.