What's the difference between zero-shot and few-shot prompting, and when would you use each?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
Zero-shot gives the model only an instruction; few-shot adds worked examples of input → output pairs in the prompt. On modern instruction-tuned models, zero-shot is the right default: it's cheaper, shorter, cache-friendlier, and these models are explicitly post-trained to follow instructions without demonstrations.
Full worked answer with diagram
Zero-shot gives the model only an instruction; few-shot adds worked examples of input → output pairs in the prompt. On modern instruction-tuned models, zero-shot is the right default: it's cheaper, shorter, cache-friendlier, and these models are explicitly post-trained to follow instructions without demonstrations.
Few-shot earns its token cost in specific situations:
- Format anchoring - you need an exact, idiosyncratic output shape (a custom markup, a house style) that's easier to show than to describe.
- Fuzzy decision boundaries - classification where the label definitions are subjective ("is this ticket urgent or merely high?"). Two or three borderline examples communicate the boundary better than a paragraph of criteria.
- Domain-specific conventions - internal jargon, non-obvious edge-case handling ("empty input → return
[], not an error"). - Steering away from a failure - include an example of the exact case the model keeps getting wrong.
When few-shot is a bad idea: tasks the model already does well zero-shot (you're paying tokens for nothing), reasoning-heavy tasks on reasoning models (canned CoT examples can constrain or degrade their internal reasoning), and highly diverse inputs where any small example set biases the model toward the examples' surface features. Also remember examples are strong implicit instructions: if all your sentiment examples are one sentence long, the model will start truncating its analysis to one sentence.
A practical middle ground is dynamic few-shot: retrieve the k most similar labelled examples per request from an example store instead of hardcoding a static set. It usually beats static few-shot, at the cost of infrastructure and cache misses (examples now vary per request, breaking prefix caching).
Worth sketching. It reframes the question as a diagnosis rather than a preference, which is what the interviewer is listening for.
flowchart TD
A["New task"] --> B{"Zero-shot already<br/>passes the eval?"}
B -->|"yes"| C["Ship zero-shot"]
B -->|"no"| D{"What is failing?"}
D -->|"output shape"| E["Few-shot for<br/>format anchoring"]
D -->|"label boundary"| F["Few-shot on<br/>borderline cases"]
D -->|"reasoning depth"| G["Reasoning budget,<br/>not examples"]
E --> H{"Inputs highly diverse?"}
F --> H
H -->|"yes"| I["Dynamic few-shot,<br/>pay the cache miss"]
H -->|"no"| J["Static set inside<br/>the cached prefix"]
What a good answer covers
- Zero-shot gives the model only an instruction; few-shot adds worked examples of input → output pairs in…
- On modern instruction-tuned models, zero-shot is the right default
- Format anchoring - you need an exact, idiosyncratic output shape (a custom markup, a house style) that's…
- Fuzzy decision boundaries - classification where the label definitions are subjective ("is this ticket…
- Domain-specific conventions - internal jargon, non-obvious edge-case handling ("empty input → return [],…
Key terms: Format anchoring · Fuzzy decision boundaries · Domain-specific conventions · Steering away from a failure
In the glossary: Zero-shot · Few-shot · Reasoning model · Prefix caching
Interviewer follow-ups to expect
How many examples is typically enough before returns diminish?
How would you measure whether few-shot is actually helping versus just adding tokens?
Why can few-shot CoT examples hurt a reasoning model?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep