April 15, 2026
The AI Engineer Interview Prep Guide: What Top Companies Actually Ask
System design for LLM systems, prompt debugging challenges, RAG architecture questions, and the five patterns that separate top candidatesβ¦
By Suresh Kumar Ariya Gowder
9 min read
- 1 How AI engineering interviews are structured in 2026
- 2 The questions that actually come up
- 3 System design: "Design a document Q&A system for 10 million documents"
- 4 Prompt debugging challenge: "Your RAG system hallucinates despite having the right context"
- 5 Cost estimation: "This customer support agent handles 100,000 daily users. How much does it cost and how do you reduce it?"
System design for LLM systems, prompt debugging challenges, RAG architecture questions, and the five patterns that separate top candidates in 2026 interviews
A senior engineer I know spent three months preparing for their AI engineering interview at a major company. They memorised transformer architecture cold. They rebuilt attention from scratch in PyTorch. They could derive gradient descent in their sleep.
They failed on the system design round. The question was: "Design a document Q&A system for 10 million documents." They had built one. But they'd never been asked to explain it out loud, under pressure, with an interviewer pushing back on every choice.
The gap between knowing how to build AI systems and being able to articulate those choices under interview conditions is the thing most prep guides don't address.
AI engineering interviews changed β and most candidates are still preparing for 2023. Traditional ML subjects like gradient descent now make up only about 20β30% of questions. In 2026, 75% of questions revolve around generative AI concepts such as RAG architecture, LLM evaluation, and multi-agent systems.
This guide covers what's actually asked, what model answers look like, and the five patterns that separate candidates who get offers from candidates who leave the loop thinking "I knew all of that."
"If you can recite the transformer paper but cannot estimate the cost of processing 1 million documents through an LLM, you will struggle with senior-level AI engineering interviews."
How AI engineering interviews are structured in 2026
Before the questions, understand the format. Most top-company loops for AI engineering roles have three technical components:
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.
For the OpenAI Applied AI team specifically, system design appears in both the phone screen and the virtual on-site, making it the most heavily weighted skill area in the entire loop. The technical deep dive functions as a reverse system design interview β you present a past project and interviewers probe the architectural decisions.
The implication: you need to be able to walk through your own built systems as rigorously as you answer hypothetical ones.
The questions that actually come up
System design: "Design a document Q&A system for 10 million documents"
The most common prompt in a 2026 GenAI system design interview is: "Design a conversational AI agent for your enterprise knowledge base." To pass, you must confidently architect a RAG pipeline, explicitly defining the trade-offs between embedding latency, vector search accuracy, and LLM token costs.
Most candidates jump to the architecture immediately. Senior candidates start with constraints:
- What's the latency requirement? (Under 2 seconds? Under 500ms? This changes everything.)
- What's the update frequency? (Documents added daily, or a static corpus?)
- What's the expected query volume? (100 QPS vs 10,000 QPS requires very different scaling.)
- What's the accuracy requirement? (Legal or medical systems need higher precision than internal wikis.)
Only after anchoring on constraints do you sketch the architecture. A strong answer:
Ingestion pipeline:
Documents β chunk (512 tokens, 64-token overlap for technical docs)
β embed (text-embedding-3-small or similar)
β store in pgvector (for <10M docs, cost-effective)
Query pipeline:
User query β embed query
β hybrid search (dense vector + BM25 sparse, combined via RRF)
β re-rank top-20 to top-5 using cross-encoder
β augment prompt with top-5 chunks + source citations
β generate with claude-sonnet-4-20250514 at temperature=0
Observability:
- Log every query, retrieved chunks, and response
- Track: retrieval relevance score, answer groundedness, latency
- Alert on: relevance score drops, latency spikes, cost per queryIngestion pipeline:
Documents β chunk (512 tokens, 64-token overlap for technical docs)
β embed (text-embedding-3-small or similar)
β store in pgvector (for <10M docs, cost-effective)
Query pipeline:
User query β embed query
β hybrid search (dense vector + BM25 sparse, combined via RRF)
β re-rank top-20 to top-5 using cross-encoder
β augment prompt with top-5 chunks + source citations
β generate with claude-sonnet-4-20250514 at temperature=0
Observability:
- Log every query, retrieved chunks, and response
- Track: retrieval relevance score, answer groundedness, latency
- Alert on: relevance score drops, latency spikes, cost per queryThe interviewer will then push: "Why pgvector over Pinecone?" They want to hear your trade-off reasoning. For 10 million documents, pgvector keeps you in a single operational stack, avoids another vendor dependency, and is cheaper. At 100M+ documents with high QPS requirements, you'd revisit.
The most critical component is the chunking and retrieval mechanism. Advanced candidates focus heavily on chunking strategies and re-ranking models. Senior-level signals include mentioning traceability β logging every step of the orchestration flow so that when a user reports a bad answer, you can identify exactly which retrieval chunk produced the wrong output.
Prompt debugging challenge: "Your RAG system hallucinates despite having the right context"
This scenario trips up candidates who can build but can't systematically diagnose. Senior candidates work through a diagnostic hierarchy before suggesting a fix:
import anthropic
client = anthropic.Anthropic()
def debug_rag_response(query: str, retrieved_chunks: list[str], response: str) -> dict:
"""
Structured diagnostic for RAG hallucination.
Returns which layer failed: retrieval, augmentation, or generation.
"""
diagnostic_prompt = f"""You are debugging a RAG system response.
Query: {query}
Retrieved context chunks:
{chr(10).join(f'[Chunk {i+1}]: {chunk}' for i, chunk in enumerate(retrieved_chunks))}
System response: {response}
Diagnose the failure. For each claim in the response:
1. Is it directly supported by a chunk? (cite chunk number)
2. Is it inferred from chunks? (note the inference)
3. Is it fabricated with no grounding? (flag as hallucination)
Then identify the failure layer:
- RETRIEVAL: right documents not retrieved, or wrong documents retrieved
- AUGMENTATION: context provided but poorly structured or too long
- GENERATION: model ignored grounding instructions
Output format:
CLAIM ANALYSIS: <per-claim breakdown>
FAILURE LAYER: <RETRIEVAL | AUGMENTATION | GENERATION>
ROOT CAUSE: <specific diagnosis>
FIX: <concrete change to make>"""
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[{"role": "user", "content": diagnostic_prompt}]
)
return {"diagnosis": response.content[0].text}import anthropic
client = anthropic.Anthropic()
def debug_rag_response(query: str, retrieved_chunks: list[str], response: str) -> dict:
"""
Structured diagnostic for RAG hallucination.
Returns which layer failed: retrieval, augmentation, or generation.
"""
diagnostic_prompt = f"""You are debugging a RAG system response.
Query: {query}
Retrieved context chunks:
{chr(10).join(f'[Chunk {i+1}]: {chunk}' for i, chunk in enumerate(retrieved_chunks))}
System response: {response}
Diagnose the failure. For each claim in the response:
1. Is it directly supported by a chunk? (cite chunk number)
2. Is it inferred from chunks? (note the inference)
3. Is it fabricated with no grounding? (flag as hallucination)
Then identify the failure layer:
- RETRIEVAL: right documents not retrieved, or wrong documents retrieved
- AUGMENTATION: context provided but poorly structured or too long
- GENERATION: model ignored grounding instructions
Output format:
CLAIM ANALYSIS: <per-claim breakdown>
FAILURE LAYER: <RETRIEVAL | AUGMENTATION | GENERATION>
ROOT CAUSE: <specific diagnosis>
FIX: <concrete change to make>"""
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[{"role": "user", "content": diagnostic_prompt}]
)
return {"diagnosis": response.content[0].text}The framework matters more than the code. In the interview, sketch this on a whiteboard:
Hallucination in RAG despite correct context:
Step 1: Check chunk relevance scores
β If score < threshold: retrieval failure, not generation failure
Step 2: Check chunk count in context
β If > 5 chunks: noise likely; reduce k or raise threshold
Step 3: Check for conflicting chunks
β If chunk A says X and chunk B says ~X: model confabulated a reconciliation
Step 4: Check prompt grounding instruction
β Does system prompt say "ONLY from context"? Or just "use context"?
Step 5: Check temperature
β Anything > 0.3 for factual RAG introduces unnecessary varianceHallucination in RAG despite correct context:
Step 1: Check chunk relevance scores
β If score < threshold: retrieval failure, not generation failure
Step 2: Check chunk count in context
β If > 5 chunks: noise likely; reduce k or raise threshold
Step 3: Check for conflicting chunks
β If chunk A says X and chunk B says ~X: model confabulated a reconciliation
Step 4: Check prompt grounding instruction
β Does system prompt say "ONLY from context"? Or just "use context"?
Step 5: Check temperature
β Anything > 0.3 for factual RAG introduces unnecessary varianceStrong candidates frame their approach to hallucinations as a "layered defense": grounding via RAG, output constraints like structured schemas, and automated evaluation using LLMs as judges. They also explain what they didn't implement and why.
Cost estimation: "This customer support agent handles 100,000 daily users. How much does it cost and how do you reduce it?"
A common interview scenario involves 100,000 daily active users with 10 interactions each and 2,000 tokens per interaction β 2 billion tokens per day, around $13,000 daily or $390,000 monthly using a frontier model. Strong candidates immediately propose model tiering and prompt caching as cost reduction strategies.
This is a production judgment question disguised as a math problem:
def estimate_llm_cost(
daily_users: int,
interactions_per_user: int,
avg_input_tokens: int,
avg_output_tokens: int,
) -> dict:
"""
Quick cost estimate for system design interviews.
Sonnet pricing: ~$3/M input, ~$15/M output tokens (approx 2026)
"""
total_queries = daily_users * interactions_per_user
total_input = total_queries * avg_input_tokens
total_output = total_queries * avg_output_tokens
daily_cost = (total_input / 1_000_000 * 3) + (total_output / 1_000_000 * 15)
return {
"daily_queries": total_queries,
"daily_input_tokens": total_input,
"daily_output_tokens": total_output,
"daily_cost_usd": round(daily_cost, 2),
"monthly_cost_usd": round(daily_cost * 30, 2)
}
# 100K users, 10 interactions, 2K tokens per interaction
baseline = estimate_llm_cost(
daily_users=100_000,
interactions_per_user=10,
avg_input_tokens=1_500,
avg_output_tokens=500
)
# β daily_cost: ~$12,000, monthly: ~$360,000
# With model tiering (80% Haiku, 20% Sonnet):
# β ~$3,000/day instead of $12,000/day - 75% cost reductiondef estimate_llm_cost(
daily_users: int,
interactions_per_user: int,
avg_input_tokens: int,
avg_output_tokens: int,
) -> dict:
"""
Quick cost estimate for system design interviews.
Sonnet pricing: ~$3/M input, ~$15/M output tokens (approx 2026)
"""
total_queries = daily_users * interactions_per_user
total_input = total_queries * avg_input_tokens
total_output = total_queries * avg_output_tokens
daily_cost = (total_input / 1_000_000 * 3) + (total_output / 1_000_000 * 15)
return {
"daily_queries": total_queries,
"daily_input_tokens": total_input,
"daily_output_tokens": total_output,
"daily_cost_usd": round(daily_cost, 2),
"monthly_cost_usd": round(daily_cost * 30, 2)
}
# 100K users, 10 interactions, 2K tokens per interaction
baseline = estimate_llm_cost(
daily_users=100_000,
interactions_per_user=10,
avg_input_tokens=1_500,
avg_output_tokens=500
)
# β daily_cost: ~$12,000, monthly: ~$360,000
# With model tiering (80% Haiku, 20% Sonnet):
# β ~$3,000/day instead of $12,000/day - 75% cost reductionThe candidate who estimates costs confidently and immediately proposes tiering, caching, and query routing is signaling production experience. The candidate who gets to the $360K monthly number and says "that seems high" has never shipped at scale.
The five patterns that separate top candidates
Every LLM interview question maps to one of five evaluation dimensions: architecture understanding, production judgment, retrieval design, failure awareness, and evaluation thinking.
Here's how those dimensions show up in what candidates say:
Pattern 1: They articulate trade-offs in both directions.
Weak answer to "RAG vs fine-tuning?": "I'd use RAG because it's cheaper."
Strong answer: "I'd start with RAG because it's faster to iterate, cheaper to update, and doesn't require labeled data. I'd consider fine-tuning if the domain has specialized vocabulary that significantly degrades zero-shot quality, or if latency is so constrained that the retrieval step itself is the bottleneck. In practice, fine-tuning rarely replaces RAG for knowledge-intensive tasks β it's more often used together."
The difference: the strong candidate explains why you would and wouldn't, not just which one they'd pick.
Pattern 2: They name failure modes before being asked.
Interviewers consistently flag candidates who proactively say things like: "One failure mode I'd watch for with this approach is context window saturation if documents are long β I'd address that with parent-child chunking," or "The risk of model tiering is routing errors, so I'd add a fallback and monitor misclassification rate."
Engineers who adapt well rely on layered debugging: walk the stack in order β client, gateway, service, storage, network. Many candidates jump straight to architecture and miss simpler explanations. Interviewers care less about the "right" answer and more about how you reason through competing priorities.
Pattern 3: They separate what they built from what they'd build differently.
The technical deep dive round is specifically designed to probe this. "What would you change if you were starting over?" is one of the most common follow-ups to a project presentation.
Candidates who say "I'd do the same thing" are signaling they either haven't thought critically about their own work, or they built it once and never operated it in production. Strong candidates have specific answers: "I'd replace fixed-size chunking with semantic chunking because we had retrieval failures on documents with non-uniform structure."
Pattern 4: They quantify everything they can.
Interviewers increasingly focus on the reasoning behind technical choices. Candidates who back choices with data β "Approach A achieved 44/60 accuracy on our eval set vs Approach B at 31/60" β consistently outperform candidates who give qualitative answers.
"It improved quality" is a bad answer. "It reduced hallucination rate from 8% to 3.2% on our golden test set of 150 queries" is a good answer. If you don't have numbers from a project, practice estimating them. Interviewers know estimates are estimates β they're testing whether you think quantitatively.
Pattern 5: They mention evaluation before being asked.
The difference between online and offline evaluation: offline is evaluation on a fixed benchmark dataset before deployment β fast, reproducible, but may not reflect production distribution. Online is evaluation of production traffic via sampling and LLM-as-judge scoring β reflects real user behavior but slower to iterate. Best practice: maintain a curated regression suite for offline and monitor online metrics post-deployment.
Candidates who mention evaluation in their system design answers β without being prompted β signal production maturity. "I'd maintain a golden test set of 100β150 hand-labeled query/answer pairs, run it against every prompt change, and monitor groundedness and answer relevance as online metrics post-deployment." This tells the interviewer you know that LLM systems don't stay good on their own.
The one question every candidate gets and most fail
"Tell me about an AI system you built in production. What broke, and how did you fix it?"
This question has no wrong technical answer. It has a wrong structural answer: one that doesn't go deep enough on the failure and the diagnosis.
The pattern interviewers want to see:
- Describe the system briefly (one sentence on architecture)
- Describe the failure mode specifically (not "it hallucinated" β which component, which condition, what the user saw)
- Describe how you diagnosed it (what signals, what tools, how long it took)
- Describe the fix and whether it held (what you changed and what happened next)
- Describe what you'd do differently (what you now know you should have instrumented from day one)
The candidate who can answer this question with specificity β real numbers, real failure modes, real diagnostic steps β is the one who gets the offer. That's the whole signal.
Practical takeaways
- AI engineering interview topics have shifted: generative AI concepts now dominate at 75% of questions. Candidates still preparing for classical ML interviews are behind.
- For system design, anchor on constraints before architecture. Latency, scale, update frequency, and accuracy requirements all change the design significantly.
- Know your token costs for current models. Being unable to estimate the cost of your own system is a signal that you haven't shipped it at scale.
- The observability layer is where senior-level experience shows up. Candidates who mention logging, groundedness checks, and online evaluation without being asked are demonstrating production maturity.
- Practice articulating trade-offs in both directions. Every technical choice has a case for it and a case against it β interviewers want to hear both.
- The "what broke?" question is the real seniority test. Have a specific, detailed answer ready. Abstract answers about hallucination don't move you forward.
- Evaluation thinking is the pattern most often missing: know the difference between offline and online evaluation, why you need both, and what metrics you'd track.
Preparing for AI engineering roles? Follow Think in AI Agents β I publish every week on the system design patterns, production engineering practices, and career strategies that matter for engineers building with LLMs.
What question caught you off guard in your last AI engineering interview? Drop it in the comments β the specific questions teach more than any general guide.
Level up your skills with my Gumroad eBooks
Get the The Spec-Driven Workflow: How I Get AI to Write Correct Code on the First Attempt on Gumroad.
Get the AI Tool Overwhelm Relief Guide: Cut Through the Noise, Use What Matters on Gumroad.
Get the Stop Competing with AI: The Freelancer's Guide to Premium Pricing & Unshakeable Client Loyalty on Gumroad.
Get the I Built 5 AI Agents That Save Me 50 Hours Every Week (No Coding Required) on Gumroad.