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.

AQA 852563 worked answers5 papersfree

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

Read the code

Trace table

Complete the algorithm

Fix the code

Explain

Testing

Paper by paper

June 2025, Paper 1B (Python)

Sat 12 May 2025, 90 marks. On AQA's site: question paper, mark scheme.

QuestionWhat it testsTypeMarksLearn it
1Operators in a short program, and a trace of a while loop that doublesTrace table7F13.2 Trace tables
F2.6 Condition-controlled loops: while
F1.9 Arithmetic operators
Worked answer
2A loyalty card with MOD and elif, and the value of the free itemsComplete the algorithm7F2.3 else, elif and Boolean operators
F1.9 Arithmetic operators
F1.7 Input from the user
Worked answer
3A coaching cost with three price bandsWrite a program8F2.3 else, elif and Boolean operators
F2.4 Nested selection and match
F13.4 Programming questions
Worked answer
4Validate a name by length until it is accepted, test data, and a username flowchartWrite a program13F6.1 Defensive design and validation
F6.3 Testing and test data
F5.2 Flowcharts
Worked answer
5Data types, and five inputs rewritten as a loop with oneWrite a program8F1.8 Data types and casting
F2.5 Count-controlled loops: for
F2.7 Loop patterns
Worked answer
6Show a bubble sort and a merge, compare them, and justify a binary searchExplain10F5.7 Bubble sort
F5.9 Merge sort and comparing algorithms
F5.6 Binary search
Worked answer
7Read a subroutine: purpose, outputs, return value, parameterRead the code7F4.2 Parameters and return values
F4.4 Decomposition and abstraction
F1.9 Arithmetic operators
Worked answer
8Trace a loop that compares two binary strings with OR, NOT and ANDTrace table6F13.2 Trace tables
F3.1 String handling
F2.3 else, elif and Boolean operators
Worked answer
9Which of five algorithms correctly total an arrayRead the code2F3.4 Iterating over a list
F6.4 Debugging logic errors
F2.6 Condition-controlled loops: while
Worked answer
10Records, and the smallest value in an array without min or sortWrite a program8F3.6 Records
F2.7 Loop patterns
F13.4 Programming questions
Worked answer
11Trace findLetter, then write the word game that calls itWrite a program14F4.2 Parameters and return values
F3.1 String handling
F13.4 Programming questions
Worked answer

June 2024, Paper 1B (Python)

Sat 15 May 2024, 90 marks. On AQA's site: question paper, mark scheme.

QuestionWhat it testsTypeMarksLearn it
1LEN, POSITION, a data type, assignment, and a two line programRead the code6F3.1 String handling
F1.6 Variables, constants and assignment
F1.7 Input from the user
Worked answer
2Follow an IF, ELSEIF chain with NOT, OR, AND and MODRead the code5F2.3 else, elif and Boolean operators
F1.9 Arithmetic operators
Worked answer
3random.randrange, a test plan, and a syntax and a logic errorTesting6F3.7 Random numbers
F6.3 Testing and test data
F1.4 Errors: syntax, runtime and logic
Worked answer
4Define abstraction and name decompositionShort answer2F4.4 Decomposition and abstraction
5The output of a nested IF for three pairs of inputsRead the code3F2.4 Nested selection and match
F13.2 Trace tables
Worked answer
6Essay marks with penalties for late essays, never below 0Write a program7F2.3 else, elif and Boolean operators
F1.7 Input from the user
F13.4 Programming questions
Worked answer
7Build a stock code with string indexing and concatenationWrite a program4F3.1 String handling
F1.7 Input from the user
Worked answer
8Trace a loop over three arrays that uses DIVTrace table6F13.2 Trace tables
F3.4 Iterating over a list
F1.9 Arithmetic operators
Worked answer
9A data structure, a RECORD definition, and the dearer of two booksComplete the algorithm7F3.6 Records
F2.3 else, elif and Boolean operators
Worked answer
10Trace three subroutines that call each otherRead the code2F4.2 Parameters and return values
F4.3 Local and global variables
Worked answer
11Authenticate against two username and password pairs until validWrite a program7F6.2 Authentication
F2.6 Condition-controlled loops: while
F13.4 Programming questions
Worked answer
12.1 to 12.5A sliding puzzle: move tiles, and read nested loops that find the blankRead the code7F3.5 Two-dimensional arrays
F4.2 Parameters and return values
Worked answer
12.6, 12.7Use given subroutines to check a row and to play until solvedWrite a program10F4.2 Parameters and return values
F2.6 Condition-controlled loops: while
F13.4 Programming questions
Worked answer
13Explain how a linear search worksExplain3F5.5 Linear search
14Local variables, and a subroutine that counts busy days and returns the countWrite a program7F4.1 Writing functions
F4.3 Local and global variables
F2.7 Loop patterns
Worked answer
15Move 1 or 2 along a row of cells, back to 0 on an X or past the endWrite a program8F3.3 Lists: one-dimensional arrays
F2.6 Condition-controlled loops: while
F13.4 Programming questions
Worked answer

