Cambridge AS & A Level Computer Science 9618/22 May/June 2026 (Paper 2 Fundamental Problem-solving and Programming Skills): Question-by-Question Guide
Cambridge AS & A Level Computer Science 9618/22 is the May/June 2026 Paper 2 (Fundamental Problem-solving and Programming Skills), variant 2. It is an AS Level component that lasts 2 hours and is worth 75 marks. It had six compulsory questions, an insert listing the pseudocode functions and operators, and no calculator. Question 1, a house alarm system, was the biggest at 27 marks. This guide goes through the paper question by question and shows what the official mark scheme gave marks for. The paper, insert and mark scheme are free on the Tutopiya Learning Portal.
For an overview of all four 9618 papers from this series, see A Level Computer Science 9618 May/June 2026 past papers: what came up and how it was marked.
9618/22 at a glance
| Question | Topic | Marks | Main command word |
|---|---|---|---|
| 1 | House alarm: password validation pseudocode, state-transition diagram, test data, lifecycle, testing methods | 27 | Complete, identify |
| 2 | Tool hire system: abstraction, data items, processes | 5 | Explain, state |
| 3 | Searching a 10 000-word text file, described in steps | 6 | Complete |
| 4 | Browser back and forward stacks, another ADT | 9 | Complete, identify, describe |
| 5 | Two bubble sorts and a Swap() procedure | 10 | Describe, explain, write |
| 6 | Grid cipher: AddPadding(), a 2D array, PopulateGrid() | 18 | Write, complete |
| Total | 75 |
Question-by-question walkthrough
Question 1: the house alarm (27 marks)
The alarm’s keypad has 26 uppercase letters and 10 digits. A password must have six to eight characters, at least one letter and one digit, and no repeated characters.
- 1(a)(i) Declaring Pass (1 mark): STRING.
- 1(a)(ii) Rule 1 (2 marks): the condition is LENGTH(Pass) < 6 OR LENGTH(Pass) > 8. One mark for using LENGTH in both places, one for the 8 (>= 9 was also accepted).
- 1(a)(iii) Rule 2 (7 marks, one per gap): declare the two flags as BOOLEAN; set LetterFlag to FALSE; loop to LENGTH(Pass); take each character with MID(Pass, Index, 1); test it with IS_NUM; set DigitFlag or LetterFlag to TRUE in the two branches (one mark for both); and report an error if NOT(LetterFlag AND DigitFlag). Because the keypad only has letters and digits, anything that isn’t a digit must be a letter, which is why the ELSE branch can set LetterFlag.
- 1(b)(i) Two more states (2 marks): any two of a sensor-triggered or intruder-detected state, the alarm sounding, an error or low-battery state, a tamper or lockdown state, or a disarm, maintenance or password-change mode.
- 1(b)(ii) Three more events (3 marks): for example movement or pressure detected, a window or door opened, a wrong password entered repeatedly, tampering with the system, a time delay passing, low battery or a panic button pressed. Repeating the two events in the question, turning the system on, or creating the password did not score.
- 1(c) Test data (3 marks): each new password had to break only the rule being tested, and use upper-case letters and digits only (lower-case letters or other characters lost a mark once). One mark for the rule 1 row (for example PHRASE345678, too long), one for both rule 2 rows (for example ABCDEF with no digit and 1234567 with no letter), and one for both rule 3 rows (for example ABCDEF11 with a repeated digit and AAA111 with both letters and digits repeated). Each needed a matching reason.
- 1(d) Three more design outcomes (3 marks): for example a structure chart, flowchart, data flow diagram, identifier table or record structure, file or database design, E-R diagram, interface or report design, class diagram, or the choice of programming language. “Decomposition” or “module” on its own did not score.
- 1(e) Two more lifecycle stages (2 marks): analysis, coding (or implementation) and maintenance. “Development” and “programming” were not enough.
- 1(f)(i) (1 mark): integration testing.
- 1(f)(ii) (3 marks): stub testing for the name, then up to two marks for describing it: a simple dummy module replaces the one that doesn’t work, and it returns an expected value or outputs a message to show it has been called. The description was not marked if the method was wrong.
Question 2: abstraction for a tool hire system (5 marks)
- Purpose of abstraction (1 mark): to filter out the information not needed for the task, keeping only what is needed.
- Four data items (2 marks, one per two): for example the tool ID or name, customer ID or name, hire ID, hire date, hire time, length of hire (half or full day), cost, payment details or tool status. Quantity did not score, nor did a return date if the hire date was already given, and “customer” alone was too vague.
- Two processes (2 marks): for example taking customer or tool details, searching for an available tool, recording or amending a booking, recording a return, working out when the tool is due back, changing the tool’s status, or calculating the cost and taking payment.
Question 3: searching a text file in steps (6 marks)
WordList.txt holds 10 000 unique lower-case words, one per line. Steps 1 to 3 (set a counter to 0, input a word, convert it to lower case) were given, and pseudocode statements were not allowed.
The scheme had seven points, max 6: open the file for reading (and close it later), outside the loop; read the next line; add 1 to the line counter; compare the line with the word; if they match, output the counter; after the loop, output “Not Found” if the word was never matched; otherwise repeat from the reading step. The reading, counting and comparing points only counted if they were clearly inside a loop, and the loop had to show where it starts and ends with at least one end condition (word found or end of file). If your steps could output both the line number and “Not Found” for the same word, only one of those two marks was given. Stopping as soon as the word is found is what makes the search efficient.
Question 4: browser back and forward stacks (9 marks)
The page shown at the start is www.bbb.home. The back stack holds www.zzz.corp (top), www.aaa.home and www.ccc.my, and the forward stack holds www.333.corp (top), www.111.home, www.999.corp and www.222.me.
- Group 1, back (2 marks): www.bbb.home is pushed onto the forward stack and www.zzz.corp is popped from the back stack and displayed. Back stack: www.aaa.home (top), www.ccc.my.
- Group 2, forward (1 mark): www.zzz.corp is pushed back onto the back stack and www.bbb.home is popped and displayed, so both stacks return to their starting state.
- Group 3, forward three times (3 marks): www.bbb.home, www.333.corp and www.111.home are pushed onto the back stack in turn, and www.333.corp, www.111.home and finally www.999.corp are popped. The back stack ends with www.111.home at the top above www.333.corp, www.bbb.home, www.zzz.corp, www.aaa.home and www.ccc.my; the forward stack holds only www.222.me. Separate marks went to the back stack, the forward stack and the displayed address.
Every mark needed the TOS pointers in the right place as well as the contents.
- 4(b) Another ADT (3 marks): one mark for a queue or linked list, plus two features. For a queue: one data item per element, a front and a rear pointer, items added at the rear and removed from the front (FIFO), and that it can be circular or linear (both words needed). For a linked list: each node holds data and a pointer to the next node, a start pointer, a null pointer in the last node, adding and removing by changing pointers, following pointers to move through the list, a free list for unused nodes, and that it is dynamic. “Uses two arrays” did not score.
Question 5: bubble sort (10 marks)
Algorithm A sorted 1000 integers with two fixed FOR loops. Algorithm B used a boundary that drops by one each pass and a NoSwaps flag inside a REPEAT loop.
- 5(a) Descending order (1 mark): change the > in the IF statement to <. Swapping the two sides of the comparison, or using <=, was also accepted.
- 5(b)(i) Why B is more efficient (4 marks): for the inner loop, it runs one fewer time on each pass, because each pass puts one more element into its final place at the end of the array. For the outer loop, it stops as soon as a pass makes no swaps, because the array is then sorted, so it doesn’t have to run all 999 passes that algorithm A always makes. Repeating the algorithm back did not score.
- 5(b)(ii) (1 mark): the outer loop runs the fewest times when the array is already sorted in ascending order.
- 5(c)(i) Why Swap() fails (2 marks): the parameters are passed by value, so the procedure swaps its own copies and the values in the array are not changed.
- 5(c)(ii) The fix (2 marks): change the header to PROCEDURE Swap(BYREF Num1, Num2 : INTEGER) and keep the body. The correct header alone earned 1 mark. If BYREF was mentioned but the header syntax was wrong, the second mark could still follow through.
Question 6: the grid cipher (18 marks)
The plain text (up to 25 characters) is padded with spaces to exactly 25, written row by row into a 5 × 5 grid, and read column by column to give the cipher text.
6(a) AddPadding() (8 marks). The function prompts for and inputs the text, keeps asking until it has 1 to 25 characters, pads it with spaces to 25 and returns it. The logic in outline:
FUNCTION AddPadding() RETURNS STRING
repeat: prompt, input Text
until LENGTH(Text) >= 1 AND LENGTH(Text) <= 25
loop from LENGTH(Text) + 1 to 25: Text ← Text & " "
return Text
Mark points: the heading, return type and ending; a prompt and input; a conditional loop checking one boundary; a conditional loop checking both; re-input inside that loop; a loop that runs once per space needed; appending the spaces (to the text, or to an empty string that is then added); and returning correctly padded text. With no input loop, the three loop marks were lost. The scheme also accepted a version with no padding loop: join the text to a constant of at least 24 spaces and take the left 25 characters with LEFT() (or MID()). Language-specific string functions that aren’t in the insert were not accepted.
6(b)(i) Declaring Grid (2 marks): Grid : ARRAY[1:5, 1:5] OF CHAR, or with bounds 0:4. One mark for both sets of bounds, one for everything else. Round brackets, CHARACTER or STRING lost the mark; lower case was fine.
6(b)(ii) PopulateGrid() (8 marks). The procedure takes the padded text as a STRING parameter, fills the grid row by row, then outputs it one row per line. In outline:
PROCEDURE PopulateGrid(Text : STRING)
Index ← 1
loop Row 1 to 5: loop Col 1 to 5:
Grid[Row, Col] ← MID(Text, Index, 1); Index ← Index + 1
loop Row 1 to 5: output the five characters of that row on one line
Mark points: an index running 1 to 25 to take every character; Row and Column generated in a loop; extracting one character in a loop; assigning it to the grid; all 25 characters stored; isolating the five characters of at least one row; all five rows; and outputting each row on its own line. The scheme accepted a calculated index ((Row − 1) × 5 + Column), building each row’s string inside the nested loop, or a single loop of 25 that moves on to the next row after every five characters. A wrong procedure heading or parameter type capped the mark at 7, and using [Row][Col] instead of [Row, Col] lost a mark once.
Where the marks are on 9618/22
| Skill | Questions | Marks |
|---|---|---|
| Design, development and testing | 1(b)–1(f) | 17 |
| Writing complete modules | 6(a), 6(b)(ii) | 16 |
| Completing and amending pseudocode, declarations | 1(a), 5(c)(ii), 6(b)(i) | 14 |
| Stacks and other ADTs | 4 | 9 |
| Explaining sorting algorithms and parameter passing | 5(a), 5(b), 5(c)(i) | 8 |
| Describing an algorithm in steps | 3 | 6 |
| Abstraction and system requirements | 2 | 5 |
| Total | 75 |
- 30 marks came from writing pseudocode, counting the gap-fill, the declarations, the Swap() fix and the two modules in Question 6. Use only the functions in the insert.
- Question 1 is mostly short recall. The state, event, design-outcome and lifecycle parts are quick marks if you know the lists, so don’t spend long on them.
How to self-mark 9618/22 with the mark scheme
- Mark the gap-fills one gap at a time. In 1(a)(iii), the two TRUE assignments are one mark together. Check you used MID with Index and 1, and IS_NUM from the insert.
- Check every test password against all three rules. In 1(c), a rule 2 or rule 3 example that also breaks another rule, or uses a lower-case letter, loses the mark.
- Check your Question 3 steps for a loop. Reading, counting and comparing only score inside a loop with a clear start, end and end condition. Make sure “Not Found” can’t be output when the word was found.
- Mark the stack diagrams by group, including the TOS pointer and the displayed address each time. A wrong pointer costs the mark even with the right contents.
- Tick the module mark points, not “does it work”. For AddPadding(), if you checked the length once without a loop, take off the three loop marks. For PopulateGrid(), check the heading and parameter type first, because an error there caps you at 7.
- Hand-trace your PopulateGrid() with the example “This is a message” padded to 25 characters, and check the five output rows match the example in the question.
Sit 9618/22 as a timed mock
The paper allows 120 minutes for 75 marks. A workable plan that leaves Question 6 enough time:
| Block | Marks | Time |
|---|---|---|
| Question 1 | 27 | 40 minutes |
| Question 2 | 5 | 6 minutes |
| Question 3 | 6 | 9 minutes |
| Question 4 | 9 | 13 minutes |
| Question 5 | 10 | 14 minutes |
| Question 6 | 18 | 32 minutes |
| Check code, traces and stacks | – | 6 minutes |
| Total | 75 | 120 minutes |
Keep the insert open beside you and check every function you use in your pseudocode is on it.
Other May/June 2026 9618 papers
Practise and download
- Download 9618/22, the insert and the mark scheme on the Learning Portal →
- 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 topics were on 9618 Paper 22 May/June 2026? +
Six questions: a house alarm password (completing validation pseudocode, states and events for a state-transition diagram, test data, design outcomes, lifecycle stages, integration and stub testing); abstraction for a tool hire system; describing a file search in steps; back and forward browser stacks; two bubble sort algorithms and a Swap() procedure; and a grid cipher with AddPadding() and PopulateGrid().
How many marks is 9618/22 and how long is it? +
It is out of 75 marks and lasts 2 hours, with an insert listing the pseudocode functions and operators and no calculator. Question 1, the alarm system, carried 27 marks, and Question 6, the grid cipher, carried 18.
Why did the Swap() procedure in 9618/22 Question 5 not work? +
Its parameters were passed by value, so the procedure swapped its own copies and the array elements were left unchanged. The fix is to pass the parameters by reference, with a header such as PROCEDURE Swap(BYREF Num1, Num2 : INTEGER). The header alone earned 1 of the 2 marks.
What was displayed after the three groups of button clicks in 9618/22 Question 4? +
www.zzz.corp after group 1, www.bbb.home after group 2 and www.999.corp after group 3. By then the back stack held six addresses with www.111.home at the top, and the forward stack held only www.222.me.
How was AddPadding() marked in 9618/22 Question 6? +
Against 8 mark points: the function heading, return type and ending; a prompt and input; a conditional loop checking one and then both length limits; re-input inside that loop; a loop for the spaces to add; appending the spaces; and returning the padded text. With no input loop, the three loop points were lost. A version using LEFT() with a string of at least 24 spaces was also accepted.
Where can I download 9618/22 May/June 2026 and its mark scheme? +
The question paper, insert and mark scheme are free to download and print on the Tutopiya Learning Portal, on the Cambridge AS & A Level Computer Science 9618 past papers page.
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
9706 Paper 12 May/June 2026: Questions and Mark Scheme
A Level Accounting 9706/12 May/June 2026 answer key: the topic of all 30 multiple choice questions, with the working for every calculation and the traps.
9706 Paper 22 May/June 2026: Questions and Mark Scheme
Question-by-question guide to A Level Accounting 9706/22 May/June 2026: every final figure, the key workings, the own figure marks and how advise parts score.
9706 Paper 32 May/June 2026: Questions and Mark Scheme
Question-by-question guide to A Level Accounting 9706/32 May/June 2026: the club accounts, the IAS 7 cash flow statement and the partnership takeover.
