Generative AI interviews test whether you can connect language-model behaviour to data, context, retrieval, evaluation, and production constraints. Fluency with buzzwords is less useful than localizing failures.
The expanded 2026 bank adds current RAG, evaluation, prompt-injection, access-control, inference-serving, embedding-migration, and long-context failure modes while keeping one discipline: identify which stage produced the evidence and which intervention targets that failure.
This is the expanded interview-preparation version
Current, research-driven questions are shown first so you can immediately see what changed. Each question keeps the detailed answer, example, likely follow-up, and weak-answer warning.
What you will be able to do
- Explain core LLM concepts concisely
- Choose prompting, RAG, or fine-tuning
- Diagnose retrieval and generation separately
- Evaluate claims and citations
- Design for latency, cost, and safety
Localize a wrong RAG answer before changing the model
Did evidence retrieval fail, or did answer generation misuse good evidence?
Trace the whole evidence path
For a RAG answer, inspect query interpretation, filtering, chunking, retrieval, reranking, context assembly, generation, citation mapping, and claim support. A plausible answer can still be unsupported, and a valid citation can point to a source that does not entail the claim.
22 interview questions with detailed answers
The 9 questions marked 2026 SIGNAL are shown first because they reflect current public big-tech interview patterns. Core fundamentals follow after them.
These were added or elevated from the latest research pass. They are intentionally placed before the older core bank so the update is visible immediately.
Current AI-engineer and RAG design interviews increasingly test safe application design, not only retrieval quality.
How would you defend a RAG system against prompt injection inside retrieved documents?
Treat retrieved text as untrusted data, never as authority. Keep system policy and tool permissions outside retrieved content, delimit evidence, restrict tools server-side, and detect or reject instructions embedded in documents.
The model cannot be the only security boundary. Authorization, data access, tool scopes, output validation, and high-impact approvals must be enforced in application code. Evaluation should include malicious-document test cases.
RAG interview material in 2026 commonly expects hybrid retrieval and reranking, not vector search alone.
Why combine BM25 with vector search in hybrid retrieval?
Lexical search is strong for exact terms, identifiers, and rare words; vector search captures semantic similarity. Hybrid retrieval combines complementary recall signals before reranking.
Normalize or rank-fuse scores rather than assuming raw BM25 and cosine values are directly comparable. Evaluate by query slice because semantic and lexical queries benefit differently.
Enterprise RAG and private-data system-design questions increasingly probe authorization and tenant isolation.
How do you enforce document-level access control in RAG?
Attach access metadata to indexed chunks and filter candidates by the authenticated principal before any unauthorized text reaches the model.
Access control should be enforced in retrieval or storage, not by asking the LLM to ignore forbidden chunks. Re-index permission changes promptly, audit retrieval IDs, and prevent shared-cache leakage across tenants.
Long-context and RAG interviews increasingly test context selection rather than maximum token count.
What is the 'lost in the middle' problem, and how would you reduce it?
Models can underuse relevant evidence placed in the middle of a very long prompt. Reduce unnecessary context, rerank strongly, group related evidence, and place critical evidence where the model reliably attends to it.
A larger context window is capacity, not guaranteed attention quality. Retrieval, compression, hierarchical summarization, and task-specific ordering often outperform dumping every matching document into the prompt.
Embedding/index migration is a practical production failure mode increasingly relevant to LLMOps interviews.
How would you migrate to a new embedding model without breaking retrieval?
Version embeddings and indexes, build the new index in parallel, evaluate it on a fixed retrieval set, dual-read or shadow it, then switch traffic with rollback available.
Old and new vectors usually are not comparable in one similarity space. Re-embed the corpus, keep model/index version in metadata, validate dimensionality and normalization, and avoid partially mixing vector versions.
Evaluation is now a major AI-engineer interview theme because production quality cannot be reduced to one benchmark.
What are the strengths and weaknesses of LLM-as-a-judge evaluation?
LLM judges are scalable for rubric-based comparisons but can be biased by wording, position, verbosity, model family, or missing domain knowledge. Calibrate them against human labels and deterministic checks.
Use explicit rubrics, blind ordering, multiple samples where variance matters, and separate factual checks from style preference. Track agreement with trusted human judgments and avoid letting the same model both produce and uncritically grade its own outputs.
Recent Apple question banks include concurrent LLM serving, and current ML-system-design banks include GPU batching.
How do continuous batching and KV caching improve LLM serving?
KV caching avoids recomputing past attention state, while continuous batching dynamically groups active decoding steps so GPU capacity stays busy as requests enter and finish.
Throughput improves, but larger batches and long contexts consume KV memory and may increase per-request waiting. A production scheduler balances token throughput, time-to-first-token, fairness, and memory headroom.
Recent Apple ML question banks explicitly include RAG strict-source-control patterns.
How would you make an LLM answer only from approved sources?
Retrieve only authorized sources, require claim-level citations, instruct the model to abstain when evidence is insufficient, and verify that cited spans actually support the claims.
Strict source control is not just prompting. The retrieval boundary, provenance IDs, evidence-to-claim mapping, and refusal policy must be testable. For high-stakes use, deterministic validation or human review may be required.
A durable interview question across LLM roles because it reveals whether the candidate diagnoses the actual failure.
When should you fine-tune an LLM instead of using prompt engineering or RAG?
Prompt first for instruction clarity, use RAG for external or changing knowledge, and fine-tune when you need stable behavior, style, domain task performance, or output patterns that examples and prompting cannot reliably achieve.
Fine-tuning adds dataset quality, training, evaluation, versioning, and rollback costs. It does not automatically solve freshness, citations, or private knowledge. Always compare against a strong prompt/RAG baseline.
Generative versus discriminative models?
A discriminative model learns a decision or conditional target; a generative model learns enough structure to produce plausible new samples, often conditionally.
The distinction is about the learned objective and use, not whether the output merely looks creative.
Explain Transformer and next-token generation to a beginner.
Attention exchanges information among allowed token positions; stacked blocks transform representations; the output distribution scores the next token, which becomes input for the following step.
Causal masks prevent future-token access. Position information preserves order. Sampling policy turns probabilities into a chosen sequence.
Tokens, embeddings, and context windows—how do they interact?
A tokenizer converts text to token IDs; embeddings map IDs to vectors; the context window limits the tokens available in one model call.
Token count is not word count. Long prompts increase attention work and can dilute relevant evidence even when they fit.
How do temperature, top-k, and top-p affect decoding?
Temperature reshapes probability sharpness; top-k limits candidates by count; top-p keeps the smallest set whose cumulative probability crosses p.
These settings change diversity, not factual knowledge. Greedy or low-temperature output can still hallucinate.
What makes a prompt or structured output reliable?
Specify task, allowed evidence, output schema, and failure behaviour; validate the returned structure and reject or repair invalid output.
A prompt is not authorization. Server-side checks enforce permissions, ranges, identities, and business rules.
When use RAG instead of fine-tuning?
Use RAG for changing or private knowledge, citations, and evidence control; fine-tune for behaviour, style, format, or task patterns that prompting cannot reliably produce.
Prompting is the cheapest first control. RAG adds knowledge at inference. Fine-tuning changes parameters and needs a dataset, evaluation, versioning, and rollback.
What are embeddings and vector search actually comparing?
An embedding represents an item as a vector; similarity search retrieves vectors close under a chosen metric such as cosine similarity.
Similarity is model- and domain-dependent. Metadata filters, normalization, index approximation, and query/document encoding affect results.
How do chunking and reranking affect RAG?
Chunking defines retrievable units; first-stage retrieval favors recall; reranking spends more compute to reorder a small candidate set for precision.
Chunks too small lose context; chunks too large mix topics and consume budget. Parent-child retrieval can return a precise match with surrounding context.
Your RAG answer is wrong. How do you localize the failure?
First check whether supporting evidence was retrieved. If not, inspect query, filters, chunks, embeddings, index, and reranker. If yes, inspect prompt, context ordering, claim support, and generation.
Use labeled questions with required evidence IDs. Measure retrieval recall before answer quality so the generator is not blamed for absent context.
How would you evaluate a RAG system?
Measure retrieval recall/precision and ranking, then answer relevance, claim-level faithfulness, citation correctness, task success, latency, and cost.
Build an eval set with questions, acceptable answers, required/forbidden evidence, and insufficiency cases. Evaluate important slices and regression before release.
Why can a valid citation fail to support a claim?
A citation may exist and resolve correctly yet discuss a related topic without entailing the specific claim.
Split the answer into atomic claims, map each to quoted evidence spans, and label supported, partial, contradicted, or unsupported.
What do LoRA and PEFT change?
LoRA freezes the base weights and learns small low-rank update matrices, reducing trainable parameters and optimizer memory.
It changes model behaviour from examples; it does not automatically add reliable citations or solve retrieval freshness.
Design a production LLM path under latency and cost limits.
Set a task SLO and quality gate, route simple requests cheaply, bound context/output, cache safely, batch where possible, stream user-visible output, and monitor per-stage latency and cost.
Include privacy, rate limits, retries, fallbacks, versioned prompts/models/indexes, and an insufficiency path. Optimize the measured bottleneck.
Review the deeper lessons
Use these links when an interview question exposes a gap. The interview guide focuses on explanation and decision-making; the linked lesson teaches the full concept.
Keep the answer honest: role boundaries, interview processes, and project outcomes vary. Never invent experience, impact, salary, or certainty to make an answer sound stronger.
Summary / Key Takeaways
- LLM interviews reward system-level reasoning rather than isolated terminology.
- Tokens, embeddings, context, attention, and decoding explain the path from prompt to generated text.
- Prompting, RAG, and fine-tuning target different failure modes and may be combined deliberately.
- RAG diagnosis begins by checking whether required evidence was actually retrieved.
- Evaluation separates retrieval, claim support, citations, task success, safety, latency, and cost.
- A citation is useful only when its evidence entails the claim it is attached to.
- Production design needs versioned components, bounded budgets, privacy controls, fallbacks, and observable stages.