10. Data Types and Structures
Data types, records, arrays (1D/2D), files, and how ADTs are implemented with arrays.
Statometer93BankerNext Paper 293%Everything for this topic — study hub
AS Level · 9618 · Paper 2
This topic is rows 29–32 of the study route.Open it on your study route
Statometer — what 33 real papers say about this topic and each of its 4 syllabus bullets
Banker · #2 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
- 93%
- 9 in 10 chance it is set
- Marks a paper
- 35.1 / 75
- 47% of Paper 2 · fair share 25%
- Appeared in
- 32 / 33
- Paper 2 sittings 2021–2026
- Last set
- May/Jun 2026
- 9618/23 · Q7 · 9 marks · 11-series streak
What the papers say
- Set in 32 of 33 Paper 2 sittings on the current syllabus — treat it as certain.
- Worth about 35.1 marks a paper (47% of Paper 2, 1.9× its fair share).
- Last set May/Jun 2026 · 9618/23 · Q7 for 9 marks — in the most recent series.
- Set in each of the last 11 series without a miss.
- Easing off: about 43 marks a paper earlier, 30.8 in the latest years — still examined, just smaller.
- Lives on “Write” and “Complete” — 83% of its questions: you must produce something — code, a diagram, a table — practise doing it, not reading it.
- 53% of its questions involve a diagram, table or figure — practise with pen and paper.
- 84% of its questions are set out as code, pseudocode or a table to complete.
- Most of its marks (66%) come in extended questions of 12+ marks — plan the answer before writing.
- Its biggest question so far: 21 marks (May/Jun 2023 · 9618/21 · Q8).
- Inside the topic, §10.1 Data types and records carries the most marks (40%) and §10.4 Introduction to abstract data types the least (10%).
- It is examined mostly as AO2 (Apply & analyse, 53%), the rest AO3 (47%) — you must apply it to the given data or scenario — work it out, trace it, explain it in context.
- The examiner has commented on 138 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 mk31
- 10–12 mk57
- 13–15 mk34
- 16+ mk45
Average 12.3 marks a question · 53% with a figure or table · 84% with code · biggest 21 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% | 45% |
| AO3 Design, program & evaluate | 60% | 55% |
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#5 of 14 on Paper 2Banker · 9382% next paper9.9 marks30/33 sittings↘ May/Jun 2026Banker · 9382%
9.9 · 40% of topic30/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
- 82%
- 8 in 10
- Marks a paper
- 9.9
- 13% of the paper · 40% of the topic
- Asked in
- 30 / 33
- Paper 2 sittings · 131 questions
- Last asked
- May/Jun 2026
- 9618/21 · Q9 · 5 marks · 11-series streak
- Asked in 30 of 33 Paper 2 sittings — nearly every paper.
- About 9.9 marks a paper (13% of Paper 2; 40% of the topic's marks across its 4 bullets).
- Last asked May/Jun 2026 · 9618/21 · Q9 (5 marks) — in the most recent series.
- Asked in each of the last 11 series.
- Easing: 15 → 7 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: 14 in May/Jun 2023 · 9618/21 · Q8.
- It is examined mostly as AO3 (Design, program & evaluate, 58%), the rest AO2 (42%) — you must build it — write the pseudocode or program, design the structure.
Last 12 sittings↘ EasingAssessment objectives
AO2 42%AO3 58%- AO1 Knowledge & understanding
- AO2 Apply & analyse
- AO3 Design, program & evaluate
- Write57%
- Complete47%
- State34%
- Give31%
10.2Arrays#4 of 14 on Paper 2Banker · 9484% next paper11.9 marks29/33 sittings→ May/Jun 2026Banker · 9484%
11.9 · 33% of topic29/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
- 84%
- 8 in 10
- Marks a paper
- 11.9
- 16% of the paper · 33% of the topic
- Asked in
- 29 / 33
- Paper 2 sittings · 104 questions
- Last asked
- May/Jun 2026
- 9618/23 · Q7 · 8 marks · 11-series streak
- Asked in 29 of 33 Paper 2 sittings — nearly every paper.
- About 11.9 marks a paper (16% of Paper 2; 33% of the topic's marks across its 4 bullets).
- Last asked May/Jun 2026 · 9618/23 · Q7 (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: 16.5 in Oct/Nov 2022 · 9618/22 · Q7.
- It is examined mostly as AO3 (Design, program & evaluate, 69%), the rest AO2 (31%) — you must build it — write the pseudocode or program, design the structure.
Last 12 sittings→ SteadyAssessment objectives
AO2 31%AO3 69%- AO1 Knowledge & understanding
- AO2 Apply & analyse
- AO3 Design, program & evaluate
- Write62%
- Complete42%
- State28%
- Describe27%
10.3Files#8 of 14 on Paper 2Regular · 5460% next paper4.1 marks21/33 sittings↘ May/Jun 2026Regular · 5460%
4.1 · 17% of topic21/33May/Jun 2026latest series · ↘Set most sessions for a few marks; know the definition and one example.Syllabus: why files are needed; pseudocode to read from and write to text files of one or more lines
- Next Paper 2
- 60%
- 6 in 10
- Marks a paper
- 4.1
- 5% of the paper · 17% of the topic
- Asked in
- 21 / 33
- Paper 2 sittings · 55 questions
- Last asked
- May/Jun 2026
- 9618/22 · Q3 · 6 marks · 11-series streak
- Asked in 21 of 33 Paper 2 sittings — about 6 papers in 10.
- About 4.1 marks a paper (5% of Paper 2; 17% 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.
- Easing: 5.5 → 3.4 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 2024 · 9618/22 · Q8.
- It is examined mostly as AO2 (Apply & analyse, 52%), the rest AO3 (48%) — you must apply it to the given data or scenario — work it out, trace it, explain it in context.
Last 12 sittings↘ EasingAssessment objectives
AO2 52%AO3 48%- AO1 Knowledge & understanding
- AO2 Apply & analyse
- AO3 Design, program & evaluate
- Write66%
- Complete40%
- Describe38%
- State27%
10.4Introduction to abstract data types#6 of 14 on Paper 2Core · 6971% next paper5.5 marks24/33 sittings→ May/Jun 2026Core · 6971%
5.5 · 10% 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.5
- 7% of the paper · 10% 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.5 marks a paper (7% of Paper 2; 10% 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
- Complete76%
- Describe48%
- State24%
- Explain24%
19% 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
Grey years are the previous syllabus (2015–2021, 84 questions) — history, not counted in the rates.
By exam series
- May/Jun17/18 · 33.2 mk
- Oct/Nov15/15 · 43.5 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
ASA22024677 views
ASA22024296 views
ASA22024293 views
O LevelAS2023563 views
ASA220215.5K views
AS20213.4K 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
Code help4referenced 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"
DECLARE Names : ARRAY[1:6] OF STRINGDECLARE i, Last : INTEGERDECLARE Temp, Target : STRINGDECLARE Found, Swapped : BOOLEANNames[1] ← "Zara"Names[2] ← "Ali"Names[3] ← "Omar"Names[4] ← "Bilal"Names[5] ← "Hina"Names[6] ← "Sana"Target ← "Hina"Found ← FALSEi ← 1WHILE i <= 6 AND NOT FoundIF Names[i] = Target THENFound ← TRUEELSEi ← i + 1ENDIFENDWHILEIF Found THENOUTPUT Target, " found at index ", iELSEOUTPUT Target, " not found"ENDIFLast ← 5REPEATSwapped ← FALSEFOR i ← 1 TO LastIF Names[i] > Names[i + 1] THENTemp ← Names[i]Names[i] ← Names[i + 1]Names[i + 1] ← TempSwapped ← TRUEENDIFNEXT iLast ← Last - 1UNTIL NOT Swapped OR Last = 0FOR i ← 1 TO 6OUTPUT Names[i]NEXT i
💡 The search stops as soon as the item is found; the sort shortens each pass and stops early when a pass makes no swaps.
DECLARE Line : STRINGDECLARE Count, Total : INTEGEROPENFILE "Scores.txt" FOR WRITEWRITEFILE "Scores.txt", "45"WRITEFILE "Scores.txt", "72"WRITEFILE "Scores.txt", "60"CLOSEFILE "Scores.txt"Count ← 0Total ← 0OPENFILE "Scores.txt" FOR READWHILE NOT EOF("Scores.txt")READFILE "Scores.txt", LineCount ← Count + 1Total ← Total + STR_TO_NUM(Line)ENDWHILECLOSEFILE "Scores.txt"OUTPUT Count, " lines, total ", Total
💡 Text files hold strings, so each line is converted with STR_TO_NUM before it is added.
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.
- 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).
- Run
Whole-array copy & reversed copy
Backup ← Original copies every element at once (same size and type). A reversed copy needs a loop.
- Run
Parallel arrays — names and marks
Two arrays share an index: Names[i] belongs with Marks[i].
- Run
Passing an array to a procedure and a function
Fill an array BYREF, then total it with a function.
- Run
Sort parallel arrays — a leaderboard
Sort marks descending and swap the names at the same time so they stay matched.
- 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.
- Run
APPEND to a file & count its lines
WRITE starts a new file; APPEND adds after the existing data.
- Run
Search a file for a record
Each line is name,mark. Stop reading as soon as the name is found.
- 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.
- Run
A record type
TYPE … ENDTYPE groups fields of different types under one name; access them with a dot.
- Run
Array of records — a class register
Register[i].Mark: index the array, then pick the field.
- 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.
- Run
Stack — push, pop, overflow & underflow
LIFO with an array and a Top pointer. Watch what happens on the 4th pop.
- Run
Linear queue — enqueue & dequeue
FIFO with Front and Rear pointers. Notice the space at the front is never reused.
- Run
Linked list in arrays with a free list
Insert at the front, delete by value, traverse — using Data/Pointer records, StartPointer and FreePointer.
- Run
AS Paper 2 — library loans
An array of records, a search function, procedures for borrowing and reporting, all driven by a menu.
- Run
Lists — the Python array
Create, index, change, append, and loop. Remember index 0. len() gives the size.
- Run
2D list — seating plan
A list of lists. seat[row][col]. Build it with a comprehension so each row is a separate list.
- 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).
- 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.
- Run
Read until end of file, count and total
readline() returns '' at EOF — the Python version of WHILE NOT EOF. Also readlines().
- 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.
- Run
Records — dataclass and dictionary
TYPE … ENDTYPE becomes a dataclass (or a dict). An array of records is a list of them.
- Run
Enumerated type with Enum
TYPE Season = (Spring, Summer, …) in Python: an Enum with an order.
- Run
Stack and queue with a list
append/pop give a stack; append/pop(0) a queue. Watch the order things come out.
Also for this topic: 11 Java programs · 11 VB.NET programs in the browser compilers.
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.
NewCS Games · 16 to play
Revise this topic by playing
Quiz battles, a daily CS word, SQL whodunnits, logic-gate puzzles and arcade — every game drills the syllabus. Solo against AskZ bots, with friends, or with your whole class. Free, no sign-up.


