Code Room
Vibe codingMediumvc-g257
Subject Ai code reviewLevel Mid–Senior~16 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

An AI assistant wrote this scikit-learn churn pipeline. Cross-validation reports a stellar 0.94 ROC-AUC, but production accuracy is far worse. Find the flaw.

python
from sklearn.preprocessing import StandardScalerfrom sklearn.model_selection import cross_val_score, train_test_splitfrom sklearn.linear_model import LogisticRegression scaler = StandardScaler()X_scaled = scaler.fit_transform(X)          # scale everything first X_tr, X_te, y_tr, y_te = train_test_split(X_scaled, y, test_size=0.2)clf = LogisticRegression()scores = cross_val_score(clf, X_scaled, y, cv=5, scoring='roc_auc')print('CV AUC:', scores.mean())
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.