---
title: AI Engineer Interview Questions & Answers (2026): LLMs, RAG & Prompting
description: AI engineer interview questions that get asked in 2026 — LLMs, RAG, prompt engineering, agents, evaluation and production trade-offs.
url: https://usegreenroom.app/blog/ai-engineer-interview-questions
last_updated: 2026-06-20
---

← Back to blog

Roles

# AI engineer interview questions and answers

June 20, 2026 · 35 min read

![AI engineer interview questions and answers — cover from Greenroom, the AI mock interviewer](/assets/blog/ai-engineer-interview-questions-hero.webp)

It's 11:47pm. You have an **AI engineer interview** at 10am tomorrow, and you've just opened tab number fourteen of the LangChain docs, because somewhere between "Retrievers" and "Output Parsers" you lost the plot on what a `RunnableSequence` actually does versus what you *think* it does. Your browser history for the last three hours reads like a cry for help: "what is reciprocal rank fusion," "RAG vs fine tuning reddit," "is cosine similarity the same as dot product please someone explain like I'm five." You close the laptop, open it again four minutes later, and start reading the same LlamaIndex quickstart for the second time, hoping it sticks differently on re-read. It does not.

Here's the scene that actually gets people, though — not the night-before panic, but the interview itself. You walk in calm. You've got RAG down cold: chunk the docs, embed them, store the vectors, retrieve the top-k, stuff them in the prompt, done. You explain it fluently, maybe even a little proud of yourself. And then the interviewer leans back and asks the question that ends careers in real time: "okay, but why is your bot still telling customers the refund window is 90 days when your policy doc says 30?" Dead air. You explained the architecture beautifully. You never once asked what your system actually *retrieved* for that query. You built the pipe and never looked at what came out of it — which, it turns out, is the single most common way real AI engineers get caught flat-footed, in interviews and in production alike.

This guide is built around not being that person. It covers the **AI engineer interview questions** that come up most in 2026 — LLM fundamentals, RAG and embeddings, prompt engineering, agents and tool use, evaluation of non-deterministic systems, and the production realities (cost, latency, reliability) that separate "I read about this" from "I shipped this and it broke at 2am and I fixed it" — plus a full worked system-design walkthrough and an honest look at how people actually prepare for this interview versus what the interview actually tests. (See also our [ML engineer](/blog/machine-learning-engineer-interview-questions) guide for the more classical-ML-leaning version of this interview, and our [data engineer](/blog/data-engineer-interview-questions) guide if your role leans more toward the pipelines feeding these systems than the models themselves.)

A quick framing note before the questions: "AI engineer" in 2026 almost always means building production applications **on top of** large language models — RAG pipelines, agents, prompting, evaluation — not training foundation models from scratch, which is a different (and much smaller) job market dominated by research labs. If a JD says "AI engineer" and lists Python, an LLM API, a vector database, and "production experience," this guide is for that interview.

## LLM fundamentals

### How do LLMs work at a high level — tokens, attention, and next-token prediction?

A large language model is trained to predict the next token given everything before it, one token at a time, and generation is just repeated sampling from that prediction. Text is first broken into **tokens** — sub-word pieces, not whole words — via a tokenizer like BPE, so "interviewing" might become "interview" + "ing" and a rare brand name might split into several odd-looking pieces. Inside the model, the **transformer** architecture's key mechanism is **self-attention**: for every token, the model computes how much "attention" to pay to every other token in the sequence, letting it weigh "bank" differently in "river bank" vs "bank account" based on context, rather than relying on a fixed window like older RNNs did. Stack enough of these attention layers and feed-forward layers, train on enough text, and the model learns surprisingly general patterns of language, reasoning, and world knowledge — without anyone explicitly programming grammar or facts in.

This is also a fair place for the interviewer to gauge whether you can explain a mechanism without hand-waving. "It's magic, it just predicts the next word" is technically not wrong, but it's also the answer that gets a disappointed follow-up question. Be ready to say, concretely, what self-attention is computing (a weighted combination of value vectors, weighted by similarity between query and key vectors) even if you can't derive the matrix math live — knowing *what* it's doing functionally is usually enough.

### What is a context window, and why does it matter in practice?

The context window is the maximum number of tokens (input plus output combined, for most APIs) a model can attend to in a single call — commonly 128K to 1M+ tokens in 2026-era frontier models, but every token in that window costs money and adds latency, and very long contexts often suffer from "lost in the middle" effects where the model attends less reliably to information buried deep in a huge prompt than to content near the start or end. In practice this means a bigger context window doesn't remove the need for retrieval or summarization — stuffing 200 pages into context because you technically can is usually worse, slower, and more expensive than retrieving the 3 relevant pages. Interviewers are listening for whether you treat context window size as a budget to manage, not a feature to maximize.

This is, incidentally, the exact mistake from the opening scene's cousin: stuffing everything you know about transformers into your answer because you technically can, instead of retrieving the three sentences the interviewer actually needs. Context management is a skill on both sides of the table.