June 2023, Paper 1B (Python)

Sat 19 May 2023, 90 marks. On AQA's site: question paper, mark scheme.

QuestionWhat it testsTypeMarksLearn it
1.1Define the term algorithmShort answer2F5.1 What an algorithm is
1.2 to 1.5String handling: length, joining, substring, position of a characterMultiple choice4F3.1 String handling
2Read a nested WHILE loop that uses integer divisionRead the code3F2.6 Condition-controlled loops: while
F1.9 Arithmetic operators
Worked answer
3One advantage of the structured approachShort answer2F4.4 Decomposition and abstraction
4Trace a Python function with three sets of inputs, then make it robustTrace table4F13.2 Trace tables
F4.2 Parameters and return values
F6.1 Defensive design and validation
Worked answer
5Trace a flowchart with a loopTrace table3F5.4 Trace tables
F5.2 Flowcharts
F13.2 Trace tables
Worked answer
6Fill the gaps in a login routineComplete the algorithm4F6.2 Authentication
F2.6 Condition-controlled loops: while
Worked answer
7A ticket price with a group discountWrite a program6F2.2 Selection: if
F1.7 Input from the user
F13.4 Programming questions
Worked answer
8Explain how merge sort worksExplain4F5.9 Merge sort and comparing algorithms
9Records: fields, assignment, looping over an array of recordsRead the code4F3.6 Records
10Trace nested FOR loops over a list of scores and find the errorTrace table6F13.2 Trace tables
F2.7 Loop patterns
F6.4 Debugging logic errors
Worked answer
11Normal, erroneous and boundary test data, and a logic errorTesting5F6.3 Testing and test data
F6.4 Debugging logic errors
Worked answer
12.1Trace a binary searchTrace table4F5.6 Binary search
F13.2 Trace tables
Worked answer
12.2Write your own linear searchWrite a program7F5.5 Linear search
F3.4 Iterating over a list
F13.4 Programming questions
Worked answer
12.3Why binary search cannot be used on an unsorted listShort answer1F5.6 Binary search
12.4Fix a subroutine's parameter and a FOR loop that counts downFix the code3F4.2 Parameters and return values
F2.5 Count-controlled loops: for
Worked answer
13Validate a grid reference until it is correctWrite a program6F6.1 Defensive design and validation
F3.1 String handling
F13.4 Programming questions
Worked answer
14Fill the gaps in an algorithm that uses a two-dimensional arrayComplete the algorithm3F3.5 Two-dimensional arrays
F4.2 Parameters and return values
Worked answer
15Share a bill: loop until it is paid, then report the tipWrite a program8F2.6 Condition-controlled loops: while
F2.3 else, elif and Boolean operators
F13.4 Programming questions
Worked answer
16A dice game to 21 with random numbersWrite a program11F3.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.

