Code Room
Vibe codingMediumvc-g084
Subject Ai prompt iterationLevel Mid–Senior~18 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

You ask an AI to write a Python function to compute the volume-weighted average price (VWAP) of trades from a Pandas DataFrame. It returns `(df['price'] * df['volume']).sum() / df['volume'].sum()` — correct for one symbol. Your data has 40 symbols interleaved and an hour of trades, and you actually need a *rolling intraday* VWAP per symbol that resets each day. You re-prompt 'do it per symbol' and it adds a `groupby('symbol')` but it's still a single number per symbol, not the running series you need. How do you re-steer to the right shape?

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.