What are the pillars of good prompt engineering?
easyAnswer
- Be explicit about role, task, format, and constraints.
- Provide examples (few-shot) when the format is nontrivial.
- Ask for step-by-step reasoning when useful (chain-of-thought).
- Use structured output (JSON schema, tool schemas) when downstream code will parse.
- Iterate on real inputs and add negative constraints ('do not X') for common failure modes.
Check yourself — multiple choice
- Vague prompts always outperform detailed ones
- Explicit role, task, format, and examples improve reliability
- You should never specify output format
- Chain-of-thought hurts performance on reasoning tasks
Explicit constraints and examples reduce variance and improve reliability.
#prompting
Practise LLMs & GenAI
214 interview questions in this topic.
Related questions
- What is in-context learning (ICL) and how does it work?
- Few-shot vs zero-shot — when do you use each?
- What is chain-of-thought (CoT) prompting?
- How does self-consistency improve CoT?
- What is Tree of Thoughts (ToT) and when does it help?
- Does role-play prompting ('You are a senior lawyer...') actually help?