Cambridge AS & A Level Computer Science 9618/22 October/November 2025 (Paper 2 Fundamental Problem-solving and Programming Skills): Question-by-Question Guide
Past Papers

Cambridge AS & A Level Computer Science 9618/22 October/November 2025 (Paper 2 Fundamental Problem-solving and Programming Skills): Question-by-Question Guide

Mahira Kitchil Project Head, Tutopiya
• 9 min read
Updated

Cambridge AS & A Level Computer Science 9618/22 is the October/November 2025 Paper 2 (Fundamental Problem-solving and Programming Skills), variant 2. It is an AS Level component that lasts 2 hours, is worth 75 marks and is sat by every 9618 candidate. It had eight compulsory questions, an insert listing the pseudocode functions and operators, and no calculator. Question 8, a library loans program built on an array of records, was the biggest at 18 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 the newest series of the same paper, see 9618 Paper 22 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/22 at a glance

Paper codes: the code printed on the cover is 9618/22/O/N/25, the question paper file is 9618_w25_qp_22, the mark scheme file is 9618_w25_ms_22 and the insert file is 9618_w25_in_22.

QuestionTopicMarksMain command word
1Selection, iteration and subroutines; data types; evaluating expressions11Complete, evaluate
2Flowchart: filling an array until 99.9 or full5Complete
3Converting a member file to one line per member10Complete, explain
4Quiz scores: a Boolean array and ValidateScore()13Write, complete, describe
5Life cycle stages and acceptance testing5Complete, identify
6The string function Compare()7Write
7Structure chart: iteration and module headers6Explain, write
8Library loans: CountLoans(), NewLoan(), archiving, reminders18Write, explain, outline
Total75

Question-by-question walkthrough

Question 1: pseudocode basics (11 marks)

  • Ticking the constructs (4 marks, one per row): the IF block containing a FOR loop that calls Reset() is selection, iteration and subroutine; OTHERWISE : Status ← TRUE is selection; WHILE AllDone() = TRUE is iteration and subroutine (AllDone() is a function call); and 30 : NextChar ← ‘X’ is selection, because it is a CASE clause.
  • Data types (3 marks): 5.42 is REAL, “JFMAMJJASOND” is STRING and 15/11/2009 is DATE.
  • Evaluating expressions (4 marks):
    • INT(Result) + 1 > 6 is FALSE: INT(5.42) is 5, plus 1 is 6, and 6 is not greater than 6
    • NUM_TO_STR(LENGTH(MonthLetter)) is “12”, a string
    • NUM_TO_STR(Result + “3.2”) is an ERROR, because “3.2” is a string and can’t be added to a REAL
    • MID(MonthLetter, MONTH(Birthday) − 2, 1) is “S”: the month is 11, 11 − 2 is 9, and the 9th letter of JFMAMJJASOND is S.

Question 2: the array flowchart (5 marks)

The flowchart inputs real values into the global array Data[1:20] until 99.9 is input or all 20 elements are used, without storing the 99.9. The scheme’s answer sets Index to 1, inputs Num, ends if Num is 99.9, otherwise stores Data[Index] ← Num and adds 1 to Index, then ends if Index = 21, otherwise loops back to the input. One mark each for:

  • initialising the array index
  • inputting the number inside a loop
  • testing for 99.9 and ending correctly
  • testing for a full array (20 iterations) and ending correctly
  • assigning the number to the Data array element and incrementing the index.

Test for 99.9 before you store the value, or the terminator ends up in the array.

Question 3: changing a file design (10 marks)

OldFile.txt holds each member’s ID, name and email on three separate lines. The new file puts all three on one line separated by ”.

  • Completing the steps (6 marks): open OldFile.txt in read mode (1); open NewFile.txt in write mode (1); read three lines into LineX, LineY and LineZ (1); set NewString to LineX & ” & LineY & ” & LineZ (1); write NewString to NewFile.txt (1); and repeat from step 3 until the end of OldFile.txt (1).
  • Why ” is a suitable separator (1 mark): it does not appear in any of the data items, such as the ID and the name.
  • Adding two encrypted items that may contain ” (3 marks): any three of: add one new separator after the third original item; work out the length of each new item; store or append that length with the item; and store the length as a fixed-length or separated digit string. Because the new items can contain ”, storing each item’s length is what lets the program extract them.

Question 4: checking quiz scores (13 marks)

Five easy questions are worth 3 points each and four hard ones 5 points each, so the highest score is 15 + 20 = 35. CheckTotal[] has one Boolean element per possible score.

  • Declaring and clearing CheckTotal (4 marks): declare it as ARRAY[0:35] OF BOOLEAN (1); declare a loop counter (1); a loop with correct syntax and number of iterations, 0 to 35 (1); and set each element to FALSE (1).
  • Setting the valid scores (5 marks, one per gap): FOR EasyQ ← 0 TO 15 STEP 3; FOR HardQ ← 0 TO 20 STEP 5; CheckTotal[HardQ + EasyQ] ← TRUE. Every combination of easy and hard points marks that total as valid.
  • Describing ValidateScore() in four steps (4 marks): check the parameter is in the range 0 to 35; if not, return FALSE; use the parameter as the index into CheckTotal; and return the value at that position. The question said not to use pseudocode, so write each step in words.

