IGCSE Computer Science · Study guide

Algorithm Design and Problem-Solving

IGCSE Computer Science · Comprehensive Guide 7

Topic 7 · Algorithm Design and Problem-Solving

Develop, represent, test, trace, correct, and explain algorithms using the exact methods required by Paper 2.

8 lesson sections · 8 worked applications · Paper 2 · Cambridge 0478 (2026–2028)

Prerequisite check

Variables, conditions, loops, tables, and step-by-step reasoning.

Exam reasoning lens

Dry-run in execution order. Precision matters: write the actual condition or correction, not a vague natural-language substitute.

Topic 7 · Section 1

Program Development Life Cycle

The defining description of analysis stage is “identifies the problem, requirements, abstraction, and decomposition needed.” Connect it with design stage, whose role is “plans the solution using decomposition, structure diagrams, flowcharts, or pseudocode.”

Required vocabulary and boundaries

IdeaPrecise roleEvidence or example
analysis stageidentifies the problem, requirements, abstraction, and decomposition neededlisting required inputs, outputs, and constraints
design stageplans the solution using decomposition, structure diagrams, flowcharts, or pseudocodedrawing the modules before coding
coding stageimplements the designed solution as program codewriting the planned selection and loops
iterative testing during codingruns and checks developing sections so errors can be found earlytesting a completed input module
testing stageuses planned test data to check whether the completed program meets requirementsrunning normal and boundary cases
life-cycle connectionuses outputs from earlier stages to guide later implementation and testingtest cases trace back to analysed requirements

Four-step exam routine

1

Identify the exact clue and name analysis stage only when its defining role fits.

2

State the mechanism or boundary: plans the solution using decomposition, structure diagrams, flowcharts, or pseudocode.

3

Apply the idea to evidence such as “writing the planned selection and loops.”

4

Reject the tempting error that waits until every possible feature is finished before any execution.

Method and reasoning

Reason Before Naming

The PDLC reduces wasted coding by checking requirements and design before implementation.

Start by underlining the clue in the scenario, then decide what job that clue is describing. This keeps the answer tied to the concept being assessed.

Answer pattern
Design comes before coding because the developer plans the algorithm, interface, and data before writing source code.
Scenario clueWhat it proves
unclear requirementsanalysis
algorithm plan neededdesign
program instructions neededcoding
errors suspectedtesting
released system changesmaintenance
Worked application

When The Scenario Is Less Obvious

The question may include a boundary case or a tempting wrong answer. Use the exact role in the scenario as evidence.

  • analysis: finding out what the program must do
  • design: planning the solution before coding
  • coding: writing the program instructions
  • testing: checking whether the program works correctly
  • maintenance: fixing or improving the program after release

A strong answer names the stage and links it to the evidence in the scenario.

TermUse in this lesson
analysisfinding out what the program must do
designplanning the solution before coding
codingwriting the program instructions
testingchecking whether the program works correctly
maintenancefixing or improving the program after release
Boundary and misconception

A Common Mix-Up

A common mistake is mixing up design and coding.

Fix: Use the action clue: gather, plan, write, test, or change after release.

MistakeCorrection
A common mistake is mixing up design and coding.Use the action clue: gather, plan, write, test, or change after release.
Topic 7 · Section 2

Abstraction and Decomposition

The defining description of abstraction is “keeps relevant details and removes information that does not affect the solution.” Connect it with decomposition, whose role is “breaks a problem or system into smaller manageable parts.”

Required vocabulary and boundaries

IdeaPrecise roleEvidence or example
abstractionkeeps relevant details and removes information that does not affect the solutionrecording journey time but not a driver's favourite colour
decompositionbreaks a problem or system into smaller manageable partsseparating login, booking, and payment subsystems
subsystem hierarchyrecognises that a system contains subsystems that can contain further subsystemspayment contains validation and receipt modules
input componentidentifies the data entering a solution or subsystema user enters a product code
process and storage componentsdescribe transformations and retained data needed by the solutioncalculate a total and store an order record
output componentidentifies the information or action produced by a solutiondisplaying a receipt total

Four-step exam routine

1

Identify the exact clue and name abstraction only when its defining role fits.

2

State the mechanism or boundary: breaks a problem or system into smaller manageable parts.

3

Apply the idea to evidence such as “payment contains validation and receipt modules.”

4

Reject the tempting error that is the result produced after processing.

Method and reasoning

Reason Before Naming

Large programming problems become easier when irrelevant detail is removed and the remaining work is split into modules.

Start by underlining the clue in the scenario, then decide what job that clue is describing. This keeps the answer tied to the concept being assessed.