QuestionWhat it testsTypeMarksLearn it
1MOD, selection, assignment, relational operators and a definite loopRead the code6F2.2 Selection: if
F1.9 Arithmetic operators
F2.5 Count-controlled loops: for
Worked answer
2Follow a nested IF with AND, then name the data typesRead the code6F2.4 Nested selection and match
F1.8 Data types and casting
Worked answer
3Rewrite two lines: concatenate strings, change a calculationFix the code2F3.1 String handling
F1.9 Arithmetic operators
Worked answer
4Which of two programs is more efficient, and whyExplain3F5.1 What an algorithm is
F5.9 Merge sort and comparing algorithms
Worked answer
5A syntax error and a logic error in a random number programFix the code5F1.4 Errors: syntax, runtime and logic
F6.4 Debugging logic errors
F3.7 Random numbers
Worked answer
6Define abstraction and complete a decomposition diagramShort answer3F4.4 Decomposition and abstraction
7Ask for an email address twice and check that they matchWrite a program5F1.7 Input from the user
F2.2 Selection: if
F13.4 Programming questions
Worked answer
8A bonus payment from items sold and years employedWrite a program7F2.3 else, elif and Boolean operators
F2.4 Nested selection and match
F13.4 Programming questions
Worked answer
9String indexing, LEN and SUBSTRINGRead the code5F3.1 String handling
F3.3 Lists: one-dimensional arrays
Worked answer
10Trace a REPEAT UNTIL loop with DIV, then compare it with WHILETrace table8F13.2 Trace tables
F2.6 Condition-controlled loops: while
F5.4 Trace tables
Worked answer
11Complete a subroutine that works out a sound file's size, local variables, why subroutinesComplete the algorithm10F4.2 Parameters and return values
F4.3 Local and global variables
F8.8 Sound
Worked answer
12Trace a bubble sort on three itemsTrace table8F5.7 Bubble sort
F13.2 Trace tables
Worked answer
13.1Keep asking until a number is between 1 and 100Write a program4F6.1 Defensive design and validation
F2.6 Condition-controlled loops: while
Worked answer
13.2Find a run of five in a sorted array of 100 cardsWrite a program6F3.4 Iterating over a list
F2.7 Loop patterns
F13.4 Programming questions
Worked answer
14.1Fill a two-dimensional array with nested WHILE loopsComplete the algorithm4F3.5 Two-dimensional arrays
F2.6 Condition-controlled loops: while
Worked answer
14.2Write a subroutine that counts the asterisks on a bingo ticketWrite a program8F3.5 Two-dimensional arrays
F4.1 Writing functions
F13.4 Programming questions
Worked answer

Sample assessment material, Paper 1B (Python)

90 marks. On AQA's site: question paper, mark scheme.

QuestionWhat it testsTypeMarksLearn it
1Define algorithm, and match terms to definitionsShort answer5F5.1 What an algorithm is
F4.4 Decomposition and abstraction
2The length of a string and concatenationMultiple choice2F3.1 String handling
3The dog biscuit algorithm: selection, iteration, subroutine calls and a data typeRead the code5F2.3 else, elif and Boolean operators
F2.5 Count-controlled loops: for
F1.8 Data types and casting
Worked answer
4Fill the gaps in a program that outputs the larger of two numbersComplete the algorithm5F2.3 else, elif and Boolean operators
F1.8 Data types and casting
5A taxi fare: 2 pounds a passenger plus 1.50 a kilometreWrite a program7F1.9 Arithmetic operators
F1.8 Data types and casting
F1.7 Input from the user
Worked answer
6Check a password against secret and display Welcome or Not welcomeWrite a program5F6.2 Authentication
F2.2 Selection: if
7A bubble sort with a swapsMade flag: data type, identifiers, and a trace tableTrace table10F5.7 Bubble sort
F13.2 Trace tables
F1.6 Variables, constants and assignment
Worked answer
8Output LOWER or NOT LOWER for a characterWrite a program7F3.1 String handling
F2.2 Selection: if
F3.2 Character codes and conversion
Worked answer
9Draw a robot's path through a grid from Forward, TurnLeft and ObjectAheadRead the code6F4.1 Writing functions
F2.6 Condition-controlled loops: while
Worked answer
10Two benefits of the structured approachShort answer2F4.4 Decomposition and abstraction
11Show the steps of a bubble sort on 3, 5, 1, 4, 2Explain5F5.7 Bubble sort
12Abstraction, and the details a developer missed in a client's requestShort answer3F4.4 Decomposition and abstraction
13Move blocks between columns with MOVE and HEIGHT, keeping their orderWrite a program10F4.2 Parameters and return values
F2.6 Condition-controlled loops: while
F5.1 What an algorithm is
Worked answer
14Which program also multiplies the numbers from one to fiveMultiple choice1F2.7 Loop patterns
15Fix a loop that prints odd numbers so that it works for negative inputFix the code4F6.4 Debugging logic errors
F2.6 Condition-controlled loops: while
Worked answer
16A test plan for a 1 to 10 validation loopTesting2F6.3 Testing and test data
17The highest common factor program that fails for 4 and 4Fix the code3F6.4 Debugging logic errors
F2.6 Condition-controlled loops: while
Worked answer
18Go-kart braking distance: validate the speed, divide by 5, wet groundWrite a program8F6.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.