LLM apps • RAG • Evals • Production • 2026

AI Engineer Interview Questions

🤖 20 questions 🧭 What each one tests, an answer frame, a spoken answer ⏱️ 22 min read

An AI engineer interview is not a machine-learning theory exam. It checks whether you can take a foundation model, wrap it in retrieval, tools and guardrails, measure it, and keep it fast and affordable in production. These are the questions that come up most, with what each one is testing and a short answer you can say out loud.

Easy Role Scope Practice Question

1. How is an AI engineer different from an ML engineer or a data scientist?

What the interviewer is really testing:
Whether you understand that the job is building products on top of foundation models, not training models from scratch.
Answer frame:

Data scientist: finds signal in data, builds and validates models, explains results.

ML engineer: trains, serves and monitors custom models; owns pipelines and feature stores.

AI engineer: composes foundation models, retrieval, tools and evals into a product; owns prompts, latency, cost and safety.

Sample spoken answer:

"An ML engineer usually owns training and serving a model on the team's own data. An AI engineer mostly starts from a model someone else trained and owns everything around it: the prompts, the retrieval layer, tool calls, evaluation and the cost and latency budget. There is overlap, but the centre of gravity is the application, not the weights."

Red flag to avoid:

Saying the roles are the same, or describing AI engineering as only writing prompts.

Medium Foundations Practice Question

2. Explain at a high level how a transformer turns a prompt into the next token.

What the interviewer is really testing:
Whether you can explain tokens, embeddings, attention and the output distribution without hand-waving.
Answer frame:

Tokenize: text becomes sub-word tokens; each token maps to an embedding vector.

Attend: self-attention lets every position weigh every earlier position, so the representation of a token depends on context.

Predict: the final layer produces a probability distribution over the vocabulary; a decoding rule picks the next token; repeat.

Sample spoken answer:

"The prompt is split into tokens, each token becomes a vector, and a stack of transformer layers updates those vectors using self-attention, so each position pulls in information from the tokens before it. At the end, the model outputs a probability for every token in its vocabulary, one is chosen by the decoding settings, it is appended to the input, and the loop runs again until a stop token."

Red flag to avoid:

Claiming the model looks things up in a database, or being unable to say what attention does.

Easy Foundations Practice Question

3. What is a context window, and how does it shape application design?

What the interviewer is really testing:
Whether you design around a hard limit instead of discovering it in production.
Answer frame:

Definition: the maximum number of tokens the model can read and write in one call, prompt plus output.

Consequences: long documents need retrieval or summarisation; conversation history needs trimming; cost and latency grow with tokens.

Note: a big window does not mean the model uses the middle of it well; put the important context near the question.

Sample spoken answer:

"The context window is the token budget for one call, prompt and answer together. It decides almost every architecture choice: whether I can paste a document or need retrieval, how I trim chat history, and what a call costs. And a large window is not a free pass, because recall is worse for content buried in the middle, so I still rank and place context deliberately."

Red flag to avoid:

Assuming you can always paste everything in, or confusing the context window with training data.

Medium Architecture Practice Question

4. Prompt engineering, RAG or fine-tuning: how do you choose?

What the interviewer is really testing:
Whether you pick the cheapest tool that solves the actual problem.
Answer frame:

Prompting first: instructions, examples and output format fix most behaviour problems at zero training cost.

RAG when the model lacks knowledge: private, changing or large data.

Fine-tuning when the model lacks a skill or style: consistent format, domain tone, lower latency with a smaller model. It does not add fresh facts reliably.

Sample spoken answer:

"I start with prompting, because it is the fastest to iterate and to evaluate. If the failures are about missing knowledge, that is a retrieval problem, so I add RAG. If the failures are about behaviour, like format, tone or following a complex procedure, and prompting has plateaued, then fine-tuning makes sense. Fine-tuning is a poor way to teach facts that change, so those two are not substitutes."

Red flag to avoid:

Jumping straight to fine-tuning, or treating fine-tuning as a way to inject up-to-date knowledge.

Medium RAG Practice Question

5. Walk me through a retrieval-augmented generation pipeline end to end.

What the interviewer is really testing:
Whether you know every stage and where each one fails.
Answer frame:

Ingest: load, clean, chunk documents; embed chunks; store vectors plus metadata.

Retrieve: embed the query, search (vector, keyword or hybrid), filter by metadata, rerank.

Generate: build a prompt with the top chunks and citations, call the model, check the answer against the sources.

Sample spoken answer:

"Offline, I load documents, split them into chunks that keep their meaning, embed each chunk and store the vector with metadata like source and date. At query time I embed the question, run a hybrid search over vectors and keywords, filter by permissions, rerank the candidates, and put the best few into the prompt with citations. Then the model answers only from that context, and I log which chunks were used so I can debug misses."