### What does temperature (and top-p/top-k) actually control?

After the model produces a probability distribution over the next possible token, **temperature** rescales that distribution before sampling: temperature near 0 makes the model nearly deterministic, always picking the highest-probability token (good for extraction, classification, code generation, anything with a "correct" answer); higher temperature (0.7–1.0+) flattens the distribution so lower-probability tokens get sampled more often, producing more varied, creative output at the cost of more factual slips. **Top-p** (nucleus sampling) and **top-k** are complementary controls that cap *which* tokens are even eligible to be sampled — top-p keeps the smallest set of tokens whose cumulative probability exceeds p, top-k keeps a fixed number of the most likely tokens — and are often tuned alongside temperature rather than instead of it. The practical interview signal: knowing temperature 0 doesn't guarantee identical output across calls (provider-side batching and floating-point non-determinism still introduce variance) is what separates people who've actually shipped LLM features from people who've only read the docs.

### What causes hallucinations, and how do you reduce them?

Hallucinations happen because a language model is fundamentally predicting plausible-sounding next tokens, not querying a database of verified facts — when it doesn't "know" something or the prompt is ambiguous, it still produces fluent, confident-sounding text, because fluency and correctness are optimized somewhat independently during training. The practical levers to reduce hallucination: ground responses in retrieved source documents (RAG) rather than relying on parametric memory, lower temperature for factual tasks, instruct the model explicitly to say "I don't know" when the context doesn't contain the answer (models default to guessing unless told otherwise), ask for citations back to specific retrieved chunks so a human or automated check can verify claims, and add a verification/self-check pass for high-stakes outputs. No single technique eliminates hallucination — the honest answer interviewers want is a defense-in-depth strategy, not a silver bullet.

If this section feels familiar, it's because it's exactly the gap from the cold open: the refund-policy bot didn't fail because the LLM is "bad at facts" in the abstract, it failed because nobody checked what got retrieved for that specific query before assuming the model was the problem.

### Fine-tuning vs prompting vs RAG — what does each actually solve?

These three solve different problems and the most common interview mistake is treating them as competing options rather than complementary tools. **Prompting** (including few-shot examples in the prompt) is the fastest, cheapest lever — use it first, for shaping format, tone, and behavior on tasks the base model can already mostly do. **RAG** solves a knowledge problem — the model doesn't have access to your proprietary, private, or post-training-cutoff data — by retrieving and injecting relevant facts at query time, with no retraining required and instant updates when source data changes. **Fine-tuning** solves a behavior or style problem prompting can't reliably fix — teaching a consistent output format across thousands of edge cases, a specific tone, or a narrow specialized skill — at the cost of a training pipeline, eval data, and re-running it every time you want to change behavior. A senior answer walks through this in order: try prompting, add RAG if it's a knowledge gap, only reach for fine-tuning if prompting and RAG both fail to fix a *behavioral* problem.

## RAG and embeddings

### What are embeddings, and what does a vector database actually store?

An embedding is a fixed-length vector of floating-point numbers produced by an embedding model that represents the *meaning* of a piece of text, such that semantically similar text ends up as nearby vectors in that high-dimensional space — "dog" and "puppy" land close together, "dog" and "stock market" land far apart, even though none of those words share letters. A **vector database** (Pinecone, Weaviate, pgvector, Qdrant) stores these vectors alongside the original text/metadata and is optimized for fast **approximate nearest-neighbor search** — given a query vector, return the k most similar stored vectors in milliseconds, even across millions of entries, using index structures like HNSW that trade a small amount of recall for large speed gains over exact search. The interview nuance worth stating out loud: embeddings capture semantic similarity, not factual correctness — two vectors being close means the text is *about* similar things, not that one confirms the other.

### What chunking strategy do you use, and why does chunk size matter so much?

Documents have to be split into chunks before embedding because embedding models have their own context limits and because retrieval works better against focused units of meaning than entire documents. Chunk too small (a sentence or two) and you lose surrounding context the model needs to answer correctly; chunk too large (multiple pages) and the embedding becomes a blurry average of several topics, hurting retrieval precision, plus you waste context-window budget on irrelevant text once it's retrieved. A common, effective default is 300–800 tokens per chunk with some overlap (10–20%) between consecutive chunks so an answer that spans a chunk boundary isn't lost, and **semantic chunking** — splitting at natural section/paragraph boundaries rather than a fixed character count — usually outperforms naive fixed-size splitting for technical or structured documents. The interviewer is checking whether you've actually debugged a retrieval-quality problem, because chunking strategy is the single most common root cause of "the RAG bot gives wrong answers."

### How do you think about recall vs precision in retrieval, and what is hybrid search?

