Track 07 · Prompting
7.1 Prompt Engineering
47 topics in 7 parts. Use it as a checklist before an interview, or as a map of what to learn next.
- CCritical
- HHigh
- MMedium
- NNew 2026
01Prompting Fundamentals8 topics
- Prompt anatomy: system + context + few-shot + user turn + prefillC
- Zero-shot vs few-shot vs many-shot: when each winsC
- Positive instructions over negations (model follows better)H
- Persona before constraints: WHO before WHATH
- Role/persona prompting: assign specific persona with domain + limitations for better framingH
- Stable content first in system prompt → prompt cache hits (90% cost saving)C
- Output format specification at end of system prompt (recency effect)H
- Prefill assistant turn: force format, guide opening toneH
02Chain-of-Thought + Reasoning6 topics
- Zero-shot CoT: "Let's think step by step" — 50% → 90% on mathC
- Few-shot CoT: examples WITH reasoning steps includedH
- Self-consistency: sample N responses, majority vote — reduces varianceC
- Tree of Thought: branch → evaluate → select best pathH
- Least-to-most: decompose problem → solve sub-problems → composeH
- Prompt chaining: multiple specialized calls vs one overloaded promptH
03Structured Output ✦NEW6 topics
- Why raw JSON instructions fail: ~20% failure rate in productionC
- JSON mode: valid JSON guaranteed, no schema enforcementH
- OpenAI Structured Outputs + Pydantic: 100% schema complianceC
- Instructor library: any LLM, auto-retry on schema violationC
- Outlines: grammar-constrained sampling (open-source models)N
- Schema design: Literal types, descriptions, constraints, reason-firstH
04DSPy — Programmatic Optimization ✦NEW6 topics
- Signatures: typed I/O contracts — compiler writes the promptN
- Modules: Predict, ChainOfThought, ReActN
- MIPROv2: optimizes instructions + few-shot examples jointlyN
- 30-45% accuracy improvement vs hand-tuned promptsH
- Metric engineering replaces prompt engineeringN
- BootstrapFinetune: distill large model → smaller model fine-tuneM
05Production Prompt Engineering6 topics
- Prompt versioning: registry → shadow → canary (5%) → productionC
- A/B testing prompts: deterministic user split, track faithfulness/cost/latencyH
- LLMLingua: 60% token reduction at 2-5% quality lossH
- Meta-prompting: model generates/improves its own promptsH
- Model version lock: pin version, run eval suite on upgradeH
- Debug framework: collect failures → classify type → targeted fixC
06Prompt Security + Red Teaming7 topics
- Direct injection: user overrides system prompt via inputC
- Indirect injection: malicious instructions hidden in retrieved documentsC
- XML delimiter wrapping: isolate user input as untrusted dataC
- OWASP Top 10 for LLMs: know LLM01, LLM02, LLM06, LLM08 in depthH
- Red teaming: 5 categories (instruction override, persona bypass, data exfil, indirect, escalation)H
- ASR (Attack Success Rate): metric for defense effectivenessH
- Garak, PyRIT: automated red teaming toolsN
07Prompt Engineering8 topics
- Zero-shot prompting: direct instructionC
- Few-shot prompting: examples in contextC
- Chain-of-thought (CoT): step-by-step reasoningC
- System prompts: persona, constraints, formatC
- Instruction tuning format: Alpaca, ChatMLH
- Prompt templates and reusable patternsH
- Self-consistency: majority vote over N samplesH
- Tree of Thought and Least-to-Most promptingH
Practise it
Knowing it is half.
Saying it is the rest.
Run a realistic voice interview with an AI panel in the Interview Room, then read a scored report on every answer.