Code Room
Vibe codingMediumvc-g395
Subject Ai code comprehensionLevel Mid–Senior~14 minCommon in Algorithms & data structures interviewsIndustries Software development, IT services

Question

You're auditing a deploy script and ask an AI to explain this Bash loop. The agent says: "It iterates over every file in the backups directory and deletes ones older than 30 days — safe and standard." You're about to run it on a production server. What does the explanation miss, and how do you verify the actual behavior without risking data?

bash
for f in $(ls /var/backups); do  if [ $(find /var/backups/$f -mtime +30) ]; then    rm -rf /var/backups/$f  fidone
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.