Code Room
Vibe codingHard
Question
An AI agent wrote a pooled-particle system in C#. After heavy use, the same particle visibly appears in two effects at once, and occasionally a 'live' particle vanishes mid-flight. Review the pool's release path and find the reuse bug that double-hands-out an instance.
public void Release(Particle p) { p.Reset(); pool.Push(p); // no check that p was actually in use}public Particle Get() { return pool.Count > 0 ? pool.Pop() : new Particle();}// elsewhere, on collision:void OnHit(Particle p) { Release(p); if (p.spawnsChild) Release(p); // accidental second release of the same instance}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.
Learn the concepts
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.