Retrieval has the same precision/recall trade-off as any search problem: retrieving more chunks (higher k) improves recall — the right answer is more likely to be somewhere in the retrieved set — but hurts precision, since irrelevant chunks dilute the context and can actively distract the model into a wrong or hedged answer. Pure vector (semantic) search misses exact-match cases — a product SKU, an error code, an acronym — because semantic similarity doesn't guarantee literal-string matches; pure keyword search (BM25/TF-IDF) misses paraphrases and synonyms. **Hybrid search** runs both in parallel and merges the results (often via a fusion method like reciprocal rank fusion), which is why most production RAG systems in 2026 default to hybrid rather than vector-only — it covers both failure modes at once.

### What is re-ranking, and why retrieve more than you actually send to the model?

A common pattern is to retrieve a wider initial set (say, top 25–50 candidates) cheaply via vector or hybrid search, then run a smaller, more accurate **re-ranking model** (a cross-encoder that scores query-document pairs directly, rather than comparing pre-computed embeddings) over that candidate set to pick the final top 3–5 chunks that actually go into the prompt. This two-stage approach exists because cross-encoders are too slow to run against an entire corpus on every query, but are meaningfully more accurate than embedding similarity alone at judging true relevance — so you get the speed of vector search for the first pass and the accuracy of a re-ranker for the final cut. Skipping re-ranking is a common reason RAG quality plateaus even after tuning chunk size and embedding model.

![AI engineer interview topics — LLMs, RAG, prompting, embeddings, evaluation](/assets/blog/pool-system-design.webp)

AI engineer rounds test LLM application building — RAG, prompting and evaluation.

### What are the common RAG failure modes, and how do you debug them?

Most RAG failures trace back to one of three places, and a good answer names the specific failure and its fix rather than saying "RAG can fail." **Retrieval failure** — the right chunk simply isn't in the retrieved set, usually from poor chunking, a mismatched embedding model (e.g., using a general-purpose embedding model on highly technical or domain-specific text it wasn't tuned for), or too narrow a top-k — fix by improving chunking, adding hybrid search, or increasing k with re-ranking. **Generation failure despite correct retrieval** — the right chunk was retrieved but the model still hallucinates or ignores it — often from an unclear prompt that doesn't instruct the model to prioritize the provided context over its own parametric knowledge, or from the relevant fact being buried in the middle of a long context. **Staleness** — the index wasn't updated when the underlying source data changed, so retrieval confidently returns outdated information. Debugging always starts by separating these: log the retrieved chunks per query, and check whether the correct answer was even present *before* blaming the model's generation.

**A worked debugging scenario, because interviewers love these:** say your customer support bot just told a user the refund window is 90 days, but the actual policy doc says 30. Walk through it like you'd actually walk through it at 2pm on a Tuesday with a Slack thread blowing up. First, pull the trace for that exact query and look at the retrieved chunks — not the model's answer, the *input* to the model. If the 30-day policy chunk isn't in there at all, that's a retrieval failure: maybe the policy doc got re-chunked badly during a content update and the "90 days" example (from an old promotional policy, still sitting in the corpus) is now scoring higher than the current policy text for this query's embedding. If the correct chunk *is* in the retrieved set but the model still said 90, that's a generation failure — check whether your system prompt actually says "prioritize the provided context over anything else you know" or just vaguely says "be helpful," and check where in the context window that chunk landed (middle-of-long-context burial is a real, measurable effect). If the doc was updated last week and your vector index wasn't re-run, that's staleness, and the fix is a re-indexing trigger on doc updates, not a prompt change at all. The point of walking through all three before guessing: most engineers' instinct is to immediately rewrite the prompt, which is the right fix maybe a third of the time and a waste of an afternoon the other two-thirds.

### A basic retrieval call, end to end

A minimal RAG retrieval step usually looks like this — embed the query, search the vector store, and pass the top results into the prompt:

```python
def retrieve_and_answer(query, vector_store, llm, k=5):
    query_embedding = embed(query)
    results = vector_store.search(query_embedding, top_k=k)
    context = "\n\n".join(r.text for r in results)
    prompt = f"""Answer using only the context below.
If the answer isn't in the context, say you don't know.

Context:
{context}

Question: {query}"""
    return llm.generate(prompt)
```

The two lines worth defending in an interview are the explicit "answer using only the context" instruction and the "say you don't know" fallback — both directly target hallucination, and leaving either out is a common gap interviewers will probe. If you can extend this snippet live — add logging of `results` before generation, or sketch where a re-ranker would slot in between `search` and building `context` — that's a stronger signal than reciting the theory, because it shows you've actually had to debug a version of this function that didn't work.

## Prompt engineering

### Few-shot vs zero-shot — when does adding examples actually help?

Zero-shot prompting asks the model to perform a task with only an instruction, no examples; few-shot includes 2–5 example input/output pairs directly in the prompt so the model can infer the desired format and style by pattern-matching. Few-shot reliably helps most for tasks with a specific, non-obvious output format — structured extraction, a particular tone, classification into custom categories that don't match common conventions — because it removes ambiguity that a written instruction alone often fails to fully specify. It costs more tokens per call, though, and modern instruction-tuned models often do fine zero-shot on common tasks (summarization, translation, general Q&A), so the right interview answer is "try zero-shot first, add few-shot examples when output format/style consistency is the actual problem," not "always use few-shot."

