Mini Minds Hub · Free printable

Algorithm Detective Quiz: Free Printable Quiz for Year 5

In short: Free printable Algorithm Detective Quiz for Year 5 (ages 9 to 10). Trace each case, choose the verdict, then fix and explain. With answers for grown-ups.

  • ForYear 5
  • StageKey Stage 2
  • CostFree
  • FormatPrintable PDF

Algorithm Detective Quiz asks Year 5 children (ages 9 to 10) to act as detectives. They trace short algorithms, choose a verdict on each case, then write a fix and explain it. It suits children who have met loops, selection and variables and are ready to check them closely. It takes about 25 minutes, and page 2 gives the grown-up the answers.

Before they start, model one tiny algorithm of your own on scrap paper. Write the value of each variable after every line, then say the output aloud. The usual slip is reading the whole algorithm and guessing the output. Ask for the values after each step first, and the verdict follows.

What is on the sheet

Children read a series of short algorithms, called cases, and trace what each one does. For cases 1 to 6 they choose a verdict from multiple choice answers, with three answers each. Then they move to numbered questions, 8 to 10, where they write their own answers on the lines provided. This includes fixing an algorithm and explaining the fix in words. Children can trace on scrap paper if they need to, so have some ready.

  • Case 3 is faulty. Write the fix and explain why the output is not 30.

Worked example: trace before you decide

Total starts at 5. Repeat 2 times: add 6 to total. What is total at the end?

This is our own example, with different numbers from the sheet. It shows two ways to check an output.

Method 1: trace each repeat
  1. Write the start value: total = 5.
  2. Repeat 1: 5 + 6 = 11. Write total = 11.
  3. Repeat 2: 11 + 6 = 17. Write total = 17.
  4. The algorithm ends, so the output is the last value.
Method 2: check with a shortcut
  1. Work out what the loop adds in all: 2 repeats of 6 is 12.
  2. Add that to the start value: 5 + 12 = 17.
  3. Compare with the trace. Both give 17, so the trace is likely to be right.
total is 17

How a detective round can run

Trace first

Children write the value of each variable after every step on scrap paper. They do not decide anything until the trace is finished.

Choose the verdict

With the trace beside them, children pick the verdict that matches what they found, not what they expected.

Fix and explain

Where an algorithm does not do what it should, children write a change and say in words why the change works.

Compare and defend

Children share a verdict with a partner and point to a line of their trace as evidence. Agreement is not the goal. Evidence is.

What is an algorithm, and why trace it?

An algorithm is a set of clear steps that solves a problem or completes a task. A recipe is a familiar example, and so is a route to school written as directions. Computers need algorithms written exactly, because they do exactly what the steps say. They cannot guess what the writer meant. That is why careful, precise thinking matters so much in computing.

Tracing means following an algorithm one step at a time and recording what changes. A variable is a named place that holds a value, and loops and selection can change it again and again. Writing the values down makes the changes visible. It also shows where an error begins. Finding and fixing errors is called debugging, and it is a normal part of programming.

Detective facts about algorithms

  • A computer follows instructions exactly as they are written. It does not fill in gaps.
  • An error in an algorithm or program is called a bug. Finding and fixing it is called debugging.
  • A loop lets a program repeat steps without writing them out again and again.
  • Selection lets a program choose between steps, depending on whether a condition is true.
  • Algorithms are not only for computers. Directions, rules for a game and a recipe are all algorithms.

Skills and curriculum link

  • Tracing loops
  • Following variables
  • Reading selection
  • Spotting errors
  • Explaining fixes
  • Reasoning with evidence

Ideas that help with tracing

  • Trace tableDraw a small table with a column for each variable and a row for each step. Fill it in as you go, and the changes are easy to see.
  • Update in orderDo the steps in the order they are written. A variable changes only at the step that changes it, so check the line you are on.
  • Check the conditionFor selection, test the condition with the current values. Then follow the path that matches, and ignore the other path.
  • Count the repeatsFor a loop, keep a tally of how many repeats you have done. Stop at the number the algorithm gives, not one sooner or later.

Key words

  • AlgorithmA set of clear steps that solves a problem or completes a task.
  • VariableA named place that stores a value. The value can change.
  • LoopA part of an algorithm that repeats its steps.
  • SelectionA choice in an algorithm. Different steps run depending on whether a condition is true.
  • TraceFollow an algorithm step by step and write down what changes.
  • BugA mistake in an algorithm or program that makes it give the wrong result.

How to use it

  1. Print both pages. Page 1 is for the child. Keep page 2, which has the notes and the answers.
  2. Have scrap paper and a pencil ready. Model one tiny algorithm of your own first, writing the variable values after each step.
  3. Work through the first case together. Let the child lead the trace and say the verdict aloud.
  4. Let the child complete cases 1 to 6 and questions 8 to 10. It takes about 25 minutes.
  5. Check against page 2 together. Ask where the trace and the verdict agreed or parted, then come back to it another day.

