Every question since 2022 — with full worked answers

AQA GCSE Computer Science Paper 1Computational thinking and programming skills — every question, answered

AQA GCSE Computer Science (8525) was first examined in June 2022, since the 2020-taught cohort's original 2021 sitting was disrupted by the pandemic, so June 2022 is genuinely the first ever live sitting of this specification, not an artefact of our own search. We analysed every Paper 1 sitting we could obtain the real question paper and mark scheme for: June 2022 and June 2023 (the June 2024 and June 2025 papers exist but are not yet public on AQA's own filestore, which keeps live series behind a login wall for roughly two years after the exam). Paper 1 is entirely about computational thinking and programming: tracing algorithms represented in AQA pseudo-code or Python, writing and completing Python programs, spotting and fixing logic and syntax errors, and explaining core programming concepts. It does not test binary, hex, logic gates, networks or databases, those are all on Paper 2. Below is what each recurring question type has asked across the two sittings we have, with a complete worked answer written to the mark scheme for each one, every paragraph explained.

AQA 852590 marks, 90 marks in both real sittings we have full papers for (June 2022 and June 2023). This paper is not tiered: every AQA 8525 candidate sits the same Paper 1, whichever of the three language options (8525/1A C#, 8525/1B Python or 8525/1C VB.NET) their centre has entered them for. We analysed Option 1B, the Python paper, since it is the most widely taught option, but the mark scheme is shared across all three options and every non-code mark (tracing, design marks, explaining) applies identically whichever language you sit.2 hours in both sittings we have full papers for. No calculator is allowed, and there are no additional materials required.2 sittings analysed

Questions © AQA, quoted for analysis. Pseudo-code and program code described in our own words, not reproduced verbatim. Mark scheme content translated into plain English, not copied. PrepWise is independent and not endorsed by AQA.

Q10.1, Q12.1 (Jun22) / Q10.1, Q12.1 (Jun23)4 marksAO2 (apply)

Both sittings we have full papers for include at least two separate trace table questions, always worth 4 to 6 marks each, and always the single most heavily tested skill on this paper.

This appears at least twice in both June 2022 and June 2023, on a different algorithm each time: a REPEAT UNTIL subroutine and a bubble sort style array swap in June 2022, then a nested nested-loop indexing bug and a binary search in June 2023.

Every Q10.1, Q12.1 (Jun22) / Q10.1, Q12.1 (Jun23) asked — find yours4 questions · 4 full worked answers
1×asked

Complete the trace table for the subroutine call calculate(50)

What it’s really asking

Trace a subroutine that repeatedly halves a number using integer (DIV) division, counting how many halvings it takes to bring the number down to 1 or less.

What the sources actually showed — June 2022
Figure 9

A subroutine called calculate, taking one parameter n, represented in pseudo-code. It sets a to n and b to 0, then repeats a block that integer-divides a by 2 (using the DIV operator, so remainders are discarded) and adds 1 to b, continuing this REPEAT UNTIL a is less than or equal to 1, then outputs b.

The real data and numbers, recreated in our own layout — never the exam board's own artwork or photos.
The full worked answer — June 2022
Written to: 4/4, point marked

Starting values: n is 50, so a is set to 50 and b is set to 0. Because this is a REPEAT UNTIL loop, the body runs at least once before the condition a is less than or equal to 1 is ever checked.

Why this scoresThis states the correct starting row (a = 50, b = 0) before any halving happens, which is the first mark point, and confirms the REPEAT UNTIL structure executes its body before testing the exit condition.

Each pass integer-divides a by 2 and adds 1 to b: 50 DIV 2 is 25 with b now 1, 25 DIV 2 is 12 with b now 2, 12 DIV 2 is 6 with b now 3, 6 DIV 2 is 3 with b now 4, and 3 DIV 2 is 1 with b now 5. Once a reaches 1 the UNTIL a is less than or equal to 1 condition is true, so the loop stops and OUTPUT b produces 5.

Why this scoresThis walks every single DIV pass in order (50, 25, 12, 6, 3, 1) with the matching b value on each row, which is the minimum-of-six-values method mark, and correctly identifies that the loop stops as soon as a first drops to 1, giving the honest final output of 5 rather than continuing past it.

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise trace table questions
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • The correct starting values of a and b, a column tracking integer division by 2 down to 1 with no other values, a minimum of six b values incrementing by one, and the final output being the last value of b and nothing else
Evidence to deploy — 2 factsScreenshot this
  1. DIV is integer division: the remainder is thrown away, so 50 DIV 2 is 25 and 3 DIV 2 is 1, never a decimal
  2. A REPEAT UNTIL loop always runs its body at least once, since the condition is only checked at the end
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Checking the UNTIL condition before running the loop body once, which is how a WHILE loop works, not a REPEAT UNTIL loop
  • Writing a seventh row after a already equals 1, continuing the halving past the point where the loop should have stopped

Full-mark self-check 0 of 4

1×asked

Complete the trace table for the algorithm shown in Figure 13

What it’s really asking

Trace a nested FOR loop over a three-element array that compares each pair of neighbouring elements and swaps them if they are in the wrong order, ending with the array sorted alphabetically.

What the sources actually showed — June 2022
Figure 13

An algorithm in pseudo-code that starts with a three-element array arr holding the characters 'c', 'b' and 'a' at indices 0, 1 and 2. A nested FOR loop (an outer loop for i from 0 to 1, an inner loop for j from 0 to 1) compares arr[j + 1] with arr[j], and if arr[j + 1] is alphabetically before arr[j] it swaps them using a temp variable.

The real data and numbers, recreated in our own layout — never the exam board's own artwork or photos.
The full worked answer — June 2022
Written to: 6/6, point marked

The array starts as arr[0] = c, arr[1] = b, arr[2] = a, with i and j both starting at 0 on the first pass. On the first comparison (i = 0, j = 0) arr[1] (b) is alphabetically before arr[0] (c), so a swap happens: temp is set to c, arr[0] becomes b, and arr[1] becomes c, giving b, c, a.

Why this scoresThis states the correct starting array plus the first i and j values at 0, which is the first method mark, and correctly identifies that the first swap fires because b comes before c alphabetically, tracing temp taking the outgoing value of arr[0].

On the next comparison (i = 0, j = 1) arr[2] (a) is alphabetically before arr[1] (c), so another swap happens: temp is set to c, arr[1] becomes a, and arr[2] becomes c, giving b, a, c. On the final comparison (i = 1, j = 0) arr[1] (a) is alphabetically before arr[0] (b), so a third swap happens: temp is set to b, arr[0] becomes a, and arr[1] becomes b, giving the final sorted array a, b, c. The last comparison (i = 1, j = 1) checks c against b and finds no swap is needed.

Why this scoresThis traces the remaining two real swaps in the correct order (b,c,a to b,a,c to a,b,c) with the matching i, j and temp values on each row, which covers the remaining method marks, and correctly ends the trace on the final sorted array rather than stopping one comparison early.

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise trace table questions
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • Correct i and j columns starting at 0, a correct temp column tracking each swapped-out value, and the three real swaps applied to the arr columns in the right order, ending on the fully sorted array
Evidence to deploy — 2 factsScreenshot this
  1. This is a bubble sort: it compares neighbouring pairs and swaps them if they are out of order, and repeating passes bubbles the smallest value towards the front
  2. A swap using a temp variable always follows the same three steps: store the outgoing value, overwrite it with the incoming value, then write the stored value into the other slot
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Swapping arr[j] and arr[j + 1] without using temp correctly, which overwrites one value before it has been saved, losing data
  • Using an index that goes out of range: the earlier attempt at this same algorithm used FOR i 0 TO 2 instead of 0 TO 1, which tries to access arr[3], an index that does not exist in a three-element array

Full-mark self-check 0 of 4

1×asked

Complete the trace table for the algorithm shown in Figure 9

June 2023Tracing a nested FOR loop with an indexing bug Full worked answer inside

What it’s really asking

Trace a nested loop over two arrays (names and scores) that is meant to display all three test scores for each of three students, but has a bug in the inner loop's bounds, and trace exactly what it actually outputs, bug and all.

What the sources actually showed — June 2023
Figure 9

An algorithm in pseudo-code with two arrays: names holding three student names, and scores holding nine test scores (three per student, in the same order as names). An outer FOR loop (i from 0 to 2) selects each student in turn, and an inner FOR loop (j from 0 to 1) is meant to display that student's scores, indexing into scores using the expression i times 3 plus j, and incrementing a counter each pass.

The real data and numbers, recreated in our own layout — never the exam board's own artwork or photos.
The full worked answer — June 2023
Written to: 5/5, point marked

On the first student (i = 0, person = Natalie), the inner loop runs for j = 0 and j = 1: result is scores[0 times 3 plus 0] which is scores[0], 78, then scores[0 times 3 plus 1] which is scores[1], 81, with count showing 0 then 1 on each pass, since count is displayed before it increments.

Why this scoresThis correctly derives the indexing formula i times 3 plus j for the first student, producing scores[0] and scores[1] (78 and 81), which is the correct method for the count and i columns plus the first Natalie row.

The same pattern repeats for Alex (i = 1): result is scores[1 times 3 plus 0], scores[3], 27, then scores[1 times 3 plus 1], scores[4], 51, with count showing 2 then 3. Then for Roshana (i = 2): result is scores[2 times 3 plus 0], scores[6], 52, then scores[2 times 3 plus 1], scores[7], 55, with count showing 4 then 5, and a final row showing count on its own reaching 6 once both loops finish. Because the inner loop only ever runs for j = 0 and j = 1, never j = 2, each student's third score (72, 54 and 59) is never traced or output at all, even though the array scores clearly contains it.

Why this scoresThis correctly derives the remaining index values for Alex and Roshana (27, 51, 52, 55) and, critically, states the actual bug honestly rather than inventing a third score that the algorithm never actually reaches, since the inner FOR loop's real bound (0 TO 1) only ever produces two passes per student.

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise trace table questions
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • A correct count column and i column, plus the correct person, j and result values for all three students, tracing the bug faithfully rather than the intended, correct behaviour
Evidence to deploy — 2 factsScreenshot this
  1. The indexing formula i times 3 plus j correctly locates the start of each student's three-score block inside a flat, one-dimensional scores array
  2. This trace proves the real bug: the inner loop's bound (0 TO 1, two passes) does not match the data (three scores per student), so a correct fix changes line 7 to FOR j 0 TO 2
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Inventing a third row per student showing the missing score, which the algorithm as printed never actually produces
  • Losing track of count and continuing to increment it after the loop has actually finished

Full-mark self-check 0 of 3

1×asked

Complete the trace table for the program in Figure 11 if the user input is wolf

June 2023Tracing a binary search Full worked answer inside

What it’s really asking

Trace a binary search on an eight-item, alphabetically sorted list, showing how the start, finish and mid pointers move on each pass until the target word is found.

What the sources actually showed — June 2023
Figure 11

A Python program implementing a binary search over an eight-item, alphabetically sorted list of animal names (cat, dog, hippo, llama, ox, rat, tiger, wolf, at indices 0 to 7). It repeatedly halves the search range using a mid index calculated as (start plus finish) integer-divided by 2, moving start up if the target is alphabetically after the midpoint animal, or finish down if it is before, until the target is found or the range is exhausted.

The real data and numbers, recreated in our own layout — never the exam board's own artwork or photos.
The full worked answer — June 2023
Written to: 4/4, point marked

The search starts with start = 0 and finish = 7, giving mid = (0 + 7) // 2 = 3, which is llama. Since wolf is alphabetically after llama, start moves to mid + 1, which is 4, and finish stays at 7 throughout the whole trace since the target is never before the midpoint.

Why this scoresThis correctly derives the first mid value (3, llama) from the given start and finish, and correctly identifies that finish never changes because wolf is always alphabetically later than every midpoint tested, which is the method behind the finish column.

The next mid is (4 + 7) // 2 = 5, rat, and since wolf is after rat, start moves to 6. The next mid is (6 + 7) // 2 = 6, tiger, and since wolf is after tiger, start moves to 7. The final mid is (7 + 7) // 2 = 7, which is wolf itself, so validAnimal becomes True and the loop condition (validAnimal == False) is no longer met, ending the search on this pass.

Why this scoresThis correctly derives the remaining two mid values (5 and 6) and the final mid value (7, where the target is actually found), and correctly states that validAnimal only becomes True on this final row, which is the discriminator between a correct binary search trace and one that stops the loop a step too early or late.

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise trace table questions
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • Correct animalToFind and validAnimal columns (False on every row except the last), a correct finish column staying at 7 throughout, and a correct mid column of 3, 5, 6, 7 derived from the correct start values
Evidence to deploy — 2 factsScreenshot this
  1. A binary search only works on data that is already sorted, since it relies on being able to discard half the remaining range on every comparison
  2. The mid formula (start plus finish) integer-divided by 2 always rounds down in Python's // operator
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Moving finish instead of start (or vice versa) when the comparison direction is the wrong way round
  • Stopping the trace one row early, before validAnimal actually becomes True on the row where mid finally lands on wolf

Full-mark self-check 0 of 3

The method for every Q10.1, Q12.1 (Jun22) / Q10.1, Q12.1 (Jun23) — same every sittingMark bands, steps, timing

What this question type rewards

The topic changes by sitting — the mark scheme never does. Learn this once, then open your question above for that sitting’s sources and a full worked answer.

  • Working through the algorithm exactly one line at a time, in the order the computer would actually execute it, never skipping ahead
  • Writing down every intermediate value, not just the final one, since method marks are awarded for correct intermediate rows
  • Matching the exact number of loop passes the real bounds produce, neither stopping early nor adding an extra pass

The steps

  1. Set up one column per variable named in the table header, in the order given
  2. Work through the algorithm one instruction at a time, updating only the variable that instruction actually changes
  3. Add a new row every time you pass back through the top of a loop, even if a value has not changed since the last row
  4. Copy forward any variable that keeps the same value on a row rather than leaving the cell blank, unless the mark scheme's example table leaves it blank
  5. Check your final row matches what the algorithm would actually OUTPUT or RETURN before moving on
About 1 to 1.5 minutes per mark, so 4 to 9 minutes depending on the tariff. Trace slowly rather than trying to do it in your head, a single skipped line invalidates every row after it.
Try one now — from our question bank

What is the main purpose of a trace table?

Trace tables are the single most tested skill on this paper, worth at least 8 to 10 marks across two separate questions in every sitting we have. Practise tracing REPEAT UNTIL loops, nested FOR loops and binary searches until you can do it without skipping a row.

Practise trace table questions

Q07, Q08 (Jun22) / Q07 (Jun23)6 marksAO3 (design), AO3 (program)

Both sittings we have full papers for ask you to write a complete Python program using selection to apply a real-world set of rules, worth 5 to 7 marks. June 2022 asked for this twice (an email checker and a bonus calculator); June 2023 asked once (a theme park discount calculator).

This appears at least once in every sitting we have full papers for, always split into design marks (for the right technique, even with imperfect syntax) and logic marks (for the actual outputs being correct).

Every Q07, Q08 (Jun22) / Q07 (Jun23) asked — find yours3 questions · 3 full worked answers
1×asked

Write a Python program to check if an email address has been entered correctly by a user

What it’s really asking

Write a program that asks for the same piece of data twice, compares the two entries with a single IF/ELSE, and outputs a different message depending on whether they match.

The full worked answer — June 2022
Written to: 5/5, point marked (2 design marks, 3 logic marks)

email1 = input("Enter email address: ") email2 = input("Enter email address again: ") if email1 == email2: print("Match") print(email1) else: print("Do not match")

Why this scoresThis uses two clearly named variables to store the two separate inputs, which earns the meaningful-variable-names design mark, and uses a single IF/ELSE comparing them directly for equality, which earns the selection-construct design mark and the correct-input-storage logic mark.

The Match branch outputs both the word Match and the actual email address, exactly as the question demands, while the Do not match branch outputs only the message, with the two outcomes kept in logically separate places (the IF branch and the ELSE branch) rather than both being printed unconditionally.

Why this scoresThis puts Match plus the email address in the IF branch and Do not match alone in the ELSE branch, which is the mark scheme's requirement that the two messages sit in logically separate places, and is what a program that just prints both messages every time would fail to earn.

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise selection programming questions
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • Meaningful variable names for both email inputs, a correct selection construct comparing them for equality, and the two outcome messages output in logically separate branches, with the matched email address included on a match
Evidence to deploy — 2 factsScreenshot this
  1. email1 == email2 is a Boolean comparison that returns True only if every character in both strings matches exactly
  2. Testing for equality (==) rather than inequality (!=) is an equally valid design choice, as long as the messages end up in the matching branches
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Printing both Match and Do not match unconditionally, outside the IF/ELSE, which loses the logic marks even if the comparison itself is correct
  • Forgetting to output the email address itself on a successful match, which the question explicitly asks for

Full-mark self-check 0 of 4

1×asked

Write a Python program that calculates the value of a bonus payment for an employee based on how many items they have sold and the number of years they have been employed

What it’s really asking

Write a program with a three-way outcome (two different bonus formulas plus a zero-bonus case) driven by two inputs and a rule that combines two conditions with AND logic for one of the three outcomes.

The full worked answer — June 2022
Written to: 7/7, point marked (3 design marks, 4 logic marks)

items = int(input("Enter number of items sold: ")) years = int(input("Enter years employed: ")) if years <= 2 and items > 100: print(items * 2) elif years > 2: print(items * 10) else: print(0)

Why this scoresThis uses meaningful variable names for both inputs and combines the two-part first condition (years of employment of 2 or fewer AND more than 100 items sold) with a single AND, which earns the nested-condition design mark and the correct Boolean-expression logic mark, since the question's first rule genuinely needs both parts true at once.

The three outcomes (double the items sold, ten times the items sold, or zero) sit in three logically separate branches (the IF, the ELIF and the ELSE), covering every combination the question describes: a low-tenure high-seller, anyone over 2 years employed regardless of sales, and everyone else who falls through to zero.

Why this scoresThis checks that all three of the question's stated outcomes are reachable and mutually exclusive, which is the correct-output-per-branch logic mark, and specifically confirms that a low-tenure employee who has NOT sold over 100 items correctly falls through to the zero branch rather than being missed.

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise selection programming questions
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • Meaningful variable names for both inputs, a nested or combined selection construct correctly combining the years and items conditions with AND, and all three bonus outcomes output in logically separate branches
Evidence to deploy — 2 factsScreenshot this
  1. years <= 2 and items > 100 is a compound Boolean expression: both parts must independently evaluate to True for the whole expression to be True
  2. An ELIF chain (years <= 2 and items > 100, then years > 2, then a final ELSE) is functionally identical to true nested IFs for this specific rule set, and the mark scheme credits either approach
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Testing only years > 2 without checking items sold at all in the first branch, which misses the AND condition the mark scheme specifically credits
  • Leaving no ELSE branch at all, meaning employees who meet neither rule get no output rather than the required 0

Full-mark self-check 0 of 3

1×asked

Write a Python program to calculate the total charge for a group of people visiting the theme park

What it’s really asking

Write a program that multiplies a per-person price by a group size, then conditionally subtracts a fixed discount if the group is large enough, using the exact boundary the question states (six or more, meaning >= 6).

The full worked answer — June 2023
Written to: 6/6, point marked (2 design marks, 4 logic marks)

group = int(input("Enter number of people: ")) total = group * 15 if group >= 6: total = total - 5 print(total)

Why this scoresThis stores the group size in a clearly named variable and correctly multiplies it by the fixed 15 pound charge before applying any discount, which earns the input-and-storage design mark and the correct-multiplication logic mark.

The discount condition uses group >= 6, matching the question's exact wording of 'six or more people', not group > 6 which would wrongly exclude a group of exactly six, and the discount is applied by subtracting a flat 5 from the running total rather than recalculating the per-person price, before the final total is output once, in one place.

Why this scoresThis uses the boundary-correct condition (>= 6, not > 6) that the mark scheme specifically distinguishes, applies the discount as a single flat subtraction as the question requires, and outputs the final total in one logical place, which together earn the remaining Boolean-condition, discount-method and output-location logic marks.

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise selection programming questions
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • Correct input storage and multiplication by 15, an accurate boundary condition using six or more (>= 6, not > 6), a correct flat 5 pound discount applied only when that condition is met, and the final total output in a logical place
Evidence to deploy — 2 factsScreenshot this
  1. 'Six or more' always translates to >= 6 in code, since a group of exactly six people must still qualify for the discount
  2. Subtracting a flat 5 from the running total achieves the same result as reducing the per-person rate, and the mark scheme accepts either correct method
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Writing group > 6 instead of group >= 6, which is the single most common way this exact question type loses a mark
  • Printing the total both before and after the discount check, rather than once, after the discount has already been correctly applied

Full-mark self-check 0 of 4

The method for every Q07, Q08 (Jun22) / Q07 (Jun23) — same every sittingMark bands, steps, timing

What this question type rewards

The topic changes by sitting — the mark scheme never does. Learn this once, then open your question above for that sitting’s sources and a full worked answer.

  • Getting the actual inputs and outputs right, since design marks are given for choosing the right technique even before the code fully works
  • Using a Boolean condition that covers every case the question states, including boundary wording like 'six or more' meaning >= 6, not > 6
  • Outputting each different result in a logically separate branch of the selection structure, not all bundled into one branch

The steps

  1. List every distinct input the question needs and store each one in a clearly named variable
  2. Identify every distinct rule as its own condition, checking the exact wording for boundary words like 'more than', 'at least', 'greater than or equal to'
  3. Write the selection structure (IF, ELIF, ELSE) so each rule's output happens in its own branch
  4. Reread the question's bullet points against your finished code line by line to check nothing was missed
  5. Do not worry about perfect Python syntax under exam pressure, since design marks are awarded for the right technique even if the syntax is not 100% correct, as long as the logic flow is unaffected
About 1.2 to 1.5 minutes per mark, so 6 to 10 minutes depending on the tariff.
Try one now — from our question bank

Which programming construct is used to make a decision based on a condition?

Writing a short selection-based program from a real-world rule set comes up at least once every sitting, worth 5 to 7 marks. Practise translating exact wording like 'six or more' into the correct boundary condition every time.

Practise selection programming questions

Q13.1 (Jun22) / Q13 (Jun23)5 marksAO3 (design), AO3 (program)

Both sittings we have full papers for ask you to write an indefinite iteration loop that keeps re-prompting the user until their input meets a stated rule, worth 4 to 6 marks.

This appears once in both June 2022 (a card position between 1 and 100) and June 2023 (a two-character grid reference with a valid letter and a valid digit), always building on a starting line of code the question already gives you.

Every Q13.1 (Jun22) / Q13 (Jun23) asked — find yours2 questions · 2 full worked answers
1×asked

Extend the program in Figure 14. The program should keep getting the user to enter the card position until they enter a card position that is between 1 and 100 inclusive

June 2022Writing a validation loop against a numeric range Full worked answer inside

What it’s really asking

Wrap a given input line in a loop that keeps re-asking for a number until it falls strictly between 1 and 100 inclusive, correctly handling both boundary values.

What the sources actually showed — June 2022
Figure 14

One line of Python already given: position = int(input("Enter card position: ")), which the answer must extend into a full validation loop.

The real data and numbers, recreated in our own layout — never the exam board's own artwork or photos.
The full worked answer — June 2022
Written to: 4/4, point marked (2 design marks, 2 logic marks)

position = int(input("Enter card position: ")) while position < 1 or position > 100: position = int(input("Enter card position: "))

Why this scoresThis uses an indefinite WHILE loop, which is the correct structure since the number of invalid attempts a user might make is unknown in advance, and repeats the exact input line inside the loop body, which is the idea-of-inputting-within-iteration design mark.

The condition checks both bounds explicitly, position < 1 for values too low and position > 100 for values too high, joined with OR so the loop keeps running if either invalid case is true, meaning 1 and 100 themselves are correctly treated as valid and the loop exits as soon as either is entered.

Why this scoresThis checks both the lower and upper bound in a single correct Boolean expression, which is exactly the two-condition logic mark the mark scheme requires, and specifically confirms that 100 itself passes as valid, since the condition is position > 100 rather than position >= 100.

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise input validation questions
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • The idea of inputting a number inside an indefinite iteration structure, plus a Boolean condition that correctly checks both the lower and the upper bound of the valid range
Evidence to deploy — 2 factsScreenshot this
  1. position < 1 or position > 100 correctly treats both 1 and 100 as valid, since the loop only continues when a value is strictly outside that range
  2. A single combined condition using OR is functionally equivalent to two separate WHILE conditions and is accepted equally by the mark scheme
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Using position <= 1 or position >= 100, which would wrongly reject the two valid boundary values 1 and 100 themselves
  • Checking the condition with an IF instead of a WHILE, which only re-prompts once rather than looping until the input is genuinely valid

Full-mark self-check 0 of 3

1×asked

Extend the program from Figure 15 so it completes the other checks needed to make sure a valid grid reference is entered

What it’s really asking

Extend a given two-character-length check into a full validator that also confirms the first character is A, B or C and the second is 1, 2 or 3, re-prompting with a message until every rule passes.

What the sources actually showed — June 2023
Figure 15

Python code already given that repeatedly asks for a grid reference until it is exactly two characters long, converting it to uppercase each time. The answer must extend this to also check the individual characters are valid, using the variable check to control an outer loop.

The real data and numbers, recreated in our own layout — never the exam board's own artwork or photos.
The full worked answer — June 2023
Written to: 6/6, point marked (2 design marks, 4 logic marks)

check = False while check == False: square = "" while len(square) != 2: square = input("Enter grid reference (eg C2): ") square = square.upper() letter = square[0] number = square[1] if letter in "ABC" and number in "123": check = True else: print("Not valid, try again.")

Why this scoresThis keeps the given length-checking inner loop unchanged, then extracts the first and second characters into their own variables, which is the extract-the-characters logic mark, using the check variable to control the outer loop exactly as the question requires.

The condition combines both character rules with AND: letter must be A, B or C, and number must be 1, 2 or 3, using Python's 'in' membership test against each allowed set, so check only becomes True once both individual characters are genuinely valid, and an appropriate re-prompt message is output in the else branch whenever either check fails.

Why this scoresThis has all the appropriate correct Boolean conditions for both the letter and the number, joined so both must pass, and sets check appropriately in every case, which is exactly the mark scheme's requirement, and it outputs the failure message in a logically appropriate location, only when the checks have genuinely failed.

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise input validation questions
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • Correct use of the check variable to control the outer loop, an appropriate technique to extract the two individual characters, a correct Boolean condition covering both the letter and the number rule, and an appropriate re-prompt message in a logically correct place
Evidence to deploy — 2 factsScreenshot this
  1. square[0] and square[1] extract the first and second characters of a two-character string using zero-based indexing
  2. letter in "ABC" is equivalent to writing (letter == "A" or letter == "B" or letter == "C"), just shorter, and the mark scheme accepts either form
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Checking only the length again and forgetting to add the letter and digit checks at all, which was the entire point of extending the given code
  • Setting check to True as soon as the length is 2, before the letter and digit rules have actually been tested

Full-mark self-check 0 of 4

The method for every Q13.1 (Jun22) / Q13 (Jun23) — same every sittingMark bands, steps, timing

What this question type rewards

The topic changes by sitting — the mark scheme never does. Learn this once, then open your question above for that sitting’s sources and a full worked answer.

  • Using an indefinite iteration structure (WHILE, or REPEAT/DO WHILE) rather than a fixed-count loop, since the number of invalid attempts is not known in advance
  • Writing the Boolean condition so it covers every invalid case, both the too-low and too-high (or too-short and too-long) ends
  • Placing the input statement inside the loop body, so the user is re-prompted every time, not just checked once

The steps

  1. Identify exactly what counts as valid, including both boundary values (is 100 itself valid, or only up to 99?)
  2. Write a WHILE loop whose condition is true only while the input is currently INVALID
  3. Put the input statement (and any related processing) inside the loop body so it repeats
  4. Combine multiple validation rules with AND/OR exactly as the question's bullet points describe them
  5. Check your loop's condition against both boundary values by hand before moving on
About 1 to 1.2 minutes per mark, so 4 to 7 minutes depending on the tariff.
Try one now — from our question bank

A program asks the user to enter a score between 1 and 10. Which validation check should be used to ensure the number is within this range?

Extending a given line of code into a full validation loop comes up in every sitting we have, worth 4 to 6 marks. Practise getting both boundary values exactly right, since that is where marks are most often lost.

Practise input validation questions

Q14.2 (Jun22) / Q16 (Jun23)9 marksAO3 (design), AO3 (program)

Both sittings we have full papers for close the paper with the single biggest program-writing task, worth 8 marks in June 2022 (a bingo-ticket counting subroutine) and 11 marks in June 2023 (a full dice game simulation).

This is always the final or near-final question on the paper and always the highest single tariff of any one question, appearing once every sitting we have full papers for.

Every Q14.2 (Jun22) / Q16 (Jun23) asked — find yours2 questions · 2 full worked answers
1×asked

Write a subroutine in Python called checkWinner that will count the number of asterisks

What it’s really asking

Write a subroutine that takes a 3 by 3 array as a parameter, counts every asterisk it contains using your own count logic rather than a built-in function, and outputs either the word Bingo (if all nine cells are marked) or the running count otherwise.

What the sources actually showed — June 2022
Figures 15 to 17

A 3 by 3 array called ticket, initially holding randomly generated key terms in every cell, which gets individual cells replaced with an asterisk as a player answers questions correctly. The subroutine checkWinner must take this array as a parameter, count how many cells now hold an asterisk (without using any built-in counting function), and output Bingo if the count is nine or the count itself otherwise.

The real data and numbers, recreated in our own layout — never the exam board's own artwork or photos.
The full worked answer — June 2022
Written to: 8/8, point marked (4 design marks, 4 logic marks)

def checkWinner(ticket): count = 0 for i in range(3): for j in range(3): if ticket[i][j] == "*": count = count + 1 if count == 9: print("Bingo") else: print(count)

Why this scoresThis defines checkWinner taking the entire ticket array as its parameter, initialises a counter to 0, and uses nested iteration (a FOR loop for each row, a FOR loop for each column) to attempt to access every one of the nine elements, which together earn all four design marks (defining the subroutine, passing the array, using iteration, and using selection for the output).

The counter is initialised to 0 before the loop and incremented by exactly 1 every time a cell genuinely equals the asterisk character, using a Boolean equality test rather than any built-in count method, and the correct indices i and j are used to access every array element exactly once, before the final IF/ELSE outputs Bingo only on nine asterisks or the running count otherwise, in one final logically separate place.

Why this scoresThis confirms the counter starts at 0 and increments in the correct place, that the indices genuinely reach all nine elements with no gaps or repeats, that the equality test against "*" is the correct Boolean condition, and that the two possible outputs sit in logically separate IF/ELSE branches, which together are the remaining four logic marks.

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise the biggest program-writing question
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • Defining the subroutine correctly with the array passed as a parameter, using nested iteration or an equivalent to reach every one of the nine elements, a counter correctly initialised and incremented on a genuine asterisk match, and Bingo or the count output in logically separate places
Evidence to deploy — 2 factsScreenshot this
  1. A 3 by 3 two-dimensional array needs two indices, ticket[i][j], to reach any single cell, and nested FOR loops are the standard way to visit every cell exactly once
  2. The question explicitly bans a built-in count function, so the counter must be your own variable, incremented manually inside the loop
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Using Python's own list.count("*") method, which the question explicitly forbids, even though it would produce the right number
  • Forgetting the count == 9 check entirely and just printing count every time, which never actually outputs the word Bingo

Full-mark self-check 0 of 4

1×asked

Write a Python program to simulate this game

What it’s really asking

Simulate a dice game where two random dice are rolled and added to a running score each turn, the player chooses whether to roll again while under 21, and the final result (win, lose, or a random tiebreak roll if under 21) is worked out and reported.

What the sources actually showed — June 2023
Figure 17

A sample run of the finished program: on each turn it rolls two dice, adds them to a running score, outputs both rolls and the new score, and if the score is still under 21 asks the player whether to roll again. The example ends when a roll pushes the score to 22, over the limit of 21, and the program reports that the player lost.

The real data and numbers, recreated in our own layout — never the exam board's own artwork or photos.
The full worked answer — June 2023
Written to: 11/11, point marked (4 design marks, 7 logic marks)

import random score = 0 rollAgain = "yes" while rollAgain == "yes": dice1 = random.randrange(1, 7) dice2 = random.randrange(1, 7) score = score + dice1 + dice2 print("Roll 1: ", dice1) print("Roll 2: ", dice2) print("Current score: ", score) if score < 21: rollAgain = input("Would you like to roll again? ") else: rollAgain = "no"

Why this scoresThis generates two random numbers correctly between 1 and 6 inclusive using random.randrange(1, 7), adds both to the running score cumulatively, and uses a WHILE loop controlled by rollAgain that only asks the player to roll again while the score is genuinely still under 21, otherwise ending the loop automatically, which together earn the random-generation, iteration, output-placement and loop-termination marks.

if score > 21: print("You lost!") elif score == 21: print("You won!") else: tiebreak = random.randrange(15, 22) if tiebreak > score: print("You lost!") else: print("You won!")

Why this scoresThis correctly separates the three real end states (over 21 is a loss, exactly 21 is a win, and under 21 needs the random tiebreak) into their own branches, and generates the tiebreak number correctly between 15 and 21 inclusive using randrange(15, 22), comparing it against the player's actual final score, which earns the win/loss selection mark and the tiebreak generation and comparison mark.

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise the biggest program-writing question
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • Two correctly generated random dice values added cumulatively to the score, a loop that correctly asks to roll again only while under 21 and terminates automatically at 21 or over, and a final selection structure covering all three end states, including a correctly ranged random tiebreak roll compared against the final score
Evidence to deploy — 2 factsScreenshot this
  1. Python's random.randrange(a, b) generates a random integer starting at a but finishing one before b, so randrange(1, 7) correctly simulates a six-sided die and randrange(15, 22) correctly covers 15 to 21 inclusive
  2. The three end states (over 21, exactly 21, under 21) are mutually exclusive, so an IF/ELIF/ELSE chain is the correct structure, never three separate IFs
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Writing random.randrange(1, 6), which only ever generates 1 to 5, since randrange's second argument is exclusive, missing 6 entirely
  • Generating the tiebreak roll before checking whether the score is actually under 21, wasting a random call and risking comparing it against the wrong branch

Full-mark self-check 0 of 4

The method for every Q14.2 (Jun22) / Q16 (Jun23) — same every sittingMark bands, steps, timing

What this question type rewards

The topic changes by sitting — the mark scheme never does. Learn this once, then open your question above for that sitting’s sources and a full worked answer.

  • Breaking the task into its named design elements first (a loop, a selection structure, the right data access) before worrying about exact syntax
  • Getting the iteration and selection structures nested or sequenced in the order the question's own bullet points describe
  • Handling every distinct end state or outcome the question lists, not just the most obvious one

The steps

  1. Reread the question's bullet points as a checklist and count how many distinct outcomes or states the finished program must handle
  2. Sketch the overall shape first: what needs to happen once, what needs to repeat, and what needs to branch
  3. Build the iteration structure first, since everything else usually nests inside it
  4. Add the selection logic for each distinct outcome, in its own clearly separate branch
  5. Reread your program against the sample output or worked example the question gives, if there is one, line by line
  6. Do not panic about perfect syntax, since AO3 design marks are awarded for choosing the right technique even where the exact syntax is imperfect
About 1 minute per mark, so roughly 9 to 12 minutes. This is usually the last question on the paper, so budget time for it earlier rather than rushing it at the very end.
Try one now — from our question bank

Which type of loop is best used when you know exactly how many times the loop should repeat?

The single biggest program-writing question on the paper is worth 8 to 11 marks every sitting we have. Practise breaking a long, multi-part specification into its design elements (loop, selection, data access) before writing a single line of code.

Practise the biggest program-writing question

Q05.2 (Jun22) / Q12.4 (Jun23)2 marksAO2 (apply), AO3 (refine)

Both sittings we have full papers for include at least one question where you must find and fix a real logic error in given code, worth 2 to 3 marks.

This appears once in both June 2022 (a wrong index used inside a loop) and June 2023 (a shadowed parameter and a backwards, out-of-range loop), always testing whether you can trace the actual bug, not just spot that something looks odd.

Every Q05.2 (Jun22) / Q12.4 (Jun23) asked — find yours2 questions · 2 full worked answers
1×asked

The program shown in Figure 6 also contains a logic error. Identify the line number that contains the logic error, and correct this line of the program

June 2022Finding and fixing a wrong array index inside a loop Full worked answer inside

What it’s really asking

Trace a loop that generates and should print ten random numbers, and spot that it is actually printing the wrong array element every time, using the loop counter as the index instead of the random number itself, which will also crash once the counter exceeds the array's length.

What the sources actually showed — June 2022
Figure 6

A Python program intended to output 10 numbers, each randomly selected from an 8 element list called numbers, using random.randrange(0, 8) to generate a random index into that list inside a while loop controlled by a count variable.

The real data and numbers, recreated in our own layout — never the exam board's own artwork or photos.
The full worked answer — June 2022
Written to: 2/2, point marked

The logic error is on line 7. The line reads print(numbers[count]), but count is the loop counter running from 1 up to 10, not the random index the program just generated on the previous line, so the program is printing whichever list element happens to sit at position count rather than a genuinely random one.

Why this scoresThis correctly identifies line 7 as the error, not the earlier lines where the random index is generated, since the bug is specifically in which variable gets used to index the array on the print statement, which is the line-number mark.

The corrected line should read print(numbers[number]), using the variable the program actually generated the random index into on the line above, rather than the counter. This also fixes a second, related problem: because count eventually reaches values above 7, the buggy version would eventually try to access an index that does not exist in the 8 element list and crash.

Why this scoresThis gives a complete, correctly indexed corrected line using the actual random-index variable (number), which is the corrected-line mark, and additionally explains why the bug is worse than just wrong output, since it would ultimately cause an out-of-range crash once count exceeds the list's highest valid index.

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise debugging questions
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • Correctly identifying line 7 as the location of the logic error, and a fully corrected line reading print(numbers[number]), using the random index rather than the loop counter
Evidence to deploy — 2 factsScreenshot this
  1. count and number are two genuinely different variables in this program: count tracks how many times the loop has run, number holds the freshly generated random index
  2. An 8 element list has valid indices 0 to 7 only, so any index of 8 or above will cause an IndexError in a real Python interpreter
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Blaming the random.randrange(0, 8) line itself, which is actually correct, rather than the print statement that ignores its result
  • Correcting the output to print(number) alone, without the array indexing at all, which would print the random index rather than the list value at that index

Full-mark self-check 0 of 3

1×asked

Rewrite line 1 and line 6 from Figure 13 to make the algorithm work as intended

What it’s really asking

Fix two separate bugs in a subroutine meant to display currency names in reverse alphabetical order: a subroutine parameter that is never actually used inside the subroutine, and a FOR loop whose direction and bounds are both wrong.

What the sources actually showed — June 2023
Figure 13

A subroutine diffCurrencies declared with a parameter called currencies, but the subroutine body immediately reassigns currencies to a fresh 8 item list and then returns currencies[x], referencing a variable x that was never actually passed in or defined. The calling code then loops with FOR i, 8 TO 0 STEP 1, intending to display the list in reverse.

The real data and numbers, recreated in our own layout — never the exam board's own artwork or photos.
The full worked answer — June 2023
Written to: 3/3, point marked, one mark for each of the two corrected lines plus a bonus mark for a second genuinely distinct fix within line 6

Line 1 should be rewritten as SUBROUTINE diffCurrencies(x), renaming the parameter to x so that it actually matches the variable used inside the subroutine on the RETURN line, since the original version declared a parameter called currencies that the RETURN statement never actually reads from.

Why this scoresThis correctly identifies that the subroutine's own body already reassigns and uses the name currencies internally, so the parameter that the caller passes in (the loop counter i) needs to arrive under the name the RETURN statement actually indexes with, x, which is exactly the fix the mark scheme credits.

Line 6 should be rewritten as FOR i FROM 7 TO 0 STEP -1, starting at index 7 (the last valid index in an 8 item list, not 8, which is out of range) and stepping backwards by 1 rather than forwards, since the loop needs to count down to produce reverse alphabetical order, starting with yen at the end of the list, ending at baht.

Why this scoresThis fixes both real faults in the same line at once: the starting bound (7, the highest valid index in an 8 item list, not the out-of-range 8) and the step direction (-1, counting down, not the original +1, which would never even start since 8 is already greater than the end value of 0).

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise debugging questions
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • A corrected line 1 that renames the parameter to x so it matches the RETURN statement's own indexing variable, and a corrected line 6 that starts at index 7, not 8, and steps backwards using STEP -1
Evidence to deploy — 2 factsScreenshot this
  1. An 8 item list has valid indices 0 to 7, so a loop bound of 8 is already one past the end of the list before any stepping direction is even considered
  2. STEP 1 (or an implicit forward step) can only count upward, so a FOR loop written as 8 TO 0 STEP 1 never actually executes at all, since 8 is already past the end condition of 0
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Fixing only the loop bounds on line 6 (changing 8 to 7) while leaving the direction as STEP 1, which still never executes since 7 is still greater than 0 with a forward step
  • Renaming the parameter on line 1 to something other than x, which would still not match what the RETURN statement on line 3 is actually indexing with

Full-mark self-check 0 of 3

The method for every Q05.2 (Jun22) / Q12.4 (Jun23) — same every sittingMark bands, steps, timing

What this question type rewards

The topic changes by sitting — the mark scheme never does. Learn this once, then open your question above for that sitting’s sources and a full worked answer.

  • Pinning down the exact line number the bug is on, not a vague 'somewhere in the loop'
  • Writing a corrected line that is actually valid code or pseudo-code, not just a description of what should happen
  • Checking your fix against a concrete example by hand before committing to it

The steps

  1. Trace the code by hand with a simple example, the same way you would for a trace table
  2. Compare what the code actually does against what the question says it should do, and note exactly where they diverge
  3. Identify the specific line number where that divergence originates, which is often earlier than where the wrong output appears
  4. Write out a full corrected line, in the same language or pseudo-code style as the original
  5. Re-trace your fixed version by hand to confirm it now produces the intended result
About 1 to 1.5 minutes per mark, so 2 to 4.5 minutes depending on the tariff.
Try one now — from our question bank

A program accepts scores between 0 and 100. Which value is an example of erroneous test data?

Finding and fixing a real bug comes up in every sitting we have. Practise tracing the buggy version by hand first, the exact same skill as a trace table question, before writing your corrected line.

Practise debugging questions

Q11.1 (Jun22) / Q06 (Jun23)5 marksAO3 (design)

Both sittings we have full papers for include a fill-the-gaps pseudo-code question, using a given word bank of possible items, worth 4 to 6 marks.

This appears once in both June 2022 (completing a sound file size calculation subroutine) and June 2023 (completing a login authentication routine), always giving you more items in the bank than gaps, so guessing by elimination alone is not reliable.

Every Q11.1 (Jun22) / Q06 (Jun23) asked — find yours2 questions · 2 full worked answers
1×asked

Complete Figure 12 by filling in the gaps using the items in Figure 11

What it’s really asking

Complete a subroutine that multiplies sample rate, sample resolution and duration to get a file size in bits, then divides by 8 to convert to bytes, choosing the correct parameter names, the correct arithmetic, and the correct RETURN and call syntax from the given word bank.

What the sources actually showed — June 2022
Figures 11 and 12

A partly complete subroutine getSize with two blanked parameter names plus a seconds parameter already given, a blanked line calculating a size value, a blanked conversion of that value from bits to bytes, and a blanked RETURN statement, followed by a blanked OUTPUT call passing the values 100, 16 and 60. Figure 11 gives a bank of possible items including sampRate, res, byte, bit, size / 8, size MOD 8, size * 8, RETURN, OUTPUT, SUBROUTINE, USERINPUT and getSize, with more items than gaps.

The real data and numbers, recreated in our own layout — never the exam board's own artwork or photos.
The full worked answer — June 2022
Written to: 6/6, point marked, one mark per correct item in the correct location

The two parameter gaps should be filled with sampRate and res, matching the two parameter names the rest of the subroutine's body already uses (sampRate * res * seconds), since the seconds parameter was already given and the multiplication line already references these two exact names.

Why this scoresThis chooses sampRate and res over near-identical distractors like rate and bit in the word bank specifically because those are the exact names the given multiplication line already refers to, which is the correct-parameter-names method.

The size in bits is converted to bytes using size / 8, dividing (not using MOD, which would give a remainder, or multiplying by 8, which would go the wrong direction), and the subroutine ends with RETURN size, passing the byte value back to the caller. The final call is OUTPUT getSize(100, 16, 60), matching the question's own stated inputs of a 100 times per second sample rate, 16 bit resolution and 60 seconds.

Why this scoresThis correctly picks size / 8 over the size MOD 8 and size * 8 distractors, since bits are converted to bytes by dividing by 8, not any other operation, and correctly identifies RETURN as the keyword that sends the calculated size back out of the subroutine, then OUTPUT getSize(...) as the call that actually triggers the calculation with the exact figures the question specifies.

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise pseudo-code completion questions
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • sampRate and res as the two parameter names, size / 8 as the bits-to-bytes conversion, RETURN size as the return statement, and OUTPUT getSize(100, 16, 60) as the final call, each in the correct gap
Evidence to deploy — 2 factsScreenshot this
  1. The formula given in the question (sampling rate times sample resolution times seconds) produces a value in bits, and dividing by 8 is the standard bits-to-bytes conversion
  2. A subroutine's RETURN statement sends a value back to wherever it was called from, which is different from OUTPUT, which displays a value directly
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Choosing size MOD 8 instead of size / 8, mixing up the remainder operator with the division operator
  • Filling the parameter gaps with rate and byte instead of sampRate and res, ignoring that the rest of the given code already fixes those exact two names

Full-mark self-check 0 of 4

1×asked

State the items from Figure 6 that should be written in place of the labels in the algorithm in Figure 5

June 2023Completing a login authentication routine Full worked answer inside

What it’s really asking

Complete a login algorithm's four blanked gaps: how a username is actually captured from the user, how it is passed into a subroutine that looks up its stored password, what an empty string result from that lookup means, and what message to show when it happens.

What the sources actually showed — June 2023
Figures 5 and 6

A login algorithm with four blanked gaps inside a REPEAT UNTIL structure: one gap where the username is actually captured from the user, one gap where the username is passed as an argument into a getPassword subroutine, one gap comparing the subroutine's returned storedPassword value against a specific value, and one gap giving the message shown when that comparison is true. Figure 6 gives a bank of possible items including USERINPUT, username, an empty string, the word True, the word SUBROUTINE, and messages like User not found and Wrong password, with more items than gaps.

The real data and numbers, recreated in our own layout — never the exam board's own artwork or photos.
The full worked answer — June 2023
Written to: 4/4, point marked, one mark per correct item in the correct location

The first gap, where the username is actually captured, should be filled with USERINPUT, since that is the item in the word bank whose role is capturing what the user types, and it directly matches the WHILE loop's own condition, which keeps re-asking until username is no longer an empty string.

Why this scoresThis correctly picks USERINPUT rather than a distractor like username itself, since the gap's job is capturing a fresh value FROM the user, which is exactly what USERINPUT represents in AQA's pseudo-code, matching the surrounding WHILE username = '' loop that is clearly waiting for real input.

The second gap, where getPassword is called, should be filled with username, passing the just-captured username into the subroutine as its argument, since the subroutine's whole job is looking up the stored password for that specific user. The third gap should be filled with an empty string, since the algorithm's own text explains the subroutine returns an empty string specifically when the username does not exist, and the fourth gap should be filled with the message User not found, which is the only item in the bank that correctly describes that exact situation, rather than Wrong password, which describes a different failure (a correct username but an incorrect password).

Why this scoresThis correctly threads username through as the subroutine's argument, matches the empty-string return value to the exact rule the question's own explanatory text gives for a non-existent username, and distinguishes User not found from the deliberately similar distractor Wrong password, which belongs to a different branch of the same algorithm (an existing username with an incorrect password).

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise pseudo-code completion questions
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • USERINPUT as the username capture, username as the argument passed into getPassword, an empty string as the comparison value for storedPassword, and the message User not found for that specific case
Evidence to deploy — 2 factsScreenshot this
  1. The question's own explanatory text states outright that getPassword returns an empty string specifically when the username does not exist, which is the direct evidence for the third and fourth gaps
  2. User not found and Wrong password are deliberately similar distractors testing whether you can tell apart a username lookup failure from a password mismatch failure
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Filling the message gap with Wrong password instead of User not found, mixing up the two different failure cases the algorithm actually distinguishes between
  • Passing password instead of username into getPassword, when the subroutine's whole purpose is looking a password up FROM a username, not the other way round

Full-mark self-check 0 of 4

The method for every Q11.1 (Jun22) / Q06 (Jun23) — same every sittingMark bands, steps, timing

What this question type rewards

The topic changes by sitting — the mark scheme never does. Learn this once, then open your question above for that sitting’s sources and a full worked answer.

  • Reading the whole algorithm first to understand its overall purpose before filling in any individual gap
  • Checking each candidate item's data type and role (a variable name, a value, a keyword) matches what the gap's position actually needs
  • Using process of elimination carefully, since the item list always contains more options than gaps, including deliberately similar-looking distractors

The steps

  1. Read the whole algorithm once, ignoring the gaps, to understand what it is meant to do overall
  2. For each gap, identify exactly what kind of item belongs there: a parameter name, a returned value, a specific string, a keyword like SUBROUTINE
  3. Cross-reference against any given inputs or worked example in the question, since one wrong answer often produces an output you can check against
  4. Watch for near-identical distractors in the word bank, such as a value with and without a unit conversion, or a variable name that is almost, but not quite, right
  5. Reread the completed algorithm as a whole to confirm it would actually work correctly
About 1 to 1.2 minutes per mark, so 4 to 7 minutes depending on the tariff.
Try one now — from our question bank

Which flowchart symbol is used to represent a decision?

A fill-the-gaps pseudo-code question comes up in every sitting we have, worth 4 to 6 marks. Practise reading the whole algorithm first, since most of the gaps only make sense once you understand what the finished algorithm is meant to do.

Practise pseudo-code completion questions

Q11.3 (Jun22) / Q08 (Jun23)3 marksAO1 (understanding)

Both sittings we have full papers for include at least one short, prose-only question asking you to explain how a concept works or why it is useful, worth 3 to 4 marks, the closest this paper gets to a written-answer question.

This appears once in both June 2022 (state three advantages of using subroutines) and June 2023 (explain how the merge sort algorithm works), on a different named concept each time but always rewarding named, specific points rather than a vague general description.

Every Q11.3 (Jun22) / Q08 (Jun23) asked — find yours2 questions · 2 full worked answers
1×asked

State three advantages of using subroutines

What it’s really asking

Name three genuinely separate benefits of using subroutines (procedures and functions) rather than one long uninterrupted program, without repeating the same underlying idea in different words.

The full worked answer — June 2022
Written to: 3/3, point marked

1. Subroutines can be developed and tested in isolation, independently of the rest of the program, which makes it easier to discover and fix errors, since a bug can be narrowed down to one specific, self-contained block of code rather than the whole program at once.

Why this scoresThis states a specific, mechanism-based advantage (isolated development and testing makes errors easier to find), which is one of the mark scheme's named points, rather than a vague 'subroutines are good for testing' with no explanation of why.

2. Subroutines make program code easier to read and understand, since related logic is grouped together under one meaningful name rather than scattered across a long, flat sequence of instructions. 3. Subroutines make it easier for a team of programmers to work together on a large project, since different people can write and test separate subroutines at the same time without constantly interfering with each other's code.

Why this scoresThis gives two further, genuinely distinct points (readability through grouping, and enabling parallel teamwork) rather than restating the first point about isolated testing in different words, which is exactly the trap a weaker answer falls into.

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise explaining programming concepts
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • Up to three marks from a list of genuinely distinct named advantages: isolated development, easier error discovery, easier reading and understanding, easier teamwork on large projects, and easier code reuse
Evidence to deploy — 2 factsScreenshot this
  1. Subroutines can be developed and tested independently of the rest of a program
  2. Subroutines make it possible for multiple programmers to work on different parts of a large project at the same time
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Writing 'subroutines make code shorter' and 'subroutines reduce the number of lines' as if they were two separate points, when they are really the same underlying idea about code reuse said twice
  • Naming three advantages with no explanation of why each one is actually true, which the mark scheme treats as under-developed

Full-mark self-check 0 of 3

1×asked

Explain how the merge sort algorithm works

June 2023Explaining the merge sort algorithm Full worked answer inside

What it’s really asking

Explain the two distinct phases of merge sort: repeatedly splitting a list down into single-item sub-lists, then merging those sub-lists back together in the correct order until one fully sorted list remains.

What the sources actually showed — June 2023
Figure 7

A diagram showing a merge sort being carried out on a list, illustrating the list being split into progressively smaller sub-lists and then merged back together in sorted order.

The real data and numbers, recreated in our own layout — never the exam board's own artwork or photos.
The full worked answer — June 2023
Written to: 4/4, point marked

Merge sort first repeatedly splits the list in half, at its midpoint, continuing to split each half again and again until every sub-list contains only a single item. A single-item list is always already considered sorted, since there is nothing left to compare it against.

Why this scoresThis correctly explains the splitting phase as repeated halving down to single-item sub-lists, which is the first named point the mark scheme rewards, rather than skipping straight to the merging phase.

The algorithm then merges these single-item sub-lists back together in pairs, comparing the items in each pair and placing the smaller (or alphabetically earlier) one first, repeating this merge-and-compare process on progressively larger sub-lists until a single, fully sorted list remains.

Why this scoresThis correctly explains the second, distinct phase (merging sub-lists back together by comparing pairs of items) and states the end condition (one final sorted list), which are the remaining named points, giving a complete two-phase explanation rather than only describing the split.

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise explaining programming concepts
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • Up to four marks for correctly explaining both phases: the list being repeatedly divided in half until every sub-list has one item, and those sub-lists then being merged back together by comparing pairs of items until one sorted list is produced
Evidence to deploy — 2 factsScreenshot this
  1. A single-item list is always trivially sorted, which is why the splitting phase stops there
  2. Merging works by comparing the front item of each sub-list being merged and taking the smaller one first, repeating until both sub-lists are exhausted
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Describing only the splitting phase, or only the merging phase, rather than both distinct phases the mark scheme separately credits
  • Describing bubble sort's neighbour-swapping method instead, confusing it with merge sort's split-then-merge method

Full-mark self-check 0 of 3

The method for every Q11.3 (Jun22) / Q08 (Jun23) — same every sittingMark bands, steps, timing

What this question type rewards

The topic changes by sitting — the mark scheme never does. Learn this once, then open your question above for that sitting’s sources and a full worked answer.

  • Writing genuinely distinct points, not the same idea restated in different words
  • Being specific about mechanism, not just naming a benefit without saying why it happens
  • Matching the number of points you write to the number of marks available, since each mark usually needs its own distinct point

The steps

  1. Count the marks available and aim for that many genuinely separate points
  2. For each point, state the specific mechanism (what actually happens), not just a one-word label
  3. Read back through your points and check none of them are really the same idea said twice
  4. If the question gives you a specific example or figure, use its own detail explicitly rather than writing a fully generic answer
About 1 to 1.3 minutes per mark, so 3 to 5 minutes depending on the tariff.
Try one now — from our question bank

Which design strategy does merge sort use?

A short, prose-only explanation question comes up in every sitting we have, worth 3 to 4 marks. Practise writing genuinely distinct points rather than the same idea reworded twice.

Practise explaining programming concepts

Q04.1+Q04.2 (Jun22) / Q12.3 (Jun23)2 marksAO2 (apply)

Both sittings we have full papers for include a short question asking you to reason about a given algorithm's efficiency or suitability, rather than write new code, worth 1 to 3 marks.

This appears once in both June 2022 (comparing the efficiency of two different working programs that produce the same result) and June 2023 (explaining why a binary search cannot be used on a specific, unsorted list), always testing understanding of why an algorithm behaves the way it does, not whether you can trace it.

Every Q04.1+Q04.2 (Jun22) / Q12.3 (Jun23) asked — find yours2 questions · 2 full worked answers
1×asked

Shade one lozenge to indicate which of the statements is true about the programs in Figure 5, and justify your answer

What it’s really asking

Decide which of two working programs, that both correctly add up the integers from 1 to a user-entered number, is more efficient: one that loops once per number, or one that calculates the same total directly using a formula, and explain why.

What the sources actually showed — June 2022
Figure 5

Two Python programs that both output the sum of every integer from 1 up to a number the user enters. Program A uses a FOR loop that runs once for every number in the range, adding each one to a running total. Program B calculates the same total directly in one step, using the arithmetic equivalent of Gauss's summation formula (multiplying the number by one more than itself, then halving the result), with no loop at all.

The real data and numbers, recreated in our own layout — never the exam board's own artwork or photos.
The full worked answer — June 2022
Written to: 3/3, point marked (fusing Q04.1 and Q04.2, one real visible question, 1 mark plus 2 marks), Program B is more efficient

Program B is more efficient than Program A. Program A uses a FOR loop that executes once for every single number between 1 and the user's input, so if the user enters 1000, the loop body runs 1000 separate times to build up the total.

Why this scoresThis correctly identifies Program B as more efficient (the mark scheme's stated answer) and begins the justification by describing exactly how Program A's cost grows, that its loop runs once per number in the range, which is the concrete mechanism the second mark needs rather than a bare assertion.

Program B instead calculates the same total in a fixed, constant number of steps, using a formula, regardless of how large the user's number is: entering 1000 takes exactly the same small number of calculations as entering 10. This means the number of calculations performed stays constant in Program B, but increases as the input number gets bigger in Program A, so Program B will take less time to execute, especially for large inputs.

Why this scoresThis explicitly contrasts the two programs' behaviour as the input grows (constant for B, growing for A), which is the specific comparative reasoning the mark scheme credits over a vague 'B just is faster', and concludes with the concrete consequence, less execution time, particularly for large inputs.

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise algorithm reasoning questions
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • Correctly identifying Program B as more efficient, then justifying it either by noting fewer lines of code will actually be executed, or that the number of calculations performed is constant in Program B but grows with the input in Program A
Evidence to deploy — 2 factsScreenshot this
  1. Program A's FOR loop executes once per integer in the range, so its cost grows directly with the size of the input number
  2. Program B calculates the total in one fixed formula step, so its cost does not depend on the size of the input number at all
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Choosing Program A as more efficient because it 'shows the working', which confuses readability with actual computational efficiency
  • Justifying the answer with 'Program B is shorter to type', which is about the code's length, not about how many operations the computer actually performs when it runs

Full-mark self-check 0 of 3

1×asked

State why a binary search cannot be used on the list fruits

What it’s really asking

Recognise that a binary search relies on the data already being in order, and that the specific list given in the question is not sorted, so the technique cannot be applied to it as it stands.

What the sources actually showed — June 2023
Figure 12

A line of Python code creating a list called fruits containing six fruit names in the order banana, apple, orange, pear, grape, pineapple, which is not in alphabetical order.

The real data and numbers, recreated in our own layout — never the exam board's own artwork or photos.
The full worked answer — June 2023
Written to: 1/1, point marked

The list fruits is not ordered or sorted: its items (banana, apple, orange, pear, grape, pineapple) are not arranged alphabetically, so a binary search cannot be used on it as it stands.

Why this scoresThis directly states the precondition a binary search actually depends on, that the data is already sorted, and confirms this specific list genuinely fails that precondition by naming its actual, unsorted order, which is exactly what the single mark rewards.

Could you have written this? Every fact in this answer is drilled in our quizzes — the writing is the easy part once the evidence is automatic.

Practise algorithm reasoning questions
Worked answer · PrepWise · prepwise.ukOur own writing — aimed at the real mark scheme, never copied

What the mark scheme rewarded

  • Stating that the list or array fruits is not ordered or sorted
Evidence to deploy — 2 factsScreenshot this
  1. A binary search only works correctly on already-sorted data, since every comparison relies on being able to safely discard the half of the list that cannot contain the target
  2. fruits, as given, is in the order banana, apple, orange, pear, grape, pineapple, which is not alphabetical
PrepWise · prepwise.ukDrill these facts in the app

Traps examiners saw

  • Answering 'because it is too slow' or a similar efficiency-based reason, when the real issue is that the algorithm's precondition (sorted data) is not met at all, not that it would technically work but slowly
  • Answering in general terms ('binary search needs sorted data') without confirming that this specific given list is actually unsorted

Full-mark self-check 0 of 2

The method for every Q04.1+Q04.2 (Jun22) / Q12.3 (Jun23) — same every sittingMark bands, steps, timing

What this question type rewards

The topic changes by sitting — the mark scheme never does. Learn this once, then open your question above for that sitting’s sources and a full worked answer.

  • Identifying the actual mechanism that makes one approach more or less efficient or suitable, not just asserting which one is better
  • Linking your reasoning to something concrete in the given code or data, such as how many times a loop actually runs, or whether a specific list is genuinely sorted
  • Being precise about what changes as the input size grows, when the question is about efficiency specifically

The steps

  1. Work out exactly what each given approach actually does, step by step if needed
  2. For an efficiency question, count how the number of operations changes as the input gets bigger for each approach
  3. For a suitability question, check the given data against the algorithm's actual precondition, such as whether a list is sorted
  4. State your reasoning in terms of the specific code or data given, not as a generic rule with no reference to the question
About 1 to 1.5 minutes per mark, so 1.5 to 4.5 minutes depending on the tariff.
Try one now — from our question bank

Which of the following is a requirement before binary search can be used?

Reasoning about an algorithm's efficiency or suitability, without writing any code, comes up in every sitting we have. Practise linking your reasoning to the specific code or data given, not a generic rule with nothing to anchor it.

Practise algorithm reasoning questions
Across the sittings we analysed

What is guaranteed to come up, and what genuinely varies

Across the two sittings we have full papers for, Paper 1's overall structure and total marks (90) never changed, and the exact same handful of question archetypes appears in both papers, though the specific algorithm or programming task tested within each archetype is different every time.

0

Not seen on Paper 1 in the two sittings we have full papers for

Binary, hexadecimal or denary number conversion · Logic gates or Boolean logic truth tables · Computer systems topics such as the fetch-decode-execute cycle, CPU architecture or memory · Networking, protocols or network topologies · Cyber security, databases or SQL

These topics are genuinely part of the AQA 8525 specification, but they belong to Paper 2 (Computing concepts), not Paper 1, and did not appear as a standalone question on either Paper 1 sitting we analysed, so do not build your Paper 1 revision plan around them.

Common questions

Before you revise

Does Paper 1 have the same structure every year?

Yes, in both sittings we have full papers for. Every sitting totalled 90 marks in 2 hours, with no calculator allowed, and both papers were entirely focused on computational thinking, tracing algorithms, and writing, completing or debugging Python programs. Always check your own paper's front cover to confirm, since AQA can make real changes in any future series, and remember this is an untiered exam, so every candidate sits the same paper regardless of ability, choosing only which language option (C#, Python or VB.NET) matches what they were taught.

Do I have to answer in Python, or can I use pseudo-code for the coding questions?

If you are entered for Option 1B, every question that requires a coded solution must be answered in Python specifically, as both papers state explicitly in their instructions. Pseudo-code is used by AQA in the question papers themselves to describe algorithms in a language-neutral way for tracing and completion questions, but when a question actually asks you to write a program, it must be genuine, working Python syntax. Entering candidates for Options 1A or 1C answer the same questions in C# or VB.NET instead, using the exact same mark scheme.

How are the program-writing questions actually marked, if my code has a small mistake?

Every program-writing question in both mark schemes we reviewed splits marks into two types: design marks, for choosing the right technique (the right kind of loop, the right selection structure) even if your exact syntax is not perfect, and program logic marks, for the actual outputs being correct. Both mark schemes explicitly state that minor syntax errors should not be penalised as long as the logic flow of the program is unaffected, and that case (capital versus lowercase letters in your own code) is ignored entirely. However, most of these questions cap the marks available at a lower maximum, usually one or two below full marks, if there are genuine errors anywhere in the code, so a program that is mostly right but has one real, functional bug will not earn full marks even though small syntax slips alone would not be punished.

What is the single biggest way marks are lost on this paper?

According to the real mark schemes for these two sittings, marks are very often lost on trace table questions by skipping a row, especially the very first row (the starting values before any loop has run) or the final row (the actual OUTPUT value), rather than any genuine misunderstanding of the algorithm itself. On the program-writing questions, the single most repeated cause of lost marks across both sittings was getting a boundary condition slightly wrong, such as using > instead of >= when a question says 'six or more' or 'between 1 and 100 inclusive', which silently excludes a value that should have been accepted.

Why doesn't this page cover binary, logic gates or networks?

Because neither real Paper 1 we analysed tested any of those topics. AQA GCSE Computer Science splits its two exams by skill, not by even coverage of every specification point: Paper 1 (Computational thinking and programming skills) is entirely about algorithms, tracing and writing programs, while data representation (binary, hexadecimal, images and sound), computer systems, networks, cyber security and databases are tested on Paper 2 (Computing concepts) instead. If you are looking for those topics, they belong on our Paper 2 page, not this one.

Practise the questions that are guaranteed to come up

Every question type on this page has practice questions waiting in the app, built the way AQA actually structures Paper 1.

Start revising free
Computer Science Paper 1: every question, answeredStart free