Practice Questions
OxfordAQA IGCSE Computer Science: Data Structures, Subroutines and Translators — Practice Questions (9210)
Original practice questions with worked answers on arrays, records, files, strings, subroutines, validation and translators for OxfordAQA IGCSE 9210.
- Subject
- Computer Science
- Level
- IGCSE
- Topic
- Programming
- Author
- Marlbridge Academic Team
- Updated
- Reviewed by
- Harris Khan (what this means)
Aligned to OxfordAQA IGCSE Computer Science (9210), For teaching from September 2017, exams from May/June 2019. Official specification .
Syllabus page (what it covers and how it is assessed): OxfordAQA IGCSE Computer Science.
Syllabus points this page covers
9210
- 3.2.6 Data structures
- 3.2.7 Input/output and file handling
- 3.2.8 String handling operations in a programming language
- 3.2.9 Random number generation in a programming language
- 3.2.10 Subroutines (procedures and functions)
- 3.2.11 Structured programming
- 3.2.12 Robust and secure programming
- 3.2.13 Classification of programming languages and translators
Found an error? Report a correction.
Need help with this topic? Request a free trial class for IGCSE Computer Science (9210).
These are original questions written for Marlbridge, for revision and practice on this content. They are not reproduced past-paper questions, and they do not replicate the exam’s exact structure, question count or mark tariffs — examination boards hold copyright in their own papers. Use these alongside the official past papers available free from your board.
Related: Data structures, subroutines and translators revision notes · study guide
These questions cover sections 3.2.6 to 3.2.13 of Topic 2 Programming in OxfordAQA International GCSE Computer Science (9210). For 3.2.1–3.2.5, use the Programming Fundamentals practice questions.
Section A
1. State one difference between an array and a record. [2]
2. A program stores the scores of 8 players in each of 3 rounds of a quiz. State the most suitable data structure and give its dimensions. [2]
3. State the result of each string operation: (a) the length of “Nairobi” (b) “Data” concatenated with “Base” (c) converting the string “17” to an integer and adding 3. [3]
4. Name the three types of program translator. [3]
5. State what is meant by a local variable. [1]
Section B
6. A library stores details about each book: its title, the number of pages, its price and whether it is currently on loan.
(a) Explain why a record is more suitable than a single array for storing the details of one book. [2] (b) Suggest a suitable data type for each of the four fields. [4]
7. A text file scores.txt holds one integer score per line. Describe, step by step, how a program would find the total of all the scores in the file. [4]
8. A program asks a user to enter a password when creating an account. The password must not be empty and must be at least 8 characters long.
(a) Write pseudocode that keeps asking for a password until it meets both rules. [4] (b) Give one item of erroneous test data and one item of boundary test data for this routine, and justify each. [4]
9. A game needs to simulate rolling two six-sided dice and output their total.
(a) Write pseudocode for a function rollTwo that returns the total of two dice. You may use RANDOM_INT(1, 6) to give a random integer from 1 to 6. [3]
(b) Explain how data is passed out of rollTwo to the part of the program that calls it. [1]
Section C
10. A team is writing a large school timetable program. Explain three advantages of using a structured approach with subroutines. [6]
11. A company is writing software for a washing machine controller.
(a) Explain why the programmers might choose assembly language for part of this software. [2] (b) State two disadvantages of writing in assembly language rather than a high-level language. [2]
12. A developer is testing a new program and will later sell it to customers. Explain which translator is most suitable during testing and which is most suitable for the version sold to customers. [4]
13. Explain the difference between how an assembler and an interpreter carry out their work. [3]
Answers
1. An array holds items that must all be the same data type [1]; a record holds fields that can be different data types [1]. (Accept: array items reached by index, record fields reached by name.)
2. A two-dimensional array [1] with dimensions 8 × 3 (players by rounds), or 3 × 8 [1].
3. (a) 7 [1] (b) “DataBase” [1] (c) 20 [1].
4. Compiler [1], interpreter [1], assembler [1].
5. A variable that exists, and can be used, only inside the subroutine where it is declared [1].
6. (a) The details are of different data types (text, whole number, decimal, true/false) [1]; a record groups related fields of different types under one name, whereas an array can only hold items of one type [1]. (b) Title: string [1]; pages: integer [1]; price: real [1]; on loan: Boolean [1].
7. Set a total to 0 [1]; open the file for reading [1]; in a loop until the end of the file, read a line, convert it to an integer and add it to the total [1]; close the file and output the total [1].
8. (a) One possible answer:
REPEAT
OUTPUT "Enter a password"
password <- USERINPUT
UNTIL LEN(password) <> 0 AND LEN(password) >= 8
Repeat loop that re-asks until valid [1]; input inside the loop [1]; empty-string check [1]; minimum length 8 check combined correctly with AND [1]. (Because a length of at least 8 is never empty, the length check alone is also credited, provided the loop and input are correct.) (b) Erroneous: an empty string, or “cat” (3 characters), which should be rejected because it breaks a rule [1 + 1]. Boundary: a password of exactly 8 characters, which should be accepted (or exactly 7, which should be rejected), because it tests the edge of the length rule [1 + 1].
9. (a)
FUNCTION rollTwo()
die1 <- RANDOM_INT(1, 6)
die2 <- RANDOM_INT(1, 6)
RETURN die1 + die2
ENDFUNCTION
Two separate random values [1]; added together [1]; returned [1].
(b) Through a return value: the total is returned to the calling statement, for example total <- rollTwo() [1].
10. Any three, each with an explanation [2 each]:
- Each subroutine can be tested separately, so errors are found and fixed more easily before modules are combined.
- Work can be divided between programmers, so the timetable program is finished sooner.
- Code is reused by calling a subroutine many times (for example, a routine that checks a room is free), so the program is shorter and a fix is made in one place.
- Clear interfaces (parameters and return values) and local variables mean modules do not interfere with each other, so the program is easier to understand and maintain.
11. (a) Assembly language gives direct control of the hardware (motors, valves, sensors) [1] and produces fast, compact code suited to an embedded system with limited memory [1]. (b) Any two: harder to write, read and debug [1]; specific to one processor family, so not portable [1]; takes longer to develop [1].
12. During testing: an interpreter [1], because it runs statement by statement and stops at the first error, so problems are found and fixed quickly without recompiling [1]. For customers: a compiler [1], because it produces a standalone executable that runs faster, does not need the translator installed, and does not give away the source code [1].
13. An assembler translates each assembly language instruction into one machine code instruction directly [1], producing machine code that is then run [1]. An interpreter does not generate machine code directly; it carries out each high-level statement by calling machine code subroutines within its own code [1].
Where marks are usually lost
- Naming a data type for a field without matching it to the data (price is real, not integer).
- Describing file handling without closing the file, or without converting each line to a number.
- Boundary test data given only as valid values; the edge on both sides earns credit.
- Advantages of subroutines listed without saying why each helps.
- Claiming an interpreter “creates an executable” or “translates the whole program first”.
Frequently asked questions
Are these OxfordAQA 9210 programming practice questions from real past papers? No. They are original practice questions with worked answers on sections 3.2.6 to 3.2.13 of Topic 2 Programming: arrays, records, files, strings, subroutines, validation and translators. Use them alongside official past papers.
How should you explain the advantages of subroutines? Say why each advantage helps, not just what it is. Listing advantages of subroutines without explaining why each one helps is a common way to lose marks.
What are common mistakes in file handling answers? Common errors are describing file handling without closing the file, and reading lines without converting each one to a number before using it in a calculation.
How should you choose boundary test data? Give values at the edge on both sides of the limit, not only valid values. Boundary test data given only as valid values misses credit.
What are common mistakes when describing an interpreter? Claiming an interpreter creates an executable, or that it translates the whole program first, loses marks. Those describe a compiler, while an interpreter translates and runs the program statement by statement.
Get free revision emails (optional)
Occasional emails with practice questions, worked explanations and links to free resources for the qualification and subjects you choose. No spam, and you can unsubscribe from any email. The free tools on this site never need an email.
Related resources
-
Revision notes
OxfordAQA IGCSE Computer Science: Data Structures, Subroutines and Translators — Revision Notes
Condensed recall notes on arrays, records, files, strings, random numbers, subroutines, validation and translators for OxfordAQA IGCSE 9210, 3.2.6-3.2.13.
Computer Science · OxfordAQA · IGCSE
Revise topic -
Study guides
OxfordAQA IGCSE Computer Science: Programming Fundamentals (9210)
Guide to OxfordAQA International GCSE Computer Science 9210 sections 3.2.1 to 3.2.5: data types, the three constructs, and arithmetic and logic operators.
Computer Science · OxfordAQA · IGCSE
Read guide -
Study guides
OxfordAQA IGCSE Computer Science: Data Structures, Subroutines and Translators (9210)
Arrays and records, file handling, string operations, random numbers, subroutines, validation and authentication, and translators for OxfordAQA IGCSE 9210.
Computer Science · OxfordAQA · IGCSE
Read guide
Related articles
-
teaching
A Level tuition in Dubai: Cambridge or Pearson Edexcel International A Level?
Schools in Dubai and Abu Dhabi teach either Cambridge International AS & A Level or Pearson Edexcel International A Level. How the two are structured, why it matters for tuition, and how online classes from Lahore work.
9 October 2026
-
curriculum guides
Choosing subjects at IGCSE and A Level
How subject choices at 14 and 16 affect university options later, and how to keep pathways open without overloading a timetable.
28 July 2026
Studying this with a teacher
Working through Computer Science IGCSE?
This page is free and stays free. If you would rather be taught it, Marlbridge runs Computer Science classes one-to-one and in small groups of up to 15, online in your own time zone. The first trial class is free. WhatsApp replies within an hour (8am–11pm Pakistan time, every day); email the same day.
OxfordAQA Computer Science teachers at Marlbridge