Interview Q&A / Machine Learning

BeginnerIn-depth4 min readUpdated 2 Oct 2026

What is the difference between supervised, unsupervised and reinforcement learning?

SHORT ANSWER

Supervised learning trains on examples that come with the correct answer (labels). Unsupervised learning finds patterns in data with no labels, such as groups. Reinforcement learning trains an agent by trial and error, using rewards and penalties from an environment.

Explain it simply

Think of three ways a student can learn.

  • Supervised: a teacher gives you a practice book with the answer key. You solve questions, check the key, and slowly learn the pattern. The answers are the labels.
  • Unsupervised: you are handed a pile of old question papers with no answers and asked to sort them. Nobody tells you the right groups, but you notice that some are about algebra, some about geometry, some about probability.
  • Reinforcement: you are learning to ride a cycle. Nobody gives you an answer key. You try something, you wobble or fall (a penalty) or you balance for longer (a reward), and you adjust.

Machine learning works in the same three ways. The difference is what the data looks like and what feedback the model gets.

Example

Take a bank that handles loan applications.

TypeData the model seesWhat it learnsBank example
SupervisedPast applications + whether each loan was repaidA mapping from input to a known answerPredict if a new applicant will repay
UnsupervisedCustomer transactions, no labelsStructure: clusters, unusual pointsGroup customers into segments for offers
ReinforcementStates, actions and rewards over timeA policy: which action to take in each stateDecide when to send payment reminders to get the most repayments

How it works

Supervised learning needs labelled pairs (input, correct output). If the output is a category (spam or not spam), it is classification. If it is a number (house price, crop yield in quintals), it is regression. The model makes a prediction, a loss function measures how wrong it is, and training adjusts the model to reduce that loss. Examples: linear regression, logistic regression, decision trees, neural networks.

Unsupervised learning has only inputs. Common tasks are clustering (k-means groups similar points), dimensionality reduction (PCA squeezes 100 columns into a few that keep most of the variation) and anomaly detection (flag a card transaction that looks nothing like the rest). There is no answer key, so judging quality is harder and often needs a human to check if the groups make sense.

Reinforcement learning (RL) has an agent acting in an environment. At each step the agent sees a state, takes an action, and gets a reward. Its goal is to maximise the total reward over time, not just the next reward. That is why it can learn to give up a small gain now for a bigger one later. Examples: game-playing agents, robot control, and the RLHF step used to tune chat models.

Real-world use

  • Supervised: spam SMS filters, loan default prediction, disease detection from X-rays, exam score prediction.
  • Unsupervised: customer segmentation for an e-commerce sale, grouping news articles by topic, fraud alerts.
  • Reinforcement: game AI, warehouse robots, recommendation systems that learn from clicks over time.

Common mistakes

  • Saying unsupervised learning has "no output". It does produce output (clusters, scores); it just has no labels to learn from.
  • Treating reinforcement learning as supervised learning with rewards. In RL the agent's own actions change what data it sees next, and rewards can arrive late.
  • Forgetting the middle ground: semi-supervised (few labels, lots of unlabelled data) and self-supervised learning, where labels are created from the data itself, like predicting the next word.

What to say in the interview

"The difference is the kind of feedback. In supervised learning every training example has a label, so the model learns to map inputs to known outputs; classification and regression are the two main types. In unsupervised learning there are no labels, so the model finds structure on its own, like clusters with k-means or fewer dimensions with PCA. In reinforcement learning an agent takes actions in an environment and learns from rewards, aiming to maximise total reward over time. For example, predicting loan default is supervised, segmenting customers is unsupervised, and learning a game strategy is reinforcement learning."

Follow-up questions

  • What is the difference between classification and regression?
  • How would you evaluate a clustering model when there are no labels?
  • What is semi-supervised or self-supervised learning?
  • What is the exploration vs exploitation trade-off in reinforcement learning?

Go deeper

Read these once the basics above feel easy.

Large language models mix all three ideas. Pre-training is self-supervised: the label for each position is simply the next token in the text. Fine-tuning on question-answer pairs is supervised. RLHF then uses a reward model trained on human preferences and optimises the model's responses with reinforcement learning. So in real systems the categories are tools, not separate worlds.

#ml-basics#supervised-learning#unsupervised-learning#reinforcement-learning

Related questions

Practise more Machine Learning questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Machine Learning quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.