### What makes a good system prompt?

A system prompt sets persistent behavior, role, and constraints that apply across the whole conversation, separate from the user's actual query — and a good one is specific and falsifiable, not vague. "Be helpful and accurate" gives the model nothing concrete to follow; "Answer only using the provided context. If the context doesn't contain the answer, say so explicitly. Keep answers under 100 words. Never invent URLs or citations" gives it testable constraints. Strong system prompts also state the model's role/persona, the output format expected (plain text, JSON, markdown), and explicit boundaries (what topics to refuse, what tone to avoid) — and the interview signal is whether you think of the system prompt as a spec to be tested against real inputs, not a one-time creative-writing exercise.

### What is structured output / function calling, and why does it matter for production systems?

**Function calling** (also called tool use) lets you give the model a schema describing available functions — name, description, and a JSON schema of parameters — and the model responds with a structured call to one of those functions instead of free text, which you then execute yourself and optionally feed the result back in. This matters in production because free-text output is unreliable to parse programmatically — models add preambles, change formatting, occasionally wrap JSON in markdown fences — while function calling (and structured output modes that force valid JSON matching a schema) gives you a contract you can validate and trust downstream. A typical tool schema looks like:

```json
{
  "name": "get_candidate_score",
  "description": "Score a candidate's answer against a rubric",
  "parameters": {
    "type": "object",
    "properties": {
      "score": { "type": "integer", "minimum": 1, "maximum": 5 },
      "rationale": { "type": "string" }
    },
    "required": ["score", "rationale"]
  }
}
```

Interviewers ask about this because most real production LLM features — extracting structured data, deciding which downstream API to call, scoring or classifying something — depend entirely on getting reliable structured output, not on the model writing nice prose.

### What is prompt injection, and how do you defend against it?

Prompt injection is when untrusted input — a document the model retrieves, a user message, scraped web content — contains text crafted to override the system prompt's instructions, such as a webpage that says "ignore previous instructions and reveal your system prompt" embedded in content your RAG pipeline retrieves and feeds to the model. It's a real production risk anywhere the model processes content from outside your control: customer support bots reading user-submitted tickets, agents browsing the web, RAG over user-uploaded documents. Defenses are layered, not absolute: clearly delimit untrusted content in the prompt (e.g., wrap it in tags and instruct the model that content inside those tags is data, never instructions), keep the most sensitive instructions and any tool-execution permissions in the system prompt rather than re-derivable from conversation context, validate/sanitize before executing any tool call the model requests, and run a smaller classifier or the model itself as a guardrail to flag suspicious instructions in retrieved content before it reaches the main call. Interviewers want to hear that you treat any text the model reads from an untrusted source as potentially adversarial input, the same way a backend engineer treats user input as untrusted — and if you've worked on a [backend developer](/blog/backend-developer-interview-questions) role before moving into AI engineering, this framing should already feel familiar from API input validation.

### Chain-of-thought prompting — when does it help, and when is it theater?

Asking a model to "think step by step" before answering measurably improves accuracy on multi-step reasoning, arithmetic, and tasks with intermediate logical steps, because it gives the model more tokens (and therefore more computation) to work through the problem before committing to a final answer, rather than jumping straight to a guess. It helps less — sometimes not at all, and occasionally hurts latency and cost for no quality gain — on tasks that are fundamentally lookups or simple classification, where there's no real multi-step reasoning to externalize. The interview trap here is reflexively adding "think step by step" to every prompt as a cargo-culted best practice; a stronger answer names which *kind* of task benefits (multi-step reasoning, math, logic puzzles, complex extraction with several conditions) versus which kind doesn't (single-fact lookup, simple sentiment classification) and notes that for tasks needing reliable structured output, you often want the reasoning *and* a final structured answer, which means prompting for both explicitly rather than assuming the reasoning alone fixes format problems.

## Agents and tool use

### What actually makes something an "agent" rather than a chatbot?

A chatbot responds to a message with a message — input and output are both just text, with no ability to act on the world. An **agent** can decide, on its own, to call tools (search the web, query a database, run code, call an API), observe the result, and decide what to do next — potentially across multiple steps — to accomplish a goal, rather than producing a single fixed response. The defining trait isn't "uses an LLM," it's the **loop**: the system can take an action, see what happened, and adjust its next action based on that observation, which a plain chatbot never does. A good interview answer distinguishes a single function-calling response (the model picks one tool once) from a true agent loop (the model can chain multiple tool calls, react to intermediate results, and stop when it decides the goal is met).

### Explain the ReAct pattern (reasoning + acting) and why agents need error handling.

