Cambridge A Level Computer Science 9618 — 2025 Oct/Nov Paper 2 · Variant 3
9618/23/O/N/25 · 75 marks · ≈84 min
The question paper and its mark scheme, free to read here and free to download. This is Cambridge’s own paper, exactly as it was sat.
Question paper24 pages
























Mark scheme17 pages
Answers below. Sit the paper first if you are practising.

















Paper as text
Question paper, page 1
This document has 24 pages. Any blank pages are indicated. [Turn over Cambridge International AS & A Level COMPUTER SCIENCE 9618/23 Paper 2 Fundamental Problem-solving and Programming Skills October/November 2025 2 hours You must answer on the question paper. You will need: Insert (enclosed) INSTRUCTIONS ● Answer all questions. ● Use a black or dark blue pen. ● Write your name, centre number and candidate number in the boxes at the top of the page. ● Write your answer to each question in the space provided. ● Do not use an erasable pen or correction fluid. ● Do not write on any bar codes. ● You may use an HB pencil for any diagrams, graphs or rough working. ● Calculators must not be used in this paper. INFORMATION ● The total mark for this paper is 75. ● The number of marks for each question or part question is shown in brackets [ ]. ● No marks will be awarded for using brand names of software packages or hardware. ● The insert contains all the resources referred to in the questions. * 0 1 5 2 5 4 9 6 6 1 * DC (CJ) 343243/3 © UCLES 2025 , , * 0000800000001 * ¬O> 4mHuOªE]y5W ¬GtX¬ sYpwbqi¨ ¥¥5 Ueu EEUEueU DFD
Question paper, page 2
2 9618/23/O/N/25 © UCLES 2025 Refer to the insert for the list of pseudocode functions and operators. 1 A user requires a program that implements complex data encryption to a recognised international standard. A programmer has started the design of the program. (a) The programmer decides to use a library routine to provide part of the solution. One reason for this is that library routines may perform functions that the programmer is unable to program themselves. State three other benefits of using library routines in the development of the program. 1 … … 2 … … 3 … … [3] (b) The programmer has identified a different part of the algorithm that would be appropriate to implement as a subroutine (a procedure or a function); no suitable library routine exists for this part. (i) State two reasons why the programmer may decide to use a subroutine. 1 … … 2 … … [2] (ii) A function header in pseudocode is defined as: FUNCTION Pass2(Count : INTEGER) RETURNS BOOLEAN Complete the table by describing the terms used in the function header. The first row has been completed. Term Description Pass2 the name of the function Count BOOLEAN [2] * 0000800000002 * , , ĬÍĊ¾Ġ´íÈõÏĪÅĊàû·þ× ĬÇĐóÕĠĬĕâāā½·ċãđĠĂ ĥµąĕõõŵĕµÕąÅĕåµąÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 3
3 9618/23/O/N/25 © UCLES 2025 [Turn over (c) Variables in the program have example values: Variable Example value DoB 23/6/2011 Multiplier 2.5 AddressLine[1] "35 Lincoln Avenue" Complete the table by evaluating each expression using the example values: Expression Evaluates to LENGTH(NUM_TO_STR(Multiplier)) MONTH(DoB) > 4 15 + STR_TO_NUM(MID(AddressLine[1], 2, 1)) [3] * 0000800000003 * , , ĬÏĊ¾Ġ´íÈõÏĪÅĊàù·þ× ĬÇďôÍĪĨĥ×÷ðČģó÷đĐĂ ĥµõÕµĕåÕąÅąąÅõÅõĕÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 4
4 9618/23/O/N/25 © UCLES 2025 2 (a) A program contains a global 1D array of type STRING containing 65 elements. An existing text file is used to store the data in the array. Only non-blank elements (those that do not contain an empty string) are written to the text file. An algorithm will: • write the first element of the array as a new line in the text file • continue until all elements have been written, each to a new line of the text file. Stepwise refinement is applied to the algorithm. Describe up to six steps for this algorithm that could be used to produce pseudocode. Do not use pseudocode statements in your answer. Step 1 … … Step 2 … … Step 3 … … Step 4 … … Step 5 … … Step 6 … … [6] (b) Iteration is one programming construct. Identify one other programming construct that will be required when the algorithm from part (a) is converted into pseudocode and explain how it is used. Construct … … Use … … [2] * 0000800000004 * , , ĬÍĊ¾Ġ´íÈõÏĪÅĊÞû·Ā× ĬÇďñÍĤĖĤäù÷ăÁÏÕāĨĂ ĥąåÕõĕåõĥĥõąąõĥõąÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 5
5 9618/23/O/N/25 © UCLES 2025 [Turn over BLANK PAGE * 0000800000005 * , , ĬÏĊ¾Ġ´íÈõÏĪÅĊÞù·Ā× ĬÇĐòÕĦĚĔÕÿĊÆĕçāāĘĂ ĥąÕĕµõÅĕõĕåąąĕąµĕÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 6
6 9618/23/O/N/25 © UCLES 2025 3 A program uses a stack to hold up to 30 integer values. The stack is implemented using a global integer variable and a global 1D array. The array is declared in pseudocode: DECLARE ThisStack : ARRAY[1:30] OF INTEGER Stack design notes: • The global variable SP acts as a stack pointer. SP contains the array index of the last value pushed onto the stack. • If the stack is empty, then SP is assigned the value zero. • The first item added to the stack will be stored in ThisStack[1] • SP is incremented each time an item is added to the stack. A function Pop() is written to remove an item from ThisStack. The function returns an item of type PopData which is defined in pseudocode: TYPE PopData DECLARE Data : INTEGER DECLARE Exists : BOOLEAN ENDTYPE The value removed from the stack is assigned to Data and Exists is set to TRUE. If it is not possible to remove a value from the stack, then Exists is set to FALSE Complete the pseudocode for Pop() FUNCTION Pop() RETURNS PopData DECLARE ThisPop : … IF … THEN PopData.Exists … // Stack is empty ELSE PopData.Data … PopData.Exists … SP … ENDIF RETURN ThisPop ENDFUNCTION [5] * 0000800000006 * , , ĬÑĊ¾Ġ´íÈõÏĪÅĊßù¶þ× ĬÇďòÚĠòĚÍČû¯õÏĤéĨĂ ĥÕõĕµÕŵµõąąÅĕåõÅÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 7
7 9618/23/O/N/25 © UCLES 2025 [Turn over BLANK PAGE * 0000800000007 * , , ĬÓĊ¾Ġ´íÈõÏĪÅĊßû¶þ× ĬÇĐñÒĪîĪìîĆúáç¸éĘĂ ĥÕąÕõµåÕåąÕąÅõŵÕÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 8
8 9618/23/O/N/25 © UCLES 2025 4 A program contains a global 1D array Data containing 20 elements of type INTEGER A global string NumString represents a sequence of three-digit numbers, separated by commas. For example: "101,456,219,754,328" The string contains at least four three-digit numbers. The total number of three-digit numbers in the string is unknown. A procedure Store() will: • extract one three-digit number at a time from NumString • convert each of the three-digit numbers extracted to an integer and assign this to the next array element, starting from index 1 • end when all three-digit numbers have been stored, or when the array is full. Complete the pseudocode for Store() All local variables used must be declared. PROCEDURE Store() … … … … … … … … … … … … … … … … ENDPROCEDURE [6] * 0000800000008 * , , ĬÑĊ¾Ġ´íÈõÏĪÅĊÝù¶Ā× ĬÇĐôÒĤĀğÏôýñăċ˹ĠĂ ĥĥÕÕµµåõÅååąąõĥµÅÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 9
9 9618/23/O/N/25 © UCLES 2025 [Turn over BLANK PAGE * 0000800000009 * , , ĬÓĊ¾Ġ´íÈõÏĪÅĊÝû¶Ā× ĬÇďóÚĦĄďêĆô¸×ó¹ĐĂ ĥĥåĕõÕÅĕÕÕõąąĕąõÕÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 10
10 9618/23/O/N/25 © UCLES 2025 5 A global 1D array Num of integers contains four elements. A program assigns values to these elements as shown: Num[1] 1 Num[2] 2 Num[3] 5 Num[4] 3 A procedure Process() manipulates the values in the array. The procedure is written in pseudocode: PROCEDURE Process(Start : INTEGER) DECLARE CaseVar, Index, Count : INTEGER Index Start Count 0 WHILE Count <= 20 CaseVar Num[Index] CASE OF CaseVar 1 : Num[Index] Num[Index] + Index //clause one Index Index + 1 Count Count + 1 2 : Num[Index] Num[Index] + Index //clause two Index Index + 2 Count Count + 2 3 : Num[Index] Num[Index] * 2 //clause three Index Index + 3 Count Count - 1 4 : Count Count + 4 //clause four OTHERWISE : Count 20 ENDCASE Index (Index MOD 4) + 1 ENDWHILE ENDPROCEDURE * 0000800000010 * , , ĬÑĊ¾Ġ´íÈõÏĪÅĊàù¸þ× ĬÇčôÛĢĈùÑûĆÛğĉòāĘĂ ĥµµĕµµąõĥĕåÅąÕĥµõÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 11
11 9618/23/O/N/25 © UCLES 2025 [Turn over (a) Complete the trace table by dry running the procedure when it is called in the statement: CALL Process(1) Index CaseVar Count Num[1] Num[2] Num[3] Num[4] [5] * 0000800000011 * , , ĬÓĊ¾Ġ´íÈõÏĪÅĊàû¸þ× ĬÇĎóÓĨČĉèýûĎ»ñæāĨĂ ĥµÅÕõÕĥĕõĥõÅąµąõĥÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 12
12 9618/23/O/N/25 © UCLES 2025 (b) As a reminder, the CASE structure in the pseudocode is: CASE OF CaseVar 1 : Num[Index] Num[Index] + Index //clause one Index Index + 1 Count Count + 1 2 : Num[Index] Num[Index] + Index //clause two Index Index + 2 Count Count + 2 3 : Num[Index] Num[Index] * 2 //clause three Index Index + 3 Count Count - 1 4 : Count Count + 4 //clause four OTHERWISE : Count 20 ENDCASE The CASE structure could be optimised by combining two existing clauses. (i) Identify the CaseVar values for these two existing clauses. … [1] (ii) Write pseudocode for a single clause to replace the two clauses identified in (b) (i). … … … [2] * 0000800000012 * , , ĬÑĊ¾Ġ´íÈõÏĪÅĊÞù¸Ā× ĬÇĎòÓĞúĀÓăôĕęÍĈđĐĂ ĥąĕÕµÕĥµĕÅąÅŵåõõÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 13
13 9618/23/O/N/25 © UCLES 2025 [Turn over BLANK PAGE * 0000800000013 * , , ĬÓĊ¾Ġ´íÈõÏĪÅĊÞû¸Ā× ĬÇčñÛĬöðæõýÔ½åÔđĠĂ ĥąĥĕõµąÕąµÕÅÅÕŵĥÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 14
14 9618/23/O/N/25 © UCLES 2025 6 Students are learning about a simple check digit method for data validation. In this method, a single check digit is appended to the end of an original number to give a new number. The students are studying a method which: • calculates the sum of all the digits in the original number • uses integer division to calculate the remainder when the sum is divided by 10 • uses the remainder as the check digit • appends the check digit to the original number, creating the new number. For example: original number 4162 sum of all digits 4 + 1 + 6 + 2 = 13 remainder when the sum is divided by 10 using integer division 3 new number 41623 The original number is always at least three digits in length. When the new number is input, the check digit is used to validate the new number. (a) A function Generate() is written to take an original number as a parameter and to return the check digit. Outline a test plan that could be used to fully test function Generate() Assume that the parameter is valid. … … … … [2] * 0000800000014 * , , ĬÍĊ¾Ġ´íÈõÏĪÅĊÝüµĂ× ĬÇĎóÚĦĉĈØóĊïġðØáĨĂ ĥåĥÕµÕÅõĥåÕąąĕĥõµÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 15
15 9618/23/O/N/25 © UCLES 2025 [Turn over (b) A function CheckNumber() will take an integer value and return the Boolean value TRUE if the check digit is correct, otherwise return FALSE Write pseudocode for the function CheckNumber() Assume that the parameter is valid. … … … … … … … … … … … … … … … … … … … … … … … … … [7] * 0000800000015 * , , ĬÏĊ¾Ġ´íÈõÏĪÅĊÝúµĂ× ĬÇčôÒĤąøáą÷ºµĈĄáĘĂ ĥåĕĕõµåĕõÕąąąõąµåÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 16
16 9618/23/O/N/25 © UCLES 2025 7 There are several different ways to express an algorithm during the design of a program. (a) One part of the program contains an algorithm which is represented by a state-transition diagram. The table shows the inputs, outputs and states for the algorithm: Current state Input Output Next state S1 A1 S2 S2 A2 X4 S3 S3 A1 X1 S3 S3 A2 X1 S3 S3 A3 X3 S4 S3 A4 S2 S4 A3 X4 S5 S4 A4 X4 S5 S4 A1 S2 Complete the state-transition diagram to represent the information given in the table: START S1 [5] * 0000800000016 * , , ĬÍĊ¾Ġ´íÈõÏĪÅĊßüµĄ× ĬÇčñÒĪ÷ñÖċð±ėìâ±ĠĂ ĥĕÅĕµµåµĕõõąÅõåµµÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 17
17 9618/23/O/N/25 © UCLES 2025 [Turn over (b) A structure chart is used to document a different part of the program, made up of five modules. Program notes: • module Setup calls either module Restart, or module Confirm • module Confirm takes a string as a parameter and returns an integer • module Modify has no parameters and returns a Boolean • module Update takes a string as a parameter • module Restart repeatedly calls module Update followed by module Modify • module Restart takes a string as a parameter that is passed by reference. Draw a structure chart to represent the relationship between the five modules, including all parameters and return values. [4] * 0000800000017 * , , ĬÏĊ¾Ġ´íÈõÏĪÅĊßúµĄ× ĬÇĎòÚĠûāãíāøÃÔö±ĐĂ ĥĕµÕõÕÅÕąąåąÅĕÅõåÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 18
18 9618/23/O/N/25 © UCLES 2025 8 A program is being developed to manage student book loans from a college library. The programmer has defined a record type to define each loan. The data items are: Data item Data type Comment StudentID STRING the unique ID of the student who has borrowed the book The first three characters of a StudentID represent a tutor ID. Each student has one tutor. BookID STRING the unique ID of the book being borrowed OnLoan BOOLEAN TRUE if the book has not been returned The programmer has defined a global array Loan to store 8000 loan records. There are more elements in the array than books in the library. Unused elements have the StudentID set to an empty string. These may occur anywhere in the array. The programmer has defined a program module: Module Description LoanStatus() • called with two parameters of type STRING representing a StudentID and a BookID • outputs a message saying whether a given loan has been returned or not • outputs a warning message if a record of the given loan is not found * 0000800000018 * , , ĬÍĊ¾Ġ´íÈõÏĪÅĊÞü·Ă× ĬÇĐñÛĬïħÜĄ÷ěûêÆĉĘĂ ĥÅåÕµµąµµÅõÅÅÕåµąÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 19
19 9618/23/O/N/25 © UCLES 2025 [Turn over (a) Write efficient pseudocode for the module LoanStatus() Assume that each combination of StudentID and BookID can occur only once. … … … … … … … … … … … … … … … … … … … … … … … … … … [8] * 0000800000019 * , , ĬÏĊ¾Ġ´íÈõÏĪÅĊÞú·Ă× ĬÇďòÓĞóėÝöĊÎßÒĒĉĨĂ ĥÅÕĕõÕĥÕåµåÅŵÅõĕÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 20
20 9618/23/O/N/25 © UCLES 2025 (b) A second module is defined: Module Description LoansPerTutor() • called with a parameter of type STRING representing a tutor ID (as a reminder, the first three characters of a StudentID represent a tutor ID) • returns an integer value representing the number of books currently on loan to students who have the given tutor Reminder: unused elements have the StudentID set to an empty string. These may occur anywhere in the array. Write pseudocode for the module LoansPerTutor() … … … … … … … … … … … … … … … … … … …[7] * 0000800000020 * , , ĬÍĊ¾Ġ´íÈõÏĪÅĊàü·Ą× ĬÇďóÓĨāĒÚüāÕýî´ęĐĂ ĥõąĕµÕĥõÅĕÕÅąµĥõąÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 21
21 9618/23/O/N/25 © UCLES 2025 (c) It is decided to mark as unused all records for book loans that have been returned. The data for these records will first be written to a new text file for archive purposes. (i) The archive program will automatically generate a meaningful filename each time it is run. Outline a meaningful format to use for the filename. … … … … [2] (ii) There is a problem that will need to be overcome before the data items can be written to a text file. As a reminder, the data items are: Data item Data type Comment StudentID STRING the unique ID of the student who has borrowed the book The first three characters of a StudentID represent a tutor ID. Each student has one tutor. BookID STRING the unique ID of the book being borrowed OnLoan BOOLEAN TRUE if the book has not been returned Explain the problem. … … [1] (iii) One way of storing the data items in a text file is to store each data item on a separate line. Identify one benefit and one drawback of this way of storing the data. Benefit … … Drawback … … [2] * 0000800000021 * , , ĬÏĊ¾Ġ´íÈõÏĪÅĊàú·Ą× ĬÇĐôÛĢýĢßþðĔÙĆĨęĠĂ ĥõõÕõµąĕÕĥąÅąÕąµĕÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 22
22 9618/23/O/N/25 © UCLES 2025 BLANK PAGE * 0000800000022 * , , ĬÑĊ¾Ġ´íÈõÏĪÅĊÝú¶Ă× ĬÇďôØĬĥĬçĉýĩ¹îą±ĐĂ ĥåÕÕõĕąµĕąåÅÅÕåõÅÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 23
23 9618/23/O/N/25 © UCLES 2025 BLANK PAGE * 0000800000023 * , , ĬÓĊ¾Ġ´íÈõÏĪÅĊÝü¶Ă× ĬÇĐóÐĞĩĜÒïôàĝĆѱĠĂ ĥååĕµõĥÕąõõÅŵŵÕÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Question paper, page 24
24 9618/23/O/N/25 © UCLES 2025 Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be pleased to make amends at the earliest possible opportunity. To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cambridgeinternational.org after the live examination series. Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge. BLANK PAGE * 0000800000024 * , , ĬÑĊ¾Ġ´íÈõÏĪÅĊßú¶Ą× ĬÇĐòÐĨěčåñûç¿êóáĘĂ ĥĕõĕõõĥõĥÕąÅąµĥµÅÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DFD
Mark scheme, page 1
This document consists of 17 printed pages. © Cambridge University Press & Assessment 2025 [Turn over Cambridge International AS & A Level COMPUTER SCIENCE 9618/23 Paper 2 Fundamental Problem-solving and Programming Skills October/November 2025 MARK SCHEME Maximum Mark: 75 Published This mark scheme is published as an aid to teachers and candidates, to indicate the requirements of the examination. It shows the basis on which Examiners were instructed to award marks. It does not indicate the details of the discussions that took place at an Examiners’ meeting before marking began, which would have considered the acceptability of alternative answers. Mark schemes should be read in conjunction with the question paper and the Principal Examiner Report for Teachers. Cambridge International will not enter into discussions about these mark schemes. Cambridge International is publishing the mark schemes for the October/November 2025 series for most Cambridge IGCSE, Cambridge International A and AS Level components, and some Cambridge O Level components.
Mark scheme, page 2
9618/23 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2025 © Cambridge University Press & Assessment 2025 Page 2 of 17 Generic Marking Principles These general marking principles must be applied by all examiners when marking candidate answers. They should be applied alongside the specific content of the mark scheme or generic level descriptions for a question. Each question paper and mark scheme will also comply with these marking principles. GENERIC MARKING PRINCIPLE 1: Marks must be awarded in line with: • the specific content of the mark scheme or the generic level descriptors for the question • the specific skills defined in the mark scheme or in the generic level descriptors for the question • the standard of response required by a candidate as exemplified by the standardisation scripts. GENERIC MARKING PRINCIPLE 2: Marks awarded are always whole marks (not half marks, or other fractions). GENERIC MARKING PRINCIPLE 3: Marks must be awarded positively: • marks are awarded for correct/valid answers, as defined in the mark scheme. However, credit is given for valid answers which go beyond the scope of the syllabus and mark scheme, referring to your Team Leader as appropriate • marks are awarded when candidates clearly demonstrate what they know and can do • marks are not deducted for errors • marks are not deducted for omissions • answers should only be judged on the quality of spelling, punctuation and grammar when these features are specifically assessed by the question as indicated by the mark scheme. The meaning, however, should be unambiguous. GENERIC MARKING PRINCIPLE 4: Rules must be applied consistently, e.g. in situations where candidates have not followed instructions or in the application of generic level descriptors. GENERIC MARKING PRINCIPLE 5: Marks should be awarded using the full range of marks defined in the mark scheme for the question (however; the use of the full mark range may be limited according to the quality of the candidate responses seen). GENERIC MARKING PRINCIPLE 6: Marks awarded are based solely on the requirements as defined in the mark scheme. Marks should not be awarded with grade thresholds or grade descriptors in mind.
Mark scheme, page 3
9618/23 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2025 © Cambridge University Press & Assessment 2025 Page 3 of 17 Annotations guidance for centres Examiners use a system of annotations as a shorthand for communicating their marking decisions to one another. Examiners are trained during the standardisation process on how and when to use annotations. The purpose of annotations is to inform the standardisation and monitoring processes and guide the supervising examiners when they are checking the work of examiners within their team. The meaning of annotations and how they are used is specific to each component and is understood by all examiners who mark the component. We publish annotations in our mark schemes to help centres understand the annotations they may see on copies of scripts. Note that there may not be a direct correlation between the number of annotations on a script and the mark awarded. Similarly, the use of an annotation may not be an indication of the quality of the response. The annotations listed below were available to examiners marking this component in this series. Annotations Annotation Meaning Benefit of the doubt To indicate where a key word/phrase/code is missing Incorrect Follow through Indicate a point in an answer Highlighted text To draw attention to a particular aspect or to indicate where parts of an answer have been combined Ignore Not answered question No examples or not enough Not relevant or used to separate parts of an answer Off-page comment Allows comments to be entered at the bottom of the RM marking window and then displayed when the associated question item is navigated to. Repetition Indicates that work or a page has been seen including blank answer spaces and blank pages. Correct
Mark scheme, page 4
9618/23 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2025 © Cambridge University Press & Assessment 2025 Page 4 of 17 Annotation Meaning Too vague
Mark scheme, page 5
9618/23 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2025 © Cambridge University Press & Assessment 2025 Page 5 of 17 Mark scheme abbreviations / separates alternative words / phrases within a marking point // separates alternative answers within a marking point underline actual word given must be used by candidate (grammatical variants accepted) max indicates the maximum number of marks that can be awarded ( ) the word / phrase in brackets is not required, but sets the context
Mark scheme, page 6
9618/23 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2025 © Cambridge University Press & Assessment 2025 Page 6 of 17 Question Answer Marks 1(a) Answers include: 1 They are tried and tested // Free from errors 2 They are readily available // Speed up development time 3 They will be updated automatically when improvements are made // No maintenance of routine is needed (as automatically updated) 4 The algorithm will be compliant with the international standard One mark per point Max 3 3 1(b)(i) 1 When a part of the algorithm performs a specific task 2 Part is repeated // performed in several places 3 Testing / debugging / maintenance is easier One mark for each point Max 2 2 1(b)(ii) Term Description Pass2 the name of the function Count The parameter / value passed to the function BOOLEAN The (data) type returned (by the function) One mark per description (excluding first row) 2 1(c) Expression Evaluates to LENGTH(NUM_TO_STR(Multiplier)) 3 MONTH(DoB) > 4 TRUE 15 + STR_TO_NUM(MID(AddressLine[1], 2, 1)) 20 One mark per row 3
Mark scheme, page 7
9618/23 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2025 © Cambridge University Press & Assessment 2025 Page 7 of 17 Question Answer Marks 2(a) One mark per point: 1 Open the file in append mode (and subsequently close) before loop 2 Initialise a variable to 1 / 0 before loop 3 Use the variable as an index to the array to access an element in a loop 4 Test if element value is blank / empty in a loop 5 If not blank then write the value to the file in a loop 6 Increment the variable in a loop 7 Repeat from MP3 until variable value is 66 / 65 / all elements (in the array) have been checked Max 6 6 2(b) One mark per point: Construct: Selection Use: To test whether the (array) element is blank Alternative: Construct: Sequence Use: To specify the order in which the steps of the algorithm have to be followed so that the task is completed correctly 2 Question Answer Marks 3 FUNCTION Pop() RETURNS PopData DECLARE ThisPop : PopData MP 2 IF SP < 1 // SP = 0 THEN MP 3 PopData.Exists FALSE // Stack is empty MP 1 ELSE PopData.Data ThisStack[SP] MP 4 PopData.Exists TRUE MP 1 SP SP – 1 MP 5 ENDIF RETURN ThisPop` ENDFUNCTION Mark as follows: MP 1 One mark for both assignments to PopData.Exists (FALSE and TRUE) MP 2, 3, 4 ,5 One mark for each of remaining four bold parts 5
Mark scheme, page 8
9618/23 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2025 © Cambridge University Press & Assessment 2025 Page 8 of 17 Question Answer Marks 4 Example solution: PROCEDURE Store() DECLARE Index, StartPos, ThisNum : INTEGER DECLARE ThisString : STRING Index 1 StartPos 1 WHILE StartPos < LENGTH(NumString) AND Index < 21 ThisString MID(NumString, StartPos, 3) ThisNum STR_TO_NUM(ThisString) Data[Index] ThisNum Index Index + 1 StartPos StartPos + 4 ENDWHILE ENDPROCEDURE Mark as follows: 1 Declare all local variables used 2 Conditional loop while end of string not reached 3 ... and array not full 4 Attempted use of MID() // Attempted use of Right() and Left() 5 Correct extraction and use next three letter substring from NumString in a loop 6 Convert to integer and assign value to array element in a loop 7 Correct increment of array index by 1 and start position of substring by 4 Max 6 Alternative FOR loop solution: PROCEDURE Store() DECLARE Index, StartPos, ThisNum : INTEGER DECLARE ThisString : STRING StartPos 1 FOR Index 1 TO 20 ThisString MID(NumString, StartPos, 3) ThisNum STR_TO_NUM(ThisString) Data[Index] ThisNum StartPos StartPos + 4 IF StartPos > LENGTH(NumString) THEN Break ENDIF NEXT Index ENDPROCEDURE 6
Mark scheme, page 9
9618/23 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2025 © Cambridge University Press & Assessment 2025 Page 9 of 17 Question Answer Marks 4 Alternative where number of 3-digit substrings calculated StartPos 1 NumOfSubStrings ((LENGTH(NumString) + 1)DIV 4)) FOR Index 1 TO NumOfSubString ThisString MID(NumString, StartPos, 3) ThisNum STR_TO_NUM(ThisString) Data[Index] ThisNum StartPos StartPos + 4 IF Index = 20 THEN Break ENDIF NEXT Index Mark as follows: 1 Declare all variables used 2 Loop for 20 iterations // number of 3-digit numbers in the NumString 3 Attempted use of MID()// Attempted use of Right() and Left() 4 Correct extraction and use next three letter substring from NumString in a loop 5 Convert to integer and assign value to array element in a loop 6 Increment StartPos by 4 in a loop 7 Test for end of NumString and Break // Test for end of array and Break Max 6
Mark scheme, page 10
9618/23 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2025 © Cambridge University Press & Assessment 2025 Page 10 of 17 Question Answer Marks 4 Alternative Solution extracting one character at a time and testing for comma PROCEDURE Store() DECLARE Index, Position : INTEGER DECLARE SubString : STRING Decalre ThisCharacter : CHAR Index 1 Position 0 SubString "" WHILE Index <= 20 AND Position <= LENGTH(NumString) Charcter MID(NumString, Position, 1) IF Character = ',' Data[Index] STR_TO_NUM(SubString) Index Index + 1 SubString "" ELSE SubString SubString & Character ENDIF Position Position + 1 ENDWHILE Data[Index] STR_TO_NUM(SubString) //last 3 digit string ENDPROCEDURE Mark as follows: 1 Declare all variables used 2 Conditional loop while end of string not reached 3 ... and array not full 4 Correct extraction and use of a character from NumString in a loop 5 Test for comma in a loop 6 If true convert substring to number … and store in Data array and set SubString to "" and increment Index 7 Otherwise concatenate next character from NumString to end of Substring Max 6
Mark scheme, page 11
9618/23 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2025 © Cambridge University Press & Assessment 2025 Page 11 of 17 Question Answer Marks 5(a) Zones 1 to 4 : One mark for each set of values as shown Zone 5: Num[4] set to 6 when Index is 7 and Num[1] set to 3 when index is 3 for second time 5 5(b)(i) 1 and 2 1 5(b)(ii) 1 TO 2 : Num[Index] Num[Index] + Index Index Index + CaseVar Count Count + CaseVar One mark per point: • use of variable CaseVar rather than literal values • completely correct clause 2 Question Answer Marks 6(a) One mark per point: 1 Create a list of numbers that should generate all of the possible check digit values 2 and check that each / the / a generated value is as expected 2 Zone 1 Zone 2 Zone 3 Zone 4 Zone 5
Mark scheme, page 12
9618/23 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2025 © Cambridge University Press & Assessment 2025 Page 12 of 17 Question Answer Marks 6(b) Note 2 different solutions with different mark scheme Example solution – conversion to string and using a loop FUNCTION CheckNumber(Number : INTEGER) RETURNS BOOLEAN DECLARE Total, Index, CheckDigit : INTEGER DECLARE NumString : STRING Total 0 NumString NUM_TO_STR(Number) CheckDigit STR_TO_NUM(RIGHT(NumString, 1)) // CheckDigit Number MOD 10 FOR Index 1 TO LENGTH(NumString) – 1 // 1 TO LENGTH(NUM_TO_STR(Number DIV 10)) Total Total + STR_TO_NUM(MID(NumString, Index, 1)) ENDFOR IF Total MOD 10 <> CheckDigit THEN RETURN FALSE ENDIF RETURN TRUE ENDFUNCTION Mark as follows: 1 Function Header including Identifier, parameters and return type 2 Use of Num_TO_STR to convert parameter // Use of Num_TO_STR to convert parameter excluding least significant digit to a string 3 Extract CheckDigit from NumString // Extract least significant digit from parameter 4 Loop for length of NumString – 1 following correct convesrion to string 5 attempt to form sum of digits in a loop 6 completely correct sum of digits in a loop and of sum initialised before loop 7 Calculate check digit from sum 8 Compare sum with final digit of parameter and return appropriate Boolean value Max 7 7
Mark scheme, page 13
9618/23 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2025 © Cambridge University Press & Assessment 2025 Page 13 of 17 Question Answer Marks 6(b) Example solution – numeric version FUNCTION CheckNumber(Number : INTEGER) RETURNS BOOLEAN DECLARE Sum, CheckDigit, Remainder: INTEGER Remainder Number MOD 10 Number Number DIV 10 CheckDigit Remainder Sum 0 WHILE Nummer > 0 Remainder Number MOD 10 Number Number DIV 10 Total Total + Remainder ENDWHILE IF Total MOD 10 <> CheckDigit THEN RETURN FALSE ENDIF RETURN TRUE ENDFUNCTION 1 Function Header including Identifier, parameters and return type 2 Initialise Sum 3 Set CheckDigit to least significant digit in Number 4 Loop while Number > 0 5 attempt to use MOD and DIV to sum successive digits in Number in loop 6 completely correct sum of all digits in Number apart from least significant digit in loop 7 Calculate check digit from sum 8 Compare with CheckDigit and return appropriate Boolean value Max 7
Mark scheme, page 14
9618/23 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2025 © Cambridge University Press & Assessment 2025 Page 14 of 17 Question Answer Marks 7(a) One mark for each: 1 S2 to S5 labelled 2 Label A1 added to event from S1 to S2 3 Event lines from S2 to S3 and S3 to S2 correctly labelled 4 Events lines from S3 to S3 and event line from S3 to S4 all labelled correctly 5 Event lines from S4 to S5 correctly and event line from S4 to S2 labelled correctly Max 4 for any additional events/lines 5
Mark scheme, page 15
9618/23 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2025 © Cambridge University Press & Assessment 2025 Page 15 of 17 Question Answer Marks 7(b) One mark for each: 1 All boxes correctly labelled and connected in correct hierarchy 2 BYREF parameter to Restart, parameter to Confirm and return 3 Diamond and loop symbol 4 Parameter to Update and return from Modify 4
Mark scheme, page 16
9618/23 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2025 © Cambridge University Press & Assessment 2025 Page 16 of 17 Question Answer Marks 8(a) Example solution: PROCEDURE LoanStatus(ThisStudentID, ThisBookID : STRING) DECLARE Index : INTEGER DECLARE Found : BOOLEAN Index 1 / 0 Found FALSE WHILE Index <= 8000 / 7999 AND NOT Found IF Loan[Index].StudentID = ThisStudentID AND Loan[Index].BookID = ThisBookID THEN IF Loan[Index].OnLoan = FALSE THEN OUTPUT "Loan has been returned." ELSE OUTPUT "Loan has not been returned." ENDIF Found TRUE ENDIF Index Index + 1 ENDWHILE IF NOT Found THEN OUTPUT "Warning - Loan not found." ENDIF ENDPROCEDURE Mark as follows: 1 Procedure heading, parameters and ending 2 Loop through all elements in Loan array 3 ... or until record loan is found 4 Test for correct StudentID in a loop 5 ... and correct BookID 6 ... check OnLoan data item 7 ... and output both messages as appropriate regarding book loan status once 8 If no matching loan found, Output 'not found' after the loop 8
Mark scheme, page 17
9618/23 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2025 © Cambridge University Press & Assessment 2025 Page 17 of 17 Question Answer Marks 8(b) Example solution: FUNCTION LoansPerTutor(TutorID : STRING) RETURNS INTEGER DECLARE Index, Count : INTEGER Count 0 FOR Index 1 / 0 TO 8000 / 7999 IF LEFT(Loan[Index].StudentID, 3) = TutorID AND Loan[Index].OnLoan = TRUE THEN Count Count + 1 ENDIF NEXT Index RETURN Count ENDFUNCTION Mark as follows: 1 Initialise local integer for Count 2 Loop through all elements in the Loan array 3 Attempt at referencing a data item in a loop 4 Extract TutorID from Loan[Index].StudentID in a loop 5 Test for Matching Tutor AND test if the book has been returned using correct dot notation in a loop 6 ... if true then increment Count in a loop 7 Return count 7 8(c)(i) One mark per point: 1 Include (a suffix string based on) the date of the archive / the next number in sequence 2 Concatenate with a root filename such as 'Archive' 2 8(c)(ii) Boolean data cannot be written to a text file // OnLoan is not a string // OnLoan will have to be converted to text 1 8(c)(iii) One mark per point: Benefit: Algorithm to store / extract a record is easier // unpacking of data is not required // No need for string concatenation Drawback: More file accesses needed (to read / write a complete record) 2
What you needed in this session
Cambridge’s own grade thresholds for 2025 Oct/Nov, Paper 2 · Variant 3. A higher threshold means an easier paper — the bar moves with how the cohort did.