Past paper – A Level Computer Science (9618)
Cambridge International AS & A Level · 9618
Computer Science · Paper 31
May/June 2026 · 9618/31/M/J/26
Answer on paper, open each mark scheme and give yourself marks, then open the Summary.
Question text
1
(a) A record data type is a type of composite user‑defined data type.
Identify two other types of composite user‑defined data types.
1 …
2 …
[2]
(b) (i)
A pointer data type is a non‑composite user‑defined data type.
State the purpose of a pointer user‑defined data type.
…
… [1]
(ii)
Write the pseudocode statement to declare a pointer data type called Word to be used
with STRING data.
…
…
…
… [2]
© Cambridge University Press & Assessment 2026
Question text
2
(a) Random file organisation can be used with a database management system.
State one other example of where random file organisation could be used.
…
… [1]
(b) Describe how records are organised in random files.
…
…
…
… [2]
(c) Outline the process that would be used to find a record in a random file.
…
…
…
…
…
… [3]
© Cambridge University Press & Assessment 2026
Question text
3
Numbers are stored in a computer system using binary floating‑point representation with:
•
10 bits for the mantissa
•
6 bits for the exponent
•
two’s complement form for both the mantissa and the exponent.
(a) Calculate the normalised binary floating‑point representation of –10.8125 in this system.
Show your working.
mantissa
exponent
working …
…
…
…
…
…
[3]
(b) Calculate the denary value of the given normalised binary floating‑point number.
Show your working.
mantissa
exponent
1
0
1
0
0
0
0
1
1
1
0
0
0
1
1
1
working …
…
…
…
…
denary value …
[3]
© Cambridge University Press & Assessment 2026
Question text
4
Draw one line to connect each TCP/IP layer to its most appropriate description.
TCP/IP layer
description
ensures packets arrive in sequence
without errors
Application
provides remote access to files on a
host server to access and manage files
stored in a remote location
Transport
interconnects nodes or hosts in a
network, encapsulates IP packets into
frames and ensures correct protocols
are followed
Internet
identifies the intended network and host
Link
contains all the programs that exchange
data and includes protocols: HTTP, FTP
and POP3
[4]
Question text
5
A virtual machine may be used to emulate computer hardware using software.
Outline two benefits and two limitations of using a virtual machine.
benefit 1 …
…
benefit 2 …
…
limitation 1 …
…
limitation 2 …
…
[4]
© Cambridge University Press & Assessment 2026
Question text
6
(a) The diagram shows a logic circuit.
P
A
R
Q
B
Z
S
C
Complete the truth table for the given logic circuit.
Show your working.
working space
A
B
C
P
Q
R
S
Z
0
0
0
0
0
1
0
1
0
0
1
1
1
0
0
1
0
1
1
1
0
1
1
1
[3]
© Cambridge University Press & Assessment 2026
,
,
(b) Describe one benefit of using a Karnaugh map (K‑map) for solving logic problems.
…
… [1]
(c) The Karnaugh map (K‑map) represents a logic circuit with four inputs.
AB
CD
00
01
11
10
00
0
0
1
0
01
0
1
1
0
11
1
1
1
1
10
0
0
1
0
(i)
Draw loop(s) around appropriate group(s) in the K‑map to produce an
optimal sum‑of‑products.
[3]
(ii)
Write the Boolean expression from your answer to 6(c)(i) as a simplified
sum‑of‑products. Do not carry out any further simplification.
…
… [2]
© Cambridge University Press & Assessment 2026
Question text
7
(a) Write this infix expression in Reverse Polish Notation (RPN).
21 * (15 – 3 + 8) / 7
…
…
…
… [2]
(b) Write this RPN expression in infix form.
c d + a b – a c - * /
…
…
…
… [3]
(c) The RPN expression
15
9 – 24
3 / * 18
6 + /
is to be evaluated.
Show the changing contents of the stack as the RPN expression is evaluated.
[4]
© Cambridge University Press & Assessment 2026
Question text
8
(a) Define the following asymmetric key encryption terms:
(i)
cipher text
…
… [1]
(ii)
public key.
…
…
… [1]
(b) Outline the process that would allow an individual to use asymmetric key encryption to send
a private message to an organisation.
…
…
…
…
…
…
…
… [4]
© Cambridge University Press & Assessment 2026
Question text
9
(a) Explain how supervised learning and unsupervised learning are trained.
…
…
…
…
…
…
…
… [4]
© Cambridge University Press & Assessment 2026
,
,
(b) Calculate the best path between the Begin node and each of the nodes in the diagram using
Dijkstra’s algorithm.
Show your working and write your answers in the table provided.
S
5
Q
8
R
5
2
3
P
6
6
9
T
4
21
Begin
U
working …
…
…
…
…
…
…
…
…
…
answers:
P
Q
R
S
T
U
[5]
© Cambridge University Press & Assessment 2026
Question text
10 (a) An insertion sort algorithm is used to sort the unique ID numbers of club members into
ascending order. These unique ID numbers are kept in a 1D array MemberID. The
corresponding names of the members are stored in a 1D array Names.
The arrays are declared as:
DECLARE MemberID : ARRAY[0:499] OF INTEGER
DECLARE Names : ARRAY[0:499] OF STRING
The following table defines the variables to be used in this algorithm.
identifier
data type
description
Count
integer
main loop counter to iterate through the whole array
Temp1
integer
temporary holding location for current member ID
Temp2
string
temporary holding location for current member name
Insert
integer
counter to show current insertion position
Write the pseudocode for an insertion sort to arrange the unique ID numbers into ascending
order. Make sure that the data in both arrays is swapped as required so that data with the
same index continues to apply to the same person.
Use the given identifiers. Assume all variables have been declared.
…
…
…
…
…
…
…
…
…
…
…
…
…
… [5]
© Cambridge University Press & Assessment 2026
,
,
(b) Describe the factors, other than changing the algorithm, that affect the time efficiency of the
insertion sort algorithm.
…
…
…
…
…
Question text
11
A declarative programming language is used to show which home cinema devices customers
already have and which devices they want.
01
device(projector).
02
device(large_tv).
03
device(medium_tv).
04
device(bluray_player).
05
device(amplifier).
06
device(media_player).
07
device(main_speakers).
08
device(centre_speaker).
09
device(surround_speakers).
10
customer(petrov).
11
customer(margaret).
12
customer(steffan).
13
customer(susan).
14
customer(allan).
15
customer(sammy).
16
owns(projector, petrov).
17
owns(media_player, petrov).
18
owns(projector, susan).
19
owns(projector, sammy).
20
owns(media_player, allan).
21
owns(bluray_player, steffan).
22
wants(main_speakers, margaret).
23
wants(surround_speakers, susan).
24
wants(medium_tv, steffan).
These facts (clauses) have the meanings:
fact
meaning
01
A projector is a device.
10
Petrov is a customer.
16
Petrov owns a projector.
22
Margaret wants main speakers.
(a) Betty is a customer who owns a large TV and wants a Blu‑ray player.
Write additional facts to represent this information.
25 …
26 …
27 …
[3]
© Cambridge University Press & Assessment 2026
,
,
(b) Using the variable Owner, the goal:
owns(media_player, Owner)
returns
Owner = petrov, allan
Write the result of using the goal:
owns(projector, Owner)
Owner = … [1]
(c) D may be available for A to buy if D is a device and A is a customer and A does not own
that device.
Write this as a rule:
may_buy_device(D, A)
IF …
…
…
… [4]
© Cambridge University Press & Assessment 2026
,
,
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 (Cambridge University Press & Assessment) 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 our 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 International Education is the name of our awarding body and a part of Cambridge University Press & Assessment, which is a department of the
University of Cambridge.
© Cambridge University Press & Assessment 2026