Code Room
Vibe codingHardvc-g156
Subject Ai test strategyLevel Senior–Staff~18 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

You're about to ask an AI agent to write the test suite for a new rate limiter (token-bucket: capacity, refill rate, per-key buckets) in Rust. You know that if you just say 'write thorough tests,' you'll get happy-path tests pinned to whatever the implementation happens to do. Write the prompt/spec you'd give the agent so the tests verify the real contract — and name the one thing a vague prompt gets most wrong here.

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.