Interview questions · Book 08
AI & Machine Learning interview questions
226 questions from 58 pages, each with a short answer. Say your answer first, then open the question to check it.
p. 1 · 4 questions
AGI
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
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
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
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. 2 · 4 questions
AI Agent
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
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
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
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. 3 · 4 questions
AI Alignment
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
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
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
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. 4 · 4 questions
Artificial Intelligence
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
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
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
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. 5 · 4 questions
Attention Mechanism
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
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
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
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. 6 · 4 questions
Backpropagation
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
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
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
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.
p. 7 · 4 questions
Chain-of-Thought Prompting
1
What is chain-of-thought prompting?
Chain-of-thought prompting is a technique that asks an LLM to reason through intermediate steps before its final answer, improving accuracy on complex tasks.
2
Does chain-of-thought prompting always improve results?
No. It helps most on problems that need several reasoning steps, such as math, logic, and planning. For simple lookups, short classifications, or formatting tasks it mostly adds tokens, cost, and latency.
3
What is a reasoning model?
A reasoning model is an LLM trained to produce its own chain of thought, often hidden or summarized, before giving a final answer. It usually performs better on complex problems but takes longer and uses more tokens per response.
4
Is the chain of thought a true explanation of the model's answer?
Not necessarily. The steps are generated text and can look convincing even when they don't match how the model actually arrived at its answer, so the reasoning should be checked rather than trusted as proof.
p. 8 · 4 questions
Chatbot
1
What is a chatbot?
A chatbot is a program that converses with people in text or speech, answering questions or helping with tasks, using scripted rules or a language model.
2
What is the difference between a chatbot and an AI agent?
A chatbot mainly talks: it answers questions in a conversation. An AI agent works toward a goal on its own, planning steps and using tools such as search, code or APIs. Many modern assistants are both.
3
Is ChatGPT a chatbot?
Yes. ChatGPT is a chatbot built on OpenAI's GPT language models. It was released in November 2022 and made LLM-based chatbots widely known.
4
How do chatbots remember the conversation?
Usually the application sends the earlier messages along with each new one, so the model sees the whole exchange. The model itself does not remember between requests, and very long conversations are limited by its context window.