Cambridge AS & A Level Computer Science 9618/42 October/November 2025 (Paper 4 Practical): Task-by-Task Guide
Cambridge AS & A Level Computer Science 9618/42 is the October/November 2025 Paper 4 (Practical), variant 2. It is an A Level component that lasts 2 hours 30 minutes, is worth 75 marks and is sat by every full A Level candidate. It had three compulsory programming tasks, written on a computer in Java, Python or Visual Basic, with every answer pasted into an evidence document. Question 1, a Bird class, was the biggest at 28 marks. This guide goes through the paper task by task and shows what the official mark scheme gave marks for. The paper and its mark scheme are free on the Tutopiya Learning Portal.
For the newest series of the same paper, see 9618 Paper 42 May/June 2026: questions and mark scheme.
For an overview of all four 9618 papers from this series, see A Level Computer Science 9618 Oct/Nov 2025 Papers & Marking.
9618/42 at a glance
Paper codes: the code printed on the cover is 9618/42/O/N/25, the question paper file is 9618_w25_qp_42, the mark scheme file is 9618_w25_ms_42 and the source files are in 9618_w25_sf_42.
| Question | Task | Code marks | Test marks | Total |
|---|---|---|---|---|
| 1 | Bird class: constructor, GetSpecies(), GetPosition(), Move(), a validated main program | 25 | 3 | 28 |
| 2 | 20 unique random integers: PrintArray(), BubbleSort(), RecursiveBinarySearch() | 23 | 3 | 26 |
| 3 | Ordered binary tree in a 2D array: AddNode(), reading TreeData.txt, WriteAllToFile() | 20 | 1 | 21 |
| Total | 68 | 7 | 75 |
The test marks are for screenshots of your program running. Work that is not in the evidence document is not marked.
Task-by-task walkthrough
Question 1: the Bird class (28 marks)
Each bird has a speed in km/h (DistancePerHour), a species and an X and Y position.
- 1(a)(i) Class and constructor (4 marks): the class header; four private attributes with the right data types (two REAL positions, a REAL speed and a STRING species); a constructor taking two parameters; and assigning those to Species and DistancePerHour while setting XPosition and YPosition to 500.0. In Python, the attribute types go in comments.
- 1(a)(ii) GetSpecies() (2 marks): a get method header with no parameter (1), returning Species (1).
- 1(a)(iii) GetPosition() (3 marks): a method with no parameter that returns a value (1); building the string “X = ” & XPosition & ” Y = ” & YPosition from the attributes (1); and returning it (1). In Python, convert the numbers with str() before joining.
- 1(a)(iv) Move() (5 marks): the header taking a direction and the minutes flying (1); calculating the distance as (DistancePerHour / 60) × minutes (1); selecting on the direction (1); north adding to and south subtracting from YPosition (1); and east adding to and west subtracting from XPosition (1).
- 1(b) Two birds (3 marks): a Cockatiel at 71.0 (1) and a Macaw at 56.0 (1), both stored in variables (1).
- 1(c)(i) The main program (8 marks): one mark each for:
- outputting each bird’s species and position with a message
- prompting for and inputting the bird, the time and the direction
- validating all three inputs
- looping until all three are valid (the time must be 0 to 500)
- calling Move() for the chosen bird
- passing only the input direction and time as arguments
- outputting the moved bird’s new position
- using the get methods wherever the attributes are needed, since they are private.
- 1(c)(ii) Four test runs (3 marks): one mark for each of the first two tests and one for the third and fourth together. Each run starts both birds at 500.0, 500.0:
- Cockatiel north, 60 minutes: 71 km travelled, Y = 571.0
- Macaw south, 30 minutes: 28 km, Y = 472.0
- Cockatiel west, 30 minutes: 35.5 km, X = 464.5
- Macaw east, 60 minutes: 56 km, X = 556.0
Question 2: sorting and searching (26 marks)
- 2(a) Declaring and filling the array (3 marks): a 1D array local to the main program (1), holding 20 random integers from 0 to 100 inclusive (1), all unique (1). The scheme’s Python example used random.sample(range(0, 101), 20), which gives unique values in one step; otherwise, generate a number and check it is not already in the array before storing it.
- 2(b) PrintArray() (3 marks): a procedure taking an array (1), outputting its contents once (1), on one line with a space between each integer (1).
- 2(c) BubbleSort() (5 marks): a function header taking the array and returning it sorted (1); an outer loop (1); an inner loop (1); comparing neighbours and swapping into ascending order (1); and loops that use the length of the parameter, so it works for an array of any length (1). The scheme’s example used a Swap flag in a WHILE loop as the outer loop.
- 2(d)(i) Main program (3 marks): call PrintArray() with the array (1); call BubbleSort() and store or use the returned array (1); output “Sorted” and call PrintArray() with the sorted array (1).
- 2(d)(ii) Screenshot (1 mark): 20 integers from 0 to 100, then “Sorted”, then the same integers in ascending order. Every candidate’s numbers will differ.
- 2(e) RecursiveBinarySearch() (6 marks): a function taking the array, lower bound, upper bound and value, returning the index or −1. In outline:
FUNCTION RecursiveBinarySearch(DataArray, Lower, Upper, DataToFind)
if Upper >= Lower:
Middle ← Lower + (Upper − Lower) DIV 2
if DataArray[Middle] = DataToFind: return Middle
if DataArray[Middle] > DataToFind:
return RecursiveBinarySearch(DataArray, Lower, Middle − 1, DataToFind)
otherwise:
return RecursiveBinarySearch(DataArray, Middle + 1, Upper, DataToFind)
otherwise: return −1
One mark each for: a recursive function header with four parameters; calculating the middle; returning the index when the middle matches; recursing with Middle − 1 as the upper bound when the middle value is greater; recursing with Middle + 1 as the lower bound when it is smaller; and returning −1 when not found. Return the result of each recursive call, or the index is lost on the way back up.
- 2(f)(i) Main program (3 marks): prompt and input an integer (1); call RecursiveBinarySearch(SortedArray, 0, 19, input) and store or use the result (1); output “Not found” for −1, or “Found at position” with the index (1).
- 2(f)(ii) Three tests (2 marks): one mark for screenshots showing the smallest number found at index 0 and the largest at index 19, and one for a number not in the array giving “Not found”.
Question 3: an ordered binary tree (21 marks)
TreeArray holds up to 50 nodes, each with a left pointer, the data and a right pointer, with −1 for null. RootPointer starts at −1 and FreeNode at 0. Nodes are never deleted.
- 3(a) Declare and initialise (3 marks): a global 2D array of 50 × 3 (1), every value set to −1 (1), and RootPointer set to −1 and FreeNode to 0 (1).
- 3(b) AddNode() (7 marks from nine points): in outline:
if FreeNode = 50: output "The tree is full"
else:
store the data at TreeArray[FreeNode][1], with both pointers −1
if RootPointer = −1: RootPointer ← 0
else:
Current ← RootPointer
loop until placed:
if data < TreeArray[Current][1]:
if the left pointer is −1: set it to FreeNode, placed
else: Current ← left pointer
else:
if the right pointer is −1: set it to FreeNode, placed
else: Current ← right pointer
FreeNode ← FreeNode + 1
The points: the header with one integer parameter, storing it at TreeArray[FreeNode][1]; checking for a full tree (FreeNode = 50) and outputting “The tree is full”; checking for an empty tree and setting RootPointer to 0; comparing with the data at the root; going left if smaller; going right if greater; repeating until the place is found; updating the parent’s pointer; and incrementing FreeNode.
- 3(c) Reading TreeData.txt (4 marks from five points): opening the file for reading and closing it (1); looping 50 times or to the end of the file (1); reading each line (1); calling AddNode() with each value (1); and exception handling with a suitable message (1). Convert each line to an integer before you pass it.
- 3(d) WriteAllToFile() (5 marks): a procedure with exception handling (try with catch or except) and a suitable message (1); opening Tree.txt for writing and closing it (1); looping through every element of the array (1); building each node’s string, such as -1,20,1 (1); and writing each string to the file on its own line (1).
- 3(e)(i) (1 mark): call WriteAllToFile() from the main program.
- 3(e)(ii) (1 mark): a screenshot of Tree.txt showing every node on its own line in the right format, with the file name visible.
Where the marks are on 9618/42
| Skill | Questions | Marks |
|---|---|---|
| Writing procedures, functions and methods | 1(a)(ii)–(iv), 2(b), 2(c), 2(e), 3(b), 3(d) | 36 |
| Main program code | 1(b), 1(c)(i), 2(d)(i), 2(f)(i), 3(c), 3(e)(i) | 22 |
| Test screenshots | 1(c)(ii), 2(d)(ii), 2(f)(ii), 3(e)(ii) | 7 |
| Declaring and initialising data | 2(a), 3(a) | 6 |
| Class declaration and constructor | 1(a)(i) | 4 |
| Total | 75 |
- The biggest single parts are the 8-mark main program in 1(c)(i), AddNode() (7) and RecursiveBinarySearch() (6). Input validation loops, pointer-following and recursion are the skills to practise.
- File handling carried 9 marks across 3(c) and 3(d), and both expected exception handling.
How to self-mark 9618/42 with the mark scheme
- Check your evidence document first. Any part with no code or screenshot pasted in scores nothing, however good the program.
- Tick mark points, not whole programs. Each subroutine is split into separate points such as the header, the loop and the return. A program that crashes can still earn most of them.
- Watch the linked points. Where a point starts with ”…”, it builds on the one before: in 1(c)(i), the looping mark needs validation of all three inputs first.
- Check your Move() results against the four expected positions above. A wrong value usually means the distance was not divided by 60, or the wrong axis was changed.
- Test the binary search at both ends. The scheme wants screenshots for index 0 and index 19, plus a value that is not there.
- Open Tree.txt and check it has 50 lines, each three values with commas and no spaces, and that the screenshot shows the file name.
Sit 9618/42 as a timed mock
The paper allows 150 minutes for 75 marks. Sit it on a computer with no internet, saving code and screenshots into a document as you go.
| Block | Marks | Time |
|---|---|---|
| Question 1 | 28 | 55 minutes |
| Question 2 | 26 | 50 minutes |
| Question 3 | 21 | 39 minutes |
| Check evidence document | – | 6 minutes |
| Total | 75 | 150 minutes |
If a subroutine won’t run, paste in what you have and move on. Partial code still earns its mark points.
9618/42 in other series
The May/June 2026 Paper 42 had the same three-task shape: a class with private attributes, a constructor and get methods; a sort written without a built-in method that must work for any length (an insertion sort there, a bubble sort here); reading a text file with exception handling; and a pointer-based structure stored in a 2D array (a linked list there, a binary tree here). This paper also asked for a recursive function and for writing data out to a new file.
Other October/November 2025 9618 papers
- 9618 Paper 12 (Theory Fundamentals)
- 9618 Paper 22 (Fundamental Problem-solving and Programming Skills)
- 9618 Paper 32 (Advanced Theory)
Practise and download
- Download 9618/42 and its mark scheme on the Learning Portal →
- All 9618 October/November 2025 papers: overview and marking patterns
- All 9618 May/June 2026 papers: overview and marking patterns
- Try a free A Level Computer Science quiz
Need help with a 9618 topic? Book a free trial lesson with an A Level Computer Science tutor →
Frequently asked questions
What did 9618 Paper 42 October/November 2025 ask you to program? +
Three tasks: a Bird class with a constructor, get methods and a Move() method, driven by a validated menu; an array of 20 unique random integers with PrintArray(), a bubble sort and a recursive binary search; and an ordered binary tree in a 2D array, filled from TreeData.txt with AddNode() and written to Tree.txt with WriteAllToFile().
How many marks is 9618/42 and how long is it? +
It is out of 75 marks and lasts 2 hours 30 minutes, programmed on a computer in Java, Python or Visual Basic (console mode). Question 1, the Bird class, was the biggest at 28 marks, followed by Question 2 at 26 and Question 3 at 21.
What should the 9618/42 Question 1 test outputs show? +
Both birds start at X = 500.0, Y = 500.0. The Cockatiel (71 km/h) flying north for 60 minutes ends at Y = 571.0, the Macaw (56 km/h) flying south for 30 minutes at Y = 472.0, the Cockatiel flying west for 30 minutes at X = 464.5, and the Macaw flying east for 60 minutes at X = 556.0.
How was RecursiveBinarySearch() marked in 9618/42? +
Six marks: a recursive function header with four parameters; calculating the middle; returning the index if the middle value matches; a recursive call with middle − 1 as the upper bound if the middle is greater; a recursive call with middle + 1 as the lower bound if it is smaller; and returning −1 when the value is not found.
How was AddNode() marked in 9618/42? +
Up to 7 marks from nine points: the header and storing the data at TreeArray[FreeNode][1]; outputting The tree is full when FreeNode is 50; setting RootPointer to 0 for an empty tree; comparing with the root's data; going left if smaller and right if greater until a place is found; updating the parent's pointer; and incrementing FreeNode.
Where can I download 9618/42 October/November 2025 and its mark scheme? +
Both are free to download and print on the Tutopiya Learning Portal, on the Cambridge AS & A Level Computer Science 9618 past papers page. You also need the source file TreeData.txt to sit it.
What is 9618_w25_qp_42? +
9618_w25_qp_42 is the file name of the question paper for Cambridge AS & A Level Computer Science 9618 Paper 42 (Paper 4 Practical, variant 2), October/November 2025. Its mark scheme is 9618_w25_ms_42, and the code printed on the cover is 9618/42/O/N/25. The source files for it are in 9618_w25_sf_42. In these file names, w25 means the October/November 2025 series, qp means question paper and ms means mark scheme.
Ready to Excel in Your Studies?
Get personalised help from Tutopiya's expert tutors. Whether it's IGCSE, IB, A-Levels, or any other curriculum — we match you with the perfect tutor and your first session is free.
Book Your Free TrialWritten by
Mahira Kitchil
Connect on LinkedIn →Project Head, Tutopiya
Mahira Kitchil is a Project Head at Tutopiya, where she works with Cambridge IGCSE and Edexcel A-Level teachers in more than 20 countries on how exams are set and marked. She writes practical guides that help students find the right past papers and use the mark scheme the way examiners do, so every practice paper counts.
Related Articles
A Level Biology 9700 Oct/Nov 2025 Papers & Mark Schemes
Free 9700 Oct/Nov 2025 Paper 1 and Paper 3 with mark schemes: the topics tested, the practical tasks and how examiners awarded marks on each.
A Level Computer Science 9618 Oct/Nov 2025 Papers & Marking
Free 9618 Oct/Nov 2025 papers and mark schemes, plus a paper-by-paper breakdown of Papers 1 to 4 and how examiners gave marks for code and theory.
A Level Geography 9696 Oct/Nov 2025 Papers: Topics & Mark Scheme
Free 9696 Oct/Nov 2025 papers, inserts and mark schemes, plus a paper-by-paper breakdown of the data questions, options and essays and how they were levelled.
