LearnThatStack Ace your next interview
AI Engineering
Prompt Engineering.
Change topic Change
Practice · Questions

All questions

Showing of 55
Beginner 12
01

What is prompt engineering, and why does it still matter when models are as capable as they are today?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

02

Explain zero-shot versus few-shot prompting. When would you choose each?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

03

What is a system prompt, and how does it differ from a user message?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

04

What is chain-of-thought prompting, and why does it improve results on certain tasks?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

05

Why are vague instructions considered the most common prompting anti-pattern, and how would you rewrite one?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

06

How does the temperature parameter interact with your prompt, and when would you adjust it?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

07

Why do experienced prompt authors wrap inputs in delimiters like XML tags or triple backticks?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

08

What is role prompting, and what does it actually change about the model's behavior?

Part of Pro
09

How do you get a model to return valid JSON, and what goes wrong with just writing "respond in JSON"?

Part of Pro
10

What is a prompt template, and why do production systems use them instead of hand-written prompts?

Part of Pro
11

Why can negative instructions like "do not mention pricing" backfire, and what should you do instead?

Part of Pro
12

When a prompt contains both instructions and a long document, how should you arrange them?

Part of Pro
Intermediate 22
13

How would you select which examples to include in a few-shot prompt?

Part of Pro
14

What formatting rules matter when you write the examples in a few-shot prompt?

Part of Pro
15

Compare zero-shot chain-of-thought with few-shot chain-of-thought. When is each appropriate?

Part of Pro
16

What is the instruction hierarchy, and how do the major APIs implement it?

Part of Pro
17

Compare the structured-output features offered by the major model providers today.

Part of Pro
18

Why does Anthropic recommend XML tags in prompts for Claude, and how do you use them effectively?

Part of Pro
19

When should you split a task into a prompt chain instead of one large prompt?

Part of Pro
20

How do you decompose a complex task into subtasks for an LLM pipeline? Walk me through the common patterns.

Part of Pro
21

How should retrieved documents be presented inside a RAG prompt?

Part of Pro
22

What prompting techniques reduce hallucination when the model must answer from provided context?

Part of Pro
23

How do you version prompts in a production system?

Part of Pro
24

How do you evaluate whether a prompt change is actually an improvement?

Part of Pro
25

What is prompt caching, and how should it change the way you order content in a prompt?

Part of Pro
26

What are the main practical differences when prompting Claude, GPT, and Gemini models?

Part of Pro
27

How do you control tone and style reliably across thousands of generations?

Part of Pro
28

What special considerations apply to multilingual prompting?

Part of Pro
29

Give an example of conflicting constraints in a prompt and explain how you would resolve them.

Part of Pro
30

How do you control the length of model outputs, and why is max_tokens not the answer?

Part of Pro
31

How does prompting change when the input includes images, PDFs, or screenshots?

Part of Pro
32

How do you write tool descriptions and parameter schemas so a model calls the right tool with the right arguments?

Part of Pro
33

How do you manage conversation history and context limits in a long-running multi-turn assistant?

Part of Pro
34

How do you decide between prompt engineering, retrieval, and fine-tuning for a given task?

Part of Pro
Expert 21
35

What is the "lost in the middle" problem, and how do you design long-context prompts around it?

Part of Pro
36

Explain quote-first grounding for long-context prompts. Why does it work?

Part of Pro
37

What is meta-prompting, and how are models used to write and improve prompts?

Part of Pro
38

How would you implement dynamic few-shot example selection in production, and what are the trade-offs?

Part of Pro
39

As a prompt author, what can you do to reduce prompt injection risk when your prompt includes untrusted content?

Part of Pro
40

How do reasoning models change established prompting practice?

Part of Pro
41

What is self-consistency, and how does it relate to temperature?

Part of Pro
42

How do you design an LLM-as-judge evaluation prompt, and what biases must you control for?

Part of Pro
43

Compare prompt caching across Anthropic, OpenAI, and Google, and explain how you would design prompts to exploit it.

Part of Pro
44

What are the trade-offs of strict schema-constrained decoding versus prompting for structure?

Part of Pro
45

How do you build regression testing and CI for prompts?

Part of Pro
46

What is your process for migrating a prompt suite to a new model or model version?

Part of Pro
47

What is assistant prefilling, and what problems does it solve?

Part of Pro
48

How do you design the system prompt for a tool-using agent?

Part of Pro
49

How would you build defense-in-depth against prompt injection for an assistant that reads untrusted email and web content?

Part of Pro
50

How faithful are chain-of-thought rationales, and what does that imply for systems that rely on them?

Part of Pro
51

Architect a prompt-management platform for a company running dozens of LLM features. What are the components?

Part of Pro
52

A high-traffic prompt is too expensive and too slow. Walk me through optimizing cost and latency without sacrificing quality.

Part of Pro
53

When would you use automatic prompt optimization frameworks like DSPy instead of manual prompt engineering?

Part of Pro
54

In a multi-stage prompt chain, how does injected content propagate, and how do you harden the pipeline against second-order injection?

Part of Pro
55

A prompt passes your playground tests but fails in production. How do you debug it?

Part of Pro

No matches

Try a different filter or search term.

Know someone prepping for Prompt Engineering? Send them this set.
Pro · $10/mo

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.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

Serverless on AWS

Serverless Architecture on AWS

Flutter Mobile

Flutter Cross-Platform Mobile Development

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

AI Engineer

LLMs, RAG, Agents, Evals

AI-Powered Developer

Claude Code, Copilot, Agentic Workflows

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git