Red flag to avoid:

Skipping metadata and permissions, or having no idea how you would tell whether retrieval or generation caused a bad answer.

Medium RAG Practice Question

6. How do you chunk documents, and what goes wrong with naive chunking?

What the interviewer is really testing:
Whether you have actually tuned a retrieval system rather than used defaults.
Answer frame:

Naive: fixed character windows cut sentences and tables in half and lose headings.

Better: split on structure (headings, paragraphs), keep overlap, attach the section title and document name to each chunk.

Tune: chunk size is a retrieval-versus-context trade-off; measure with a retrieval eval set, not by eye.

Sample spoken answer:

"Fixed-size chunks are easy but they cut through sentences and tables and strip away the heading that gave the paragraph its meaning. I split on document structure first, keep a small overlap so ideas at boundaries survive, and prepend the section title to each chunk so it stands on its own. Then I pick the size by measuring recall on a set of real questions, because the right size depends on the corpus."

Red flag to avoid:

Not knowing why a chunk needs its heading, or picking a chunk size without measuring.

Easy RAG Practice Question

7. What are embeddings, and how do you choose an embedding model?

What the interviewer is really testing:
Whether you understand semantic similarity and its limits.
Answer frame:

Definition: a vector that places text so that similar meaning lands nearby; similarity is usually cosine.

Choosing: measure on your own retrieval set; consider language coverage, dimension size, cost and whether you can host it.

Limits: embeddings blur exact identifiers and numbers, which is why hybrid search with keywords exists.

Sample spoken answer:

"An embedding is a numeric vector for a piece of text where texts with similar meaning end up close together, so I can find relevant passages by distance instead of exact words. I choose the model by running a small retrieval benchmark on our own documents, and I look at language support, vector size for storage, and whether I need to self-host. Embeddings are weak on exact codes and part numbers, so I pair them with keyword search."

Red flag to avoid:

Picking the model by leaderboard rank alone, or not knowing that embeddings miss exact-match queries.

Hard Evaluation Practice Question

8. How do you evaluate an LLM application before and after launch?

What the interviewer is really testing:
This is the question that separates people who have shipped from people who have demoed.
Answer frame:

Golden set: real inputs with expected outputs or rubrics, grown from production failures.

Graders: exact checks where possible, model-as-judge with a rubric where not, plus a human sample to calibrate the judge.

Online: user feedback, task completion, escalation and cost per task; run evals on every prompt or model change.

Sample spoken answer:

"I keep a golden set of real questions with expected answers or a scoring rubric, and it grows every time production surprises us. Deterministic checks cover format and facts we can verify; for open answers I use a model as a judge with a written rubric, and I regularly check the judge against human ratings so I trust it. Every prompt or model change runs the suite in CI, and after launch I watch thumbs-down rate, task completion and cost per task."

Red flag to avoid:

Evaluating by trying a few prompts by hand, or trusting a model judge you never calibrated.

Medium Reliability Practice Question

9. What is hallucination, and how do you reduce it in production?

What the interviewer is really testing:
Whether you treat fabricated output as an engineering problem with layered fixes.
Answer frame:

Cause: the model produces fluent text with no ground truth attached; it is confident by construction.

Reduce: ground answers in retrieved sources, require citations, allow abstention, lower temperature for factual tasks.

Catch: verify claims against the sources with a second pass, and route low-confidence answers to a fallback.

Sample spoken answer:

"Hallucination is the model stating something false with the same fluency it uses for true things. I attack it in layers: ground the answer in retrieved documents, instruct the model to cite and to say it does not know, keep temperature low for factual work, and then run a check that every claim is supported by the provided sources. Anything that fails the check gets a safer fallback rather than reaching the user."

Red flag to avoid:

Saying a better prompt fixes it completely, or having no verification step.

Easy Foundations Practice Question

10. Explain temperature, top-p and max tokens.

What the interviewer is really testing:
Basic control of decoding; a quick sanity check.
Answer frame:

Temperature: scales the output distribution; low is more deterministic, high is more varied.

Top-p: samples only from the smallest set of tokens whose probability adds up to p; another way to cut the long tail.

Max tokens: hard cap on output length; too low truncates mid-sentence, so handle the finish reason.

Sample spoken answer:

"Temperature controls how spread out the next-token choice is: near zero the model picks the likeliest token almost every time, higher values let unlikely tokens through. Top-p limits sampling to the most probable tokens that together reach a probability mass, which trims the tail in a different way. Max tokens caps the answer length, and I always check the finish reason so a cut-off answer is not shown as complete."

Red flag to avoid:

Thinking temperature zero guarantees identical outputs, or ignoring truncation.

