GCSE Computer Science: Algorithms and Programming

The programming paper is the one students most often lose marks on for reasons that have nothing to do with understanding. A loop runs one time more or one time fewer than expected, an index is read from one instead of zero, a remainder is reported as a quotient, an input arrives as text and is multiplied as if it were a number. Every wrong option in this set is the result of one of those specific slips, and each explanation names the slip rather than simply restating the right answer.

Three of the ten questions are code traces — a counting FOR loop, a WHILE loop that stops on a condition, and a function whose result depends on which branch of an IF is taken — and each fragment is written out in full, so nothing depends on a page you cannot see. Around them sit searching and sorting, data types and casting, integer division and modulus, indexing a two-dimensional array, choosing boundary test data, and the reason a model leaves detail out.

Pseudocode here is deliberately board-neutral: assignment with an equals sign, IF ... THEN ... ELSE ... ENDIF, FOR ... NEXT, WHILE ... ENDWHILE, OUTPUT. Each exam board publishes its own reference language or pseudocode guide and its own specification, and that wording is their copyright — nothing here is copied from any of them. Check which style your board uses before the exam; the reasoning you practise is the same in all of them.

Zestly is an independent study tool. It is not affiliated with any exam board and it is not an exam centre.

  • Trace a short pseudocode fragment containing a FOR loop, a WHILE loop or a function call and state its output exactly
  • Say what a binary search requires of a list, and give the state of a list after one pass of a bubble sort
  • Use integer division and the modulus operator correctly, and recognise when input must be cast before arithmetic
  • Index a two-dimensional array correctly when indexing starts at zero
  • Choose boundary test data that checks each limit from both sides
  • Explain what abstraction removes from a model and why a problem is broken into subprograms

A bubble sort works through a list from left to right, comparing each adjacent pair and swapping them when the left value is the larger. Starting from the list 5, 3, 8, 1, 9, what is the list after ONE complete pass? — one of ten questions written for this set, alongside three pseudocode traces, casting, array indexing and boundary test data.

Sample question

Which of the following statements accurately describes a key requirement for using a binary search algorithm on a list of data?

See the answer

The list must be sorted in ascending or descending order.

Binary search works by repeatedly dividing the search interval in half. This logic only functions if the data is already ordered, allowing the algorithm to discard half the remaining items at each step.

Try this quiz →Try this exam →Try this written work →

← Computer Science

↑ GCSE