Prompting and reliable outputs
Develop useful, testable model interactions with structured constraints.
Validate output schemas and treat external instructions as untrusted content.
Interview questions
Choose a question to reveal its answer.
01EasyCoreWhat is zero-shot prompting?
Answer
What is zero-shot prompting?
Provides task instructions without worked examples.
Ask a model to classify sentiment without demonstrations.
from pydantic import BaseModel
class Classification(BaseModel):
label: str
confidence: float
# Validate model output before using it.
result = Classification.model_validate_json('{"label":"positive","confidence":0.8}')Schema validation alone does not establish factual correctness.
02EasyCoreWhen should you use few-shot examples?
Answer
When should you use few-shot examples?
Includes a small set of example inputs and outputs in the prompt.
Show three desired formatting examples before a new request.
03EasyCoreHow do structured outputs improve application reliability?
Answer
How do structured outputs improve application reliability?
Constrains responses to a schema where supported and validates them downstream.
Return typed JSON for an application workflow.
04MediumHigh priorityHow does an LLM call external tools?
Answer
How does an LLM call external tools?
Model requests a named function with arguments; application decides whether and how to execute it.
Let a model request a weather lookup without giving arbitrary system access.
05MediumHigh priorityWhat causes problems when an LLM hallucinates?
Answer
What causes problems when an LLM hallucinates?
Generated content that is unsupported or factually incorrect.
A model invents a citation that does not exist.
06MediumHow can grounding improve factual answers?
Answer
How can grounding improve factual answers?
Connects model responses to verified external context or evidence.
Answer using retrieved source passages and cite them.
07MediumHow does prompt injection threaten tool-using applications?
Answer
How does prompt injection threaten tool-using applications?
Untrusted content attempts to override intended instructions or trigger unauthorized actions.
A retrieved page tells an agent to disclose secrets.
08MediumWhat can application guardrails enforce?
Answer
What can application guardrails enforce?
Application-level validation or policy control around model inputs, actions or outputs.
Reject tool calls outside an allowed scope.
09HardHow do you design a prompt evaluation dataset?
Answer
How do you design a prompt evaluation dataset?
Representative set of test cases with expected behavior or scoring criteria.
Regression-test a prompt before releasing a change.
10HardHow does a diffusion model generate data?
Answer
How does a diffusion model generate data?
Learns to reverse a noising process, commonly generating data through iterative denoising.
Generate an image by progressively denoising latent noise.
Priority and difficulty are editorial study recommendations.
Technical reference: Documentation / paper ↗
Try a few practice questions
Explore the questions before creating a free account.
1. Which action is safest after receiving model-generated JSON?
2. Which request is an example of few-shot prompting?
3. A retrieved document instructs an agent to send a secret key. What should happen?
LLM evaluation and safety
Continue to the next set of interview questions.