An algorithm is a well-defined, precise, finite set of steps for solving a problem.
What do those words mean?
- Well-defined and precise: each step is clear and exact. The person (or computer) following it never has to guess what to do.
- Finite: the algorithm must end. It cannot go on forever.
- Steps: the instructions are carried out one at a time, in the correct order.
Algorithms in everyday life
You already use algorithms every day. A recipe is an algorithm! Here is an algorithm for making a cup of tea:
- Boil some water. (Ask an adult to help with hot water.)
- Put a teabag into a cup.
- Pour the hot water into the cup.
- Wait 3 minutes.
- Take out the teabag.
- Add milk and sugar if you like.

Notice that the steps are clear, they are in order, and they end with a cup of tea. That makes it an algorithm.
Ways to write an algorithm
- Narrative: the steps are written in ordinary sentences, like a story.
- Pseudocode: the steps are written in short, code-like statements such as
IF,THENandPRINT. - Flowchart: the steps are drawn as shapes joined by arrows.
Here is a simple flowchart for fixing a lamp that does not work. Follow the arrows from the top. The diamond shapes are questions: you go one way for “Yes” and another way for “No”.

Related lessons on this site
Quick check
- What does it mean for an algorithm to be finite?
- Write an algorithm, as numbered steps, for brushing your teeth.
- Name three ways to write an algorithm.
Attributions to media used in this post
- “Teabag – 26403497192” by Pasi Mammela, licensed under CC BY-SA 2.0, via Wikimedia Commons.
- “LampFlowchart” by Booyabazooka (SVG) and Wapcaplet (original PNG), licensed under CC BY-SA 3.0, via Wikimedia Commons.
© 2020 Vedesh Kungebeharry. All rights reserved.
Updates to this post: October 2026 – Added explanations, examples, a flowchart and a quick check.
