When would an application set the temperature parameter to 0?
What is a token in the context of an LLM API?
What is the difference between the system, user and assistant message roles in chat APIs?
When would you pass a stop sequence to an LLM API call?
What is the difference between a model's context window limit and its max output token limit?
Why are hosted LLM APIs designed to be stateless?
What is the difference between temperature and top-p sampling?
Why do LLM API providers charge more for output tokens than for input tokens?
Why does setting temperature to 0 not guarantee fully deterministic output across calls?
Prompting & Context Management
How does an application maintain conversation history across multi-turn interactions with an LLM API?
What happens when an API request exceeds a model's maximum context window?
What is few-shot prompting and when is it worth the extra tokens in a production feature?
What are the latency and cost tradeoffs of resending the full conversation history on every API request?
What is the 'Lost in the Middle' phenomenon in long-context models?
What is the 'needle in a haystack' problem when using extremely large context windows?
What are the tradeoffs of sliding-window truncation versus conversational summarization for context management?
How should you version and manage prompts in a production codebase?
Why does streaming reduce perceived latency for users?
What is Time to First Token (TTFT)?
How does an application implement request cancellation when a user clicks 'Stop Generating' during a streaming response?
How do you handle incomplete markdown or unclosed code blocks when rendering streaming tokens incrementally?
What are the latency tradeoffs between time-to-first-token and total generation time?
How does streaming an LLM response work end to end from the provider API through your backend to the browser?
What is JSON mode in hosted model APIs?
What is the difference between basic JSON mode and schema-enforced structured outputs?
Why should you not treat syntactically valid JSON from an LLM as semantically valid application data?
How does the output repair pattern work when LLM output fails schema validation?
How do you handle structured JSON or tool calls when streaming a model response?
What is retrieval-augmented generation (RAG), and when would you use it instead of fine-tuning or a longer context window?
Why is chunk overlap used when splitting documents for RAG?
Why do documents need to be chunked before being embedded into a vector database?
What is an embedding vector from an application developer's standpoint?
What are the tradeoffs between small chunks and large chunks in RAG?
What are the tradeoffs between fixed-size chunking and semantic chunking?
How do you keep a vector index in sync when underlying documents are updated or deleted?
What happens to an existing vector index when you switch to a different embedding model?
What is the purpose of metadata filtering during vector retrieval?
What is the difference between semantic vector search and keyword search such as BM25?
What is the role of a re-ranking model in a retrieval pipeline?
When would you choose hybrid search over pure vector similarity search?
How can you differentiate between a retrieval failure and a generation failure when a RAG feature produces incorrect output?
Why would you pre-filter rather than post-filter when querying a vector database with metadata?
Hallucination & Grounding
How should a UI communicate model uncertainty or potential inaccuracies to users?
How do you extract and return verifiable citations or sources to the end user in a RAG application?
How do you constrain a model to refuse an answer rather than hallucinate when context is insufficient?
How does grounding the prompt in retrieved context reduce hallucinations?
How should a UI present citations so users can verify claims against sources?
Why do LLMs still hallucinate when the correct context is present in the prompt?
Reliability & Error Handling
How should your backend handle HTTP 429 rate limit errors from an LLM provider?
Why can model version updates behind the same API name break application features?
When would you implement an automated fallback to a secondary model or provider?
How do you choose timeout values for LLM API calls when generation length varies widely?
What are the risks of automated fallback from a primary model to a secondary backup model?
When should an LLM task run as an asynchronous background job instead of inside a synchronous request?
Cost Optimization & Caching
What is semantic caching?
What is model routing or model tiering?
When would you route a task to a small model instead of a frontier model?
What is the difference between exact-match caching and semantic caching in an LLM backend?
How do you estimate and budget token consumption for an LLM feature?
How does API-level prompt caching reduce latency and token cost?
What kinds of prompt content benefit most from prompt caching?
What are the tradeoffs of using provider batch APIs instead of real-time endpoints?
How does token-based billing influence prompt design in production applications?
What are the risks of using a semantic cache for user queries?
What types of prompt changes invalidate a prompt cache prefix?
How would you prevent a single user or tenant from running up an unbounded LLM bill?
Why is it dangerous to render raw LLM-generated markdown as HTML in the browser?
Why must LLM-generated output be treated as untrusted before rendering or execution?
What data retention and training policies should you verify before sending production data to a hosted LLM API?
How does the principle of least privilege apply to agent tool permissions?
What is the difference between direct and indirect prompt injection?
Why is it dangerous to execute LLM-generated SQL or shell commands without validation?
How can you prevent sensitive PII or API secrets from leaking into LLM prompts and logs?
Why can regex-based sanitizers not reliably prevent prompt injection?
How do you apply content moderation to user input and model output in an LLM feature?
How can an indirect prompt injection compromise an agent via retrieved RAG documents or tool outputs?
Why is system prompt hardening alone insufficient to prevent prompt injection?
How do you ensure a RAG feature only retrieves documents the requesting user is authorized to see?
Evaluation & Observability
What is a golden dataset or eval set for an LLM feature?
What is the LLM-as-a-judge pattern?
What LLM-specific metrics should you trace in production alongside standard HTTP request logs?
How do you test functionality that depends on non-deterministic LLM output?
How can user feedback signals such as thumbs up or down be used to improve an LLM feature?
What are the limitations or risks of using LLM-as-a-judge for automated quality checks?
How do shadow runs or canary evaluations help you roll out a new prompt or model version safely?
How do you evaluate whether a prompt change improved output quality without causing regressions?
How do you calibrate an LLM judge against human-labelled ground truth?
What traces and spans should you capture when an agent runs across multiple LLM and tool calls?
How do you bound an agent loop to prevent runaway execution or infinite loops?
What is the difference between short-term and long-term memory in an AI agent?
When would you use a multi-agent system instead of a single agent equipped with multiple tools?
How do you make side-effecting agent tools such as database writes or payments idempotent?
What are the trade-offs between a deterministic code workflow and an autonomous agent loop?
How should an application implement human-in-the-loop confirmation for consequential agent actions?
What are the primary operational failure modes of multi-agent architectures?