Question 5: the life cycle (5 marks)

  • Naming the stage (4 marks, one per row): producing a structure chart is design; modifying a program to run on new hardware is maintenance; identifying the customer’s requirements is analysis; and an IDE’s auto-complete is used during coding.
  • The final testing by the customer (1 mark): acceptance testing.

Question 6: the Compare() function (7 marks)

Compare(String1, String2, CaseMatters, Position) returns FALSE if String2 is shorter than String1; otherwise it checks whether String1 matches the start (‘s’) or end (‘e’) of String2, treating upper and lower case as the same when CaseMatters is FALSE. The logic in outline:

FUNCTION Compare(String1, String2 : STRING, CaseMatters : BOOLEAN, Position : CHAR) RETURNS BOOLEAN
    S1Length ← LENGTH(String1)
    if LENGTH(String2) < S1Length: return FALSE
    if CaseMatters = FALSE: convert both strings with TO_UPPER
    if Position = 'e': String2 ← RIGHT(String2, S1Length)
    if Position = 's': String2 ← LEFT(String2, S1Length)
    return String1 = String2

Mark points: the heading, parameters, return type and ending; finding the length of String1; returning FALSE if String2 is shorter; comparing the (modified) strings; testing CaseMatters and converting both strings to the same case when it is FALSE; using ‘s’ or ‘e’ to form the part of String2 to compare; and returning the right Boolean in every case. Check your answer against the six examples in the question, including “GUE” matching the end of “Catalogue” when case doesn’t matter.

Question 7: the structure chart (6 marks)

Convert calls Analyse (passing Count), Update (passing Key and getting T1 back) and Sort (passing the flag P2 both ways).

  • The curved arrow (2 marks): it means Convert repeatedly calls Analyse, then Update, then Sort, in that order. One mark for repetition, one for naming all four modules with the sequence stated or implied.
  • Module headers (4 marks, one per underlined part):
    • PROCEDURE Analyse(Count : INTEGER) (1)
    • FUNCTION Update (1), with (Key : STRING) RETURNS INTEGER (1), since T1 comes back as a single value
    • PROCEDURE Sort(BYREF P2 : BOOLEAN) (1), because P2 is a flag (filled circle) passed in both directions.

Question 8: library loans (18 marks)

The global array Loan holds 7000 records, each with StudentID, BookID and OnLoan. Unused records have an empty StudentID and can be anywhere in the array.

8(a) CountLoans() (7 marks). A procedure that takes a StudentID, counts that student’s books still on loan and books returned, and outputs both. In outline:

PROCEDURE CountLoans(ThisStudentID : STRING)
    declare Index and two counts, set both counts to 0
    loop Index from 1 to 7000:
        if Loan[Index].StudentID = ThisStudentID:
            if Loan[Index].OnLoan = FALSE: add 1 to the returned count
            otherwise: add 1 to the on-loan count
    output both counts with a message

Mark points: declaring the index and both counts; a loop of 7000 iterations; correct indexed dot notation such as Loan[Index].StudentID; comparing StudentID with the parameter inside the loop; testing OnLoan with correct logic for both outcomes; initialising both counts and incrementing the right one; and an output with both counts and a suitable message.

8(b) NewLoan() (7 marks). A function that takes a StudentID and BookID, finds an unused record, fills it in and returns TRUE, or returns FALSE if there is no space. The question asks for efficient code, so stop as soon as a free record is found. In outline:

FUNCTION NewLoan(ThisStudentID, ThisBookID : STRING) RETURNS BOOLEAN
    Index ← 1, IsStored ← FALSE
    while Index <= 7000 AND NOT IsStored:
        if Loan[Index].StudentID = "":
            store the StudentID and BookID, set OnLoan to TRUE, IsStored ← TRUE
        Index ← Index + 1
    return IsStored

Mark points: a correct loop through the 7000 elements; ending at the first unused element (a RETURN inside a FOR loop was also accepted); indexed dot notation; testing for an unused record (StudentID = "") inside the loop; the two ID assignments; setting OnLoan to TRUE; and returning the right Boolean whether or not a space was found.

8(c) Saving records before archiving (2 marks): write them to a text file (1), either as one line per record with separator characters between the items, or with each item on its own line (1).

8(d) Reminder emails (2 marks): either store the return date of each loan (or the start date and loan period) and have the algorithm calculate when the reminder is due; or store the student’s email address so the reminder can be sent. Any two of these four points.

