Code Room
Vibe codingEasyvc-g568
Subject Ai code reviewLevel Entry–Mid~10 minCommon in Security interviewsIndustries Software development

Question

An AI assistant generated this React/Next.js component to call your analytics API. It compiles and the dashboard loads. What should you immediately flag, and why is this worse than a normal hardcoded-secret mistake?

jsx
export default function Dashboard() {  const API_KEY = "sk_live_4eC39HqLyjWDarjtT1zdp7dc";  useEffect(() => {    fetch(`https://api.metrics.io/v1/data?key=${API_KEY}`)      .then(r => r.json()).then(setData);  }, []);}
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.