AI-ENGINEERING
    beginner

    Prompt Engineering

    Software Engineer path · lesson 96 of 99
    The idea
    A prompt is like a work order for a brilliant but literal contractor: state who they are, show two examples of what 'done' looks like, describe the job, ask them to think it through, and specify the exact format to hand back. Vague orders get vague work.
    How to use
    Toggle techniques to add layers to the prompt and watch quality and parseable output change.
    Constructed prompt (layers assemble as you toggle)
    task16 tok
    Classify the sentiment of this review: "The pasta was undercooked and the waiter was rude."
    16
    prompt tokens
    Layer legend
    system
    examples
    task
    reasoning
    format

    Key insight

    A prompt is layered context the model reads top-to-bottom. Toggle techniques and watch the layers — and the token budget — assemble. More context usually means more capability and more cost; engineering is choosing the layers that pay for themselves.

    Assemble a production prompt

    Sequence

    Order the sections of a well-structured prompt, top to bottom.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    1. 1Drop a step here
    2. 2Drop a step here
    3. 3Drop a step here
    4. 4Drop a step here
    5. 5Drop a step here
    6. 6Drop a step here
    6 pieces left to place

    Test your knowledge

    21 questions
    Question 1 of 21
    Score: 0

    A model given a strict JSON-format constraint returns perfectly valid JSON that is factually wrong. What does this demonstrate?

    The short version

    A prompt is like a work order for a brilliant but literal contractor: state who they are, show two examples of what "done" looks like, describe the job, ask them to think it through, and specify the exact format to hand back. Vague orders get vague work.

    In more depth

    Prompt Engineering

    Prompting steers a model by editing its context, not its weights — the cheapest, fastest lever before retrieval (RAG) or fine-tuning.

    Building blocks

    System/role: persona and task framing the model reads first.
    Few-shot examples: in-context demonstrations that teach the format and decision boundary.
    Chain-of-thought: "think step by step" elicits intermediate reasoning for multi-step tasks.
    Output constraints: a fixed format (one word, JSON) makes outputs parseable and low-variance.

    Interview Questions

    OpenAI
    Anthropic
    Google
    Anthropic
    Microsoft
    OpenAI
    Google
    OpenAI
    Anthropic
    Google
    Meta

    Love this visualization?

    Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.

    100% free • No credit card required