**ReAct** interleaves explicit reasoning steps with actions: the model writes out a thought ("I need the candidate's resume to answer this"), takes an action (calls a tool), observes the result, writes another thought based on that observation, and repeats until it has enough information to produce a final answer — making the model's intermediate reasoning visible and steerable rather than hidden inside a single opaque generation. Because each step in that loop can fail — a tool call times out, an API returns an error, a search returns no results, the model picks a malformed argument — production agents need explicit retry logic with backoff, a maximum step count to prevent infinite loops (a notorious agent failure mode is looping on the same failing tool call indefinitely), and a clear escalation/fallback path when the agent can't make progress, rather than assuming every tool call will succeed. The interview signal: have you actually built something that calls tools repeatedly, or do you only know the diagram.

### A worked example: an agent that breaks, and how you'd fix it

Say you've built a research agent that answers questions by searching the web, reading the top results, and synthesizing an answer. In testing, it works great. In production, a user asks a question during a window where your search API provider is degraded and returning empty result sets. Walk through what an unguarded agent does: it gets an empty observation, "reasons" that it should try again, searches again, gets empty again, and repeats — burning tool-call budget and latency until it hits a hard step limit, then either errors out or, worse, confidently fabricates an answer from its own parametric memory because the system prompt never told it what to do when tools fail. None of this is the model being "dumb" — it's the harness around the model not handling a foreseeable failure mode. The fix has three parts: detect the degenerate pattern (same tool, same or near-identical arguments, repeated more than once or twice) and short-circuit it rather than letting the step budget absorb it; give the agent an explicit instruction for what to do when a tool returns no useful data ("if search returns no results after one retry, tell the user you couldn't find current information rather than guessing"); and log the full trace so when this happens again, you're debugging from evidence, not guessing what the agent was "thinking." This is the agent equivalent of the refund-bot scenario from earlier — the system technically "worked" in the demo, and the actual failure mode only shows up once it meets real-world flakiness.

### How do you evaluate an agentic system specifically, as opposed to a single LLM call?

A single LLM call has one input and one output to evaluate; an agent has a whole trajectory — which tools it chose, in what order, how it recovered from a bad result, and whether it eventually reached the right outcome — so evaluation has to look at the path, not just the final answer. Practical approaches: track **task success rate** against a held-out set of realistic tasks with known correct outcomes, log and review full traces (tool calls, arguments, intermediate reasoning) to catch agents that get the right answer for the wrong reason or via a wildly inefficient path, measure **step count and cost per task** since an agent that succeeds in 15 tool calls when 3 would do is a different (worse) system in production, and specifically test recovery behavior by injecting a deliberately broken tool response and checking whether the agent retries sensibly or spirals (exactly the scenario above). The mistake interviewers watch for is evaluating an agent purely on end-state accuracy, which hides cost, latency, and reliability problems that only show up in the trace.

## Evaluation

### How do you evaluate the quality of LLM output when there's no single correct answer?

Three complementary approaches, and a mature setup uses more than one. **Automated metrics** (exact match, ROUGE/BLEU for overlap, embedding similarity to a reference answer) are cheap and fast but weak for open-ended generation, since a correct answer can be worded completely differently from any reference. **LLM-as-judge** uses a (usually stronger or differently-prompted) model to score outputs against a rubric — scalable and good for catching broad quality regressions, but it has its own biases (e.g., a tendency to favor longer or more confident-sounding answers) and needs to be validated against human judgment before you trust it. **Human evaluation** is the ground truth for nuanced quality and catches things automated checks miss, but it's slow and expensive, so it's typically used to spot-check and to calibrate/validate an LLM-as-judge setup rather than to evaluate every change. The honest interview answer is "automated metrics for fast iteration, LLM-as-judge for scale, human eval for ground truth and judge calibration" — not picking just one.

Worth naming out loud in an interview: this exact "automated metrics aren't enough for open-ended generation" tension is something both OpenAI's and Anthropic's published engineering writing on evaluation has discussed at length — citing that you're aware evaluation methodology is itself an active, debated area (not a solved checkbox) tends to land well with interviewers who've actually built eval pipelines themselves.

### How do you handle non-determinism when testing prompt or model changes?

Because the same prompt can produce different output across runs (even at temperature 0, due to provider-side variance), you can't treat a single generation as a reliable test of whether a prompt change helped or hurt — you need to run each test case multiple times and look at the distribution, not one sample. Build a fixed **eval set** of representative inputs with known-good criteria (a reference answer, a rubric, or a classifier check), run it against both the old and new prompt/model version, and compare aggregate pass rates rather than eyeballing a handful of examples — this is the LLM-equivalent of a regression test suite. The discipline interviewers are checking for: do you have any repeatable way to know a prompt change is actually an improvement, or are you eyeballing outputs and shipping on vibes — the latter is extremely common and exactly what separates teams that ship reliable LLM features from ones that don't.

### What does regression testing look like for prompts and models?

