Cambridge IGCSE GCSE Computer Science

Cambridge: Algorithm design and problem solving — Cambridge IGCSE GCSE Computer Science revision

Free revision notes, key terms, common exam traps and 5 practice questions with answers. About 8 minutes to read.

Designing algorithms

  • Problems are solved through decomposition (breaking into sub-problems), abstraction (removing unnecessary detail) and pattern recognition, then expressed as structure diagrams, flowcharts or pseudocode.
  • Cambridge pseudocode uses constructs such as INPUT, OUTPUT, IF...THEN...ELSE...ENDIF, CASE OF...OTHERWISE...ENDCASE, FOR...NEXT, WHILE...ENDWHILE and REPEAT...UNTIL.
  • Flowchart symbols: oval terminator, parallelogram input/output, rectangle process, diamond decision, arrows for flow.

Testing and validation

  • Trace tables record variable values line by line, revealing logic errors and the final output; examiners frequently ask for a completed trace table.
  • Test data types: normal (typical accepted values), abnormal/erroneous (should be rejected), extreme (largest and smallest accepted) and boundary (values either side of the limit).
  • Validation checks data is reasonable (range, type, length, presence, format, check digit); verification checks it has been entered accurately (double entry, visual check).

Key terms

Decomposition
Breaking a problem into smaller sub-problems.
Abstraction
Removing unnecessary detail to focus on essentials.
Pseudocode
Structured English-like description of an algorithm.
Trace table
Table recording variable values as an algorithm executes.
Validation
Automatic check that data is sensible and allowable.
Verification
Check that data has been entered accurately.

Common exam traps

  • Confusing validation (is it sensible?) with verification (was it typed correctly?).
  • Using binary search on unsorted data — the list must be sorted first.
  • Forgetting to include the final values or outputs in a trace table.

Practice questions with answers

  1. 1. Decomposition means:

    • • Removing detail
    • • Breaking a problem into smaller parts
    • • Sorting a list
    • • Testing data

    Answer: Breaking a problem into smaller parts

    Each sub-problem is easier to solve.

  2. 2. Which flowchart symbol represents a decision?

    • • Oval
    • • Rectangle
    • • Diamond
    • • Parallelogram

    Answer: Diamond

    Decisions have two or more outgoing paths.

  3. 3. Write pseudocode to output the larger of two inputs A and B.

    Answer: IF A > B THEN OUTPUT A ELSE OUTPUT B ENDIF

    Selection compares then outputs.

  4. 4. A REPEAT...UNTIL loop always:

    • • Runs zero or more times
    • • Runs at least once
    • • Runs exactly ten times
    • • Never runs

    Answer: Runs at least once

    The condition is tested after the body.

  5. 5. What is a trace table used for?

    Answer: Recording variable values at each step to check the logic and find errors

    It shows how the algorithm behaves.

Keep going in the app

This topic has 47 questions in total, plus flashcards, cram mode and Grade 9 Push challenges.

More free Computer Science revision

ReviseRush is an independent educational revision aid. It is not affiliated with, endorsed by or connected to AQA, Edexcel, OCR, WJEC, Pearson or any exam board. All notes and questions are original. Always check content against your official course and specification. No grade outcome is guaranteed.