Interview Q&A / Machine Learning

BeginnerQuick answer1 min readUpdated 3 Oct 2026

How does reinforcement learning work? Explain agent, environment, reward and policy.

SHORT ANSWER

An agent takes actions in an environment, receives a reward and a new state, and learns a policy (a rule for choosing actions) that maximises total reward over time. It learns by trial and error, not from labelled examples.

Explain it simply

Training a dog is a good picture. The dog (agent) is in the garden (environment). It sits (action), you give a biscuit (reward). Over many tries the dog learns that sitting on command pays off. Nobody gave the dog a labelled dataset.

The four words to know:

  • Agent: the learner and decision maker.
  • Environment: everything the agent interacts with.
  • Reward: a number telling the agent how good the last action was.
  • Policy: the agent's strategy, a mapping from situation to action.

Example

A tiny example: a delivery bot on a grid earns +10 for reaching the customer, -1 for each step, and -5 for hitting a wall.

text
Step 1: bot at start, picks "right"   -> reward -1
Step 2: picks "right" again           -> reward -1
Step 3: hits wall                     -> reward -5
...
Reached customer                      -> reward +10
Total = -1 -1 -5 ... +10

The goal is the highest total (the return), not the biggest single reward. The bot must balance exploration (trying new moves) against exploitation (repeating moves known to be good). Q-learning and policy-gradient methods are standard ways to learn the policy.

What to say in the interview

"In reinforcement learning an agent interacts with an environment, gets a reward for each action, and learns a policy that maximises long-term reward. Unlike supervised learning, there is no answer key, and the agent's actions change the data it sees next. The key trade-off is exploration versus exploitation."

Common mistakes

  • Confusing reward with label; a reward is feedback after acting, not the correct answer.
  • Maximising immediate reward instead of the total over time.

#reinforcement-learning#agent#reward

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.