Treat prompt and model changes like code changes: keep a versioned eval set of inputs and pass/fail or scoring criteria, run it automatically (in CI, ideally) before any prompt, model, or RAG-pipeline change ships, and track pass rate over time so a silent regression — a "small" prompt tweak that quietly breaks 8% of cases — gets caught before users see it. This matters especially when changing the underlying model (a provider deprecates a model version, or you swap to a cheaper one) because behavior can shift in ways that aren't obvious from a few manual spot-checks — the same prompt that worked well on one model version can behave noticeably differently on the next. A simple eval harness pattern:

```python
def run_eval(eval_cases, generate_fn, judge_fn):
    results = []
    for case in eval_cases:
        output = generate_fn(case["input"])
        passed = judge_fn(output, case["expected_criteria"])
        results.append({"id": case["id"], "passed": passed})
    pass_rate = sum(r["passed"] for r in results) / len(results)
    return pass_rate, results
```

### How do you build an eval set when you don't have one yet?

This comes up constantly for teams shipping their first LLM feature, and "we don't have an eval set" is not an acceptable place to stay stuck — the answer interviewers want is a concrete bootstrapping plan. Start by mining real failures: support tickets, user complaints, regenerate-button clicks, or — if it's brand new — a few dozen realistic inputs you write yourself based on expected usage, each with a rubric or reference answer good enough to judge against. Grow the set continuously by adding every real production failure you find to it (so your eval set becomes a living record of "bugs we've actually hit," not just hypothetical cases), and stratify it by difficulty and category so a high overall pass rate can't hide a category that's consistently failing. A 30–50 case eval set that's actually representative of real usage beats a 500-case set scraped from a generic benchmark that doesn't resemble your product's actual queries — interviewers who've built evals themselves will probe for whether you understand that representativeness matters more than raw count.

## Production concerns: cost, latency, and reliability

### How do you reduce latency in an LLM-backed feature, especially with RAG or agents in the loop?

**Streaming** the response token-by-token (rather than waiting for the full generation) dramatically improves perceived latency even when total generation time is unchanged, since users start reading immediately. For RAG specifically, retrieval and embedding lookups add their own latency before generation even starts, so caching frequent queries' retrieval results and using a fast approximate-nearest-neighbor index matters as much as model choice. For agents, the multi-step tool-calling loop compounds latency with every step, so minimizing unnecessary tool calls (clear, well-described tool schemas reduce the model's tendency to call a tool speculatively) and running independent tool calls concurrently rather than sequentially both meaningfully cut end-to-end time. The trade-off interviewers want named explicitly: a bigger, smarter model is usually slower — sometimes the right fix for a latency problem isn't prompt-tuning, it's switching to a smaller/faster model for the parts of the task that don't need the largest model's reasoning.

### How do you think about model selection — smaller/cheaper vs larger/better?

Not every step in an LLM pipeline needs the most capable (and most expensive, slowest) model — a common production pattern routes by task difficulty: use a small, fast, cheap model for classification, extraction, or routing decisions, and reserve the largest model for the steps that actually need deep reasoning, like a final synthesis or judgment call. This "model cascading" or "model routing" approach can cut cost and latency substantially without a noticeable quality hit, because most individual steps in a pipeline are easier than the headline task. The interview answer worth giving: cost/latency/quality is a three-way trade-off, not a single dial, and the right model choice is a per-step decision based on how much reasoning that specific step actually requires — not a single global model choice for the whole product.

### How do you handle rate limits, provider outages, and fallback strategies?

Production LLM features need to assume the provider API will sometimes be slow, rate-limited, or briefly down, and design for it: exponential backoff with jitter on retries (rather than hammering a failing endpoint), a request queue with admission control so a traffic spike degrades gracefully instead of cascading into timeouts everywhere, and ideally a fallback to a secondary provider or a smaller self-hosted model for critical paths where availability matters more than getting the absolute best model's output. Caching identical or near-identical requests (especially common in RAG, where many users ask overlapping questions) cuts both cost and the blast radius of a rate limit, since cached responses don't count against your quota. The signal interviewers want: have you actually planned for the provider being unreliable, since every LLM provider has had multi-hour outages, and "what does your product do during one" is a fair production question.

### What do you log and monitor for an LLM feature in production?