Answer pattern
Decomposition breaks a booking system into smaller modules such as login, search, booking, cancellation, and reports.
Scenario clueWhat it proves
too much irrelevant detailabstraction
problem too largedecomposition
show module hierarchystructure chart
Worked application

When The Scenario Is Less Obvious

The question may include a boundary case or a tempting wrong answer. Use the exact role in the scenario as evidence.

  • abstraction: removing unnecessary detail
  • decomposition: breaking a problem into smaller sub-problems
  • module: separate part of a larger solution
  • structure chart: diagram showing a system broken into modules

A strong answer names the technique and describes the exact detail or sub-task.

TermUse in this lesson
abstractionremoving unnecessary detail
decompositionbreaking a problem into smaller sub-problems
moduleseparate part of a larger solution
structure chartdiagram showing a system broken into modules
Boundary and misconception

A Common Mix-Up

A common mistake is swapping abstraction and decomposition.

Fix: Ask: are we ignoring detail or breaking the problem into smaller tasks?

MistakeCorrection
A common mistake is swapping abstraction and decomposition.Ask: are we ignoring detail or breaking the problem into smaller tasks?
Topic 7 · Section 3

Algorithm Construction

The defining description of algorithm is “is a precise ordered set of steps that solves a problem.” Connect it with algorithm purpose, whose role is “states the overall result the algorithm is intended to achieve.”

Required vocabulary and boundaries

IdeaPrecise roleEvidence or example
algorithmis a precise ordered set of steps that solves a probleminstructions for finding a maximum value
algorithm purposestates the overall result the algorithm is intended to achievefind and output the largest mark
algorithm process descriptionexplains how inputs, decisions, repetition, and outputs produce the resultcompare each value and update Maximum
pseudocode designexpresses language-independent solution steps using the required examination conventionsIF Value > Maximum THEN
flowchart designuses standard symbols and directed flow to show algorithm stepsa decision diamond for a condition
algorithm precisionwrites exact conditions and operations that can be followed without guessingX > Y instead of 'X is greater'

Four-step exam routine

1

Identify the exact clue and name algorithm only when its defining role fits.

2

State the mechanism or boundary: states the overall result the algorithm is intended to achieve.

3

Apply the idea to evidence such as “compare each value and update Maximum.”

4

Reject the tempting error that requires a specific programming-language library.

Method and reasoning

Reason Before Naming

A small line placement error can change the whole result of an algorithm.

Start by underlining the clue in the scenario, then decide what job that clue is describing. This keeps the answer tied to the concept being assessed.

Answer pattern
A pass counter starts at 0 and increases by 1 only when the score meets the pass condition.
Scenario clueWhat it proves
before loopinitialise
inside loopprocess each value
IF conditionselection
NEXT/ENDWHILEclose loop
Worked application

When The Scenario Is Less Obvious

The question may include a boundary case or a tempting wrong answer. Use the exact role in the scenario as evidence.

  • algorithm: step-by-step solution
  • pseudocode: structured English-like algorithm notation
  • flowchart: diagram showing algorithm steps
  • counter: variable used for counting
  • accumulator: variable used for a running total

A strong answer explains why a line is needed, not just what the line says.

TermUse in this lesson
algorithmstep-by-step solution
pseudocodestructured English-like algorithm notation
flowchartdiagram showing algorithm steps
countervariable used for counting
accumulatorvariable used for a running total
Boundary and misconception

A Common Mix-Up

A common mistake is using an accumulator without initialising it.

Fix: Check initialisation, loop bounds, condition, and update position.

MistakeCorrection
A common mistake is using an accumulator without initialising it.Check initialisation, loop bounds, condition, and update position.
Topic 7 · Section 4

Sorting and Searching

The defining description of linear search is “checks items one by one until the target is found or the data ends.” Connect it with linear-search result, whose role is “records whether or where the target was found.”

Required vocabulary and boundaries

IdeaPrecise roleEvidence or example
linear searchchecks items one by one until the target is found or the data endscompare a name with each array element
linear-search resultrecords whether or where the target was foundFound becomes TRUE at the matching index
bubble sortrepeatedly compares adjacent items and swaps those in the wrong orderswap 9 and 4 when sorting ascending
bubble-sort passmoves through adjacent pairs so a large unsorted value can move toward the endone complete left-to-right set of comparisons
bubble-sort repetitioncontinues passes until no further swaps are needed or the required passes finisha Swap flag remains FALSE
method distinctionuses linear search to locate a target and bubble sort to reorder datafind a product versus arrange prices