Where the marks are on 9618/22

SkillQuestionsMarks
Writing complete modules6, 8(a), 8(b)21
Completing and writing short pseudocode, headers and declarations4(a), 4(b), 7(b)13
Pseudocode basics: constructs, data types, expressions111
Describing algorithms in steps3(a), 4(c)10
File and data design3(b), 3(c), 8(c), 8(d)8
Life cycle, testing and structure charts5, 7(a)7
Flowchart25
Total75
  • 34 marks came from writing pseudocode, counting the three modules and the shorter code in 4(a), 4(b) and 7(b). Use only the functions in the insert, such as LENGTH, LEFT, RIGHT, MID and TO_UPPER.
  • Questions 1, 5 and 7(a) are 18 marks of short, fixed answers. Bank them quickly and save time for Question 8.

How to self-mark 9618/22 with the mark scheme

  1. Learn the abbreviations. A slash separates alternative words, // separates alternative answers, underlined words must appear, and “max” caps a list.
  2. Tick the module mark points, not “does it work”. For Compare(), CountLoans() and NewLoan(), go through each MP in turn. Your code doesn’t have to match the example to earn a point.
  3. Check your record syntax. Several points need Loan[Index].StudentID style dot notation inside a loop.
  4. Check NewLoan() stops early. A loop that carries on after storing the loan misses that point, and may store the same loan in more than one free record.
  5. Mark the gap-fills one gap at a time. In 4(b) each of the five gaps is a mark, including the STEP values.
  6. Hand-trace Compare() with all six examples in the question and check you get TRUE, FALSE, TRUE, FALSE, TRUE, FALSE.

Sit 9618/22 as a timed mock

The paper allows 120 minutes for 75 marks. A workable plan that leaves Question 8 enough time:

BlockMarksTime
Question 11114 minutes
Question 258 minutes
Question 31014 minutes
Question 41317 minutes
Question 555 minutes
Question 6714 minutes
Question 767 minutes
Question 81835 minutes
Check code and traces–6 minutes
Total75120 minutes

Keep the insert open beside you and check every function you use in your pseudocode is on it.

9618/22 in other series

The May/June 2026 Paper 22 also asked for life cycle stages and a named testing method, an algorithm described in numbered steps that works through a text file, a by-reference parameter (a BYREF fix to Swap() there, a BYREF flag in the Sort header here), and full modules written against mark points. This paper put more marks into arrays of records and file design, while 2026 tested stacks, bubble sort and a state-transition diagram.

Other October/November 2025 9618 papers

Practise and download

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 October/November 2025? +

Eight questions: selection, iteration and subroutines, data types and evaluating expressions; a flowchart to fill an array; converting a member file to one line per member; a quiz score check using a Boolean array; life cycle stages and acceptance testing; a string Compare() function; a structure chart and module headers; and a library loans program using an array of records.

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 8, the library loans program, is the biggest at 18 marks.

What were the answers to 9618/22 Question 1(c) Oct/Nov 2025? +

INT(Result) + 1 > 6 is FALSE, because INT(5.42) + 1 is 6. NUM_TO_STR(LENGTH(MonthLetter)) is "12". NUM_TO_STR(Result + "3.2") is an ERROR, because a REAL cannot be added to a string. MID(MonthLetter, MONTH(Birthday) − 2, 1) is "S", the 9th letter of JFMAMJJASOND.

How was the quiz score array set up in 9618/22 Question 4? +

CheckTotal is ARRAY[0:35] OF BOOLEAN, because the highest score is 5 × 3 + 4 × 5 = 35. The nested loops run EasyQ from 0 to 15 STEP 3 and HardQ from 0 to 20 STEP 5, setting CheckTotal[HardQ + EasyQ] to TRUE. Each of the five gaps was a mark.

How was the Compare() function marked on 9618/22? +

Against 7 mark points: the heading, parameters, return type and ending; finding the length of String1; returning FALSE if String2 is shorter; converting both strings to the same case when CaseMatters is FALSE; using 's' or 'e' to take the start or end of String2; comparing the strings; and returning the right Boolean in every case.

Where can I download 9618/22 October/November 2025 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.

What is 9618_w25_qp_22? +

9618_w25_qp_22 is the file name of the question paper for Cambridge AS & A Level Computer Science 9618 Paper 22 (Paper 2 Fundamental Problem-solving and Programming Skills, variant 2), October/November 2025. Its mark scheme is 9618_w25_ms_22, and the code printed on the cover is 9618/22/O/N/25. The insert that goes with it is 9618_w25_in_22. 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 Trial
M

Written 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.

Mahira Kitchil on LinkedIn

Get Started

Courses

Company

Subjects & Curriculums

Resources

Book a Tutor

Struggling with this topic?

Practise A Level Computer Science with free topic quizzes