Help, stretch and game ideas

If it feels too hard

Ask the child to write the value of each variable after every step before choosing a verdict. Start with cases 1 and 2, and do them side by side. Once the pattern feels familiar, let them move on to the next case on their own.

To stretch confident children

Ask children to trace case 4 again on scrap paper, this time with a start of 3 and 4 repeats. Then they check their result with a partner. If the two traces differ, they find the first step where the values part.

Make it a game

Pairs take turns reading a case aloud. The reader defends their verdict by pointing to a line of their trace. The partner can challenge. They then compare fixes before checking the key on page 2.

Mistakes to watch for

Watch forA child stops the loop one repeat too early or runs it one repeat too many.

Try thisAdd a tally column to the trace. Tick each repeat as it is done, and stop exactly when the tally matches the repeat number.

Watch forA child uses an old value of a variable instead of the latest one.

Try thisCross out the old value each time a new one is written. Only the value at the end of the row is the current one.

Watch forA child follows both paths of a selection instead of one.

Try thisTest the condition with the current values and say aloud, "true" or "false". Then follow only the path that matches.

Talk about it

  • How did you decide on your verdict? Which line of your trace showed you?
  • Where did the values start to change in a way you did not expect?
  • What did the loop do to the variable each time it ran?
  • If an algorithm gave an unexpected output, where would you look first?
  • How could you explain your fix to someone who has not seen the case?
  • Can you think of an everyday task that is really an algorithm?

Take it off the page

Robot walk

One person writes a short set of movement instructions on paper. A partner follows them exactly and nothing more. Check what happens when a step is unclear, then fix the instructions. Use a clear space.

Human loop

Write a short pattern of claps and steps, with a repeat. Perform it, then count the repeats aloud and check the pattern matches the written steps.

Bug hunt

Write a short set of instructions for drawing a simple shape, with one deliberate mistake. Swap with someone, who follows the steps on paper and finds the mistake.

Who it is for

Parents

Sit beside your child for the first case and let them lead the trace. You do not need programming knowledge, because page 2 has the answers. Praise the careful tracing and the explanations. Keep to about 25 minutes, and stop sooner if they tire.

Teachers

Use it as a starter, a plenary after teaching loops, selection and variables, or an early finisher task. It needs no preparation beyond printing, and scrap paper for tracing. Page 2 gives support and stretch ideas for mixed groups, along with the answers.

Home educators

Print it as part of a wider computing plan. It pairs well with unplugged activities, such as writing instructions for a partner to follow. The case format suits discussion, so it works for brothers and sisters together, or for revision a few weeks later.

Where this fits in learning

Before this, children usually write and follow simple sequences of instructions, and meet repetition in short programs. They also begin to predict what a simple program will do. Tracing builds on that habit of predicting and checking.

After this, children can use selection, repetition and variables more confidently in programs they design themselves. At Key Stage 2 they are expected to detect and correct errors in algorithms and programs. Practising with short cases on paper prepares them to do that on screen.

Keep practising

If this sheet went well, find more in our Year 5 computing worksheets guide, or try Robot Maze Debugging, Garden Trail Algorithm, Plan a Chelsea Virtual Tour or Bailey's Code Block Match next.

Questions parents and teachers ask

What age is Algorithm Detective Quiz for?

It is written for Year 5, ages 9 to 10, in Key Stage 2. It suits children who have already met loops, selection and variables and are ready to trace them carefully and explain their thinking.

How long does it take?

It takes about 25 minutes. Children trace each case, choose a verdict, then write their answers. Stop at a case boundary if time runs out, and return to the rest another day.

What if it feels too hard?

Ask children to write the value of each variable after every step before choosing a verdict. Start with cases 1 and 2 and work through them together. A written trace usually makes the next step clear.

Do children need a computer?

No. The quiz needs only paper and a pencil. Scrap paper is useful for tracing, so have some ready, as the sheet does not supply it. It makes a calm screen free activity.

Do I need to know programming to help?

No. Page 2 has notes on how to use the sheet, help for children who find it hard, a stretch idea and the answers. Trace alongside your child and check the key afterwards.

Can teachers use it in class?

Yes. It works as a starter, a plenary, an early finisher task, homework or a table activity. It needs no preparation beyond printing and having scrap paper to hand.

Can it be used for home education?

Yes. Home educators and tutors can use it on its own or within a wider computing plan. It can be printed again for brothers, sisters or revision, and the partner game works with two children.

Preview the full PDF

Made by Jaques of London, making games for families since 1795. A printable supports classroom learning and does not replace a teacher.