Code Room
Vibe codingHardvc-g466
Subject Ai team collaborationLevel Senior–Staff~22 minCommon in Algorithms & data structures interviewsIndustries Software development, Telecom

Question

You're letting an AI agent work in a C++ networking codebase to add a new packet-parsing path. The codebase has a hard rule: the hot path must do zero heap allocation, and there's a region of legacy code that's fragile and must not be touched. How do you set up guardrails so the agent stays out of the no-go zone and respects the no-allocation invariant — given the agent can't 'see' these rules unless you make them visible?

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.