Prompt Engineering Tutorial 0/120 lessons ~6 min read Lesson 30

    Prompt Design Patterns

    Just as software engineering has design patterns, prompt engineering does too.

    Course progress0%
    Focus
    6 guided sections
    Practice signal
    Examples included
    Career prep
    Foundation builder

    Introduction

    Just as software engineering has design patterns, prompt engineering does too. Recognising patterns lets you reach for the right tool without reinventing each prompt.

    Beginner analogy: Like cooking — you don't reinvent boiling water for pasta every time. Patterns standardise the boring parts.

    Understanding the topic

    Core concepts to understand:

    • Classify-then-act — first classify intent, then dispatch.
    • Plan-then-execute — outline first, then fill.
    • Critique-then-revise — generate, self-critique, rewrite.
    • Extract-then-summarise — pull entities, then narrate.
    • Few-shot + chain-of-thought — examples with reasoning.
    • Role-with-audience — expert speaking to specific listener.

    Syntax reference

    Visual workflow / architecture:

    bash
    Pattern When to use
    ─────────────────────────────────────
    classify-then-act routing / triage
    plan-then-execute long answers, docs
    critique-revise quality-critical text
    extract-summarise docs & reports
    few-shot + CoT reasoning + format
    role + audience tone-sensitive UX

    Real-world use

    Most production AI features are 2–3 of these patterns composed together (e.g. classify-then-act + role).

    Best practices

    • Name your patterns internally — improves team communication.
    • Document which pattern each prompt uses in the template header.
    • Pattern libraries (LangChain Hub, OpenPrompt) accelerate teams.

    Hands-on exercise

    Interview preparation — practice these questions:

    • Q1. Name 3 prompt design patterns.
    • Q2. When use classify-then-act?
    • Q3. Why is plan-then-execute better than direct generation?
    • Q4. How do patterns affect eval design?
    Ready to mark this lesson complete?Track your journey across the entire course.