Four-step exam routine

1

Identify the exact clue and name linear search only when its defining role fits.

2

State the mechanism or boundary: records whether or where the target was found.

3

Apply the idea to evidence such as “swap 9 and 4 when sorting ascending.”

4

Reject the tempting error that guarantees every list is sorted after one comparison.

Method and reasoning

Reason Before Naming

The algorithm choice depends on the task: locating data is different from ordering data.

Start by underlining the clue in the scenario, then decide what job that clue is describing. This keeps the answer tied to the concept being assessed.

Answer pattern
Bubble sort compares adjacent items and swaps them if they are in the wrong order.
Scenario clueWhat it proves
target valuelinear search
unsorted listlinear search still works
neighbour comparisonbubble sort
prevent data losstemporary variable
Worked application

When The Scenario Is Less Obvious

The question may include a boundary case or a tempting wrong answer. Use the exact role in the scenario as evidence.

  • linear search: checking list items one by one
  • bubble sort: sorting by repeatedly comparing adjacent items
  • swap: exchange two values
  • temporary variable: extra storage used during a swap

A strong answer names the algorithm and describes the repeated operation.

TermUse in this lesson
linear searchchecking list items one by one
bubble sortsorting by repeatedly comparing adjacent items
swapexchange two values
temporary variableextra storage used during a swap
Boundary and misconception

A Common Mix-Up

A common mistake is saying linear search requires the list to be sorted.

Fix: For searching, track checked items. For sorting, track adjacent comparisons and swaps.

MistakeCorrection
A common mistake is saying linear search requires the list to be sorted.For searching, track checked items. For sorting, track adjacent comparisons and swaps.
Topic 7 · Section 5

Validation and Verification

The defining description of input validation is “checks that input is sensible and follows defined rules.” Connect it with range check and length check, whose role is “test numeric limits or the permitted number of characters.”

Required vocabulary and boundaries

IdeaPrecise roleEvidence or example
input validationchecks that input is sensible and follows defined rulesa mark must be from 0 to 100
range check and length checktest numeric limits or the permitted number of charactersage 0–120 or an eight-character identifier
type check and presence checktest whether input has the required data type or has been suppliedan integer quantity and a non-empty surname
format check and check digittest a required pattern or a calculated digitDD/MM/YYYY or a valid product code
visual checkhas a person compare entered data with the original sourcechecking a typed address against a form
double entry checkrequires the same data to be entered twice and compares the entriestyping a new password twice

Four-step exam routine

1

Identify the exact clue and name input validation only when its defining role fits.

2

State the mechanism or boundary: test numeric limits or the permitted number of characters.

3

Apply the idea to evidence such as “an integer quantity and a non-empty surname.”

4

Reject the tempting error that guarantee the real-world value is true.

Method and reasoning

Reason Before Naming

A value can be valid but still wrong, so validation and verification can both be needed.

Start by underlining the clue in the scenario, then decide what job that clue is describing. This keeps the answer tied to the concept being assessed.

Answer pattern
Verification checks copied data against the original, for example by double entry or visual checking.
Scenario clueWhat it proves
must be 1 to 12range check
must not be emptypresence check
must match patternformat check
typed from paperverification
Worked application

When The Scenario Is Less Obvious

The question may include a boundary case or a tempting wrong answer. Use the exact role in the scenario as evidence.

  • validation: automatic check that data is sensible or allowed
  • verification: check that copied data matches the source
  • range check: checks data is within limits
  • presence check: checks data is not blank
  • double entry: entering data twice to compare copies

A strong answer says what is being checked and why that makes it validation or verification.

TermUse in this lesson
validationautomatic check that data is sensible or allowed
verificationcheck that copied data matches the source
range checkchecks data is within limits
presence checkchecks data is not blank
double entryentering data twice to compare copies
Boundary and misconception

A Common Mix-Up

A common mistake is saying validation proves data is correct.

Fix: Use validation for sensible/allowed; use verification for matching the source.

MistakeCorrection
A common mistake is saying validation proves data is correct.Use validation for sensible/allowed; use verification for matching the source.
Topic 7 · Section 6

Test Data and Trace Tables

The defining description of normal test data is “is valid, typical input within the accepted range.” Connect it with abnormal test data, whose role is “is invalid input that should be rejected.”

Required vocabulary and boundaries

