Practical Exercises and Examples of Prompting
Theory without practice is just academic knowledge. This section provides hands-on exercises to help you master prompt engineering techniques. Work through these progressively to build your skills.
Exercise 1: Basic Prompt Structure
Objective: Master the PTCF (Persona, Task, Context, Format) framework.
Your Task: You work for a software company and need to write release notes for a new feature.
Exercise Steps:
- Write a basic prompt (what most people would do):
Write release notes for our new dashboard feature.
- Apply the PTCF framework:
Persona: You are a technical writer for a B2B software company
Task: Write release notes for our new analytics dashboard feature
Context: This feature helps users visualise their data trends. Our audience is business analysts who aren't highly technical. This is part of our monthly product update.
Format: Structure as: Feature name, brief description (1-2 sentences), key benefits (3 bullet points), getting started steps (numbered list)
- Compare the outputs: Run both prompts and note the differences in quality, specificity, and usefulness.
Success Criteria: The PTCF version should be more specific, better structured, and more appropriate for the target audience.
Exercise 2: Zero-Shot vs Few-Shot Prompting
Objective: Understand when and how to use examples effectively.
Your Task: Extract key information from customer support tickets.
Exercise Steps:
- Start with zero-shot:
Extract the main issue, urgency level, and customer sentiment from this support ticket:
"Hi, I've been trying to export my data for the past 3 days and it keeps failing. This is really frustrating because I need this for my board presentation tomorrow. The error message just says 'export failed' with no other details. Can someone please help me ASAP?"
- Add few-shot examples:
Extract the main issue, urgency level, and customer sentiment from support tickets. Here are examples:
Ticket: "The login page won't load. I've tried different browsers but nothing works."
Extraction: {"issue": "login page not loading", "urgency": "medium", "sentiment": "frustrated"}
Ticket: "Love the new feature! Just wondering if there's a way to customize the colors?"
Extraction: {"issue": "feature customization question", "urgency": "low", "sentiment": "positive"}
Now extract from: "Hi, I've been trying to export my data for the past 3 days and it keeps failing. This is really frustrating because I need this for my board presentation tomorrow. The error message just says 'export failed' with no other details. Can someone please help me ASAP?"
- Test with edge cases: Try tickets with mixed sentiment, unclear urgency, or complex issues.
Success Criteria: The few-shot version should provide more consistent formatting and better handle nuanced cases.
Exercise 3: Chain-of-Thought Reasoning
Objective: Learn to break down complex problems into steps.
Your Task: Analyse a business scenario and make a recommendation.
Scenario: "A small e-commerce company has seen a 30% drop in sales over the past 3 months. Website traffic is down 15%, but conversion rate has dropped from 3.2% to 2.1%. Customer acquisition cost has increased by 40%. The company recently changed their website design and started using a new payment processor."
Exercise Steps:
- Basic prompt:
Analyse this business situation and recommend what the company should do.
- Chain-of-thought prompt:
Analyse this business situation step by step and recommend what the company should do.
Think through this systematically:
1. First, identify what the data tells us about the problem
2. Consider potential causes for each metric change
3. Evaluate which causes are most likely given the timeline
4. Prioritise which issues to address first
5. Recommend specific actions with rationale
Business situation: [Include the scenario]
- Advanced chain-of-thought:
You are a business consultant analysing a client's performance issues. Work through this systematically:
Step 1: Data Analysis
- What does each metric change tell us?
- How do the metrics relate to each other?
- What patterns do you see in the timeline?
Step 2: Hypothesis Generation
- What are the possible causes for these changes?
- Which causes align with the timing of changes?
- What evidence supports or contradicts each hypothesis?
Step 3: Root Cause Assessment
- Which causes are most likely primary vs. secondary?
- How might the recent changes (website, payment processor) be involved?
- What additional data would help confirm your assessment?
Step 4: Recommendation Development
- What should be the immediate priorities?
- What can be tested quickly vs. what requires longer-term changes?
- How should success be measured?
Business situation: [Include the scenario]
Success Criteria: The chain-of-thought versions should show clear reasoning, consider multiple factors, and provide more actionable recommendations.
Exercise 4: Self-Criticism and Iteration
Objective: Learn to use AI to improve its own outputs.
Your Task: Create a marketing email for a product launch.
Exercise Steps:
- Initial prompt:
Write a marketing email for the launch of our new project management software called "TaskFlow Pro". It's designed for small teams and includes features like automated scheduling, team collaboration tools, and progress tracking.
- Add self-criticism:
Write a marketing email for the launch of our new project management software called "TaskFlow Pro". It's designed for small teams and includes features like automated scheduling, team collaboration tools, and progress tracking.
After writing the email, critique it using these criteria:
1. Does it clearly communicate the value proposition?
2. Is the tone appropriate for small business owners?
3. Does it include a clear call-to-action?
4. Is the subject line compelling?
5. Are the benefits specific and credible?
Then provide an improved version that addresses any weaknesses you identified.
- Structured iteration:
Write a marketing email for TaskFlow Pro launch, then improve it through multiple iterations:
Version 1: Initial draft focusing on features and benefits
Critique 1: Evaluate for clarity, persuasiveness, and action-orientation
Version 2: Revised draft addressing critique points
Critique 2: Evaluate for emotional appeal and competitive differentiation
Version 3: Final version optimised for conversion
Product details: TaskFlow Pro is project management software for small teams (5-20 people) with automated scheduling, collaboration tools, and progress tracking. Price: $15/user/month. Main competitors: Asana, Trello. Key differentiator: AI-powered scheduling that automatically Optimises team workloads.
Success Criteria: Each iteration should show clear improvements in specific areas, with the final version being significantly better than the initial draft.
Exercise 5: Model-Specific Optimisation
Objective: Learn to adapt prompts for different AI models.
Your Task: Create a competitive analysis report.
Exercise Steps:
- Create a base prompt:
Analyse the competitive landscape for meal delivery services in urban markets. Include market leaders, their strengths/weaknesses, and opportunities for new entrants.
- Optimise for ChatGPT:
### Role
You are a market research analyst specialising in food delivery and logistics.
### Task
Create a competitive analysis of meal delivery services in urban markets.
### Structure
1. **Market Overview** (2-3 sentences)
2. **Major Players** (3-4 companies with key metrics)
3. **Competitive Positioning** (strengths/weaknesses table)
4. **Market Opportunities** (3-4 specific gaps)
5. **Strategic Recommendations** (prioritized action items)
### Requirements
- Focus on data-driven insights
- Include specific examples and metrics where possible
- Limit to 400 words total
- Use professional business language
- Optimise for Claude:
I need a competitive analysis of meal delivery services in urban markets. Please focus specifically on actionable insights for a potential new entrant and avoid general industry commentary.
Structure your analysis with clear sections and limit each to 2-3 sentences. Include market leaders, their competitive positioning, and specific opportunities for differentiation.
Consider factors like:
- Market share and growth trends
- Operational strengths and weaknesses
- Customer satisfaction and loyalty
- Technology and innovation gaps
Do not include:
- General background on the food delivery industry
- Speculation beyond available market data
- Theoretical frameworks without practical application
- Optimise for Gemini:
# Competitive Analysis: Urban Meal Delivery Services
## 1. Market Assessment
### 1.1 Market Size and Growth
- Current market size and growth trajectory
- Key urban markets and penetration rates
- Consumer behaviour trends
### 1.2 Competitive Landscape Overview
- Number of active competitors
- Market concentration and fragmentation
- Competitive intensity assessment
## 2. Major Player Analysis
### 2.1 Market Leaders
For each major competitor:
- Market share and geographic presence
- Business model and value proposition
- Key operational capabilities
### 2.2 Competitive Positioning
- Strengths and competitive advantages
- Weaknesses and vulnerabilities
- Strategic focus and recent moves
## 3. Opportunity Assessment
### 3.1 Market Gaps
- Underserved customer segments
- Geographic opportunities
- Service or technology gaps
### 3.2 Entry Strategy Recommendations
- Optimal positioning for new entrants
- Required capabilities and resources
- Go-to-market approach
Success Criteria: Each version should feel natural for its target model and produce outputs matching its strengths.
Exercise 6: Production-Ready Prompts
Objective: Create prompts suitable for automated, high-volume use.
Your Task: Build a prompt for automatically categorising customer inquiries.
Exercise Steps:
- Identify requirements:
- Must handle 1000+ inquiries per day
- Categories: Technical Support, Billing, Sales, General Info
- Must include confidence scores
- Should flag unclear cases for human review
- Create robust prompt:
You are an AI system that categorises customer inquiries for routing to appropriate departments.
Categories:
- TECHNICAL: Product issues, bugs, how-to questions, troubleshooting
- BILLING: Payment issues, subscription changes, refunds, invoicing
- SALES: Product information, pricing, demos, new purchases
- GENERAL: Company info, policies, feedback, other inquiries
For each inquiry:
1. Assign ONE category from the list above
2. Provide confidence score (0-100)
3. If confidence < 70, flag as "HUMAN_REVIEW_NEEDED"
4. Include brief reasoning (max 10 words)
Output format (JSON only, no explanation):
{
"category": "CATEGORY_NAME",
"confidence": 85,
"human_review": false,
"reasoning": "clear billing question about refund"
}
Customer inquiry: [INQUIRY_TEXT]
- Test edge cases:
- Inquiries that span multiple categories
- Very short or unclear messages
- Inquiries with typos or poor grammar
- Messages in different languages
- Spam or irrelevant content
- Refine based on results:
- Add examples for problematic cases
- Adjust confidence thresholds
- Improve category definitions
- Add error handling instructions
Success Criteria: The prompt should handle edge cases gracefully, provide consistent outputs, and flag uncertain cases appropriately.
Exercise 7: Complex Multi-Step Workflow
Objective: Chain multiple prompts together for complex tasks.
Your Task: Create a content marketing workflow that goes from topic idea to published article.
Exercise Steps:
- Design the workflow:
Step 1: Topic Research and Validation
Step 2: Outline Creation
Step 3: Content Writing
Step 4: SEO Optimisation
Step 5: Quality Review
- Create prompts for each step:
Step 1 - Topic Research:
You are a content strategist researching topics for a B2B software blog.
Analyse this topic idea and provide:
1. Search volume and competition assessment
2. Target audience alignment (scale 1-10)
3. Content angle recommendations (3 options)
4. Related keywords to target
5. Go/no-go recommendation with reasoning
Topic idea: [TOPIC]
Company focus: [COMPANY_DESCRIPTION]
Target audience: [AUDIENCE_DESCRIPTION]
Step 2 - Outline Creation:
Create a detailed article outline for this approved topic:
Topic: [APPROVED_TOPIC]
Angle: [CHOSEN_ANGLE]
Target keywords: [KEYWORDS]
Word count target: 1500-2000 words
Include:
- Compelling headline (3 options)
- Introduction hook and thesis
- 4-6 main sections with subsections
- Conclusion with call-to-action
- Meta description (under 160 characters)
Step 3 - Content Writing:
Write the article based on this outline:
[OUTLINE_FROM_STEP_2]
Writing guidelines:
- Professional but conversational tone
- Include specific examples and data
- Use subheadings for scannability
- Write for busy executives (clear, actionable)
- Include internal linking opportunities
- Test the full workflow with a real topic and refine each step based on the quality of handoffs between prompts.
Success Criteria: Each step should produce outputs that work well as inputs for the next step, with minimal manual intervention needed.
Practice Schedule
To build proficiency, practice regularly:
Week 1-2: Master basic techniques (Exercises 1-3) Week 3-4: Advanced techniques and optimisation (Exercises 4-5)Week 5-6: Production applications (Exercises 6-7) Ongoing: Apply techniques to your real work challenges
Common Mistakes to Avoid
Overcomplicating prompts: Start simple and add complexity only when needed.
Ignoring edge cases: Test your prompts with unusual or problematic inputs.
Not measuring results: Track performance to know if your prompts are actually working.
Forgetting the human element: Remember that AI outputs usually need human review and refinement.
Copying without adapting: Prompts that work for others might not work for your specific use case.
The key to mastering prompt engineering is consistent practice with real problems. Use these exercises as starting points, then apply the techniques to challenges in your own work.