- Practice
- About 15 min
- 5 practice questions
Writing good prompts: role, task, context, format and examples
Write clear prompts using role, task, context, format and examples; turn weak prompts into strong ones; ask for step-by-step working, tables and quizzes.
If something looks wrong, please tell us.
A chatbot answers the question you actually typed, not the one in your head. A vague prompt gets a vague, generic answer; a precise prompt gets an answer you can use straight away. Writing prompts well - often called prompt engineering - is a practical skill that saves time and is now tested in computer-awareness questions.
The five parts of a strong prompt
A strong prompt
- Role Who to act as
- Task The exact job to do - must always be clear
- Context Background, level and limits
- Format The shape of the answer
- Examples A sample of what you want
| Part | What it tells the AI | Example |
|---|---|---|
| Role | Who to act as | You are a patient maths teacher for competitive-exam students. |
| Task | The exact job to do | Explain how to calculate compound interest. |
| Context | Background, level and limits | I am a beginner and already understand simple interest. |
| Format | The shape of the answer | Use five numbered steps, then one worked example in rupees. |
| Examples | A sample of what you want | Write questions in the style of this one: ... |
Not every prompt needs all five, but the task must always be clear, and adding context and format improves almost any request. Giving no examples is called zero-shot prompting; giving one or a few samples is few-shot prompting. Examples in a prompt guide that one answer only - they do not retrain the model.
Weak prompts and how to strengthen them
| Weak prompt | What is missing | Stronger prompt |
|---|---|---|
| Tell me about GST | Task, level, format | Explain GST to a beginner in five short points, then give one simple example of a shop bill. |
| Write about rivers | Scope and purpose | Make a revision table of six peninsular rivers of India with columns River, Where it rises, Where it drains. |
| Make questions | Topic, number, type, answers | Make 5 MCQs on the Fundamental Rights, four options each, answers with one-line reasons at the end. |
| Explain this | What 'this' is, level | Explain the paragraph below in simple English for a Class 8 student, in under 120 words: ... |
Ask for step-by-step working
For reasoning and arithmetic, add "solve step by step and show each step". Laying out the working often makes the answer more careful, and - more importantly - lets you check every step. It does not guarantee correctness: a step can still be wrong, so recompute anything that matters.
Strong prompt = Role + Task + Context + Format (+ Examples). Be specific, ask for one job at a time, and refine with follow-up messages.
Worked example 1: building a quiz prompt
- Role: "You are a quiz-maker for students preparing for competitive exams."
- Task: "Write 5 multiple-choice questions on the water cycle."
- Context: "The students know the basic terms evaporation, condensation and precipitation."
- Format: "Four options each. Do not mark the answers under the questions; list the answers with a one-line reason at the end."
- Example: "Match this style: Which process turns water vapour into droplets? (condensation)"
Putting the answers at the end lets you attempt the quiz honestly before seeing them. You must still check each answer key against your textbook, because a generated key can be wrong.
Worked example 2: refining with follow-ups
First prompt: "Explain inflation." The reply is 400 words of English with terms you have not met. Rather than starting again, send follow-ups: (1) "Shorten this to about 100 words." (2) "Now explain it in simple Hindi." (3) "Give it as a table: Term, Meaning, Everyday example." (4) "Ask me three questions to test whether I understood." Each follow-up keeps the earlier conversation in view, so you reach the right answer in a few short steps.
Refining an answer with follow-ups
- Explain inflation. Reply: 400 words with unfamiliar terms
- Shorten this to about 100 words.
- Now explain it in simple Hindi.
- Give it as a table: Term, Meaning, Everyday example.
- Ask me three questions to test whether I understood.
Asking for tables and quizzes
- Name the columns: "a table with columns Article, Subject, One-line meaning".
- Fix the size: "exactly 10 rows", "in under 150 words".
- State the level and language: "for a beginner", "in Hindi".
- Split big jobs: ask for an outline first, then each part.
Key takeaways: state the task clearly, then add role, context, format and examples as needed. Turn weak prompts into strong ones by naming the topic, audience, size and layout. Ask for step-by-step working so you can check it, and improve answers with short follow-up messages instead of retyping everything.
Check your understanding
-
1. Which prompt is most likely to give a useful revision answer?
- Tell me about GST
- GST?
- You are a commerce teacher. Explain GST to a beginner preparing for a competitive exam in five numbered points, then give one simple example of a shop bill.
- Explain GST
Show answer
Answer: C. It sets a role, a clear task, the learner's level, a format (five numbered points) and asks for an example. The others give the AI no level, scope or format, so the reply will be generic.
-
2. In the prompt line "Answer as a table with columns Term and Meaning", which part of a prompt is being given?
- Format
- Role
- Context
- Example
Show answer
Answer: A. It describes the shape of the answer - a table with named columns - which is the format. A role would say who to act as, context would give background, and an example would show a sample answer.
-
3. A student pastes two sample questions into a prompt and asks for ten more in the same style. This technique is called:
- Role prompting
- Zero-shot prompting
- Retraining the model
- Few-shot prompting
Show answer
Answer: D. Supplying a few examples to guide the answer is few-shot prompting. Zero-shot means no examples. Examples in a prompt guide only that reply; they do not retrain the model.
-
4. Why is it useful to ask a chatbot to "solve step by step and show each step"?
- It guarantees the final answer is correct
- Each step can be checked, and the working is often more careful
- It hides the method so the answer is shorter
- It stops the chatbot from using numbers
Show answer
Answer: B. Showing the working tends to make reasoning more careful and, above all, lets you check every step. It does not guarantee correctness, so the claim of a guaranteed answer is false.
-
5. A chatbot's first answer on a topic is too long and in English, but you wanted a short Hindi explanation. The best next step is to:
- Close the chat and try a different chatbot
- Send the same prompt again without changes
- Send a follow-up: "Shorten this to about 100 words in simple Hindi"
- Stop using AI for this topic
Show answer
Answer: C. A short follow-up keeps the earlier conversation and states exactly what to change - length and language. Repeating the same prompt unchanged will usually produce a similar answer.
Sign in to keep track of the lessons you finish.