All questions
Showing of 55What is prompt engineering, and why does it still matter when models are as capable as they are today?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Prompt engineering is the practice of giving a model clear instructions, useful context, and a precise output contract. Stronger models need less wording for simple tasks, but they still cannot infer product requirements that were never provided.
A good prompt defines the goal, identifies the input, explains important constraints, and shows what a successful answer looks like. It may also include examples or tools. This improves consistency and makes failures easier to diagnose.
Prompt engineering is only one part of an LLM system. Retrieval, tool design, schema validation, and evaluations often matter more than clever phrasing. Treat prompts as versioned application code and test them on representative cases instead of relying on one successful example.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
Explain zero-shot versus few-shot prompting. When would you choose each?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Zero-shot prompting gives instructions without examples. Few-shot prompting adds a small set of input and output examples that demonstrate the expected behavior.
Start zero-shot when the task is familiar and the rules are easy to state. It keeps the prompt shorter and avoids examples that might bias the answer. Use few-shot prompting when the format is unusual, labels are domain-specific, edge cases matter, or instructions alone produce inconsistent results.
Choose examples that cover meaningful variations, not several copies of the easy case. Keep their formatting consistent with the real input. Compare both approaches on an evaluation set because examples consume context and can sometimes make a capable model copy irrelevant details.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is a system prompt, and how does it differ from a user message?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
A system prompt contains application-level instructions for the model, such as its role, allowed tools, safety boundaries, and response style. A user message contains the person's current request or data.
Model APIs usually give system or developer instructions higher priority than user content. That helps the application keep stable rules across many turns. However, a system prompt is not a security boundary. A determined user may still expose weaknesses, and the model cannot enforce database permissions or approval policies by itself.
Keep stable rules in the higher-priority message and request-specific details in the user message. Enforce hard constraints in code, then test conflicts such as a user asking the model to ignore its original instructions.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is chain-of-thought prompting, and why does it improve results on certain tasks?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Chain-of-thought prompting asks a model to work through intermediate reasoning before giving an answer. It can help with tasks that contain several dependent steps, such as arithmetic, planning, or logic.
Writing intermediate steps gives the model more computation and can make mistakes easier to spot. However, a detailed rationale is not proof that the answer is correct. Models can invent convincing explanations after making a guess.
For modern reasoning models, follow the provider's guidance because explicit “think step by step” prompts may add little or reduce performance. In user-facing systems, request a concise explanation or verifiable work rather than hidden internal reasoning. Check results with tools, tests, or source evidence whenever possible.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
Why are vague instructions considered the most common prompting anti-pattern, and how would you rewrite one?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Vague instructions leave important choices to the model. Different runs may solve different versions of the task. A request to summarize a document does not define the audience, length, focus, or output format.
A clearer version states the audience first. Ask for a summary written for a busy product manager. Then request three short bullets about the decision, evidence, and next action. Tell the model to use only the document.
Good prompts make success observable without overloading the model with unnecessary rules. State who will use the result, what information matters, what to omit, and how the output will be consumed. If a rule cannot be checked or explained, consider removing it.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
How does the temperature parameter interact with your prompt, and when would you adjust it?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
The prompt defines what the model should do, while temperature changes how varied its token choices are. Clear instructions can reduce variation, but they cannot make high-temperature sampling fully predictable.
Use a low temperature for extraction, classification, strict formatting, and other tasks with one preferred answer. A moderate value may help when you want several ideas, tones, or creative drafts. Temperature does not correct a vague prompt or make unsupported facts true.
Some current models ignore or restrict temperature, especially when using reasoning modes. Check the model's API. Tune settings on repeated evaluation runs, and change one sampling control at a time so you know what caused the difference.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
Why do experienced prompt authors wrap inputs in delimiters like XML tags or triple backticks?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Delimiters show where instructions end and untrusted data begins. They help the model distinguish a document, user-provided text, examples, and the requested output from one another.
Use meaningful labels when several blocks are present, such as <policy>, <customer_message>, and <task>. Triple backticks work well for a single code or text block. Make the structure consistent and tell the model how each block should be used.
Delimiters improve clarity but do not stop prompt injection. Content inside a tagged document can still contain hostile instructions. Tell the model to treat it as data, limit tool permissions, validate outputs, and enforce sensitive rules outside the prompt.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is role prompting, and what does it actually change about the model's behavior?
How do you get a model to return valid JSON, and what goes wrong with just writing "respond in JSON"?
What is a prompt template, and why do production systems use them instead of hand-written prompts?
Why can negative instructions like "do not mention pricing" backfire, and what should you do instead?
When a prompt contains both instructions and a long document, how should you arrange them?
How would you select which examples to include in a few-shot prompt?
What formatting rules matter when you write the examples in a few-shot prompt?
Compare zero-shot chain-of-thought with few-shot chain-of-thought. When is each appropriate?
What is the instruction hierarchy, and how do the major APIs implement it?
Compare the structured-output features offered by the major model providers today.
Why does Anthropic recommend XML tags in prompts for Claude, and how do you use them effectively?
When should you split a task into a prompt chain instead of one large prompt?
How do you decompose a complex task into subtasks for an LLM pipeline? Walk me through the common patterns.
How should retrieved documents be presented inside a RAG prompt?
What prompting techniques reduce hallucination when the model must answer from provided context?
How do you version prompts in a production system?
How do you evaluate whether a prompt change is actually an improvement?
What is prompt caching, and how should it change the way you order content in a prompt?
What are the main practical differences when prompting Claude, GPT, and Gemini models?
How do you control tone and style reliably across thousands of generations?
What special considerations apply to multilingual prompting?
Give an example of conflicting constraints in a prompt and explain how you would resolve them.
How do you control the length of model outputs, and why is max_tokens not the answer?
How does prompting change when the input includes images, PDFs, or screenshots?
How do you write tool descriptions and parameter schemas so a model calls the right tool with the right arguments?
How do you manage conversation history and context limits in a long-running multi-turn assistant?
How do you decide between prompt engineering, retrieval, and fine-tuning for a given task?
What is the "lost in the middle" problem, and how do you design long-context prompts around it?
Explain quote-first grounding for long-context prompts. Why does it work?
What is meta-prompting, and how are models used to write and improve prompts?
How would you implement dynamic few-shot example selection in production, and what are the trade-offs?
As a prompt author, what can you do to reduce prompt injection risk when your prompt includes untrusted content?
How do reasoning models change established prompting practice?
What is self-consistency, and how does it relate to temperature?
How do you design an LLM-as-judge evaluation prompt, and what biases must you control for?
Compare prompt caching across Anthropic, OpenAI, and Google, and explain how you would design prompts to exploit it.
What are the trade-offs of strict schema-constrained decoding versus prompting for structure?
How do you build regression testing and CI for prompts?
What is your process for migrating a prompt suite to a new model or model version?
What is assistant prefilling, and what problems does it solve?
How do you design the system prompt for a tool-using agent?
How would you build defense-in-depth against prompt injection for an assistant that reads untrusted email and web content?
How faithful are chain-of-thought rationales, and what does that imply for systems that rely on them?
Architect a prompt-management platform for a company running dozens of LLM features. What are the components?
A high-traffic prompt is too expensive and too slow. Walk me through optimizing cost and latency without sacrificing quality.
When would you use automatic prompt optimization frameworks like DSPy instead of manual prompt engineering?
In a multi-stage prompt chain, how does injected content propagate, and how do you harden the pipeline against second-order injection?
A prompt passes your playground tests but fails in production. How do you debug it?
This answer is part of Pro.
The full written answer, with the trade-offs and follow-ups an interviewer will probe.
No matches
Try a different filter or search term.
Prompt Engineering cheatsheet
- The 30-second mental model01
- Anatomy of a prompt02
- Technique catalog03
- Instruction hierarchy04
- Few-shot example selection05
- Long-context strategies06
- Model-specific tips (2026)07
- Prompt caching implications for structure08
- Production prompt management09
- Anti-patterns10
- Quick-reference checklists11
- Rules of thumb (memorize these)12
- + 6 more inside
48 of 55 Prompt Engineering answers are in Pro.
Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.
- Full answers + code
- AI explanations, simpler or deeper
- 1,000 AI credits / month
- Cancel anytime
Change topic
Pick a different technology or stack. Your current topic stays put until you choose a new one.
MEAN
MongoDB, Express, Angular, Node.jsMERN
MongoDB, Express, React, Node.jsDjango
Python Full-Stack DevelopmentRuby on Rails
Convention over ConfigurationServerless on AWS
Serverless Architecture on AWSInterviewers also test these - they're common to every stack, whichever one you picked above.
Flutter Mobile
Flutter Cross-Platform Mobile DevelopmentInterviewers also test these - they're common to every stack, whichever one you picked above.
Spring Boot
Enterprise Java Development.NET
Microsoft EcosystemVue
Vue.js, Vite, TypeScript, Tailwind, Node.jsGo Backend
Golang, gRPC, PostgreSQL, Redis, RabbitMQInterviewers also test these - they're common to every stack, whichever one you picked above.
FastAPI
Python, FastAPI, SQLAlchemy, PostgreSQLReact Native
React, TypeScript, Redux, FirebaseiOS Native
Swift, SwiftUI, UIKit, FirebaseAndroid Native
Java, Jetpack Compose, FirebaseDevOps / Platform
Docker, Kubernetes, Terraform, CI/CDInterviewers also test these - they're common to every stack, whichever one you picked above.
AI Engineer
LLMs, RAG, Agents, EvalsAI-Powered Developer
Claude Code, Copilot, Agentic WorkflowsCore SWE Interview Prep
Data structures, algorithms, OS, concurrency, networking, gitInterviewers also test these - they're common to every stack, whichever one you picked above.
Interviewers also test these - they're common to every stack, whichever one you picked above.