AI Interview Questions and Answers

Questions covering the concepts that come up most in AI interviews today — what they mean, how they fit together, and how to actually use them. Answers are written to be said out loud in an interview, not memorized as definitions. Where a concept has a full page on this site, it's linked so you can go deeper than this page goes. These are the definitional half — what the terms mean. The harder half is applying them, which is what the scenario-question clusters covers; a real interview tends to use both.

In this guide
  1. AI Fundamentals
  2. Generative AI and LLMs
  3. Working With LLMs
  4. RAG, Agents and Modern AI Applications
  5. Reliability and Safety
  6. Practical Interview Questions
  7. Going deeper on one area

AI Fundamentals

1. What is Artificial Intelligence?

Artificial intelligence is software built to do tasks that normally need human judgment. Understanding language, recognising images, deciding from incomplete information. It's a broad field rather than one technique, and machine learning, deep learning and generative AI are all ways of building it.

2. What is the difference between AI, Machine Learning, and Generative AI?

AI is the goal: software that handles tasks needing human-like judgment. Machine learning is how that's mostly done today. Rather than writing rules by hand, you train a system on examples and let it find the patterns. Generative AI is one use of machine learning, built to produce new content rather than classify or predict.

3. What is Machine Learning?

Machine learning builds software that gets better at a task by learning from examples instead of following hand-written rules. You supply data where the right answer is already known. Training then adjusts the system until it gets new, unseen examples right too.

4. What is Deep Learning?

Deep learning is machine learning using neural networks with many stacked layers. Each layer picks up a slightly more complex pattern than the one before. In an image model, early layers find edges, later ones combine those into shapes, then objects. It's behind almost every major AI advance of the last decade.

5. What is a neural network?

A neural network is a model made of layers of simple units, each doing a small calculation and passing the result on. No single unit understands anything. The ability to recognise a pattern comes from millions of those calculations combining, with training adjusting the strength of each connection.

6. What is the difference between supervised and unsupervised learning?

Supervised learning trains on examples that carry the right answer already. Show it a thousand photos labelled "cat" or "dog" and it learns to tell them apart. Unsupervised learning gets no labels and has to find structure itself, like grouping similar customers without being told what the groups are.

7. What is the difference between training and inference?

Training is when a model learns from data, adjusting its internal numbers over many passes until it gets better at the task. Inference is using that already-trained model to answer a real question or complete a real task, with no further learning happening. Training happens once, or occasionally; inference happens every single time someone actually uses the model.

Generative AI and LLMs

8. What is Generative AI?

Generative AI produces new content rather than classifying or predicting something about existing content. Text, images, audio, code. A spam filter isn't generative, because it labels an email. A model that writes the email is.

9. What is a Large Language Model (LLM)?

A large language model is an AI program trained on huge amounts of text to predict the next word. That single ability is enough to answer questions, write code, summarise documents and hold a conversation. Learn more: LLM.

10. What is a token?

A token is the small chunk of text a model actually reads and generates. Often a whole word, sometimes part of one. Text is broken into tokens before a model sees it, and a model's context window is measured in tokens rather than words. Learn more: Token.

11. What is a context window?

A context window is the most text a model can read and act on in one request. Everything you send and everything it writes back shares that one fixed budget. Learn more: Context Window.

12. What is temperature in an LLM?

Temperature controls how much randomness goes into picking the next word. Low temperature makes the model stick to its most likely answer. High temperature lets it pick less likely words more often, giving more varied output. Learn more: Temperature.

13. What is an AI hallucination?

A hallucination is a confident, fluent answer that's factually wrong. The model isn't lying or guessing randomly. It's doing what it always does, predicting plausible text, with nothing grounding this particular answer in fact. Learn more: Hallucination.

14. What is a multimodal AI model?

A multimodal model takes in or produces more than one kind of content. Text and images, or text and audio, rather than text alone. Describing a photo, or generating an image from a written description, uses that capability.

15. What is a reasoning model?

A reasoning model is trained to work through a problem in explicit steps before answering, rather than producing an answer directly. That helps on problems with clear multi-step structure, like maths or planning. It doesn't stop the model being confidently wrong about plain facts. Learn more: Reasoning Models.