IdeaPrecise roleEvidence or example
normal test datais valid, typical input within the accepted range50 for a permitted mark of 0–100
abnormal test datais invalid input that should be rejected−4 for a permitted mark of 0–100
extreme test datais the largest or smallest acceptable value0 and 100 for a mark range
boundary test dataincludes each extreme accepted value and the corresponding value just outside the boundary−1, 0, 100, and 101
trace table dry rundocuments changing values step by step during executioncolumns for Count, Total, and Maximum
trace-table outputs and promptsrecords displayed output and user prompts at the steps where they occurshowing 'Enter mark' before an INPUT

Four-step exam routine

1

Identify the exact clue and name normal test data only when its defining role fits.

2

State the mechanism or boundary: is invalid input that should be rejected.

3

Apply the idea to evidence such as “0 and 100 for a mark range.”

4

Reject the tempting error that contains only one typical middle value.

Method and reasoning

Reason Before Naming

Boundary values are important because many errors happen just inside or outside the allowed limits.

Start by underlining the clue in the scenario, then decide what job that clue is describing. This keeps the answer tied to the concept being assessed.

Answer pattern
A trace table is completed by dry-running the algorithm and recording variable values when they change.
Scenario clueWhat it proves
middle valid valuenormal
minimum/maximum validboundary
outside valid rangeabnormal
step through variablestrace table
Worked application

When The Scenario Is Less Obvious

The question may include a boundary case or a tempting wrong answer. Use the exact role in the scenario as evidence.

  • normal test data: valid data the program should accept
  • boundary test data: data at the edge of valid limits
  • abnormal test data: invalid data the program should reject
  • trace table: table recording variable values during a dry run
  • dry run: manually stepping through an algorithm

A strong answer uses the exact limits and shows the variable change clearly.

TermUse in this lesson
normal test datavalid data the program should accept
boundary test datadata at the edge of valid limits
abnormal test datainvalid data the program should reject
trace tabletable recording variable values during a dry run
dry runmanually stepping through an algorithm
Boundary and misconception

A Common Mix-Up

A common mistake is treating boundary data as always invalid.

Fix: Use the stated valid limits, and follow the algorithm line by line.

MistakeCorrection
A common mistake is treating boundary data as always invalid.Use the stated valid limits, and follow the algorithm line by line.
Topic 7 · Section 7

Totalling, Counting, and Finding Values

The defining description of totalling is “adds each required value to a running Total.” Connect it with counting, whose role is “increments a Count when an event or condition is met.”

Required vocabulary and boundaries

IdeaPrecise roleEvidence or example
totallingadds each required value to a running TotalTotal ← Total + Mark
countingincrements a Count when an event or condition is metCount ← Count + 1
maximumupdates the stored largest value when a greater item is foundIF Value > Maximum THEN
minimumupdates the stored smallest value when a lower item is foundIF Value < Minimum THEN
averagedivides the final total by the count of included valuesAverage ← Total / Count
safe initialisationsets Total and Count to zero and initialises extrema from valid dataMaximum ← Values[1]

Four-step exam routine

1

Identify the exact clue and name totalling only when its defining role fits.

2

State the mechanism or boundary: increments a Count when an event or condition is met.

3

Apply the idea to evidence such as “IF Value > Maximum THEN.”

4

Reject the tempting error that uses the greater-than comparison.

Method and reasoning

Reason Before Naming

These terms are usually assessed through short scenarios, so the mark often comes from matching the clue rather than recalling a definition alone.

Start by underlining the clue in the scenario, then decide what job that clue is describing. This keeps the answer tied to the concept being assessed.

Answer pattern
totalling is the best match when the scenario clue is 'sum marks'.
Scenario clueWhat it proves
sum markstotalling
number of passescounting
highest scoremaximum
lowest scoreminimum
Worked application

When The Scenario Is Less Obvious

The question may include a boundary case or a tempting wrong answer. Use the exact role in the scenario as evidence.

  • totalling: adding values to a running total
  • counting: increasing a counter when an event occurs
  • maximum: largest value found so far
  • minimum: smallest value found so far
  • average: total divided by count

A strong answer names the idea, quotes or paraphrases the clue, and explains the link in one sentence.

TermUse in this lesson
totallingadding values to a running total
countingincreasing a counter when an event occurs
maximumlargest value found so far
minimumsmallest value found so far
averagetotal divided by count
Boundary and misconception

A Common Mix-Up

A common mistake is stopping at a broad Totalling, Counting, and Finding Values word instead of proving the answer from the clue.

Fix: Underline the clue first, then choose the term that explains that exact clue.

MistakeCorrection
A common mistake is stopping at a broad Totalling, Counting, and Finding Values word instead of proving the answer from the clue.Underline the clue first, then choose the term that explains that exact clue.
Topic 7 · Section 8

Algorithm Errors and Corrections

