Two patterns to break: (1) Always ask "how would you verify this works?" before accepting code. Forces the model to think about test cases. (2) If something feels off, paste the code back and ask "what would happen if X was actually empty/null/large?". Confident-wrong code usually has a single edge case the model didn't model.
Before I accept this code, answer two things. One: how would you verify it actually works, what specific inputs or test cases would prove it? Two: what happens if [the key input] is empty, null, very large, or malformed? Walk each case and fix any that break.