Vague requests get filled in with plausible guesses. In a live round, a bad prompt costs you minutes.
A strong coding prompt has five parts: context, the exact interface, constraints, what to leave out, and how you'll check it.
Ask for one small piece at a time. You can't review a big answer quickly, and reviewing is your job.
When the output is wrong, say what's wrong and why. 'Try again' tends to get the same mistake reworded.
- What are the five parts of a spec prompt?
- Context, exact interface, constraints, what to leave out, and how it'll be checked.
- How much code should you ask for at once in a live round?
- One or two functions. Anything larger can't be reviewed properly under time pressure.
- What's the best way to fix a wrong answer from a model?
- State what's wrong, with the failing input, and ask for that one change. Don't just say 'try again'.
- Why start a fresh chat for each problem?
- Long chats drift from earlier instructions and carry old mistakes, while a fresh start has clean context.
- What's the strongest way to stop a model revealing something?
- Don't send it. Absent data can't leak, whereas rules can be argued with.