The defining description of logic error is “the algorithm runs but produces an incorrect result.” Connect it with syntax error, whose role is “the written structure does not follow the required language or pseudocode form.”

Required vocabulary and boundaries

IdeaPrecise roleEvidence or example
logic errorthe algorithm runs but produces an incorrect resultusing < instead of <= at a boundary
syntax errorthe written structure does not follow the required language or pseudocode formmissing ENDIF
trace table for error findingreveals variable changes step by step during a dry runCount never increases
boundary correctionrepairs a comparison at the smallest/largest accepted or rejected valuechange Age < 18 to Age <= 18 when 18 is accepted
loop correctionrepairs the start, stop, or update so iteration terminates and covers the intended valuesadd Count ← Count + 1
precisionwrites the exact corrected pseudocode, program code, or flowchart logicX > Y rather than 'X is larger'

Four-step exam routine

1

Identify the exact clue and name logic error only when its defining role fits.

2

State the mechanism or boundary: the written structure does not follow the required language or pseudocode form.

3

Apply the idea to evidence such as “Count never increases.”

4

Reject the tempting error that changes an unrelated variable name.

Method and reasoning

Reason Before Naming

These terms are usually assessed through short scenarios, so the mark often comes from matching the clue rather than recalling a definition alone.

Start by underlining the clue in the scenario, then decide what job that clue is describing. This keeps the answer tied to the concept being assessed.

Answer pattern
fix comparison is the best match when the scenario clue is 'boundary values fail'.
Scenario clueWhat it proves
boundary values failfix comparison
counter unchangedadd update
loop never stopschange condition/update
wrong branch runscheck IF condition
Worked application

When The Scenario Is Less Obvious

The question may include a boundary case or a tempting wrong answer. Use the exact role in the scenario as evidence.

  • syntax error: mistake in the way code is written
  • logic error: algorithm runs but gives the wrong result
  • dry run: manual step-through of an algorithm
  • correction: change that fixes the algorithm

A strong answer names the idea, quotes or paraphrases the clue, and explains the link in one sentence.

TermUse in this lesson
syntax errormistake in the way code is written
logic erroralgorithm runs but gives the wrong result
dry runmanual step-through of an algorithm
correctionchange that fixes the algorithm
Boundary and misconception

A Common Mix-Up

A common mistake is stopping at a broad Algorithm Errors and Corrections word instead of proving the answer from the clue.

Fix: Underline the clue first, then choose the term that explains that exact clue.

MistakeCorrection
A common mistake is stopping at a broad Algorithm Errors and Corrections word instead of proving the answer from the clue.Underline the clue first, then choose the term that explains that exact clue.
Paper 2 response lab

Turn knowledge into marks

A high-quality response does more than recall a term. It selects the command word, states the exact role, follows the mechanism in order, and connects the effect to the scenario.

Define precisely

For analysis stage, begin with the defining role: identifies the problem, requirements, abstraction, and decomposition needed. Do not replace the definition with an example.

Describe a process

Use an ordered chain. Name what enters, what changes or is checked, and what result follows. A useful anchor here is “writing the planned selection and loops.”

Apply or justify

Quote the scenario need, select loop correction, then link its role — repairs the start, stop, or update so iteration terminates and covers the intended values — to the required outcome.

Repair a misconception

Do not accept the claim that uses an informal description instead of the corrected condition. Replace it with the exact boundary: writes the exact corrected pseudocode, program code, or flowchart logic.

Mark-by-mark response ladder

  1. Name: use the exact syllabus term.
  2. Role: define what that term does or represents.
  3. Mechanism: describe the relevant steps in their logical order.
  4. Context: explain why that mechanism matters in the stated scenario.
  5. Boundary: avoid claiming more than the method guarantees.

Last-pass checklist

Program Development Life Cycleanalysis stage — identifies the problem, requirements, abstraction, and decomposition needed.
Abstraction and Decompositionabstraction — keeps relevant details and removes information that does not affect the solution.
Algorithm Constructionalgorithm — is a precise ordered set of steps that solves a problem.
Sorting and Searchinglinear search — checks items one by one until the target is found or the data ends.
Validation and Verificationinput validation — checks that input is sensible and follows defined rules.
Test Data and Trace Tablesnormal test data — is valid, typical input within the accepted range.
Totalling, Counting, and Finding Valuestotalling — adds each required value to a running Total.
Algorithm Errors and Correctionslogic error — the algorithm runs but produces an incorrect result.

Mapped to Cambridge IGCSE Computer Science 0478 · 2026–2028 syllabus, version 5