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

    What is a Prompt?

    A prompt is any text (or image, audio, file) you give to an LLM as input.

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

    Introduction

    A prompt is any text (or image, audio, file) you give to an LLM as input. The LLM reads it, runs it through billions of learned weights, and produces a continuation. Everything else — system messages, examples, retrieved documents, tool definitions — is just structured prompting.

    Beginner analogy: A prompt is the opening line of a conversation. The model's reply is whatever it predicts the rest of the conversation should look like, based on every conversation it has ever seen.

    Understanding the topic

    Core concepts to understand:

    • Prompts are input tokens — chunks of text the model converts to numbers.
    • Prompts include the system message, user message, prior turns, and any retrieved context.
    • Length matters: prompts must fit inside the model's context window (8k–2M tokens).
    • The order of information in a prompt strongly affects the answer (recency & primacy bias).
    • A prompt is not just a question — it can be a role, a task, examples, or a full template.

    Syntax reference

    Visual workflow / architecture:

    bash
    Prompt = System + Few-Shot Examples + User Message + Retrieved Context
    ┌─────────────────────────────────────────────────────────┐
    │ SYSTEM: "You are a senior support agent. Be concise."
    ├─────────────────────────────────────────────────────────┤
    │ EXAMPLES: Q: ... A: ... Q: ... A: ... │
    ├─────────────────────────────────────────────────────────┤
    │ RETRIEVED CONTEXT: <doc chunks from RAG>
    ├─────────────────────────────────────────────────────────┤
    │ USER: "My subscription was charged twice."
    └─────────────────────────────────────────────────────────┘

    Real-world use

    When you chat with ChatGPT, you only see the user message — but behind the scenes OpenAI injects a long system prompt, tool definitions, and memory snippets. Every reply is a continuation of that hidden prompt.

    Best practices

    • Put the most important instruction at the very top OR the very bottom — those positions get the most attention.
    • Keep prompts short enough to fit, long enough to be unambiguous.
    • Separate sections with clear delimiters (---, ###, XML tags).

    Common mistakes

    • Burying critical instructions in the middle of a long prompt.
    • Mixing examples and instructions without delimiters.

    Hands-on exercise

    Interview preparation — practice these questions:

    • Q1. What is a prompt, technically?
    • Q2. What parts make up a typical production prompt?
    • Q3. Why does the position of an instruction in a prompt matter?
    • Q4. What is a context window?
    Ready to mark this lesson complete?Track your journey across the entire course.