AI interview questions and answers
71 common interview questions on AI, machine learning, LLMs, RAG, agents, governance, Copilot Studio and AI for business analysts, with short, clear answers. Click a question to see the answer.
AI basics
1What is artificial intelligence, in simple words?
AI is software that learns patterns from examples so it can do tasks that usually need human thinking, like understanding language, recognising images or making predictions. Unlike traditional software, it isn't programmed rule by rule; it learns from data.
Learn more →2What is the difference between AI, machine learning and deep learning?
AI is the broad goal of making machines act intelligently. Machine learning is one way to achieve it, by learning from data. Deep learning is a type of machine learning that uses many-layered neural networks, and it powers today's image recognition and chatbots.
Learn more →3What is generative AI?
Generative AI creates new content (text, images, audio, video or code) instead of only classifying or predicting. ChatGPT, Claude, Gemini and image generators like Midjourney are examples.
Learn more →4What is a large language model (LLM)?
An LLM is a model trained on huge amounts of text to predict the next token. Repeating that prediction produces fluent answers. It's the engine behind assistants like ChatGPT and Claude.
Learn more →5What is a token, and why does it matter?
A token is a small piece of text, often a word or part of a word. Models read, limit and bill by tokens, so the length of prompts and answers directly affects cost and what fits in the context window.
Learn more →6What is a hallucination, and how do you reduce it?
A hallucination is a confident but wrong or made-up answer. Reduce it by grounding the model in real documents (RAG), asking for citations, allowing it to say "I don't know", using tools for exact facts, and testing with evaluation sets.
Learn more →7What is the difference between training and inference?
Training is when the model learns from data and adjusts its parameters. Inference is when the trained model is used to answer a question. Training happens rarely and is expensive; inference happens every time someone uses it.
Learn more →Machine learning & data
8Explain supervised, unsupervised and reinforcement learning.
Supervised learning uses labelled examples (spam / not spam). Unsupervised learning finds patterns or groups without labels (customer segments). Reinforcement learning learns by trial and error with rewards (game-playing AI, and fine-tuning chatbots with human feedback).
Learn more →9What is overfitting, and how do you prevent it?
Overfitting is when a model memorises its training data and performs badly on new data. Prevent it with more and more varied data, simpler models, regularisation, early stopping and by always testing on data the model hasn't seen.
Learn more →10Why do we split data into training, validation and test sets?
Training data teaches the model, validation data helps tune and compare models, and the test set gives a final honest check on unseen data. Mixing them up (data leakage) makes a model look better than it really is.
Learn more →11What is the difference between classification and regression?
Classification predicts a category (fraud or not, which department). Regression predicts a number (price, delivery time).
Learn more →12How would you choose an algorithm for a new problem?
Start with the kind of answer needed: a number (regression), a category (classification), groups (clustering) or actions (reinforcement learning). Consider data size, the need for explainability and accuracy, start with a simple baseline, then compare a few options on a validation set.
Learn more →13Explain precision and recall with an example.
In a spam filter, precision is the share of emails flagged as spam that really were spam; recall is the share of all spam emails that were caught. For cancer screening recall matters most (don't miss cases); for spam filters precision matters (don't hide real emails).
Learn more →14Why does data quality matter so much in AI?
Models learn whatever is in the data, including errors and bias: garbage in, garbage out. Accuracy, completeness, consistency, timeliness and representativeness directly affect how accurate and fair the AI is.
Learn more →15What is the difference between a random forest and gradient boosting?
Both use many decision trees. A random forest builds trees independently on random samples and lets them vote. Gradient boosting builds trees one after another, each fixing the previous ones' mistakes. Boosting is often more accurate on tabular data but needs more tuning.
Learn more →LLMs & prompt engineering
16What makes a good prompt?
Clear role, specific task, relevant context, constraints, the output format, examples where helpful, and tone. Then iterate on the answer instead of accepting the first draft.
Learn more →17What is the difference between zero-shot and few-shot prompting?
Zero-shot asks without examples; few-shot includes two or three examples of the input and desired output so the model copies the pattern. Few-shot is useful when the format or style must be exact.
Learn more →18What is chain-of-thought prompting?
Asking the model to reason step by step before giving the final answer. It improves accuracy on maths, logic and multi-step problems.
Learn more →19What is a context window, and what is context engineering?
The context window is how much text a model can consider at once. Context engineering is deciding what goes into it (instructions, data, history, retrieved documents, tool results) so the model has exactly what it needs without noise.
Learn more →20What does temperature control?
Randomness. Low temperature gives consistent, predictable answers (good for facts and extraction); high temperature gives varied, creative answers (good for brainstorming).
Learn more →21What is a system prompt?
Standing instructions given to the model before the conversation, setting its role, tone, rules and limits. Users usually don't see it.
Learn more →22Explain the transformer architecture simply.
Transformers turn tokens into vectors and use self-attention so every word can look at every other word to understand context, then feed-forward layers refine the meaning. Stacking many of these layers lets models like GPT understand and generate language.
Learn more →RAG & fine-tuning
23What is RAG, and why is it used?
Retrieval-Augmented Generation searches your documents for relevant passages and gives them to the LLM with the question, so answers are grounded in up-to-date, company-specific information, with citations and fewer hallucinations.
Learn more →24When would you not use RAG?
When the knowledge is small enough to give the model directly, or stable enough to preload (CAG). RAG adds complexity; use the simplest architecture that solves the problem reliably.
Learn more →25What is chunking, and why does it matter?
Splitting documents into pieces before indexing them. Chunks that are too large bury the answer; too small and they lose context. Strategies include fixed-size with overlap, recursive, semantic and hierarchical chunking.
Learn more →26What is hybrid search and reranking?
Hybrid search combines keyword search (BM25) with meaning-based vector search. Reranking then uses a stronger model to re-order the top results so the most relevant chunks reach the LLM.
Learn more →27RAG or fine-tuning: how do you decide?
Use RAG for facts that change or must be cited. Use fine-tuning to teach style, format, tone or a specialised skill. Many production systems combine both.
Learn more →28What are LoRA and QLoRA?
LoRA fine-tunes a model by training small adapter layers while the base model stays frozen, which is far cheaper. QLoRA does the same on a 4-bit compressed base model, so it fits on smaller hardware.
Learn more →29What is the difference between RAG, CAG and MAG?
RAG retrieves context at question time; CAG preloads a small, stable knowledge base into the cache; MAG (memory-augmented generation) lets the AI read and write a memory across conversations.
Learn more →Agents & agentic AI
30What is the difference between a chatbot and an AI agent?
A chatbot answers. An agent pursues a goal in a loop: it reasons, uses tools (search, APIs, email), observes the results and repeats until done or a limit is reached.
Learn more →31What is agentic AI?
Systems that plan and carry out multi-step work with some autonomy, often with several specialised agents coordinated by an orchestrator, under guardrails, evaluations, human approvals and cost limits.
Learn more →32When would you use a workflow instead of an agent?
When the task is well defined, repetitive and rule-based, such as routing invoices. Workflows are predictable and cheaper; agents are for open-ended tasks that need judgement. Many systems combine both.
Learn more →33Explain the ReAct pattern.
Reason, act, observe: the agent thinks about the next step, calls a tool, reads the result and repeats. It's the most common single-agent pattern.
Learn more →34What is MCP, and how is it different from an API?
The Model Context Protocol is an open standard that lets AI agents discover and use tools and data through MCP servers. An API is a general interface between applications; an MCP server usually wraps APIs so any compatible agent can use them.
Learn more →35How do you evaluate an AI agent?
Measure outcomes (did it complete the task correctly?) and trajectories (were the steps and tool calls sensible?). Use golden test sets from real failures, LLM-as-judge checked against humans, regression tests after changes, and track cost, latency and escalation rate.
Learn more →36How do you keep an agent safe?
Least-privilege tool permissions, human approval for irreversible actions, step and budget limits, guardrails on inputs and outputs, prompt-injection defences, full logging, and a kill switch.
Learn more →37What metrics would you track for an agent in production?
Task success rate, cost and latency per task, human escalation rate and tool-call accuracy, plus user satisfaction and safety incidents.
Learn more →38How is agentic AI different from RAG?
RAG is mainly about retrieving the right knowledge so a model can give a better answer. Agentic AI plans, uses many tools, takes actions and completes multi-step tasks. RAG is often one of the tools an agent uses.
Learn more →39How would you design an agentic AI system at a high level?
User request → an agent (planner and reasoner, an LLM) → tools (search, APIs, databases), memory (short- and long-term) and a knowledge base (RAG) → execution of actions → final answer. Around it: guardrails, human approval for risky steps, logging, evaluation and cost limits.
Learn more →40How do you make an agent's tool use reliable?
Clear tool names and descriptions with strict input schemas, input validation, error messages the model can act on, retries and fallback tools, read-only tools by default, approval for risky actions, and logging every call for observability.
Learn more →41How does function calling work?
You describe each tool (name, description, input schema). The model decides a tool is needed and returns the tool name and arguments as JSON; your app runs the tool and sends the result back; the model then writes the answer. The model never runs code itself.
Learn more →42How do you stop an agent from looping forever?
Set a maximum number of steps, a time limit and a token or cost budget, detect repeated actions, and give the loop clear exit conditions, such as a final answer or a hand-over to a human.
Learn more →43How do you defend an agent against prompt injection?
Treat everything the agent reads (web pages, files, tool output) as data, never as instructions; give it only the tools it needs (least privilege); filter inputs and outputs; and require human approval for risky actions like sending emails or payments.
Learn more →44Short-term vs long-term memory in an agent?
Short-term memory is the context of the current task or chat; it disappears when the session ends. Long-term memory stores facts, preferences and past results across sessions, often in a vector store or files, and needs expiry and privacy rules.
Learn more →45When should you use a multi-agent system?
When the task needs very different skills, parts can run in parallel, or the context is too big for one agent. Otherwise keep one agent: every extra agent adds cost, delay and new ways to fail.
Learn more →46Rule-based chatbot vs LLM chatbot: when would you use each?
Use rule-based for a small set of fixed, high-stakes or very common tasks where answers must be predictable. Use an LLM chatbot (usually with RAG) for open questions over documents. Many real bots are hybrid: rules for key steps like payments, AI for everything else, and a human hand-over.
Learn more →47How would you design and measure a customer support chatbot?
Define one clear job, collect real customer questions as a test set, write a system prompt with boundaries, connect the knowledge base with RAG, add hand-over to humans, and test before launch. Then track accuracy, containment rate, fallback and escalation rates, response time, satisfaction and cost per conversation.
Learn more →48What are the main components of an AI agent?
An LLM as the brain for reasoning, a planner to break goals into steps, tools to act (APIs, search, databases), memory for context and past results, and an orchestration loop that runs plan, act, observe and reflect until the goal is reached.
Learn more →49What types of AI agents are there?
Classic types range from simple reflex, model-based, goal-based and utility-based to learning agents. Modern LLM agents include tool-using agents, planning agents (plan-and-execute, ReAct), multi-agent systems and hierarchical agents with a manager and workers.
Learn more →50What is the role of memory in an AI agent?
Short-term memory keeps the current conversation and task in context; long-term memory stores facts, preferences and past results (often in a vector store) so the agent stays consistent across sessions. Good memory design also means expiring old facts and respecting privacy.
Learn more →51How would you deploy and scale an AI agent?
Wrap it as an API, package it in a container, deploy on a cloud or managed platform, and monitor uptime, latency, success rate, errors and token cost. Scale with more copies behind a load balancer, queues for long jobs, caching for frequent answers and smaller models for easy tasks.
Learn more →52What are the main challenges in building AI agents?
Hallucination, cost and latency, data privacy, reliability (agents not following instructions) and evaluation. Common answers: RAG with citations, caching and smaller models, data masking and access control, guardrails and fallbacks, and regular testing with real-world test sets.
Learn more →AI governance & ethics
53What is AI governance?
The rules, processes and people that make sure AI is used safely, fairly, legally and accountably: who may use AI, for what, with which data, and who is responsible when something goes wrong.
Learn more →54What are the core principles of responsible AI?
Fairness, transparency, explainability, accountability, privacy, safety and security, human oversight, and reliability.
Learn more →55Explain the EU AI Act's risk levels.
Unacceptable risk is banned (e.g. social scoring). High risk (hiring, credit, healthcare) needs strict controls. Limited risk mainly needs transparency (chatbots must say they're AI). Minimal risk (spam filters) is largely free to use.
Learn more →56What is shadow AI, and why is it a risk?
Employees using AI tools the company hasn't approved. Data may leak to unknown providers and nobody can manage the risk. An AI inventory and an acceptable use policy are the first steps.
Learn more →57What frameworks and standards would you use for AI governance?
NIST AI RMF (Govern, Map, Measure, Manage), ISO/IEC 42001 for AI management systems, the EU AI Act, and data laws such as GDPR, India's DPDP Act and the UAE PDPL.
Learn more →58How would you handle bias in an AI system?
Check training data for representativeness, test outcomes across groups, document limits in a model card, keep humans reviewing high-impact decisions, and monitor for drift after launch.
Learn more →Copilot Studio & Microsoft 365 agents
59What is Copilot Studio?
Microsoft's low-code platform for building, testing and publishing AI agents, with knowledge sources, topics, tools such as connectors and agent flows, and publishing to Teams, Microsoft 365 Copilot and other channels.
Learn more →60Declarative agent vs custom engine agent?
A declarative agent uses Microsoft 365 Copilot's own orchestrator and models and responds when asked. A custom engine agent brings its own orchestration and model choices and can act proactively, often hosted on Azure.
Learn more →61What is the difference between topics and generative orchestration?
Topics are designed conversation paths triggered by phrases, for steps that must be exact. With generative orchestration, the agent chooses which topics, tools and knowledge to use based on their descriptions.
Learn more →62How do you deploy a Copilot Studio agent safely to a client?
Build in a development environment, deploy with a solution through Power Platform pipelines to test for UAT, then to production; redo non-solution settings; apply DLP policies, security groups and monitor Copilot Credits.
Learn more →63How would you test a Copilot Studio agent?
Use the test pane with normal, tricky and off-topic questions; check answers cite the right sources; test connectors and flow error handling; run UAT with real users; keep an evaluation set to rerun before each release.
Learn more →AI for business analysts
64How can a business analyst use AI in a project?
Draft user stories and acceptance criteria, summarise workshops, analyse data gaps, create process maps and wireframes, generate test cases and UAT scripts, and write release notes and user guides, always reviewing outputs and protecting client data.
Learn more →65How would you gather requirements for an AI agent?
Clarify the users, the top questions or tasks, data sources and their owners, actions it may take, what it must never do, approval points, success metrics, and how errors are handled and escalated.
Learn more →66How do you write acceptance criteria for an AI feature?
Combine functional checks (Given/When/Then) with quality thresholds: accuracy on a test set, citations present, refusal for out-of-scope questions, response time, and escalation behaviour.
Learn more →67What risks would you raise when a client wants to use AI?
Data privacy and confidentiality, hallucinations, bias, regulatory compliance, unclear accountability, cost, and user adoption. Propose mitigations such as RAG with citations, human review and a pilot in shadow mode.
Learn more →Scenario & behavioural
68Tell me about a time you explained a complex AI concept to a non-technical audience.
Use the STAR method: the situation, the audience, how you used analogies and examples (for example RAG as an open-book exam), and the result, such as the decision made or the feedback received.
Learn more →69A stakeholder says "the AI is always right". How do you respond?
Explain hallucinations with a concrete example, agree on which outputs need human checking, and propose grounding with sources and an evaluation set so trust is based on evidence.
Learn more →70Your chatbot gives a wrong answer to a customer. What do you do?
Contain it (correct the customer, flag the conversation), find the root cause (missing or outdated document, retrieval, prompt), fix it, add the case to the test set, and monitor so it doesn't recur.
Learn more →71How do you keep up with AI changes?
Follow official release notes and documentation, test new features hands-on, learn in public through knowledge-sharing sessions, and focus on concepts that stay stable while tools change.
Learn more →No questions match that search.
Practise with a quiz
Test yourself with 170+ quiz questions, each with explanations.