About Algorithm design and problem solving in O Level Computer Science
Algorithm design and problem solving is one of the 4 main topics in our O Level Computer Science (Cambridge (CAIE) 2210) question bank, and about 19% of its real questions come from it. Tayyari Karo has 38 real questions on this topic from 2021 to 2026, from Paper 2. By difficulty: 27 medium, 9 easy, 2 hard.
Work through the questions below, then open the explanation for each one. Redo the ones you missed a few days later.
Try 8 real questions
These are real past-paper questions. Think of your answer first, then open the explanation.
May/June 2026 · Paper 2 · Algorithm design and problem solving
Tick one box to identify the type of validation check to test whether a number entered into a computer system is between two set values: A length check; B presence check; C type check; D range check. [1]
Show model answer
D (range check).
A range check tests whether a value lies between two limits.
Oct/Nov 2025 · Paper 2 · Algorithm design and problem solving
2 Identify three different types of test data that can be used to test a program.
Show model answer
2 normal (typical valid data), boundary (at the limits of valid input), erroneous (invalid data that should be rejected).
May/June 2024 · Paper 2 · Algorithm design and problem solving
Tick one box to complete this sentence. A validation check to make sure that an email address contains an '@' sign is a: A range check; B visual check; C presence check; D format check.
Show model answer
D - format check (it checks the data is in the correct format / pattern).
Checking for '@' is a format check.
Oct/Nov 2024 · Paper 2 · Algorithm design and problem solving
1 Tick one box to show which check is used for verification when data is input: length check, range check, type check, visual check.
Show model answer
1 visual check
May/June 2023 · Paper 2 · Algorithm design and problem solving
State two features that should be included to create a maintainable program. Give a reason why each feature should be used.
Show model answer
Any two, e.g.:
1. Meaningful variable/identifier names - makes the code easier to read and understand so future changes are simpler.
2. Comments - explain what sections of code do, helping programmers maintain/debug it.
(Other valid: indentation for readability; modular structure using procedures/functions.)
Maintainable: meaningful names + comments + indentation + modularity.
Oct/Nov 2023 · Paper 2 · Algorithm design and problem solving
5 The first stage of the program development life cycle is analysis. Two tasks in analysis are abstraction and decomposition.
(a) Describe what is meant by abstraction.
(b) Identify three of the component parts when a problem has been decomposed at the analysis stage.
(c) Identify and describe one other stage of the program development life cycle.
Show model answer
5 (a) Abstraction is removing unnecessary detail and focusing only on the essential information needed to solve the problem.
(b) Three component parts when decomposed: inputs required; processes/calculations to be carried out; outputs produced (or sub-problems/modules).
(c) One other stage, e.g. design (planning how the program will work, e.g. flowcharts/structure charts); coding/implementation (writing the program); testing (checking it works); maintenance (fixing/updating after release).
May/June 2022 · Paper 2 · Algorithm design and problem solving
Give one piece of normal test data and one piece of erroneous test data that could be used to validate the input of an email address. State the reason for your choice in each case.
Show model answer
Normal test data: e.g. "student@example.com" - it is a valid email containing an @ symbol and a domain, so it should be accepted.
Erroneous test data: e.g. "studentexample.com" (no @ symbol) - it is missing the @ symbol so it should be rejected by the validation.
(Other valid: erroneous = "student@" missing domain.)
Normal = valid format accepted; erroneous = invalid format rejected.
Oct/Nov 2022 · Paper 2 · Algorithm design and problem solving
3 A PIN is input into a banking app. Before acceptance: check 1 - each character must be a digit; check 2 - exactly four digits; check 3 - value between 1000 and 9999 inclusive.
(a) Describe each validation check.
(b) The PIN can be changed by the user. Describe how the new PIN could be verified before use.
Show model answer
3 (a) Check 1: check that every character of the PIN is numeric (0-9); reject if any character is not a digit. Check 2: check the length of the PIN is exactly 4 characters. Check 3: range check that the numeric value is >= 1000 and <= 9999.
(b) Verification: the user is asked to enter the new PIN twice and the two entries are compared; if they match it is accepted (or the input is displayed back for the user to confirm it is correct).