Skip to main content

Interview questions · Book 08

AI & Machine Learning interview questions

266 questions from 68 pages, each with a short answer. Say your answer first, then open the question to check it.

Practice

Getting the questions ready…

Take the quiz Cheat sheet

p. 1 · 4 questions

Agent2Agent Protocol

Full page
  1. 1

    What is the Agent2Agent (A2A) protocol?

    The Agent2Agent (A2A) protocol is an open standard that lets AI agents built by different teams or vendors find each other, hand off tasks and share results.

  2. 2

    What is the difference between A2A and MCP?

    MCP connects one AI agent to tools, data and prompts. A2A lets separate agents, possibly from different companies, discover each other and delegate work. Many systems use both.

  3. 3

    What is an Agent Card?

    A JSON document that an A2A agent publishes to describe itself: its name, what it can do, how to reach it and which authentication it requires. Other agents read it to decide whether and how to call it.

  4. 4

    Who maintains A2A?

    It started at Google and is now an open-source project at the Linux Foundation, run by a technical steering committee with members from several large technology companies.

p. 2 · 4 questions

AGI

Full page
  1. 1

    What is AGI?

    AGI (artificial general intelligence) is a hypothetical AI system that could learn and do any intellectual task a person can, not just a narrow set of tasks.

  2. 2

    Does AGI exist yet?

    No system is generally accepted as AGI. Current models are very capable in many areas but still fall short of flexible, human-like general intelligence, and experts disagree on how far away it is.

  3. 3

    What is the difference between AI and AGI?

    AI is the whole field and includes narrow systems built for specific tasks. AGI is one particular goal within it: a system with general, human-level ability across tasks.

  4. 4

    Is AGI the same as superintelligence?

    No. AGI means roughly human-level general ability. Superintelligence means intelligence that far exceeds the best humans in nearly every area.

p. 3 · 4 questions

AI Agent

Full page
  1. 1

    What is an AI agent?

    An AI agent is a system that uses an LLM to plan and carry out multi-step tasks by deciding which tools to call, observing the results, and acting again.

  2. 2

    What is the difference between an AI agent and a chatbot?

    A chatbot answers messages with text, while an AI agent can take actions by calling tools, such as searching, editing files, or sending requests to APIs. Agents also work through multiple steps on their own until a goal is reached.

  3. 3

    What is tool calling?

    Tool calling, also called function calling, is when a model responds with a structured request to run a specific function with specific arguments instead of plain text. The application executes the function and returns the result to the model.

  4. 4

    Are AI agents safe to use?

    They can be, with guardrails. Give agents only the permissions they need, cap how many steps they can take, log their actions, and require human approval for anything destructive or expensive, such as deleting data or making payments.

p. 4 · 4 questions

AI Alignment

Full page
  1. 1

    What is AI alignment?

    AI alignment is the field of making AI systems pursue the goals and values their designers intend, so they behave helpfully, honestly, and safely.

  2. 2

    What is RLHF?

    Reinforcement learning from human feedback is a training method in which people rank or compare a model's answers, a separate reward model learns to predict those preferences, and the language model is then trained to produce answers the reward model scores highly. It is one of the main ways chat models are aligned.

  3. 3

    What is reward hacking?

    Reward hacking happens when an AI system finds a way to score well on the goal it was given without doing what its designers really wanted, such as exploiting a bug in a game or gaming a test. It shows how hard it is to specify goals precisely.

  4. 4

    Is AI alignment the same as AI safety?

    Not exactly. Alignment is about making a system's goals and behavior match human intentions, while AI safety is a broader field that also includes preventing misuse, securing systems, and reducing wider harms.

p. 5 · 4 questions

AI Coding Agent

Full page
  1. 1

    What is an AI coding agent?

    An AI coding agent is an AI system that takes a programming task, explores the code, edits files and runs commands in a loop until the task is done.

  2. 2

    What is the difference between an AI coding assistant and a coding agent?

    An assistant suggests code that you accept or reject as you type. An agent takes a whole task, makes the changes itself across files and runs commands to check them, then reports back.

  3. 3

    Are AI coding agents safe to use?

    They are as safe as the access you give them. Run them with limited permissions, let them ask before risky commands, keep secrets out of reach and review their changes before merging.

  4. 4

    Do I still need to know how to code?

    Yes. An agent speeds up the typing, but someone has to define the task, judge whether the result is right and maintain it afterwards, and knowing how the code works is what makes that possible.

p. 6 · 4 questions

Artificial Intelligence

Full page
  1. 1

    What is artificial intelligence?

    Artificial intelligence (AI) is the field of computer science that builds systems able to do tasks that normally require human intelligence.

  2. 2

    What is the difference between AI and machine learning?

    AI is the overall goal of making machines behave intelligently. Machine learning is a subset of AI in which systems learn from data instead of following rules written by hand.

  3. 3

    Is ChatGPT artificial intelligence?

    Yes. ChatGPT is an AI chatbot built on a large language model, a kind of deep learning model trained on huge amounts of text. It is still narrow AI, not general intelligence.

  4. 4

    What are the main types of AI?

    A common split is by capability: narrow AI, which handles specific tasks and is what exists today, and general AI, a hypothetical system as capable as a person across tasks. By technique, AI ranges from rule-based systems to machine learning and deep learning.

p. 7 · 4 questions

Attention Mechanism

Full page
  1. 1

    What is the attention mechanism in AI?

    The attention mechanism is a neural network technique that lets a model decide, for each token, which other parts of the input matter most and focus on them.

  2. 2

    What are queries, keys, and values in attention?

    They are three vectors computed from each token. The query describes what a token is looking for, the key describes what a token contains, and the value is the information passed along; matching queries against keys decides how much of each value to use.

  3. 3

    What is multi-head attention?

    Multi-head attention runs several independent attention calculations, called heads, side by side, each with its own learned weights. Their results are combined, which lets the model track several kinds of relationships between tokens at once.

  4. 4

    Why is attention expensive for long inputs?

    Standard self-attention compares every token with every other token, so doubling the input length roughly quadruples the work. Models use optimized implementations, caching, and approximate forms of attention to reduce this cost.

p. 8 · 4 questions

Backpropagation

Full page
  1. 1

    What is backpropagation?

    Backpropagation is the algorithm that trains neural networks by measuring how much each weight added to the error and nudging every weight to reduce it.

  2. 2

    What is the difference between backpropagation and gradient descent?

    Backpropagation calculates the gradients, how the error changes with each weight. Gradient descent uses those gradients to update the weights. Training needs both.

  3. 3

    What is the vanishing gradient problem?

    In deep networks, gradients can shrink as they pass backwards through many layers, so the early layers barely learn. ReLU activations, normalization and residual connections reduce the problem.

  4. 4

    Do I need to implement backpropagation myself?

    Rarely. PyTorch, TensorFlow and JAX compute gradients automatically. Implementing it once for a small network is still a good way to understand how training works.

More

Settings