LIM26 is Live — Learning Intelligence Meet 2026 by Ocoviz · Discover the Movement
Computational thinking basics

Algorithm examples in everyday life and in computing

Ten simple algorithm examples, from making tea to sorting a list, with clear steps and pseudocode for the computing ones.

Everyday examples

Algorithms you already use

☕

1. Making tea

Boil water. Put a tea bag in a cup. Pour in the water. Wait three minutes. Remove the bag. Add milk and sugar if you like.

🚦

2. Crossing a road

Stop at the kerb. Look right, left, right again. If no vehicle is near, cross while still watching. Otherwise wait and repeat.

🪨

3. Washing hands

Wet hands. Apply soap. Rub palms, backs, fingers and thumbs. Rinse. Dry with a clean towel.

Computing example 4

Largest of three numbers

Assume the first number is the largest. If the second is bigger, it becomes the largest. If the third is bigger than that, it becomes the largest. Print the largest.

READ a, b, c
largest = a
IF b > largest THEN largest = b
IF c > largest THEN largest = c
PRINT largest
Computing example 5

Even or odd

Divide the number by 2 and look at the remainder. If the remainder is 0 the number is even; otherwise it is odd.

READ n
IF n MOD 2 = 0 THEN
    PRINT "even"
ELSE
    PRINT "odd"
Computing example 6

Sum of the first n numbers

Start with a total of 0. Count from 1 to n, adding each number to the total.

READ n
total = 0
FOR i = 1 TO n
    total = total + i
PRINT total
Computing example 7

Linear search

Look through a list one item at a time until you find what you want or reach the end.

READ list, target
FOR each item IN list
    IF item = target THEN
        PRINT "found"
        STOP
PRINT "not found"
Computing example 8

Guess the number (binary search idea)

To guess a number from 1 to 100, always guess the middle of the range you have left. If the answer is 'higher', throw away the lower half; if 'lower', throw away the upper half. You will find it in at most 7 guesses.

Computing example 9

Bubble sort, one pass

Compare each pair of neighbours and swap them if the left one is bigger. After one pass over 5, 2, 4, 1 you get 2, 4, 1, 5, and the biggest number has moved to the end. Repeat passes until nothing swaps.

Computing example 10

How apps use algorithms

Maps use algorithms to find routes, video apps use them to suggest what to watch, and search engines use them to rank pages. They are far bigger than the examples above, but they follow the same rule: clear steps that turn input into output.

Frequently Asked Questions (FAQs)

Algorithm examples: answered

What are some simple examples of an algorithm?
Making tea, crossing a road safely, finding the largest of three numbers, checking if a number is even or odd and searching for a name in a list are all simple algorithms.
What is an everyday life example of an algorithm?
A recipe is the classic one. Others include the steps for brushing teeth, a bus route you follow each morning or the way you sort laundry.
How do I explain algorithms to kids?
Start with an activity such as giving exact instructions to a 'robot' to make a sandwich. When the robot does something silly, students see why steps must be clear and in order.
What is an algorithm in computer science with an example?
Finding the largest of three numbers is a good one: assume the first is the largest, compare with the second and third, and update the largest if you find a bigger one.
What are real-life examples of algorithms used by computers?
Search engines ranking pages, maps finding routes, video apps suggesting what to watch and banks flagging unusual payments all use algorithms.
Which algorithm is easiest for beginners?
Adding two numbers, checking even or odd and finding the largest of three are good starting points because they are short and easy to test.

Turn thinking into a classroom habit

See how Ocoviz supports CBSE's computational thinking and AI direction.

Explore CBSE CT & AI