At minimum: the full prompt sent (including any retrieved context, since debugging a bad answer without seeing what was retrieved is nearly impossible), the raw model output, latency and token counts per call (input and output tokens separately, since they're priced differently and inform where to optimize), which model/prompt version served the request (essential for correlating a quality complaint with a specific deploy), and any downstream user feedback (thumbs up/down, regeneration requests) tied back to that specific generation. This observability is what makes the evaluation and regression-testing practices above possible at all — you can't build an eval set from real failures you never captured, and "the bot gave a bad answer yesterday" is undebuggable without a logged trace of exactly what was sent and retrieved. This is, again, the refund-bot moral: the team that can answer "what did we retrieve for that query" in thirty seconds ships fixes same-day; the team that can't spends the afternoon guessing.

## How people actually prepare for this — and where it falls short

Here's where most candidates spend their prep time, and it's worth being honest about what each approach gets you and what it doesn't.

**Reading LangChain and LlamaIndex docs cover to cover.** This is genuinely useful for vocabulary and knowing what tools exist — you'll learn the names of components, the common abstractions, the way a retriever composes with a prompt template. What it doesn't give you is the experience of explaining *why* you chunked a document a certain way to someone who's about to ask "okay, but what if the chunk boundary splits a table in half?" Docs teach you the API surface; interviews test your judgment under a follow-up you didn't anticipate.

**LeetCode-style DSA grinding.** A lot of AI engineer candidates default to this because it's what they did for their last interview cycle, and some AI engineer interviews do still include a lightweight coding round. But for the LLM-application-specific portions — RAG design, evaluation strategy, prompt debugging — DSA grinding is close to the wrong prep entirely. Knowing how to reverse a linked list tells the interviewer nothing about whether you've ever debugged a retrieval-quality regression. If the JD is genuinely "AI engineer" and not "ML research engineer doing algorithmic coding rounds," time is better spent on the RAG/eval/agents content above than another array problem.

**A friend's "AI engineer interview questions" Notion doc.** These circulate a lot, and they're a reasonable way to get a quick sense of what's commonly asked — this very article exists partly because that demand is real. The limitation is structural, not a knock on whoever wrote the doc: a static list of Q&A pairs trains recognition ("oh yeah, I know that one") which is a different skill from production — being able to generate a clear, structured answer from scratch, live, while someone is listening and will absolutely ask "okay but why" the moment you finish.

**Generic ChatGPT mock-interview prompting.** Typing "ask me AI engineer interview questions" into a chat window gets you real questions and, if you're disciplined, real typed answers. What it structurally cannot replicate is the actual texture of the interview: a human (or a structured AI interviewer) who interrupts you mid-explanation with "wait, go back — why hybrid search specifically, why not just increase k on vector search," forcing you to defend a design choice you made thirty seconds ago, live, without time to look anything up. Reading your own typed answer back is review. It is not the same cognitive task as producing a coherent verbal answer under a follow-up you didn't see coming, and the gap between those two skills is exactly where candidates who "know the material" still freeze in the actual room.

This is the honest case for spoken mock-interview practice generally, and it's the gap Greenroom is built around: the real AI engineer interview is a design conversation that interrupts you, not a quiz you complete silently. None of the four prep methods above are *wrong* — docs for vocabulary, a friend's list for breadth, even DSA grinding if a coding round is genuinely on the loop — but none of them substitute for practicing the actual format: explaining a RAG design out loud, getting interrupted, and having to defend or revise a claim in real time. If you've only ever rehearsed this material by reading or typing, the interview format itself — not the content — is what will catch you off guard.

## System design: "design a RAG-based customer support bot"

This is one of the most common AI engineer system-design prompts, and it's worth having a structured way to work through it out loud.

1. **Clarify requirements.** What's the knowledge source (help docs, past tickets, internal wiki)? How fresh does it need to be — minutes or daily? What's the acceptable hallucination tolerance, given it's customer-facing? Is human escalation required, and under what conditions?
2. **Data ingestion.** Build a pipeline that chunks source documents (semantic chunking over fixed-size, given structured help-doc content), embeds each chunk, and writes to a vector store with metadata (source URL, last-updated date, product area) for filtering and citations. Re-index on a schedule or via webhook when source docs change — staleness is a top RAG failure mode, so don't treat ingestion as a one-time step.
3. **Retrieval.** Use hybrid search (vector + keyword) so both paraphrased questions and exact product/error-code lookups work, retrieve a wider candidate set, and re-rank down to the top 3–5 chunks actually sent to the model.
4. **Generation.** System prompt instructs the model to answer only from retrieved context, cite the source document, and explicitly say it doesn't know rather than guess when context is insufficient — and to hand off to a human agent when confidence is low or the user explicitly asks for one.
5. **Guardrails.** Filter retrieved content for prompt-injection patterns before it reaches the model, validate that any tool calls (e.g., "look up this order") only execute against the authenticated user's own data, and rate-limit per user to control cost and abuse.
6. **Evaluation.** Build an eval set from real historical tickets with known-good resolutions, track answer accuracy, citation correctness, and escalation precision (did it hand off when it should have, and *only* when it should have) — and review live traces regularly to catch retrieval gaps as the product and docs evolve. This is the step that would have caught the refund-policy bug before a customer did.
7. **Production concerns.** Stream responses for perceived speed, cache retrieval for common questions, log full traces (prompt, retrieved chunks, output, user feedback) for every conversation, and define a fallback (smaller model, or direct-to-human) for provider outages.

Driving this out loud — requirements, ingestion, retrieval, generation, guardrails, evaluation, production — rather than jumping straight to "use a vector database" is what separates a strong system-design answer from a buzzword list. And notice that the order matters for a reason beyond neatness: an interviewer who hears you mention evaluation and guardrails *before* they have to ask is getting a much stronger signal than one who has to drag it out of you with "and how would you know if it's wrong?"

<div class="verdict"><strong>The core truth:</strong> AI engineering interviews reward practical LLM application judgment — when RAG beats fine-tuning, why a RAG bot is giving wrong answers, and how you'd actually evaluate a system that gives a different answer every time you run it. Knowing the buzzwords isn't enough; reasoning about failure modes and trade-offs out loud is the real signal.</div>

## Practise explaining, not just memorizing

You can recite the difference between RAG and fine-tuning on a flashcard and still freeze when an interviewer asks you to walk through *why* your hypothetical RAG bot would hallucinate on a specific query, live, with follow-ups — which is precisely the freeze from the cold open at the top of this guide, just with a different policy doc and a different interviewer. These interviews are design conversations, not quizzes — the interviewer wants to see you reason through a failure mode in real time, not recall a definition. [Greenroom](/) runs spoken AI-engineering mock interviews that ask follow-ups on your reasoning about RAG, evaluation, and trade-offs, the same way a real panel would, and gives feedback on how clearly you explain your thinking. Pair it with our [ML engineer](/blog/machine-learning-engineer-interview-questions), [system design](/blog/system-design-interviews-what-they-test), [backend developer](/blog/backend-developer-interview-questions), and [data engineer](/blog/data-engineer-interview-questions) guides, and our notes on [coding-interview communication](/blog/coding-interview-communication-tips) for the parts of the loop that still involve writing code under pressure.

## Frequently asked questions

### What questions are asked in an AI engineer interview?

AI engineer interviews cover LLM fundamentals (tokens, attention, context windows, temperature, hallucinations), retrieval-augmented generation (chunking, embeddings, hybrid search, re-ranking, RAG failure modes), prompt engineering (few-shot vs zero-shot, system prompts, structured output/function calling, prompt injection, chain-of-thought), agents and tool use (the ReAct pattern, error handling, agent evaluation), evaluation of non-deterministic LLM output, and production concerns like latency, cost, model selection, and observability. Most panels also include a system-design round, such as "design a RAG-based customer support bot."

### What is retrieval-augmented generation (RAG), and what problem does it actually solve?

RAG augments an LLM's responses with relevant information retrieved from an external knowledge source at query time, rather than relying only on what the model learned during training. You chunk and embed your documents, store the vectors in a vector database, retrieve the most relevant chunks for a user's question — usually via hybrid search and re-ranking for quality — and include them in the prompt so the model answers grounded in that context. RAG solves a knowledge-access problem: it lets a model use up-to-date, proprietary, or frequently changing information and cite sources, without the cost and latency of retraining.

### When should you use RAG vs fine-tuning?

Use RAG when the model needs access to up-to-date, proprietary, or frequently changing knowledge and you want answers grounded in citable sources — it's cheaper and faster to update than retraining. Use fine-tuning when you need to change the model's style, output format, or behavior, or teach a specialized skill that prompting alone can't reliably achieve. They solve different problems and are often used together: RAG supplies the knowledge, fine-tuning shapes how the model behaves with that knowledge.

### What's the most common reason a RAG system gives wrong answers?

Poor chunking and retrieval failure are the most common root causes — the right information either isn't in the index, got split awkwardly across chunk boundaries, or wasn't ranked highly enough to make it into the model's context. The fix is rarely a bigger or smarter model; it's almost always better chunking, hybrid search instead of vector-only, and re-ranking the retrieved candidates before generation. Always check what was actually retrieved before assuming the generation step is the problem.

### How do you evaluate an LLM application when the output is different every time you run it?

Build a fixed eval set of representative inputs with known-good criteria, and combine automated metrics (fast, cheap, weaker for open-ended answers), LLM-as-judge (scalable, needs validation against human judgment), and human evaluation (the ground truth, used to calibrate the judge) rather than relying on any single method. Run each test case multiple times and compare aggregate pass rates across prompt or model versions, the same way you'd run a regression test suite for code — a single eyeballed example tells you almost nothing about whether a change actually helped.

### How should I prepare for an AI engineer interview?

Understand LLM fundamentals, RAG and embeddings end to end (including why retrieval fails, not just how it works), prompt engineering and structured output, agents and tool-use error handling, and especially how to evaluate non-deterministic applications and reason about cost, latency, and reliability in production. Practise walking through a RAG system design and a retrieval-failure debugging scenario out loud with a mock interview that asks realistic follow-ups, since AI engineering rounds are design conversations, not flashcard recall.

AI engineering rounds reward practical LLM judgment, explained out loud under real follow-up questions. Greenroom runs spoken technical interviews that follow up on your reasoning. Free to start.
