AQA GCSE Computer Science past paper questions, worked and runnable
AQA GCSE Computer Science (8525) Paper 1 past paper questions: trace tables, programs to write, algorithms to complete and fix. Each one is worked through step by step and can be run in your browser, with the lesson that teaches it.
Paper 1 is where the programming marks are: tracing, fixing and writing code. For each question below we say what it tests and link the lesson that teaches it. Where it says Worked answer, the question is gone through step by step, with a program you can run. We do not host the papers. Each one is linked on AQA's own site.
By type of question
Write a program
- June 2025 Paper 1, Question 3: A coaching cost with three price bands (8 marks)
- June 2025 Paper 1, Question 4: Validate a name by length until it is accepted, test data, and a username flowchart (13 marks)
- June 2025 Paper 1, Question 5: Data types, and five inputs rewritten as a loop with one (8 marks)
- June 2025 Paper 1, Question 10: Records, and the smallest value in an array without min or sort (8 marks)
- June 2025 Paper 1, Question 11: Trace findLetter, then write the word game that calls it (14 marks)
- June 2024 Paper 1, Question 6: Essay marks with penalties for late essays, never below 0 (7 marks)
- June 2024 Paper 1, Question 7: Build a stock code with string indexing and concatenation (4 marks)
- June 2024 Paper 1, Question 11: Authenticate against two username and password pairs until valid (7 marks)
- June 2024 Paper 1, Question 12.6, 12.7: Use given subroutines to check a row and to play until solved (10 marks)
- June 2024 Paper 1, Question 14: Local variables, and a subroutine that counts busy days and returns the count (7 marks)
- June 2024 Paper 1, Question 15: Move 1 or 2 along a row of cells, back to 0 on an X or past the end (8 marks)
- June 2023 Paper 1, Question 7: A ticket price with a group discount (6 marks)
- June 2023 Paper 1, Question 12.2: Write your own linear search (7 marks)
- June 2023 Paper 1, Question 13: Validate a grid reference until it is correct (6 marks)
- June 2023 Paper 1, Question 15: Share a bill: loop until it is paid, then report the tip (8 marks)
- June 2023 Paper 1, Question 16: A dice game to 21 with random numbers (11 marks)
- June 2022 Paper 1, Question 7: Ask for an email address twice and check that they match (5 marks)
- June 2022 Paper 1, Question 8: A bonus payment from items sold and years employed (7 marks)
- June 2022 Paper 1, Question 13.1: Keep asking until a number is between 1 and 100 (4 marks)
- June 2022 Paper 1, Question 13.2: Find a run of five in a sorted array of 100 cards (6 marks)
- June 2022 Paper 1, Question 14.2: Write a subroutine that counts the asterisks on a bingo ticket (8 marks)
- Sample Paper 1, Question 5: A taxi fare: 2 pounds a passenger plus 1.50 a kilometre (7 marks)
- Sample Paper 1, Question 8: Output LOWER or NOT LOWER for a character (7 marks)
- Sample Paper 1, Question 13: Move blocks between columns with MOVE and HEIGHT, keeping their order (10 marks)
- Sample Paper 1, Question 18: Go-kart braking distance: validate the speed, divide by 5, wet ground (8 marks)
Read the code
- June 2025 Paper 1, Question 7: Read a subroutine: purpose, outputs, return value, parameter (7 marks)
- June 2025 Paper 1, Question 9: Which of five algorithms correctly total an array (2 marks)
- June 2024 Paper 1, Question 1: LEN, POSITION, a data type, assignment, and a two line program (6 marks)
- June 2024 Paper 1, Question 2: Follow an IF, ELSEIF chain with NOT, OR, AND and MOD (5 marks)
- June 2024 Paper 1, Question 5: The output of a nested IF for three pairs of inputs (3 marks)
- June 2024 Paper 1, Question 10: Trace three subroutines that call each other (2 marks)
- June 2024 Paper 1, Question 12.1 to 12.5: A sliding puzzle: move tiles, and read nested loops that find the blank (7 marks)
- June 2023 Paper 1, Question 2: Read a nested WHILE loop that uses integer division (3 marks)
- June 2022 Paper 1, Question 1: MOD, selection, assignment, relational operators and a definite loop (6 marks)
- June 2022 Paper 1, Question 2: Follow a nested IF with AND, then name the data types (6 marks)
- June 2022 Paper 1, Question 9: String indexing, LEN and SUBSTRING (5 marks)
- Sample Paper 1, Question 3: The dog biscuit algorithm: selection, iteration, subroutine calls and a data type (5 marks)
- Sample Paper 1, Question 9: Draw a robot's path through a grid from Forward, TurnLeft and ObjectAhead (6 marks)
Trace table
- June 2025 Paper 1, Question 1: Operators in a short program, and a trace of a while loop that doubles (7 marks)
- June 2025 Paper 1, Question 8: Trace a loop that compares two binary strings with OR, NOT and AND (6 marks)
- June 2024 Paper 1, Question 8: Trace a loop over three arrays that uses DIV (6 marks)
- June 2023 Paper 1, Question 4: Trace a Python function with three sets of inputs, then make it robust (4 marks)
- June 2023 Paper 1, Question 5: Trace a flowchart with a loop (3 marks)
- June 2023 Paper 1, Question 10: Trace nested FOR loops over a list of scores and find the error (6 marks)
- June 2023 Paper 1, Question 12.1: Trace a binary search (4 marks)
- June 2022 Paper 1, Question 10: Trace a REPEAT UNTIL loop with DIV, then compare it with WHILE (8 marks)
- June 2022 Paper 1, Question 12: Trace a bubble sort on three items (8 marks)
- Sample Paper 1, Question 7: A bubble sort with a swapsMade flag: data type, identifiers, and a trace table (10 marks)
Complete the algorithm
- June 2025 Paper 1, Question 2: A loyalty card with MOD and elif, and the value of the free items (7 marks)
- June 2024 Paper 1, Question 9: A data structure, a RECORD definition, and the dearer of two books (7 marks)
- June 2023 Paper 1, Question 6: Fill the gaps in a login routine (4 marks)
- June 2023 Paper 1, Question 14: Fill the gaps in an algorithm that uses a two-dimensional array (3 marks)
- June 2022 Paper 1, Question 11: Complete a subroutine that works out a sound file's size, local variables, why subroutines (10 marks)
- June 2022 Paper 1, Question 14.1: Fill a two-dimensional array with nested WHILE loops (4 marks)
Fix the code
- June 2023 Paper 1, Question 12.4: Fix a subroutine's parameter and a FOR loop that counts down (3 marks)
- June 2022 Paper 1, Question 3: Rewrite two lines: concatenate strings, change a calculation (2 marks)
- June 2022 Paper 1, Question 5: A syntax error and a logic error in a random number program (5 marks)
- Sample Paper 1, Question 15: Fix a loop that prints odd numbers so that it works for negative input (4 marks)
- Sample Paper 1, Question 17: The highest common factor program that fails for 4 and 4 (3 marks)
Explain
- June 2025 Paper 1, Question 6: Show a bubble sort and a merge, compare them, and justify a binary search (10 marks)
- June 2022 Paper 1, Question 4: Which of two programs is more efficient, and why (3 marks)
Testing
- June 2024 Paper 1, Question 3: random.randrange, a test plan, and a syntax and a logic error (6 marks)
- June 2023 Paper 1, Question 11: Normal, erroneous and boundary test data, and a logic error (5 marks)
Paper by paper
June 2025, Paper 1B (Python)
Sat 12 May 2025, 90 marks. On AQA's site: question paper, mark scheme.
June 2024, Paper 1B (Python)
Sat 15 May 2024, 90 marks. On AQA's site: question paper, mark scheme.
June 2023, Paper 1B (Python)
Sat 19 May 2023, 90 marks. On AQA's site: question paper, mark scheme.
| Question | What it tests | Type | Marks | Learn it | |
|---|---|---|---|---|---|
| 1.1 | Define the term algorithm | Short answer | 2 | F5.1 What an algorithm is | |
| 1.2 to 1.5 | String handling: length, joining, substring, position of a character | Multiple choice | 4 | F3.1 String handling | |
| 2 | Read a nested WHILE loop that uses integer division | Read the code | 3 | F2.6 Condition-controlled loops: while F1.9 Arithmetic operators | Worked answer |
| 3 | One advantage of the structured approach | Short answer | 2 | F4.4 Decomposition and abstraction | |
| 4 | Trace a Python function with three sets of inputs, then make it robust | Trace table | 4 | F13.2 Trace tables F4.2 Parameters and return values F6.1 Defensive design and validation | Worked answer |
| 5 | Trace a flowchart with a loop | Trace table | 3 | F5.4 Trace tables F5.2 Flowcharts F13.2 Trace tables | Worked answer |
| 6 | Fill the gaps in a login routine | Complete the algorithm | 4 | F6.2 Authentication F2.6 Condition-controlled loops: while | Worked answer |
| 7 | A ticket price with a group discount | Write a program | 6 | F2.2 Selection: if F1.7 Input from the user F13.4 Programming questions | Worked answer |
| 8 | Explain how merge sort works | Explain | 4 | F5.9 Merge sort and comparing algorithms | |
| 9 | Records: fields, assignment, looping over an array of records | Read the code | 4 | F3.6 Records | |
| 10 | Trace nested FOR loops over a list of scores and find the error | Trace table | 6 | F13.2 Trace tables F2.7 Loop patterns F6.4 Debugging logic errors | Worked answer |
| 11 | Normal, erroneous and boundary test data, and a logic error | Testing | 5 | F6.3 Testing and test data F6.4 Debugging logic errors | Worked answer |
| 12.1 | Trace a binary search | Trace table | 4 | F5.6 Binary search F13.2 Trace tables | Worked answer |
| 12.2 | Write your own linear search | Write a program | 7 | F5.5 Linear search F3.4 Iterating over a list F13.4 Programming questions | Worked answer |
| 12.3 | Why binary search cannot be used on an unsorted list | Short answer | 1 | F5.6 Binary search | |
| 12.4 | Fix a subroutine's parameter and a FOR loop that counts down | Fix the code | 3 | F4.2 Parameters and return values F2.5 Count-controlled loops: for | Worked answer |
| 13 | Validate a grid reference until it is correct | Write a program | 6 | F6.1 Defensive design and validation F3.1 String handling F13.4 Programming questions | Worked answer |
| 14 | Fill the gaps in an algorithm that uses a two-dimensional array | Complete the algorithm | 3 | F3.5 Two-dimensional arrays F4.2 Parameters and return values | Worked answer |
| 15 | Share a bill: loop until it is paid, then report the tip | Write a program | 8 | F2.6 Condition-controlled loops: while F2.3 else, elif and Boolean operators F13.4 Programming questions | Worked answer |
| 16 | A dice game to 21 with random numbers | Write a program | 11 | F3.7 Random numbers F2.6 Condition-controlled loops: while F13.4 Programming questions | Worked answer |
June 2022, Paper 1B (Python)
90 marks. On AQA's site: question paper, mark scheme.
Sample assessment material, Paper 1B (Python)
90 marks. On AQA's site: question paper, mark scheme.
| Question | What it tests | Type | Marks | Learn it | |
|---|---|---|---|---|---|
| 1 | Define algorithm, and match terms to definitions | Short answer | 5 | F5.1 What an algorithm is F4.4 Decomposition and abstraction | |
| 2 | The length of a string and concatenation | Multiple choice | 2 | F3.1 String handling | |
| 3 | The dog biscuit algorithm: selection, iteration, subroutine calls and a data type | Read the code | 5 | F2.3 else, elif and Boolean operators F2.5 Count-controlled loops: for F1.8 Data types and casting | Worked answer |
| 4 | Fill the gaps in a program that outputs the larger of two numbers | Complete the algorithm | 5 | F2.3 else, elif and Boolean operators F1.8 Data types and casting | |
| 5 | A taxi fare: 2 pounds a passenger plus 1.50 a kilometre | Write a program | 7 | F1.9 Arithmetic operators F1.8 Data types and casting F1.7 Input from the user | Worked answer |
| 6 | Check a password against secret and display Welcome or Not welcome | Write a program | 5 | F6.2 Authentication F2.2 Selection: if | |
| 7 | A bubble sort with a swapsMade flag: data type, identifiers, and a trace table | Trace table | 10 | F5.7 Bubble sort F13.2 Trace tables F1.6 Variables, constants and assignment | Worked answer |
| 8 | Output LOWER or NOT LOWER for a character | Write a program | 7 | F3.1 String handling F2.2 Selection: if F3.2 Character codes and conversion | Worked answer |
| 9 | Draw a robot's path through a grid from Forward, TurnLeft and ObjectAhead | Read the code | 6 | F4.1 Writing functions F2.6 Condition-controlled loops: while | Worked answer |
| 10 | Two benefits of the structured approach | Short answer | 2 | F4.4 Decomposition and abstraction | |
| 11 | Show the steps of a bubble sort on 3, 5, 1, 4, 2 | Explain | 5 | F5.7 Bubble sort | |
| 12 | Abstraction, and the details a developer missed in a client's request | Short answer | 3 | F4.4 Decomposition and abstraction | |
| 13 | Move blocks between columns with MOVE and HEIGHT, keeping their order | Write a program | 10 | F4.2 Parameters and return values F2.6 Condition-controlled loops: while F5.1 What an algorithm is | Worked answer |
| 14 | Which program also multiplies the numbers from one to five | Multiple choice | 1 | F2.7 Loop patterns | |
| 15 | Fix a loop that prints odd numbers so that it works for negative input | Fix the code | 4 | F6.4 Debugging logic errors F2.6 Condition-controlled loops: while | Worked answer |
| 16 | A test plan for a 1 to 10 validation loop | Testing | 2 | F6.3 Testing and test data | |
| 17 | The highest common factor program that fails for 4 and 4 | Fix the code | 3 | F6.4 Debugging logic errors F2.6 Condition-controlled loops: while | Worked answer |
| 18 | Go-kart braking distance: validate the speed, divide by 5, wet ground | Write a program | 8 | F6.1 Defensive design and validation F2.6 Condition-controlled loops: while F13.4 Programming questions | Worked answer |
The specification
AQA GCSE Computer Science (8525), point by point, with the lesson for each section.
These are our own explanations of published exam questions. It is not written or endorsed by AQA, and the question paper and mark scheme remain AQA's copyright. Read them on AQA's site with the links on this page.