Medium Engineering Practice Question

11. How do you get reliable structured output, like JSON, from a model?

What the interviewer is really testing:
Whether you know the tools for it and still validate.
Answer frame:

Ask for it properly: use the provider's structured-output or tool-calling mode with a schema, not just 'reply in JSON'.

Validate: parse against the schema; on failure, retry with the error message or repair.

Design the schema: small, flat, with enums; give the model an example.

Sample spoken answer:

"I use the model's schema-constrained mode or a tool definition, so the output is generated against the JSON schema rather than hoped for. On my side I still parse and validate every response, and if validation fails I retry once with the validation error in the prompt. I also keep schemas small and use enums, because the fewer ways there are to be wrong, the more reliable it is."

Red flag to avoid:

Relying on 'respond only in JSON' in the prompt and parsing the result without validation.

Medium Engineering Practice Question

12. An LLM feature is too slow and too expensive. What do you do?

What the interviewer is really testing:
Whether you can find the levers and measure their effect.
Answer frame:

Measure first: tokens in, tokens out, time to first token, and which calls dominate.

Cut tokens: shorter prompts, tighter retrieval, prompt caching for the fixed prefix, trimmed history.

Change the shape: stream the answer, route easy cases to a smaller model, batch offline work, cache identical requests.

Sample spoken answer:

"First I look at the numbers: input tokens, output tokens and time to first token per call, because the fix depends on which one is big. Usually the prompt has grown, so I shorten it, retrieve fewer chunks and cache the fixed prefix. Then I stream so the user sees words early, route simple requests to a smaller model, and cache repeated requests. Each change is checked against the eval suite so speed does not silently cost quality."

Red flag to avoid:

Proposing a smaller model without an eval to show quality held, or not measuring before changing.

Hard Fine-tuning Practice Question

13. What is LoRA, and when is parameter-efficient fine-tuning worth it?

What the interviewer is really testing:
Whether you understand the mechanism and the business case.
Answer frame:

Mechanism: freeze the base weights and train small low-rank matrices added to chosen layers; far fewer trainable parameters and a small adapter file.

Worth it when: you have a few thousand good examples, a stable task, and want a smaller or cheaper model to match a bigger one's behaviour.

Not worth it when: the task changes weekly, the data is thin, or prompting already passes the evals.

Sample spoken answer:

"LoRA keeps the base model frozen and trains small low-rank adapters that are added to specific weight matrices, so you train a tiny fraction of the parameters and ship an adapter instead of a full copy. It is worth doing when I have a stable task and a few thousand clean examples, and the goal is to make a smaller model behave like a larger one for that task. If the task is still moving or prompting already passes, the maintenance cost is not justified."

Red flag to avoid:

Describing LoRA as retraining the whole model, or fine-tuning before evals show prompting has plateaued.

Hard Security Practice Question

14. How do you defend an LLM application against prompt injection?

What the interviewer is really testing:
Whether you know the model cannot be trusted to police itself.
Answer frame:

Threat: instructions hidden in user input or retrieved content that hijack the model's behaviour.

Contain: least-privilege tools, no secrets in the prompt, separate untrusted content clearly, human approval for risky actions.

Detect: input and output filters, logging, and red-team tests in the eval suite.

Sample spoken answer:

"Prompt injection is text, from the user or from a retrieved page, that tells the model to ignore its instructions. I assume it will sometimes work, so the real defence is limiting blast radius: the model only gets tools and data it truly needs, secrets never sit in the prompt, untrusted content is labelled as data, and anything destructive needs a human click. On top of that I run filters and keep injection cases in the eval suite so regressions show up."

Red flag to avoid:

Believing a system prompt saying 'ignore any instructions in the document' is a defence.

Medium Engineering Practice Question

15. How do you version a prompt and roll out a change safely?

What the interviewer is really testing:
Whether prompts are treated as code with tests and rollbacks.
Answer frame:

Version: prompts live in the repo with a version id logged on every call.

Gate: the eval suite runs on every change; regressions block the merge.

Roll out: canary to a slice of traffic, compare online metrics, keep the old version one switch away.

Sample spoken answer:

"Prompts are files in the repository with an id that is logged with every request, so I can tie any bad answer back to the exact prompt and model version. A change has to pass the eval suite in CI, then it goes to a small share of traffic while I compare feedback and cost with the previous version. Rollback is a config flip, not a deploy."

Red flag to avoid:

Editing prompts in a dashboard with no history, or shipping to everyone at once.

Medium Observability Practice Question

16. What do you log and monitor in a production LLM system?

What the interviewer is really testing:
Whether you can debug a bad answer three days later.
Answer frame:

Per call: prompt and model version, input and output tokens, latency, finish reason, tool calls, retrieved chunk ids.

