Prompt Engineering Study Guide — AI Foundations

22% of the exam · domain 2 of 5 · AI Foundations · Free Prompt Engineering practice questions

0 of 50 topics covered
What the exam asks here — tap to tick off0 / 10 covered
Domain 2 of 5

Prompt Engineering

This domain tests your ability to design, evaluate, and refine prompts for large language models (LLMs). It covers the major prompting techniques, control parameters, safety considerations, and output-formatting strategies used in production AI systems. At 22% of the exam, it is the single largest domain—expect roughly one in five questions to originate here. Questions test both conceptual recognition ("which technique is this?") and applied judgment ("given this requirement, which approach is correct?").


Zero-Shot Prompting

Zero-shot prompting means giving the model a direct instruction with no examples. The model relies entirely on pre-trained knowledge and the instruction itself.

Structure: [Instruction] + [Input]

Example:

Classify the sentiment of the following review as Positive, Negative, or Neutral.
Review: "The battery life is disappointing."

When to use it:

  • Tasks the model handles well from training (translation, summarization, classification of common categories)
  • When no labeled examples are available
  • When latency and token cost must be minimized
CharacteristicZero-ShotFew-Shot
Examples in promptNone1–N
Token costLowestHigher
Output format controlWeakStrong
Best forWell-known tasksNovel formats or edge tasks
Failure modeInconsistent format, wrong label setExample bias, token overuse

Common traps:

  • Examiners may describe a prompt with only instructions and ask which technique it is—zero-shot, not "basic prompting."
  • Zero-shot does NOT mean the model has no knowledge; it means the prompt contains no examples.
  • Choosing zero-shot when the task requires a very specific output format is a common wrong-answer scenario—few-shot is better there.

Worked scenario: A developer needs to extract city names from unstructured text. The model keeps returning full sentences instead of just city names. The fix is not to use chain-of-thought—it is to switch to few-shot prompting to demonstrate the exact output format required.


Few-Shot Prompting

Few-shot prompting embeds one or more input–output examples in the prompt before the actual query. The model infers the task pattern from these demonstrations.

Structure: [Instruction (optional)] + [Example 1: Input → Output] + ... + [Example N: Input → Output] + [Actual Input]

One-shot = exactly 1 example. Few-shot = 2–N examples (typically 3–10).

Key principles:

  • Examples must be representative of the range of inputs.
  • Example format must match desired output format exactly.
  • Order of examples can affect output; place the most relevant example last (recency bias in attention).
  • Overly similar examples can cause the model to ignore edge cases (example bias).
Number of ExamplesTermUse Case
0Zero-shotGeneral tasks, cost-sensitive
1One-shotQuick format demonstration
2–10Few-shotCustom formats, classification with specific labels
Hundreds–thousandsFine-tuningNot a prompting technique—requires training

Common traps:

  • Few-shot is not fine-tuning. Fine-tuning updates model weights; few-shot does not.
  • Adding more examples always helps—false. Beyond ~10 examples, gains plateau and token costs rise; poorly chosen examples hurt performance.
  • "In-context learning" is the technical name for what few-shot prompting achieves—expect both terms on the exam.

Worked scenario: A company wants an LLM to output customer complaints in a structured Category | Severity | Summary pipe-delimited format. Zero-shot keeps returning prose. The correct approach is few-shot prompting with 3–5 examples showing the exact pipe-delimited format.


Sign in and enroll free to read the full guide

11 more sections (about 2,743 words) continue below. This course is free: enroll from the course page to unlock every guide.