Code Room
Vibe codingHardvc-g087
Subject Ai prompt iterationLevel Senior–Staff~20 minCommon in Algorithms & data structures interviewsIndustries Software development, Technology

Question

You ask an AI agent to 'add graceful shutdown to our Go HTTP service.' It wires `signal.Notify` and calls `server.Shutdown(ctx)` with a 5s timeout — looks textbook. In a load test, in-flight requests get cut and a background worker pool keeps running after the process is 'done.' You re-prompt 'make shutdown actually wait'; it bumps the timeout to 30s. It doesn't see the second component that needs draining. How do you re-steer to a correct shutdown?

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.