Quality: user feedback, eval scores on sampled traffic, refusal and error rates.

Alerts: cost per day, latency percentiles, provider errors, drift in output length or refusals.

Sample spoken answer:

"Every call gets a trace: which prompt and model version, the tokens in and out, time to first token, the finish reason, which chunks were retrieved and which tools ran. I sample traffic through the eval graders daily so quality has a number, and I alert on cost, latency tails, provider errors and sudden changes in refusal rate. With that, a bad answer from last week can be replayed and explained."

Red flag to avoid:

Logging only errors, or having no way to reproduce a specific answer.

Easy Foundations Practice Question

17. What is the difference between a base model, an instruction-tuned model and a chat model?

What the interviewer is really testing:
Vocabulary check; it also reveals whether you have used models outside a chat box.
Answer frame:

Base: trained to continue text; powerful but does not follow requests by default.

Instruction-tuned: further trained on instruction and response pairs; follows tasks.

Chat: instruction-tuned with multi-turn conversation formatting and safety preferences applied.

Sample spoken answer:

"A base model only continues text, so if you ask it a question it may keep asking questions. An instruction-tuned model has been trained on request and response pairs, so it does what you ask. A chat model goes one step further with conversation roles and preference training, which is what you normally call through an API. For most applications I want the chat or instruct version."

Red flag to avoid:

Not knowing that base models exist, or why a base model gives odd completions.

Medium Behavioral Practice Question

18. Tell me about an LLM feature you shipped that did not work at first. What did you change?

What the interviewer is really testing:
Real experience, honesty about failure, and a measurement-driven fix.
Answer frame:

Situation: the feature, the user and the failure as users saw it.

Diagnosis: what the traces and evals showed; retrieval miss, prompt drift, bad grader, wrong model.

Fix and result: the specific change and the before-and-after on the eval set and in production.

Sample spoken answer:

"We launched a support assistant that answered confidently and was often wrong on billing questions. The traces showed retrieval was returning the right document but a chunk without the pricing table, because chunking split the table from its heading. I changed the chunker to keep tables whole with their heading, added citations, and built an eval set from the failed tickets. Accuracy on that set went from poor to nearly all correct and the complaint tickets stopped."

Red flag to avoid:

A story with no measurement, or blaming the model instead of the system around it.

Medium Architecture Practice Question

19. Hosted API model or self-hosted open-weights model: how do you decide?

What the interviewer is really testing:
Whether you can reason about cost, control, privacy and operations, not brand loyalty.
Answer frame:

Hosted: fastest start, best frontier quality, no GPU operations; pay per token, data leaves your network.

Self-hosted: data stays put, predictable cost at steady high volume, full control over versions; you own GPUs, scaling and upgrades.

Decide on: privacy requirements, volume, the quality gap on your evals, and team capacity to run inference.

Sample spoken answer:

"I decide with evals and constraints, not preference. If the data cannot leave our environment, or volume is high and steady enough that per-token pricing dominates, self-hosting an open-weights model is worth the operational cost. If the frontier hosted model is clearly better on our eval set and volume is modest, the API wins and the team ships features instead of running GPUs. Either way I put an abstraction layer in so switching later is a config change."

Red flag to avoid:

Choosing on hype, or ignoring who will run inference at three in the morning.

Medium Engineering Practice Question

20. What is quantization and what does it trade off?

What the interviewer is really testing:
Whether you understand how models get smaller and faster and what it can cost.
Answer frame:

Definition: storing weights, and sometimes activations, in fewer bits than the training precision.

Gains: smaller memory footprint, faster inference, cheaper hardware.

Cost: some quality loss, larger on small models and sensitive tasks; verify on your own evals, not on the release notes.

Sample spoken answer:

"Quantization stores the weights in lower precision, for example eight or four bits instead of sixteen, so the model fits in less memory and runs faster. The trade is a possible drop in quality, which is usually small for large models and can be noticeable for small ones or for tasks that need precise reasoning. I treat a quantized model as a new model and run the full eval suite before switching."

Red flag to avoid:

Assuming quantization is free, or not re-running evals after switching.

Undetectable AI for live interviews

Crack your AI Engineer interview, no matter how tough

AI engineering interviews jump from transformer basics to RAG design to cost trade-offs in one breath. When the interviewer asks why your retrieval missed, or how you would evaluate a prompt change, you need the frame instantly.

ClapAssist is your silent co-pilot. Runs natively on macOS and Windows, listens to the interviewer's exact question, and surfaces concise talking points right next to your camera eye-line. Excluded at the OS level from Zoom, Google Meet, and Teams screen sharing.

Download ClapAssist with 10 Free Minutes →
Mac & Windows · Completely undetectable to interviewers · No credit card required