Code Room
Vibe codingEasyvc-g531
Subject Ai code commentsLevel Entry–Mid~12 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

You ask an AI to add explanatory comments to a confusing piece of Bash that nobody on the team understands. It returns this. The comments are confident and readable — but does each one match what the code actually does?

bash
# Loop over all .log files in the current directoryfor f in *.log; do  # Skip files larger than 10MB  if [ $(stat -f%z "$f") -gt 10000000 ]; then    # Compress the file in place    gzip "$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.