16. What are embeddings?

An embedding is a piece of text turned into a list of numbers, positioned so that text with similar meaning lands nearby. That's what lets a system search by meaning instead of matching exact words. Learn more: Embeddings.

Working With LLMs

17. What is prompt engineering?

Prompt engineering is writing a model's instructions so it gives a more reliable answer. That covers how you phrase the task, what examples you include, and what output format you ask for. It's the cheapest thing to try before reaching for retrieval or fine-tuning. Learn more: Prompt Engineering.

18. What is a system prompt?

A system prompt is the instruction given to a model before the conversation starts. It sets the role, tone and rules for the whole session, separately from anything the user types. It's how a product enforces consistent behaviour across every conversation. Learn more: System Prompt.

19. What is few-shot prompting?

Few-shot prompting means putting a few worked examples in the prompt, showing the model the pattern you want before asking for the real task. It's usually more reliable than describing the task in words, and it costs context window space. Learn more: Few-Shot Prompting.

20. What are structured outputs?

Structured output forces a model's response to match a schema you define, so your code can parse it directly. That's different from asking the model nicely to format its answer a certain way, which it can drift from. Learn more: Structured Outputs.

21. What is tool calling?

Tool calling lets a model request that a specific action run, with specific arguments, instead of only writing text back. The model never runs anything itself. It returns a structured request and your code executes it. Learn more: Tool Calling.

22. What is function calling?

Function calling is tool calling applied to a custom function you wrote yourself, as opposed to a built-in capability a vendor supplies. The two terms are often used interchangeably in casual conversation. Learn more: Function Calling.

RAG, Agents and Modern AI Applications

23. What is MCP (Model Context Protocol)?

MCP is a shared set of rules for connecting an AI application to outside tools and data. Without it, every app needs custom integration code for every tool. With it, both sides build to the protocol once and any app can use any tool. Learn more: MCP.

24. What is a subagent?

A subagent is an agent that another agent calls to handle one piece of work. It runs with its own context, does the task, and returns just the result rather than everything it tried. The agent that called it stays focused on the larger job. Learn more: Subagent.

25. What is Retrieval-Augmented Generation (RAG)?

RAG retrieves relevant information and gives it to the model as context before the model answers. Ask an assistant about your company's holiday policy and the application fetches the policy document first, then hands the relevant section over. That lets the model answer from information that wasn't in its training data. Learn more: RAG.

26. Why would you use RAG?

Use RAG when the model needs current or private information it wasn't trained on, when that information changes too often to retrain around, or when an answer needs to be traceable back to a real source. A support bot answering from this week's documentation is the typical case.

27. What is a vector database?

A vector database stores embeddings and is built to quickly find the ones most similar to a given query, out of millions of them. It's the piece of a RAG pipeline that makes fast retrieval by meaning possible at scale. Learn more: Vector Database.

28. What is an AI agent?

An AI agent decides its own sequence of actions to reach a goal. It acts, checks the result, then decides what to do next, rather than following steps someone wrote in advance. Learn more: AI Agent.

29. What makes an AI system agentic?

How much of what happens next is decided by the model, rather than fixed in code. It's a scale, not a yes-or-no label — a system that makes one small decision on its own barely counts, while a full AI agent, deciding its whole sequence of actions, sits at the far end. Learn more: Agentic AI.

30. What is AI memory?

AI memory is what a system deliberately saves and reuses across separate sessions, like a user's preferences or a fact from an earlier conversation. A model has no memory of its own beyond what's in its context window. Anything meant to persist has to be stored and re-supplied on purpose. Learn more: Agent Memory.

Reliability and Safety

31. How can you reduce AI hallucinations?

Ground answers in retrieved source material rather than the model's own memory, give it explicit permission to say it doesn't know instead of forcing an answer, and use a constrained output format for tasks with a fixed set of valid answers. None of these eliminate hallucination completely — treat it as a risk to manage, not a bug you fully close. Learn more: Hallucination.

32. What is prompt injection?

Prompt injection is when text your application treats as data gets read by the model as an instruction. An email, a document, a web page. The model has no reliable way to tell your instructions from content that arrived with them. Learn more: Prompt Injection.

