7. Algorithm Design and Problem-Solving
Program development life cycle, decomposition, flowcharts and pseudocode, standard algorithms (searching, sorting, totalling, counting, max/min), validation and testing with trace tables.
Statometer87BankerNext Paper 294%Everything for this topic — study hub
O Level / IGCSE · 2210 · 0478 · Paper 2
Statometer — what 25 real papers say about this topic and each of its 6 syllabus bullets
Banker · #4 of 10 in O Level / IGCSE · recomputed with every new session
Set in nearly every paper and worth a big slice of it — revise first, expect it.
- Next Paper 2
- 94%
- 9 in 10 chance it is set
- Marks a paper
- 20.6 / 75
- 28% of Paper 2 · fair share 25%
- Appeared in
- 25 / 25
- Paper 2 sittings 2023–2026
- Last set
- May/Jun 2026
- 0478/23 · Q5 · 7 marks · 11-series streak
What the papers say
- Set in 25 of 25 Paper 2 sittings on the current syllabus — treat it as certain.
- Worth about 20.6 marks a paper (28% of Paper 2).
- Last set May/Jun 2026 · 0478/23 · Q5 for 7 marks — in the most recent series.
- Set in each of the last 11 series without a miss.
- Easing off: about 25.2 marks a paper earlier, 18.1 in the latest years — still examined, just smaller.
- Lives on “Complete” and “Describe” — 45% of its questions: you must produce something — code, a diagram, a table — practise doing it, not reading it.
- 54% of its questions involve a diagram, table or figure — practise with pen and paper.
- 57% of its questions are set out as code, pseudocode or a table to complete.
- Most of its marks (80%) come in extended questions of 6+ marks — plan the answer before writing.
- Its biggest question so far: 16 marks (Oct/Nov 2023 · 0478/21 · Q8).
- Inside the topic, Test data (normal, abnormal, extreme, boundary); trace tables for dry runs; identifying and correcting errors in algorithms carries the most marks (24%) and The program development life cycle the least (3%).
- It is examined mostly as AO2 (Apply to a context, 66%), the rest AO1 (28%) — you must apply it to the scenario or the given data — a definition alone will not score.
- The examiner has commented on 159 of its questions — read “What the examiner said” before you practise.
Command words
Share of questions using the word (a question can use several). What each wants →
Question shapes
- 1–2 mk25
- 3–4 mk59
- 5–6 mk84
- 7–9 mk86
- 10+ mk42
Average 6.8 marks a question · 54% with a figure or table · 57% with code · biggest 16 marks
Assessment objectives — how it is examined
Every part of every current-syllabus question filed under Cambridge's AO1 / AO2 / AO3 (from its command word and what it asks you to do), so you know whether this topic pays for definitions, for applying, or for judging and building.
- AO1 Knowledge & understanding
- AO2 Apply to a context
- AO3 Evaluate & judge
Paper 2 as a whole
| Paper 2 | Syllabus | Measured |
|---|---|---|
| AO1 Knowledge & understanding | 20% | 27% |
| AO2 Apply to a context | 60% | 51% |
| AO3 Evaluate & judge | 20% | 22% |
Syllabus = Cambridge's grid; measured = the bank's current-syllabus papers.
Inside the topic — every syllabus bullet, measured
Each part of each question is filed under the bullet it examines; the numbers are per Paper 2 sitting, exactly like the topic's. Open a bullet for its own Statometer.
The program development life cycle#15 of 19 on Paper 2Occasional · 3346% next paper1.7 marks12/25 sittings→ May/Jun 2026Occasional · 3346%
1.7 · 3% of topic12/25May/Jun 2026latest series · →Rotated in occasionally — the bullet students skip and then meet.Syllabus: analysis, design, coding and testing, and what happens at each stage
- Next Paper 2
- 46%
- 2 in 4
- Marks a paper
- 1.7
- 2% of the paper · 3% of the topic
- Asked in
- 12 / 25
- Paper 2 sittings · 19 questions
- Last asked
- May/Jun 2026
- 2210/22 · Q4 · 3 marks
- Asked in 12 of 25 Paper 2 sittings — roughly one paper in 2.
- About 1.7 marks a paper (2% of Paper 2; 3% of the topic's marks across its 6 bullets).
- Last asked May/Jun 2026 · 2210/22 · Q4 (3 marks) — in the most recent series.
- Usually “Identify”: short, precise answers in syllabus words.
- Biggest chunk of marks so far: 6 in Feb/Mar 2026 · 0478/22 · Q3.
- It is examined almost entirely as AO1 (Knowledge & understanding, 98%) — definitions and descriptions in syllabus words score.
Last 12 sittings→ SteadyAssessment objectives
AO1 98%- AO1 Knowledge & understanding
- AO2 Apply to a context
- AO3 Evaluate & judge
- Identify32%
- Describe26%
- Tick21%
- State16%
Sub-systems and decomposition (inputs, processes, outputs, storage); designing solutions with structure diagrams, flowcharts and pseudocode#9 of 19 on Paper 2Core · 5879% next paper3.1 marks20/25 sittings↘ May/Jun 2026Core · 5879%
3.1 · 17% of topic20/25May/Jun 2026latest series · ↘A regular earner inside the topic — most papers touch it.
- Next Paper 2
- 79%
- 8 in 10
- Marks a paper
- 3.1
- 4% of the paper · 17% of the topic
- Asked in
- 20 / 25
- Paper 2 sittings · 97 questions
- Last asked
- May/Jun 2026
- 0478/23 · Q5 · 2 marks · 4-series streak
- Asked in 20 of 25 Paper 2 sittings — about 8 papers in 10.
- About 3.1 marks a paper (4% of Paper 2; 17% of the topic's marks across its 6 bullets).
- Last asked May/Jun 2026 · 0478/23 · Q5 (2 marks) — in the most recent series.
- Asked in each of the last 4 series.
- Easing: 3.7 → 2.5 marks a paper.
- Usually “Complete”: you must produce something — code, a diagram, a table — practise doing it, not reading it.
- Biggest chunk of marks so far: 8 in May/Jun 2025 · 0478/23 · Q1.
- It is examined mostly as AO2 (Apply to a context, 66%), the rest AO1 (34%) — you must apply it to the scenario or the given data — a definition alone will not score.
Last 12 sittings↘ EasingAssessment objectives
AO1 34%AO2 66%- AO1 Knowledge & understanding
- AO2 Apply to a context
- AO3 Evaluate & judge
- Complete55%
- Write17%
- Describe16%
- Explain14%
Explaining the purpose of a given algorithm; standard methods of solution#11 of 19 on Paper 2Regular · 5471% next paper2.9 marks18/25 sittings↘ May/Jun 2026Regular · 5471%
2.9 · 19% of topic18/25May/Jun 2026latest series · ↘Set most sessions for a few marks; know the definition and one example.Syllabus: linear search, bubble sort, totalling, counting, maximum/minimum/average
- Next Paper 2
- 71%
- 7 in 10
- Marks a paper
- 2.9
- 4% of the paper · 19% of the topic
- Asked in
- 18 / 25
- Paper 2 sittings · 78 questions
- Last asked
- May/Jun 2026
- 0478/23 · Q3 · 0.5 marks · 11-series streak
- Asked in 18 of 25 Paper 2 sittings — about 7 papers in 10.
- About 2.9 marks a paper (4% of Paper 2; 19% of the topic's marks across its 6 bullets).
- Last asked May/Jun 2026 · 0478/23 · Q3 (0.5 marks) — in the most recent series.
- Asked in each of the last 11 series.
- Easing: 4.6 → 2 marks a paper.
- Usually “Complete”: you must produce something — code, a diagram, a table — practise doing it, not reading it.
- Biggest chunk of marks so far: 8 in May/Jun 2023 · 0478/23 · Q7.
- It is examined almost entirely as AO2 (Apply to a context, 82%) — you must apply it to the scenario or the given data — a definition alone will not score.
Last 12 sittings↘ EasingAssessment objectives
AO1 18%AO2 82%- AO1 Knowledge & understanding
- AO2 Apply to a context
- AO3 Evaluate & judge
- Complete50%
- Explain28%
- Describe24%
- Identify21%
Validation checks (range, length, type, presence, format, check digit) and verification checks (visual, double entry)#7 of 19 on Paper 2Core · 6275% next paper3.7 marks20/25 sittings→ May/Jun 2026Core · 6275%
3.7 · 19% of topic20/25May/Jun 2026latest series · →A regular earner inside the topic — most papers touch it.
- Next Paper 2
- 75%
- 7 in 10
- Marks a paper
- 3.7
- 5% of the paper · 19% of the topic
- Asked in
- 20 / 25
- Paper 2 sittings · 84 questions
- Last asked
- May/Jun 2026
- 0478/23 · Q3 · 10 marks · 10-series streak
- Asked in 20 of 25 Paper 2 sittings — about 8 papers in 10.
- About 3.7 marks a paper (5% of Paper 2; 19% of the topic's marks across its 6 bullets).
- Last asked May/Jun 2026 · 0478/23 · Q3 (10 marks) — in the most recent series.
- Asked in each of the last 10 series.
- Usually “Give” or “Describe”: short, precise answers in syllabus words.
- Biggest chunk of marks so far: 10 in May/Jun 2026 · 0478/23 · Q3.
- It is examined mostly as AO1 (Knowledge & understanding, 54%), the rest AO2 (37%) — definitions and descriptions in syllabus words score.
Last 12 sittings→ SteadyAssessment objectives
AO1 54%AO2 37%- AO1 Knowledge & understanding
- AO2 Apply to a context
- AO3 Evaluate & judge
- Give33%
- Describe31%
- Explain30%
- Identify23%
Test data (normal, abnormal, extreme, boundary); trace tables for dry runs; identifying and correcting errors in algorithms#4 of 19 on Paper 2Banker · 8287% next paper5.4 marks23/25 sittings→ May/Jun 2026Banker · 8287%
5.4 · 24% of topic23/25May/Jun 2026latest series · →Asked in nearly every paper — the bullet to know cold.
- Next Paper 2
- 87%
- 9 in 10
- Marks a paper
- 5.4
- 7% of the paper · 24% of the topic
- Asked in
- 23 / 25
- Paper 2 sittings · 98 questions
- Last asked
- May/Jun 2026
- 0478/23 · Q5 · 5 marks · 11-series streak
- Asked in 23 of 25 Paper 2 sittings — nearly every paper.
- About 5.4 marks a paper (7% of Paper 2; 24% of the topic's marks across its 6 bullets).
- Last asked May/Jun 2026 · 0478/23 · Q5 (5 marks) — in the most recent series.
- Asked in each of the last 11 series.
- Usually “Complete”: you must produce something — code, a diagram, a table — practise doing it, not reading it.
- Biggest chunk of marks so far: 9 in Oct/Nov 2024 · 2210/23 · Q7.
- It is examined almost entirely as AO2 (Apply to a context, 78%) — you must apply it to the scenario or the given data — a definition alone will not score.
Last 12 sittings→ SteadyAssessment objectives
AO2 78%- AO1 Knowledge & understanding
- AO2 Apply to a context
- AO3 Evaluate & judge
- Complete50%
- Describe30%
- Give28%
- State24%
Writing and amending algorithms for a scenario in pseudocode, program code and flowcharts#12 of 19 on Paper 2Regular · 4555% next paper2.7 marks15/25 sittings↘ May/Jun 2026Regular · 4555%
2.7 · 18% of topic15/25May/Jun 2026latest series · ↘Set most sessions for a few marks; know the definition and one example.
- Next Paper 2
- 55%
- 6 in 10
- Marks a paper
- 2.7
- 4% of the paper · 18% of the topic
- Asked in
- 15 / 25
- Paper 2 sittings · 78 questions
- Last asked
- May/Jun 2026
- 2210/21 · Q10 · 6 marks · 11-series streak
- Asked in 15 of 25 Paper 2 sittings — about 6 papers in 10.
- About 2.7 marks a paper (4% of Paper 2; 18% of the topic's marks across its 6 bullets).
- Last asked May/Jun 2026 · 2210/21 · Q10 (6 marks) — in the most recent series.
- Asked in each of the last 11 series.
- Easing: 3.1 → 2.5 marks a paper.
- Usually “Write”: you must produce something — code, a diagram, a table — practise doing it, not reading it.
- Biggest chunk of marks so far: 6 in May/Jun 2026 · 2210/21 · Q10.
- It is examined almost entirely as AO2 (Apply to a context, 100%) — you must apply it to the scenario or the given data — a definition alone will not score.
Last 12 sittings↘ EasingAssessment objectives
AO2 100%- AO1 Knowledge & understanding
- AO2 Apply to a context
- AO3 Evaluate & judge
- Write62%
- Describe22%
- Give17%
- Complete17%
12% of the topic's marks sit in question parts that belong to another topic (scenario questions cross sections) or that no bullet claims; they count for the topic, not for a bullet.
Marks a paper, year by year
Grey years are the previous syllabus (2010–2022, 205 questions) — history, not counted in the rates.
By exam series
- Feb/Mar4/4 · 26.8 mk
- May/Jun12/12 · 21.4 mk
- Oct/Nov9/9 · 20.6 mk
What you need to know6syllabus section 7
- The program development life cycle — analysis, design, coding and testing, and what happens at each stage
- Sub-systems and decomposition (inputs, processes, outputs, storage); designing solutions with structure diagrams, flowcharts and pseudocode
- Explaining the purpose of a given algorithm; standard methods of solution — linear search, bubble sort, totalling, counting, maximum/minimum/average
- Validation checks (range, length, type, presence, format, check digit) and verification checks (visual, double entry)
- Test data (normal, abnormal, extreme, boundary); trace tables for dry runs; identifying and correcting errors in algorithms
- Writing and amending algorithms for a scenario in pseudocode, program code and flowcharts
Video lectures13ZAK's YouTube channel · play here
O LevelAS2023116 views
O LevelAS2021526 views
O LevelUrdu2021370 views
O Level2021607 views
O Level2020843 views
O Level2020731 views
Infographics3draw these the way the examiner expects · download as PNG
Flowchart symbols & the PDLC
Bubble sort & linear search
Choosing test data
Key terms11use these exact words in the exam
Dotted terms are defined in the glossary.
Code help4referenced to the Cambridge pseudocode guide
DECLARE A : ARRAY[1:6] OF INTEGERDECLARE i, Target : INTEGERDECLARE Found : BOOLEANA[1] ← 8A[2] ← 3A[3] ← 9A[4] ← 1A[5] ← 7A[6] ← 4Target ← 7Found ← FALSEi ← 1WHILE i <= 6 AND NOT Found DOIF A[i] = Target THENFound ← TRUEELSEi ← i + 1ENDIFENDWHILEIF Found THENOUTPUT "Found at position ", iELSEOUTPUT "Not found"ENDIF
DECLARE A : ARRAY[1:5] OF INTEGERDECLARE i, Temp : INTEGERDECLARE Swapped : BOOLEANA[1] ← 5A[2] ← 1A[3] ← 4A[4] ← 2A[5] ← 3REPEATSwapped ← FALSEFOR i ← 1 TO 4IF A[i] > A[i + 1] THENTemp ← A[i]A[i] ← A[i + 1]A[i + 1] ← TempSwapped ← TRUEENDIFNEXT iUNTIL NOT SwappedFOR i ← 1 TO 5OUTPUT A[i]NEXT i
💡 Open the Trace Table tab after running — this is the classic Paper 2 trace question.
DECLARE Marks : ARRAY[1:5] OF INTEGERDECLARE i, Total, Count, Max, Min : INTEGERMarks[1] ← 67Marks[2] ← 91Marks[3] ← 45Marks[4] ← 78Marks[5] ← 84Total ← 0Count ← 0Max ← Marks[1]Min ← Marks[1]FOR i ← 1 TO 5Total ← Total + Marks[i]IF Marks[i] >= 50 THENCount ← Count + 1ENDIFIF Marks[i] > Max THENMax ← Marks[i]ENDIFIF Marks[i] < Min THENMin ← Marks[i]ENDIFNEXT iOUTPUT "Total ", Total, " Passes ", Count, " Max ", Max, " Min ", Min, " Avg ", Total / 5
DECLARE Age : INTEGERREPEATOUTPUT "Enter age 5-120"INPUT AgeIF Age < 5 OR Age > 120 THENOUTPUT "Out of range, try again"ENDIFUNTIL Age >= 5 AND Age <= 120OUTPUT "Accepted ", Age
Playground examples24runnable programs for this topic
- Run
Swap two variables
The three-line swap with a temporary variable — a favourite trace-table question.
O LevelASPseudocodeBasics & data types §1.5 - Run
FOR loop & totalling
A count-controlled loop that accumulates a running total.
O LevelASPseudocodeIteration §7.1 - Run
WHILE with a sentinel — totalling & counting
Read numbers until -1; INPUT once before the loop and again at the end of the body.
O LevelASPseudocodeIteration §7.3 · 2210 WHILE … DO - Run
Maximum, minimum & average
The standard algorithm: start Highest very low and Lowest very high, then update as you go.
O LevelASPseudocodeIteration 2210 §7.1 standard methods - Run
Counting — how many passed?
Two counters updated inside a loop, then a percentage.
O LevelASPseudocodeIteration 2210 §7.1 standard methods - Run
Total, average and position of the maximum
Keep the index of the best value, not just the value, so you can say where it was.
O LevelASPseudocodeArrays §3.2 - Run
Range check
Keep asking until the value is between 0 and 100.
O LevelASPseudocodeValidation, testing & exceptions 2210 §7.3 / 9618 §6.2 - Run
Presence & length checks
Nothing entered? Too short or too long? Say which check failed.
O LevelASPseudocodeValidation, testing & exceptions 2210 §7.3 / 9618 §6.2 - Run
Type check — digits only
A function that tests every character before the string is converted to a number.
O LevelASPseudocodeValidation, testing & exceptions 2210 §7.3 / 9618 §6.2 - Run
Format check — is this an email address?
One @ that is not first, and a dot after it that is not last.
O LevelASPseudocodeValidation, testing & exceptions 2210 §7.3 / 9618 §6.2 - Run
Check digit — ISBN-13
Weights 1 and 3 alternate, total MOD 10, subtract from 10. The classic check-digit algorithm.
O LevelASPseudocodeValidation, testing & exceptions 2210 §2.3, §7.3 - Run
Verification — double entry
Validation checks the data is sensible; verification checks it was entered correctly.
O LevelASPseudocodeValidation, testing & exceptions 2210 §7.3 / 9618 §6.2 - Run
Trace table practice
A typical dry-run question. Run it, then open the Trace table tab and check it against your own table.
O LevelASPseudocodeValidation, testing & exceptions 2210 §7.4 / 9618 §12.3 - Run
Normal, boundary and abnormal test data
Drive a function with each kind of test data and check the results against what you expected.
ASPseudocodeValidation, testing & exceptions 9618 §12.3 - Run
Linear search
Check each element in turn and stop as soon as the target is found.
O LevelASPseudocodeSearching 2210 §7.1 / 9618 §9.2 - Run
Linear search — every match
Do not stop at the first hit: report every position and count them.
O LevelASPseudocodeSearching 2210 §7.1 - Run
Bubble sort
Compare neighbours and swap; after each pass the largest value has bubbled to the end.
O LevelASPseudocodeSorting 2210 §7.1 / 9618 §9.2 - Run
Sort names alphabetically
Bubble sort works on strings too: "Ali" < "Zara" compares character codes.
O LevelASPseudocodeSorting 2210 §7.1 - Run
O Level Section B — a week of temperatures
Validate seven readings into an array, then report the average and the hottest day. Everything Paper 2 Section B expects in one program.
O LevelPseudocodeExam-style tasks 2210 §7–8 - Run
O Level Section B — cinema booking
Ticket types with CASE, quantities, a running total and a group discount.
O LevelPseudocodeExam-style tasks 2210 §7–8 - Run
Totalling, counting, max, min, average
The standard loop pattern with a list — and then the built-ins sum(), max(), min(), len() that do it in one line.
O LevelASPythonIteration §7.1 ↔ Python - Run
Validation loop — range and type checks
Keep asking until the input is a whole number between 1 and 100. try/except catches the ValueError from int().
O LevelASPythonValidation, testing & exceptions §7.3 ↔ Python, A2 §20.3 - Run
Linear search
Walk the list until you find the target — the exam wants the loop, not list.index().
O LevelASPythonSearching §7 ↔ Python - Run
Bubble sort with a swapped flag
The classic Paper 2 / Paper 4 sort. Open the Trace tab to watch the swaps.
O LevelASPythonSorting §7 ↔ Python
Flowchart Studio12draw-it-yourself tasks and worked flowcharts, run and checked box by box
- Open
Area of a rectangle
Input two numbers, multiply, output — the simplest complete flowchart.
O LevelASSequence & I/O 2210 §7 - Open
Celsius to Fahrenheit
A formula in a process box; the exam's favourite two-line calculation.
O LevelSequence & I/O 2210 §7 - Open
Pass or fail
One decision, two output boxes, arrows that rejoin before Stop.
O LevelSelection 2210 §7 - Open
Largest of three numbers
Nested decisions: the chart shows why the second comparison depends on the first.
O LevelASSelection 2210 §7 - Open
Total and average of N numbers
Totalling and counting together, then a division after the loop — the classic 2210 Q.
O LevelASTotalling, counting, max / min 2210 §7 - Open
Total until −1 (rogue value)
A sentinel-controlled loop: read, test, add, read again.
O LevelASTotalling, counting, max / min 2210 §7 - Open
Highest and lowest of 10 marks
Set max low and min high, then one decision each inside the loop.
O LevelASTotalling, counting, max / min 2210 §7 - Open
Count how many passed
A counter that only increments inside a decision.
O LevelTotalling, counting, max / min 2210 §7 - Open
Range check with a rejection loop
Keep asking until the value is between 1 and 100 — the validation flowchart every paper wants.
O LevelASValidation & rejection loops 2210 §7 - Open
Presence check
A WHILE loop that rejects an empty string.
O LevelValidation & rejection loops 2210 §7 - Open
Linear search
Search an array for a value with a found flag — 2210 §7's standard method.
O LevelASArrays 2210 §7 - Open
One pass of a bubble sort
Compare neighbours and swap: the decision inside the loop with three process boxes.
O LevelASArrays 2210 §7
Test yourself
Ready to check you know it?
Every round is a fresh random draw, weak cards come back until you get them right, and past-paper questions come with their mark schemes. Marks earn XP on your dashboard.