LLM Interview Questions — 30 Questions Senior Engineers Ask (2026)
Updated March 2026 — 30 LLM-specific questions across three depth tiers: Foundations, Application, and Production. Each question includes a sample answer and what interviewers look for.
Most GenAI interview prep covers broad topics — RAG, agents, career positioning. This page goes deeper on the LLM-specific questions that senior engineers ask when they want to test whether you actually understand the models you build on top of.
You will find 30 questions organized by depth: 10 on LLM foundations (tokenization, attention, embeddings), 10 on architecture decisions (RAG design, agents, multi-model routing), and 10 on production realities (cost, latency, evaluation, guardrails).
1. Why LLM Interview Questions Differ
Section titled “1. Why LLM Interview Questions Differ”LLM interviews test a fundamentally different skill set than classical machine learning interviews.
Traditional ML vs LLM Interviews
Section titled “Traditional ML vs LLM Interviews”In a traditional ML interview, you design features, select models, tune hyperparameters, and evaluate on held-out test sets. You own the entire training pipeline.
In an LLM interview, you rarely train anything. You select pre-trained models, design prompts, build retrieval systems, and evaluate non-deterministic outputs. The core skills shift from model building to model orchestration.
Five Skills LLM Interviewers Test
Section titled “Five Skills LLM Interviewers Test”- Architecture understanding — Can you explain how transformers work, not just use them?
- Production judgment — Can you make cost/quality/latency trade-offs with real numbers?
- Retrieval design — Can you build a RAG pipeline that actually works at scale?
- Failure awareness — Do you know how LLMs break and how to mitigate failures?
- Evaluation thinking — Can you measure quality when there is no single right answer?
If you can recite the transformer paper but cannot estimate the cost of processing 1 million documents through GPT-4, you will struggle with senior-level LLM interview questions.
2. What LLM Interviewers Really Test
Section titled “2. What LLM Interviewers Really Test”Every LLM interview question maps to one of five evaluation dimensions — understanding these helps you structure stronger answers.
The Five Evaluation Dimensions
Section titled “The Five Evaluation Dimensions”Dimension 1: Depth of understanding. Can you explain why something works, not just what it does? Saying “attention computes query-key-value” is not enough. Interviewers want to hear why dot-product attention scales poorly with sequence length and what alternatives exist.
Dimension 2: Production experience. Have you shipped LLM features to real users? Interviewers probe for specific numbers: latency targets you hit, cost budgets you operated within, failure rates you measured.
Dimension 3: Trade-off reasoning. Every decision has a cost. Fine-tuning vs RAG, large model vs small model, accuracy vs latency — interviewers want structured reasoning, not gut feelings.
Dimension 4: Cost awareness. LLM inference is expensive. Can you estimate per-request costs? Do you know when to use a cheaper model? Have you implemented caching or prompt engineering techniques to reduce token usage?
Dimension 5: Failure modes. Hallucinations, prompt injection, context window overflow, embedding drift — interviewers ask what can go wrong because production engineers must anticipate failures before they hit users.
3. How LLM Questions Are Structured
Section titled “3. How LLM Questions Are Structured”LLM interview questions follow a consistent structure across companies — mapping them helps you prepare systematically.
The Three-Tier Question Model
Section titled “The Three-Tier Question Model”Questions cluster into three tiers, roughly ordered by seniority:
| Tier | Focus | Example Topic | Seniority |
|---|---|---|---|
| Foundations | How LLMs work internally | Tokenization, attention, embeddings | Mid-level+ |
| Application | Designing LLM-powered systems | RAG pipelines, agents, routing | Senior |
| Production | Operating LLMs at scale | Cost, latency, evaluation, guardrails | Senior/Staff |
Junior roles focus on Tier 1. Senior roles spend 70% of the interview on Tiers 2 and 3. Staff-level roles assume you know Tier 1 and go straight to system design.
How to Use This Page
Section titled “How to Use This Page”Each of the next three sections covers one tier with 10 questions. For each question you get:
- The question as an interviewer would ask it
- A sample answer at the senior level
- What the interviewer is looking for
Read all 30 if you are preparing broadly. Focus on Tier 2 and 3 if your interview is <2 weeks away and you already have solid fundamentals.
4. LLM Interview Questions — Foundations
Section titled “4. LLM Interview Questions — Foundations”These 10 questions test whether you understand the machinery underneath the API calls. Interviewers use them to separate engineers who read the docs from engineers who understand the models.
Q1: What is BPE tokenization and why does it matter?
Section titled “Q1: What is BPE tokenization and why does it matter?”Sample answer: BPE (Byte Pair Encoding) starts with individual bytes and iteratively merges the most frequent adjacent pairs to build a vocabulary of subword tokens. GPT-4 uses a ~100K token vocabulary built this way. It matters because tokenization directly affects three things: cost (you pay per token), context window consumption (a 128K context window is 128K tokens, not characters), and multilingual performance (languages with non-Latin scripts often require more tokens per word, increasing cost 2-4x).
What they want: That you connect tokenization to practical concerns like cost and context usage, not just describe the algorithm.
Q2: Explain self-attention in transformers
Section titled “Q2: Explain self-attention in transformers”Sample answer: Self-attention lets each token in a sequence compute a relevance score with every other token. Each token is projected into query (Q), key (K), and value (V) vectors. The attention score between two tokens is the dot product of Q and K, scaled by the square root of the dimension, then softmax-normalized. The output is a weighted sum of V vectors. Multi-head attention runs this in parallel across multiple subspaces — GPT-3 uses 96 heads across 12,288 dimensions. The computational cost is O(n^2) with sequence length, which is why context window expansion requires architectural innovations like sparse attention or ring attention.
What they want: The scaling relationship (O(n^2)) and why it matters for context windows. Bonus: mention specific head counts or dimensions from real models.
Q3: What is the difference between encoder and decoder transformers?
Section titled “Q3: What is the difference between encoder and decoder transformers?”Sample answer: Encoder transformers (like BERT) use bidirectional attention — each token attends to all other tokens. They excel at understanding tasks: classification, NER, semantic similarity. Decoder transformers (like GPT) use causal (left-to-right) masking — each token only attends to previous tokens. They excel at generation. Encoder-decoder models (like T5) use the encoder for input understanding and the decoder for output generation. Most production LLMs in 2026 are decoder-only because generation is the primary use case, and scaling laws favor decoder architectures.
What they want: That you know the architectural difference is about attention masking, not some fundamental structural change.
Q4: How does temperature affect LLM output?
Section titled “Q4: How does temperature affect LLM output?”Sample answer: Temperature scales the logits before the softmax function. Temperature = 1.0 is the default distribution. Temperature <1.0 sharpens the distribution — the model becomes more deterministic, choosing high-probability tokens more often. Temperature >1.0 flattens it — more randomness, more creative but less reliable output. Temperature = 0 is greedy decoding (always pick the highest probability token). In production, I use temperature 0 for structured extraction and classification, 0.3-0.7 for conversational assistants, and avoid >1.0 outside creative writing use cases.
What they want: The mathematical mechanism (logit scaling before softmax) and practical guidelines for production settings.
Q5: What is top-p (nucleus) sampling and when do you use it over temperature?
Section titled “Q5: What is top-p (nucleus) sampling and when do you use it over temperature?”Sample answer: Top-p sampling selects from the smallest set of tokens whose cumulative probability exceeds p. With top-p = 0.9, the model considers only tokens that collectively account for 90% of the probability mass. This adapts the candidate set size dynamically — for confident predictions (one dominant token), few candidates are considered. For uncertain predictions, more candidates are included. I prefer top-p over temperature alone because it prevents the model from selecting extremely unlikely tokens that temperature alone might allow. A common production setting is temperature 0.7 + top-p 0.95.
What they want: Understanding that top-p is adaptive where temperature is uniform, and a practical default configuration.
Q6: What are embeddings and how are they used in LLM systems?
Section titled “Q6: What are embeddings and how are they used in LLM systems?”Sample answer: Embeddings are dense vector representations that capture semantic meaning. In LLM systems, they serve two primary roles: (1) input representation — the embedding layer converts token IDs into vectors the model processes, and (2) retrieval — separate embedding models (like text-embedding-3-small) convert text into vectors for similarity search in RAG pipelines. The critical production detail: embedding models are not the same as the LLM. You choose them independently. A common mistake is assuming GPT-4’s understanding of text matches how text-embedding-3-small represents it for retrieval.
What they want: The distinction between the LLM’s internal embeddings and the separate embedding models used for retrieval.
Q7: What is a context window and what happens when you exceed it?
Section titled “Q7: What is a context window and what happens when you exceed it?”Sample answer: The context window is the maximum number of tokens a model can process in a single request — input plus output combined. GPT-4 Turbo has a 128K context window; Claude 3 has 200K. When you exceed it, the API returns an error (not a degraded response). In practice, quality degrades before hitting the limit — models attend less effectively to tokens in the middle of long contexts (the “lost in the middle” problem). This is why RAG outperforms stuffing everything into the context window for large document sets.
What they want: That you know about quality degradation before the hard limit, not just the token count.
Q8: How does KV-cache work and why does it matter?
Section titled “Q8: How does KV-cache work and why does it matter?”Sample answer: During autoregressive generation, each new token requires attending to all previous tokens. Without caching, this means recomputing the key and value projections for every previous token at every generation step — O(n^2) total computation for n tokens. The KV-cache stores previously computed key and value tensors so each new token only computes its own K and V vectors and attends to the cached values. This reduces per-step computation to O(n). In production, the KV-cache is why long outputs consume significant GPU memory and why providers charge more for output tokens than input tokens.
What they want: The connection between KV-cache, memory consumption, and token pricing.
Q9: What are the main LLM model families and their trade-offs?
Section titled “Q9: What are the main LLM model families and their trade-offs?”Sample answer: Three dominant families in 2026: OpenAI (GPT-4o, o1, o3), Anthropic (Claude 3.5/4), and open-weight models (Llama 3, Mistral, Gemma). OpenAI has the largest ecosystem and tool integration. Anthropic leads on safety alignment and long-context performance. Open-weight models offer cost control and data privacy through self-hosting. The trade-off is capability vs control vs cost: proprietary APIs give you the strongest models but zero control over infrastructure. Open-weight models give full control but require GPU infrastructure and typically lag on benchmarks.
What they want: A structured comparison framework, not just listing model names.
Q10: What is RLHF and why is it used?
Section titled “Q10: What is RLHF and why is it used?”Sample answer: RLHF (Reinforcement Learning from Human Feedback) is the training stage that aligns a pre-trained LLM with human preferences. After pre-training on text prediction and supervised fine-tuning on instruction data, RLHF trains a reward model on human preference rankings, then uses PPO (Proximal Policy Optimization) to fine-tune the LLM to maximize that reward. RLHF is what makes ChatGPT conversational rather than just a text completion engine. The production implication: RLHF-aligned models sometimes refuse valid requests or hedge excessively — understanding this helps you debug unexpected refusals in production.
What they want: The three-stage training pipeline (pre-training, SFT, RLHF) and why aligned models sometimes over-refuse.
5. LLM Architecture Interview Questions
Section titled “5. LLM Architecture Interview Questions”These 10 questions test your ability to design systems that use LLMs effectively. This is where senior interviews spend most of their time.
Interview Question Categories
Section titled “Interview Question Categories”📊 Visual Explanation
Section titled “📊 Visual Explanation”LLM Interview Question Categories
30 questions across three depth tiers — from foundations through production
Q11: How do you design a RAG pipeline?
Section titled “Q11: How do you design a RAG pipeline?”Sample answer: A RAG pipeline has four stages: ingestion, retrieval, augmentation, and generation. Ingestion: chunk documents (I typically use 512 tokens with 64-token overlap for technical docs), embed with a model like text-embedding-3-small, and store in a vector database. Retrieval: embed the user query, perform similarity search (cosine distance), and return top-k results (k=5 is a good starting point). Augmentation: insert retrieved chunks into the prompt with clear delimiters and source citations. Generation: send the augmented prompt to the LLM with instructions to cite sources and abstain when context is insufficient. The key design decision is chunking strategy — too small and you lose context, too large and retrieval precision drops.
What they want: Specific numbers (chunk sizes, overlap, top-k), not abstract descriptions.
Q12: When would you choose fine-tuning over RAG?
Section titled “Q12: When would you choose fine-tuning over RAG?”Sample answer: Choose RAG when your knowledge changes frequently, you need citation traceability, or your data is too large to embed in model weights. Choose fine-tuning when you need consistent output style (e.g., always respond in JSON), domain-specific reasoning patterns that prompting cannot achieve, or latency reduction (fine-tuned smaller models can replace larger prompted ones). In practice, 80% of production use cases are best served by RAG or RAG + prompt engineering. Fine-tuning is expensive ($25-500+ per training run), requires ongoing retraining as data changes, and can cause catastrophic forgetting.
What they want: A clear decision framework with cost awareness, not a preference.
Q13: How do you choose a chunking strategy?
Section titled “Q13: How do you choose a chunking strategy?”Sample answer: Chunking strategy depends on document type and retrieval requirements. For technical documentation: 512-token chunks with 64-token overlap — this captures a single concept per chunk while maintaining cross-chunk context. For legal contracts: section-based chunking that preserves clause boundaries, even if chunks vary in size. For code: function-level chunking with docstrings included. For conversations: turn-based chunking. I always evaluate chunking with retrieval precision@k — retrieve the top 5 chunks for 50 test queries and measure how often the correct chunk appears. I’ve seen precision drop 15-20% from a bad chunking choice alone.
What they want: Multiple strategies tied to document types, plus an evaluation approach.
Q14: How do you design an LLM agent?
Section titled “Q14: How do you design an LLM agent?”Sample answer: An LLM agent follows the ReAct pattern: Reason about the task, Act by calling a tool, Observe the result, and repeat until done. The core components are: (1) a system prompt defining the agent’s role and available tools, (2) a tool schema describing each tool’s inputs and outputs, (3) a loop controller that manages the reason-act-observe cycle, and (4) termination conditions (max steps, success criteria, timeout). For production, you also need: cost caps (abort after $X in token spend), observability (log every step for debugging), and human-in-the-loop escalation for low-confidence decisions.
What they want: Production concerns (cost caps, timeouts, observability) alongside the core pattern.
Q15: When do you use multi-agent vs single-agent?
Section titled “Q15: When do you use multi-agent vs single-agent?”Sample answer: Single-agent when the task is linear and the tool set is <10 tools. Multi-agent when the task has distinct phases that benefit from specialized prompts. Example: a code review system might use one agent for security analysis (specialized prompt, security-focused tools) and another for performance analysis (different prompt, profiling tools), with an orchestrator that merges their findings. The trade-off: multi-agent systems are harder to debug, cost more (each agent consumes tokens), and introduce coordination complexity. I default to single-agent and only split when I can prove the single agent’s quality degrades due to prompt overload.
What they want: A clear decision criterion and the default-to-simple principle.
Q16: How do you select a vector database?
Section titled “Q16: How do you select a vector database?”Sample answer: Three factors drive the choice: operational capacity, data residency, and scale economics. If you have no DevOps team and your data can live in the cloud, use a managed service like Pinecone — zero infrastructure overhead. If you need hybrid search (vector + keyword), data must stay on-premises, or you are past 5 million vectors, self-hosted Weaviate or Qdrant saves 60-80% on cost. For prototyping, use Chroma locally. The vector database comparison covers this in full depth. The key is matching the operational model to your team’s capacity, not picking the “best” database.
What they want: Decision driven by constraints, not technology preference.
Q17: How does multi-model routing work?
Section titled “Q17: How does multi-model routing work?”Sample answer: Multi-model routing sends different requests to different models based on complexity, cost, or latency requirements. A simple router classifies the input (keyword matching or a small classifier) and routes: simple factual queries go to a smaller model (GPT-4o-mini, Claude Haiku), complex reasoning goes to a larger model (GPT-4o, Claude Opus), and code generation might go to a specialized model. This reduces average cost by 40-60% while maintaining quality on hard queries. The router itself must be fast — <50ms latency — so it does not negate the savings. An LLM-based router defeats the purpose.
What they want: Cost reduction numbers and the insight that the router must be cheap.
Q18: How do you handle context window limits in RAG?
Section titled “Q18: How do you handle context window limits in RAG?”Sample answer: Three strategies: (1) Retrieval filtering — only retrieve the most relevant chunks, not everything. Use reranking (cross-encoder) after initial vector search to ensure the top-k are truly relevant. (2) Prompt compression — summarize retrieved chunks before inserting them into the prompt. This trades some information for token savings. (3) Map-reduce — for tasks requiring many documents (summarization, comparison), process each document independently with a smaller prompt, then merge the outputs. Strategy 1 handles 90% of cases. Strategy 3 is necessary when the answer requires reasoning across more documents than fit in the context window.
What they want: Multiple strategies ranked by when to use each, not just “use a bigger context window.”
Q19: How do you evaluate retrieval quality?
Section titled “Q19: How do you evaluate retrieval quality?”Sample answer: Three metrics at the retrieval stage: Precision@k (what fraction of retrieved chunks are relevant), Recall@k (what fraction of relevant chunks are retrieved), and MRR (Mean Reciprocal Rank — how high the first relevant chunk ranks). I build a test set of 50-100 query-document pairs with human labels. Precision@5 > 0.8 is my bar for production. Below that, I investigate: is the embedding model wrong for the domain? Are chunks too large? Is the query being poorly embedded? The generation stage needs separate evaluation — retrieval quality and answer quality are correlated but not identical.
What they want: Specific metrics with target thresholds and a debugging approach.
Q20: How do you design a tool schema for an agent?
Section titled “Q20: How do you design a tool schema for an agent?”Sample answer: Each tool needs: a clear name (verb-noun: search_documents, create_ticket), a description the LLM can reason about (one sentence explaining when to use it, not how it works), typed input parameters with descriptions, and a defined output format. Common mistakes: tool names that are ambiguous (“process” could mean anything), missing parameter descriptions (the LLM guesses types), and overly complex return objects (the LLM cannot parse nested JSON reliably). I keep tools to <5 parameters each and <10 tools per agent. Beyond that, the model’s tool selection accuracy drops measurably.
What they want: Practical limits (5 params, 10 tools) and the insight that tool descriptions are critical for LLM reasoning.
6. LLM Production Interview Questions
Section titled “6. LLM Production Interview Questions”These 10 questions separate engineers who have shipped LLM features from those who have only built prototypes. Expect these in senior and staff-level interviews.
Q21: How do you optimize LLM latency in production?
Section titled “Q21: How do you optimize LLM latency in production?”Sample answer: Five techniques, in order of impact: (1) Streaming — return tokens as they generate so the user sees output immediately. Time-to-first-token matters more than total generation time for UX. (2) Semantic caching — cache responses for semantically similar queries using an embedding similarity threshold. This can eliminate 20-40% of LLM calls for repeat-heavy workloads. (3) Model routing — send simple queries to faster, cheaper models. (4) Prompt optimization — shorter prompts mean fewer input tokens and faster processing. A 50% reduction in prompt length roughly halves time-to-first-token. (5) Parallel retrieval — in RAG, run the vector search and any preprocessing in parallel, not sequentially.
What they want: Techniques ordered by impact with specific numbers.
Q22: How do you manage LLM costs in production?
Section titled “Q22: How do you manage LLM costs in production?”Sample answer: Four cost levers: (1) Model selection — GPT-4o-mini costs ~15x less than GPT-4o per token. Use the smallest model that meets quality requirements. (2) Prompt compression — remove unnecessary instructions, use shorter examples, compress retrieved context. (3) Caching — semantic caching for repeated queries, exact caching for identical inputs. (4) Token budgets — set per-request and per-user limits. A customer support bot might cap at 2,000 output tokens per response. In my experience, model routing alone (sending 70% of queries to a smaller model) reduced monthly costs by 55% with <3% quality degradation on our evaluation suite.
What they want: A quantified example from production experience.
Q23: How do you evaluate LLM output quality?
Section titled “Q23: How do you evaluate LLM output quality?”Sample answer: Three-layer evaluation approach: (1) Automated metrics — BLEU/ROUGE for summarization, exact match for extraction, custom rubrics scored by a judge LLM. These run on every deployment. (2) Evaluation datasets — curated query-response pairs with human-graded gold answers. Track scores across deployments to catch regressions. (3) Human review — sample 5% of production responses weekly for manual quality scoring. The judge LLM approach (using GPT-4 to grade GPT-4o-mini outputs) works surprisingly well when you provide clear rubrics. I’ve measured 85-90% agreement between GPT-4 judges and human reviewers on 5-point quality scales.
What they want: The three-layer structure and the judge LLM insight with agreement metrics.
Q24: How do you implement guardrails for an LLM?
Section titled “Q24: How do you implement guardrails for an LLM?”Sample answer: Guardrails operate at three stages: input, processing, and output. Input guardrails: PII detection (regex + NER model), prompt injection detection (classifier trained on known attacks), and topic filtering (reject off-topic queries). Processing guardrails: token budget limits, timeout enforcement, and blocked tool calls. Output guardrails: content filtering (toxicity classifier), format validation (JSON schema check), factual grounding check (verify claims against retrieved context), and PII scrubbing. I implement guardrails as middleware — they wrap the LLM call, not modify the model. This lets you update guardrails independently of the model.
What they want: The three-stage framework and the middleware architecture insight.
Q25: How do you detect and mitigate hallucinations?
Section titled “Q25: How do you detect and mitigate hallucinations?”Sample answer: Detection first: (1) Cross-reference generated claims against retrieved context using NLI (Natural Language Inference). (2) Generate multiple responses at temperature 0.3 and flag any claim that does not appear in all responses (self-consistency). (3) Ask the model to cite specific passages — then verify those citations exist. Mitigation: (1) Constrain the prompt (“only answer based on the provided context, say ‘I don’t know’ otherwise”). (2) Reduce temperature for factual tasks. (3) Use RAG to ground responses in source documents. (4) Implement confidence scoring and route low-confidence responses to human review. Zero hallucination is not achievable — the goal is detection + graceful degradation.
What they want: The admission that zero hallucination is impossible, paired with a practical detection + mitigation pipeline.
Q26: Write a basic RAG pipeline
Section titled “Q26: Write a basic RAG pipeline”Sample answer:
from openai import OpenAIimport numpy as np
client = OpenAI()
def embed(text: str) -> list[float]: """Generate embedding for a text string.""" response = client.embeddings.create( input=text, model="text-embedding-3-small" ) return response.data[0].embedding
def retrieve(query: str, chunks: list[dict], top_k: int = 5) -> list[dict]: """Retrieve top-k most relevant chunks for a query.""" query_embedding = np.array(embed(query)) scored = [] for chunk in chunks: chunk_embedding = np.array(chunk["embedding"]) score = np.dot(query_embedding, chunk_embedding) / ( np.linalg.norm(query_embedding) * np.linalg.norm(chunk_embedding) ) scored.append({**chunk, "score": float(score)}) scored.sort(key=lambda x: x["score"], reverse=True) return scored[:top_k]
def generate(query: str, context_chunks: list[dict]) -> str: """Generate an answer grounded in retrieved context.""" context = "\n---\n".join( f"[Source {i+1}]: {c['text']}" for i, c in enumerate(context_chunks) ) response = client.chat.completions.create( model="gpt-4o-mini", temperature=0, messages=[{ "role": "system", "content": "Answer based only on the provided context. " "Cite sources as [Source N]. " "If the context is insufficient, say so." }, { "role": "user", "content": f"Context:\n{context}\n\nQuestion: {query}" }] ) return response.choices[0].message.contentWhat they want: Clean code with error handling patterns, source citation in the prompt, and appropriate model/temperature choices.
Q27: How do you implement prompt versioning?
Section titled “Q27: How do you implement prompt versioning?”Sample answer: Treat prompts like code: version them in git, tag them with semantic versions, and gate deployments on evaluation scores. My workflow: (1) prompts live in a prompts/ directory as YAML files with metadata (version, author, eval score). (2) Every prompt change runs the evaluation suite in CI. (3) A new prompt only deploys if its eval score >= the current production prompt’s score minus a 2% tolerance. (4) Prompt rollback is instant — switch the version pointer. The anti-pattern is storing prompts in application code with no tracking. When something breaks in production, you need to know exactly which prompt version was running.
What they want: The CI/eval gate concept and the rollback mechanism.
Q28: How do you handle rate limits and API failures?
Section titled “Q28: How do you handle rate limits and API failures?”Sample answer: Three layers: (1) Client-side — exponential backoff with jitter (start at 1s, max 60s, random jitter up to 50% of delay). (2) Circuit breaker — after N consecutive failures (I use 5), stop calling that provider for a cooldown period (30-60s). During cooldown, route to a fallback model. (3) Multi-provider failover — configure primary and secondary providers. If OpenAI is down, route to Anthropic. This requires abstracting the LLM call behind an interface so the application does not know which provider is handling the request.
What they want: The circuit breaker pattern and multi-provider failover — not just retry logic.
Q29: How do you monitor an LLM in production?
Section titled “Q29: How do you monitor an LLM in production?”Sample answer: Four monitoring layers: (1) Infrastructure — latency p50/p95/p99, error rate, throughput (requests/sec). (2) Cost — daily spend, per-request cost, cost by model. Alert when daily spend exceeds 120% of the 7-day average. (3) Quality — automated eval scores on a rolling sample (run the judge LLM on 5% of responses), user feedback signals (thumbs up/down, regeneration rate). (4) Safety — guardrail trigger rate, blocked request volume, PII detection frequency. The most actionable alert is the quality score trend — a 5% drop in eval scores over 3 days usually means a prompt regression or a data quality issue in your RAG pipeline.
What they want: Four distinct layers with specific alert thresholds.
Q30: How do you build an evaluation pipeline for LLM deployments?
Section titled “Q30: How do you build an evaluation pipeline for LLM deployments?”Sample answer: An eval pipeline has four components: (1) Test dataset — 100-500 query-response pairs with human-graded gold answers, stratified by difficulty and topic. (2) Scoring functions — automated metrics (exact match, semantic similarity, rubric-based LLM judge) that produce a score per response. (3) CI integration — every prompt or retrieval change triggers the eval suite. Deployment is blocked if the aggregate score drops below the production baseline minus a tolerance threshold. (4) Drift monitoring — run the eval suite weekly against production traffic samples to detect quality degradation that does not correlate with code changes (e.g., upstream model updates). The key insight: eval datasets must be maintained like code. Stale eval datasets give false confidence.
What they want: The CI gate (deploy only if eval passes) and drift monitoring as separate concerns.
7. What Separates Senior from Junior
Section titled “7. What Separates Senior from Junior”The difference between passing and failing a senior LLM interview is almost never about knowledge — it is about how you communicate trade-offs.
Weak vs Strong Answer Patterns
Section titled “Weak vs Strong Answer Patterns”Q: “How would you chunk documents for RAG?”
❌ Junior answer: “I would split the documents into chunks and put them in a vector database.”
✅ Senior answer: “For this technical documentation use case, I would start with 512-token chunks with 64-token overlap. I chose 512 because our embedding model (text-embedding-3-small, 1536 dimensions) captures a single concept well at that length — our retrieval precision@5 was 0.83 at 512 vs 0.71 at 1024. The 64-token overlap preserves cross-chunk context for sentences that span boundaries. I would evaluate this against semantic chunking (splitting on section headers) and adjust based on retrieval metrics.”
The Three Marks of a Senior Answer
Section titled “The Three Marks of a Senior Answer”- Specific numbers — chunk sizes, precision scores, latency targets, cost figures. If you do not have real numbers, use reasonable estimates and say so.
- Alternatives considered — mentioning what you did not choose and why shows depth.
- Measurement criteria — how you would know if your decision was right or wrong.
Common Mistakes That Signal Junior Level
Section titled “Common Mistakes That Signal Junior Level”- Describing what a technology is without discussing when to use it
- Giving one answer without acknowledging trade-offs
- Using vague qualifiers (“it should be fast”, “it might work”) instead of numbers
- Not mentioning cost or operational overhead
- Treating every question as a definition prompt instead of a design prompt
8. LLM Questions from Top Companies
Section titled “8. LLM Questions from Top Companies”Different company types emphasize different aspects of LLM knowledge. Knowing the pattern helps you allocate preparation time.
FAANG / Large Tech
Section titled “FAANG / Large Tech”Focus: System design at scale. They assume you know foundations and jump straight to production architecture.
Typical questions:
- Design an LLM-powered search system that handles 10M queries/day
- How would you build a content moderation pipeline using LLMs?
- Design a multi-model serving infrastructure with automatic failover
What they value: Scalability numbers, failure handling, cost modeling, team/org considerations.
AI Startups
Section titled “AI Startups”Focus: Speed and versatility. They want engineers who can build end-to-end with minimal infrastructure.
Typical questions:
- Build a RAG prototype for our domain in 30 minutes (live coding)
- How would you evaluate our chatbot’s quality with no existing test data?
- Design an agent that can interact with our API — what tool schemas would you define?
What they value: Shipping speed, practical judgment, ability to work with ambiguity.
Enterprise Companies
Section titled “Enterprise Companies”Focus: Security, compliance, and integration with existing systems.
Typical questions:
- How do you ensure PII never reaches the LLM provider?
- Design a guardrails layer for a financial services chatbot
- How would you integrate LLM features into our existing Java microservices architecture?
What they value: Security awareness, compliance thinking, integration patterns, risk management.
The Universal Signal
Section titled “The Universal Signal”Across all company types, one signal matters most: do you reason from requirements to solutions, or do you pick a tool and justify it backwards? The first approach passes interviews. The second fails them.
9. LLM Interview Prep in Practice
Section titled “9. LLM Interview Prep in Practice”A structured preparation plan beats random question grinding. Here is a 2-week plan that covers all three tiers.
Week 1: Foundations + Application (Days 1-7)
Section titled “Week 1: Foundations + Application (Days 1-7)”Days 1-2: Review transformer architecture and tokenization. Practice explaining attention, KV-cache, and BPE aloud in <2 minutes each.
Days 3-4: Build a RAG pipeline from scratch (not a framework tutorial — use the OpenAI API directly). Measure retrieval precision. Change chunk sizes and measure the impact.
Days 5-6: Design 3 different agent architectures on paper: single-agent with tools, multi-agent with orchestrator, and human-in-the-loop. For each, define the tool schemas, termination conditions, and cost caps.
Day 7: Mock interview — have someone ask you 5 random questions from Sections 4-5 of this page. Record yourself and review for vague answers.
Week 2: Production + Mock Interviews (Days 8-14)
Section titled “Week 2: Production + Mock Interviews (Days 8-14)”Days 8-9: Study cost optimization. Calculate the actual cost of processing 100K documents through GPT-4o vs GPT-4o-mini. Compare RAG vs fine-tuning cost for a specific use case.
Days 10-11: Build an evaluation pipeline. Create 20 test query-answer pairs, implement a judge LLM scorer, and measure agreement with your own manual scores.
Days 12-13: Practice system design interview questions. Design an end-to-end LLM system in 45 minutes: requirements, architecture, cost estimate, evaluation plan, failure modes.
Day 14: Final mock interview — 5 questions across all tiers, 45 minutes total, with a timer.
Resources
Section titled “Resources”- GenAI Interview Questions — broader interview prep with career positioning
- Gen AI Engineer Interview Guide — 30 questions with full 11-section answers
- Prompt Engineering Guide — practical prompting patterns for interviews and production
10. Summary and Key Takeaways
Section titled “10. Summary and Key Takeaways”LLM interviews reward practical depth over theoretical breadth. Here is what to take away from these 30 questions.
- LLM interviews test orchestration, not training. You will not be asked to train a model — you will be asked to select, deploy, evaluate, and optimize one.
- Numbers beat narratives. “512-token chunks with 0.83 precision@5” is stronger than “I would chunk the documents appropriately.”
- Production awareness is the senior signal. Cost, latency, guardrails, and monitoring matter more than architecture diagrams.
- Trade-offs are the real answer. Every question has multiple valid approaches. Interviewers want to see your reasoning, not your conclusion.
- Evaluation is non-negotiable. If your answer does not include how you would measure success, it is incomplete.
- Build something before the interview. A RAG pipeline you built yourself teaches more than 50 blog posts about RAG architecture.
Related
Section titled “Related”- GenAI Interview Questions — broader GenAI interview prep across 4 experience levels
- Gen AI Engineer Interview Guide — full 30-question guide with 11-section answers
- RAG Architecture — deep dive into retrieval-augmented generation
- Agent Design Patterns — agentic architectures and orchestration
- System Design Interview — end-to-end system design for GenAI
- LLM Evaluation — metrics and pipelines for measuring LLM quality
Last updated: March 2026. Interview patterns are based on publicly shared experiences and common industry practices as of early 2026.
Frequently Asked Questions
What are the most common LLM interview questions?
LLM interview questions fall into three categories: Foundations (tokenization, attention mechanisms, context windows, embeddings), Application (RAG pipeline design, agent architecture, fine-tuning decisions), and Production (latency optimization, cost management, evaluation metrics, guardrails). Senior-level interviews focus heavily on production trade-offs and system design rather than textbook definitions.
How is an LLM interview different from a traditional ML interview?
Traditional ML interviews test feature engineering, model selection, and training pipelines. LLM interviews test prompt engineering, retrieval architecture, cost optimization, and failure mode awareness. You rarely train models from scratch in LLM roles — instead you orchestrate pre-trained models, design retrieval systems, and build evaluation pipelines for non-deterministic outputs.
What is BPE tokenization and why do interviewers ask about it?
BPE (Byte Pair Encoding) is the tokenization algorithm used by GPT models. It iteratively merges the most frequent byte pairs in training data to build a vocabulary of subword tokens. Interviewers ask about it because tokenization directly affects cost (you pay per token), context window usage, and multilingual performance. Understanding BPE helps you estimate API costs and debug unexpected model behavior.
How do you answer RAG architecture questions in an LLM interview?
Start with the retrieval pipeline: embedding model selection, chunking strategy (size and overlap), vector database choice, and similarity metric. Then cover the generation side: context window management, prompt template design, and citation enforcement. Strong answers include specific numbers — chunk sizes you have used, latency targets you hit, and retrieval precision metrics you measured.
What LLM production questions should I prepare for?
Prepare for questions on: latency optimization (streaming, caching, model routing), cost management (token budgets, prompt compression, smaller model fallbacks), evaluation (automated metrics vs human review, regression testing), guardrails (PII detection, content filtering, output validation), and monitoring (drift detection, quality scoring, alert thresholds). Interviewers want to hear about systems you have actually operated.
What is the difference between fine-tuning and RAG?
RAG retrieves external documents at query time to ground the model's response in specific knowledge. Fine-tuning adjusts model weights on your domain data to change the model's behavior or knowledge permanently. Use RAG when your knowledge base changes frequently or you need citation traceability. Use fine-tuning when you need consistent style, format, or domain-specific reasoning patterns that prompting alone cannot achieve.
How do you explain attention mechanisms in an interview?
Attention lets a model weigh the relevance of every input token when generating each output token. Self-attention computes query, key, and value vectors for each token, then uses dot-product similarity between queries and keys to determine attention weights. Multi-head attention runs this process in parallel across multiple representation subspaces. The key interview insight: attention is what allows transformers to capture long-range dependencies without recurrence.
What agent design questions come up in LLM interviews?
Common agent questions include: how the ReAct loop works (reason-act-observe cycle), when to use single-agent vs multi-agent architectures, how to design tool schemas, how to handle agent failures and loops, and how to evaluate agent performance. Senior-level questions focus on production concerns — timeouts, cost caps, human-in-the-loop escalation, and observability for debugging multi-step agent traces.
How should I prepare for LLM coding questions?
Practice three patterns: (1) building a basic RAG pipeline with chunking, embedding, and retrieval; (2) implementing a tool-calling agent with structured output parsing; (3) writing evaluation functions that score model outputs against ground truth. Use Python with LangChain or LangGraph for practice. Interviewers care about clean abstractions and error handling more than framework-specific syntax.
What separates senior from junior answers in LLM interviews?
Junior answers recite definitions. Senior answers discuss trade-offs with specific numbers. For example, on chunking strategy: a junior says 'I would chunk the documents.' A senior says 'I used 512-token chunks with 64-token overlap for technical documentation because our retrieval precision dropped 12% with 1024-token chunks — the semantic density was too low for our embedding model.' Senior answers reference production experience, measurable outcomes, and decisions that did not work.