33. What are AI guardrails?

Guardrails are checks placed around a model to catch a bad response before it reaches a user. They filter unsafe output, block disallowed actions, and validate a response before anything uses it. They sit outside the model and don't change the model itself. Learn more: Guardrails.

34. What are AI evals?

An eval is a repeatable test for an AI system. You fix a set of real examples and a way to score the answers, then measure the system against them. It replaces judging quality by trying a few prompts and going on instinct. Learn more: AI Evals.

35. Why is human-in-the-loop important?

Because a model can be confidently wrong, and some actions are too costly to let it take unsupervised — approving a large refund, sending an external email, deleting data. Human-in-the-loop means a person reviews or approves specific actions before they happen, often the only reliable defense once an AI system has real tools and real permissions. Learn more: Human-in-the-Loop.

Practical Interview Questions

36. When would you use RAG instead of fine-tuning?

When the problem is that the model doesn't know your facts, not that it writes in the wrong style or format. RAG adds information at the moment a question is asked; fine-tuning changes the model itself beforehand and is better at reshaping how it responds than at reliably storing facts. If a model needs to answer from a document it's never seen, that's a retrieval problem, not a training one. Learn more: RAG vs Fine-Tuning.

37. When would you use an AI agent instead of a fixed workflow?

A fixed workflow is usually better when the steps are already known and predictable — it's cheaper, easier to test, and can't make a judgment call it wasn't supposed to make. An agent earns its cost when the right sequence of steps can't be known in advance, because it depends on what earlier steps find. A fixed invoice-processing pipeline doesn't need an agent, since the steps never change. Investigating why an application's performance suddenly dropped might, because the right path to the answer isn't known until you're partway through it. More agentic doesn't automatically mean better — it's a tradeoff, not an upgrade.

38. How would you choose an AI model for an application?

Start from the constraints that actually matter for the task: cost per request at your expected volume, how fast it needs to respond, how large a context window the task requires, whether it needs to call tools reliably, and whether the task needs step-by-step reasoning or just a fast, simple answer. Chasing the single "best" model on a leaderboard usually matters less than picking the one that fits these constraints for your specific use case.

39. How would you evaluate whether an AI application is working well?

Build an eval: a fixed set of real examples with a way to score the output, so quality can be measured and compared after any change, rather than judged by a handful of examples that happened to look right. Layer deterministic checks — exact-match rules with no judgment call involved — for anything with one correct answer, an LLM judge for subjective quality at scale, and periodic human review to keep the judge honest. Learn more: AI Evals.

40. What should you consider before giving an AI system access to tools?

Give it the narrowest set of tools that does the job, require human approval for anything irreversible or externally visible, and treat every tool result — and anything the tools read, like a fetched web page or document — as untrusted content the model could be manipulated by. The more real actions a system can take, the more a mistake or a manipulated input actually costs. Learn more: Prompt Injection.

41. How can you reduce the cost of an LLM application?

Send less: shorter prompts, retrieved context instead of a huge pasted document, and a smaller or cheaper model wherever the task doesn't need your strongest one. Caching repeated prompts, batching requests, and reserving a bigger, more expensive model for only the steps that genuinely need it are the other standard levers. Cost usually comes down to how many tokens you're sending and how often, more than which single model you picked.

42. What are common reasons an AI application fails in production?

Five account for most of them. Retrieval that misses the right information. A prompt that worked in testing but breaks on real user phrasing. An agent given more tool access than the task needed. Context silently dropped once a conversation outgrows the window. And no eval in place to catch a regression before users do. Most failures trace back to one of these rather than the model being incapable.

Going deeper on one area

This page stays broad on purpose. For harder, scenario-based questions on one specific topic: RAG Interview Questions covers retrieval, chunking, embeddings, and reranking; Agent & Subagent Interview Questions covers the agent loop, delegation, and multi-agent systems in more depth than the fundamentals above. For focused revision pages: LLM, Generative AI, Agentic AI, Prompt Engineering, and RAG interview questions. Asked to design a whole system instead of answer a definition: AI System Design Interview Questions.