10. Data Types and Structures
Data types, records, arrays (1D/2D), files, and how ADTs are implemented with arrays.
Statometer92BankerNext Paper 295%Everything for this topic — study hub
AS Level · 9618 · Paper 2
Statometer — what 33 real papers say about this topic and each of its 4 syllabus bullets
Banker · #1 of 12 in AS Level · recomputed with every new session
Set in nearly every paper and worth a big slice of it — revise first, expect it.
- Next Paper 2
- 95%
- 9 in 10 chance it is set
- Marks a paper
- 40.2 / 75
- 54% of Paper 2 · fair share 25%
- Appeared in
- 33 / 33
- Paper 2 sittings 2021–2026
- Last set
- May/Jun 2026
- 9618/23 · Q8 · 19 marks · 11-series streak
What the papers say
- Set in 33 of 33 Paper 2 sittings on the current syllabus — treat it as certain.
- Worth about 40.2 marks a paper (54% of Paper 2, 2.1× its fair share).
- Last set May/Jun 2026 · 9618/23 · Q8 for 19 marks — in the most recent series.
- Set in each of the last 11 series without a miss.
- Steady at around 38.8 marks a paper year on year.
- Lives on “Write” and “Complete” — 89% of its questions: you must produce something — code, a diagram, a table — practise doing it, not reading it.
- 42% of its questions involve a diagram, table or figure — practise with pen and paper.
- 79% of its questions are set out as code, pseudocode or a table to complete.
- Most of its marks (60%) come in extended questions of 12+ marks — plan the answer before writing.
- Its biggest question so far: 35 marks (Oct/Nov 2023 · 9618/23 · Q7).
- Inside the topic, §10.1 Data types and records carries the most marks (38%) and §10.3 Files the least (14%).
- It is examined mostly as AO3 (Design, program & evaluate, 60%), the rest AO2 (41%) — you must build it — write the pseudocode or program, design the structure.
- The examiner has commented on 71 of its questions — read “What the examiner said” before you practise.
Command words
Share of questions using the word (a question can use several). What each wants →
Question shapes
- ≤ 6 mk20
- 7–9 mk26
- 10–12 mk28
- 13–15 mk11
- 16+ mk29
Average 11.6 marks a question · 42% with a figure or table · 79% with code · biggest 35 marks
Assessment objectives — how it is examined
Every part of every current-syllabus question filed under Cambridge's AO1 / AO2 / AO3 (from its command word and what it asks you to do), so you know whether this topic pays for definitions, for applying, or for judging and building.
- AO1 Knowledge & understanding
- AO2 Apply & analyse
- AO3 Design, program & evaluate
Paper 2 as a whole
| Paper 2 | Syllabus | Measured |
|---|---|---|
| AO1 Knowledge & understanding | 0% | 0% |
| AO2 Apply & analyse | 40% | 46% |
| AO3 Design, program & evaluate | 60% | 54% |
Syllabus = Cambridge's grid; measured = the bank's current-syllabus papers.
Inside the topic — every syllabus bullet, measured
Each part of each question is filed under the bullet it examines; the numbers are per Paper 2 sitting, exactly like the topic's. Open a bullet for its own Statometer.
10.1Data types and records#3 of 14 on Paper 2Banker · 9793% next paper12.4 marks32/33 sittings→ May/Jun 2026Banker · 9793%
12.4 · 38% of topic32/33May/Jun 2026latest series · →Asked in nearly every paper — the bullet to know cold.Syllabus: choosing INTEGER, REAL, CHAR, STRING, BOOLEAN, DATE; defining a record structure and reading from / writing to its fields
- Next Paper 2
- 93%
- 9 in 10
- Marks a paper
- 12.4
- 17% of the paper · 38% of the topic
- Asked in
- 32 / 33
- Paper 2 sittings · 70 questions
- Last asked
- May/Jun 2026
- 9618/23 · Q8 · 8 marks · 11-series streak
- Asked in 32 of 33 Paper 2 sittings — nearly every paper.
- About 12.4 marks a paper (17% of Paper 2; 38% of the topic's marks across its 4 bullets).
- Last asked May/Jun 2026 · 9618/23 · Q8 (8 marks) — in the most recent series.
- Asked in each of the last 11 series.
- Usually “Write” or “Complete”: you must produce something — code, a diagram, a table — practise doing it, not reading it.
- Biggest chunk of marks so far: 17 in Oct/Nov 2023 · 9618/23 · Q7.
- It is examined mostly as AO3 (Design, program & evaluate, 75%), the rest AO2 (26%) — you must build it — write the pseudocode or program, design the structure.
Last 12 sittings→ SteadyAssessment objectives
AO2 26%AO3 75%- AO1 Knowledge & understanding
- AO2 Apply & analyse
- AO3 Design, program & evaluate
- Write70%
- Complete43%
- State29%
- Explain27%
10.2Arrays#4 of 14 on Paper 2Banker · 9485% next paper11.9 marks28/33 sittings↗ May/Jun 2026Banker · 9485%
11.9 · 31% of topic28/33May/Jun 2026latest series · ↗Asked in nearly every paper — the bullet to know cold.Syllabus: index, upper and lower bounds; choosing a 1D or 2D array; pseudocode for arrays; bubble sort and linear search on an array
- Next Paper 2
- 85%
- 8 in 10
- Marks a paper
- 11.9
- 16% of the paper · 31% of the topic
- Asked in
- 28 / 33
- Paper 2 sittings · 65 questions
- Last asked
- May/Jun 2026
- 9618/23 · Q8 · 8 marks · 11-series streak
- Asked in 28 of 33 Paper 2 sittings — about 8 papers in 10.
- About 11.9 marks a paper (16% of Paper 2; 31% of the topic's marks across its 4 bullets).
- Last asked May/Jun 2026 · 9618/23 · Q8 (8 marks) — in the most recent series.
- Asked in each of the last 11 series.
- Rising: 8.1 → 13.5 marks a paper.
- Usually “Write” or “Complete”: you must produce something — code, a diagram, a table — practise doing it, not reading it.
- Biggest chunk of marks so far: 13 in May/Jun 2026 · 9618/21 · Q9.
- It is examined mostly as AO3 (Design, program & evaluate, 74%), the rest AO2 (26%) — you must build it — write the pseudocode or program, design the structure.
Last 12 sittings↗ RisingAssessment objectives
AO2 26%AO3 74%- AO1 Knowledge & understanding
- AO2 Apply & analyse
- AO3 Design, program & evaluate
- Write65%
- Complete43%
- State28%
- Explain25%
10.3Files#7 of 14 on Paper 2Core · 6371% next paper4.7 marks25/33 sittings→ May/Jun 2026Core · 6371%
4.7 · 14% of topic25/33May/Jun 2026latest series · →A regular earner inside the topic — most papers touch it.Syllabus: why files are needed; pseudocode to read from and write to text files of one or more lines
- Next Paper 2
- 71%
- 7 in 10
- Marks a paper
- 4.7
- 6% of the paper · 14% of the topic
- Asked in
- 25 / 33
- Paper 2 sittings · 32 questions
- Last asked
- May/Jun 2026
- 9618/22 · Q3 · 6 marks · 11-series streak
- Asked in 25 of 33 Paper 2 sittings — about 8 papers in 10.
- About 4.7 marks a paper (6% of Paper 2; 14% of the topic's marks across its 4 bullets).
- Last asked May/Jun 2026 · 9618/22 · Q3 (6 marks) — in the most recent series.
- Asked in each of the last 11 series.
- Usually “Write” or “Explain”: you must produce something — code, a diagram, a table — practise doing it, not reading it.
- Biggest chunk of marks so far: 13 in May/Jun 2024 · 9618/22 · Q8.
- It is examined mostly as AO3 (Design, program & evaluate, 51%), the rest AO2 (49%) — you must build it — write the pseudocode or program, design the structure.
Last 12 sittings→ SteadyAssessment objectives
AO2 49%AO3 51%- AO1 Knowledge & understanding
- AO2 Apply & analyse
- AO3 Design, program & evaluate
- Write72%
- Explain38%
- Describe38%
- Complete34%
10.4Introduction to abstract data types#6 of 14 on Paper 2Core · 6771% next paper5.2 marks24/33 sittings→ May/Jun 2026Core · 6771%
5.2 · 16% of topic24/33May/Jun 2026latest series · →A regular earner inside the topic — most papers touch it.Syllabus: stacks, queues and linked lists: features, when to use each, adding/editing/deleting data, and how each is implemented with arrays
- Next Paper 2
- 71%
- 7 in 10
- Marks a paper
- 5.2
- 7% of the paper · 16% of the topic
- Asked in
- 24 / 33
- Paper 2 sittings · 25 questions
- Last asked
- May/Jun 2026
- 9618/23 · Q6 · 13 marks · 11-series streak
- Asked in 24 of 33 Paper 2 sittings — about 7 papers in 10.
- About 5.2 marks a paper (7% of Paper 2; 16% of the topic's marks across its 4 bullets).
- Last asked May/Jun 2026 · 9618/23 · Q6 (13 marks) — in the most recent series.
- Asked in each of the last 11 series.
- Usually “Complete” or “Describe”: you must produce something — code, a diagram, a table — practise doing it, not reading it.
- Biggest chunk of marks so far: 13 in May/Jun 2026 · 9618/23 · Q6.
- It is examined almost entirely as AO2 (Apply & analyse, 91%) — you must apply it to the given data or scenario — work it out, trace it, explain it in context.
Last 12 sittings→ SteadyAssessment objectives
AO2 91%- AO1 Knowledge & understanding
- AO2 Apply & analyse
- AO3 Design, program & evaluate
- Complete72%
- Describe48%
- Explain28%
- State24%
17% of the topic's marks sit in question parts that belong to another topic (scenario questions cross sections) or that no bullet claims; they count for the topic, not for a bullet.
Marks a paper, year by year
By exam series
- May/Jun18/18 · 37.3 mk
- Oct/Nov15/15 · 43.3 mk
What you need to know4syllabus §10.1, §10.2, §10.3, §10.4
- 10.1Data types and records — choosing INTEGER, REAL, CHAR, STRING, BOOLEAN, DATE; defining a record structure and reading from / writing to its fields
- 10.2Arrays — index, upper and lower bounds; choosing a 1D or 2D array; pseudocode for arrays; bubble sort and linear search on an array
- 10.3Files — why files are needed; pseudocode to read from and write to text files of one or more lines
- 10.4Introduction to abstract data types — stacks, queues and linked lists: features, when to use each, adding/editing/deleting data, and how each is implemented with arrays
Video lectures42ZAK's YouTube channel · play here
ASA22024642 views
ASA22024293 views
ASA22024291 views
O LevelAS2023561 views
ASA29618 Paper 320215.4K views
AS20213.3K views
Infographics3draw these the way the examiner expects · download as PNG
Bubble sort & linear search
Stack, queue & linked list
Arrays, records & text files
Key terms9use these exact words in the exam
Dotted terms are defined in the glossary.
Code help2referenced to the Cambridge pseudocode guide
DECLARE Data : ARRAY[1:5] OF INTEGERDECLARE Link : ARRAY[1:5] OF INTEGERDECLARE Start, Free, P, Node : INTEGER// initial free list 1→2→3→4→5FOR Node ← 1 TO 4Link[Node] ← Node + 1NEXT NodeLink[5] ← 0Start ← 0Free ← 1PROCEDURE AddToFront(V : INTEGER)DECLARE N : INTEGERN ← FreeFree ← Link[Free]Data[N] ← VLink[N] ← StartStart ← NENDPROCEDURECALL AddToFront(30)CALL AddToFront(20)CALL AddToFront(10)P ← StartWHILE P <> 0OUTPUT Data[P]P ← Link[P]ENDWHILE
TYPE StudentDECLARE Name : STRINGDECLARE Mark : INTEGERENDTYPEDECLARE Group : ARRAY[1:3] OF StudentDECLARE i : INTEGERGroup[1].Name ← "Ali"Group[1].Mark ← 71Group[2].Name ← "Sara"Group[2].Mark ← 88Group[3].Name ← "Omar"Group[3].Mark ← 64OPENFILE "class.txt" FOR WRITEFOR i ← 1 TO 3WRITEFILE "class.txt", Group[i].Name & "," & NUM_TO_STR(Group[i].Mark)NEXT iCLOSEFILE "class.txt"OUTPUT "Saved — see Files panel"
Playground examples26runnable programs for this topic
- Run
Fill a 1D array with INPUT, output it backwards
Arrays are indexed from 1; a FOR loop visits every element.
O LevelASPseudocodeArrays §3.1–3.2 - Run
2D array — marks table with row and column totals
ARRAY[1:3, 1:4]: the first index is the row (student), the second the column (test).
O LevelASPseudocodeArrays §3.1–3.2, §7.1 - Run
Whole-array copy & reversed copy
Backup ← Original copies every element at once (same size and type). A reversed copy needs a loop.
ASA2PseudocodeArrays §3.2 - Run
Parallel arrays — names and marks
Two arrays share an index: Names[i] belongs with Marks[i].
O LevelASPseudocodeArrays §3.2 - Run
Passing an array to a procedure and a function
Fill an array BYREF, then total it with a function.
ASA2PseudocodeProcedures & functions §8.1–8.3 - Run
Sort parallel arrays — a leaderboard
Sort marks descending and swap the names at the same time so they stay matched.
ASPseudocodeSorting 9618 §9.2, §10.2 - Run
Text file — write then read to EOF
OPENFILE FOR WRITE creates the file; FOR READ plus a WHILE NOT EOF loop reads every line.
O LevelASPseudocodeFile handling §9.1 - Run
APPEND to a file & count its lines
WRITE starts a new file; APPEND adds after the existing data.
O LevelASPseudocodeFile handling §9.1 - Run
Search a file for a record
Each line is name,mark. Stop reading as soon as the name is found.
ASPseudocodeFile handling §9.1 - Run
Save records to a text file and load them back
Write each record as one delimited line, then parse the lines back into an array of records.
ASA2PseudocodeFile handling §4.1, §9.1 - Run
A record type
TYPE … ENDTYPE groups fields of different types under one name; access them with a dot.
ASA2PseudocodeRecords & user-defined types §4.1 - Run
Array of records — a class register
Register[i].Mark: index the array, then pick the field.
ASA2PseudocodeRecords & user-defined types §4.2 - Run
Records with DATE fields & whole-record copy
The guide's StudentRecord: Pupil2 ← Pupil1 copies every field; arrays of records are updated in a loop.
A2PseudocodeRecords & user-defined types §4.1–4.2 - Run
Stack — push, pop, overflow & underflow
LIFO with an array and a Top pointer. Watch what happens on the 4th pop.
ASA2PseudocodeStacks, queues, lists & trees 9618 §10.4, §19.1 - Run
Linear queue — enqueue & dequeue
FIFO with Front and Rear pointers. Notice the space at the front is never reused.
ASA2PseudocodeStacks, queues, lists & trees 9618 §10.4, §19.1 - Run
Linked list in arrays with a free list
Insert at the front, delete by value, traverse — using Data/Pointer records, StartPointer and FreePointer.
ASA2PseudocodeStacks, queues, lists & trees 9618 §10.4, §19.1 - Run
AS Paper 2 — library loans
An array of records, a search function, procedures for borrowing and reporting, all driven by a menu.
ASPseudocodeExam-style tasks §4.2, §8 - Run
Lists — the Python array
Create, index, change, append, and loop. Remember index 0. len() gives the size.
O LevelASPythonArrays §3.1–3.2 ↔ Python - Run
2D list — seating plan
A list of lists. seat[row][col]. Build it with a comprehension so each row is a separate list.
O LevelASPythonArrays §3.1 ↔ Python - Run
Frequency count with a list and a dictionary
Count dice rolls two ways: a list indexed by value, and a dictionary (the ADT the exam calls a dictionary).
ASA2PythonArrays §3 ↔ Python - Run
Write then read a text file
open() with 'w', 'a' and 'r'; with closes the file for you. The file appears in the Files panel after the run.
O LevelASPythonFile handling §9.1 ↔ Python - Run
Read until end of file, count and total
readline() returns '' at EOF — the Python version of WHILE NOT EOF. Also readlines().
ASPythonFile handling §9.1 ↔ Python - Run
Records in a file — CSV with the csv module
A list of dictionaries written and read back as CSV, the way Paper 4 file-handling questions expect.
A2PythonFile handling §9 ↔ Python - Run
Records — dataclass and dictionary
TYPE … ENDTYPE becomes a dataclass (or a dict). An array of records is a list of them.
ASPythonRecords & user-defined types §4.1 ↔ Python - Run
Enumerated type with Enum
TYPE Season = (Spring, Summer, …) in Python: an Enum with an order.
ASPythonRecords & user-defined types §4.1 ↔ Python - Run
Stack and queue with a list
append/pop give a stack; append/pop(0) a queue. Watch the order things come out.
ASA2PythonStacks, queues, lists & trees §10 ADT ↔ Python
Test yourself
Ready to check you know it?
Every round is a fresh random draw, weak cards come back until you get them right, and past-paper questions come with their mark schemes. Marks earn XP on your dashboard.