Paper 1
30 April 2026 · 100 marks · 2 hours 10 minutes
IB COMPUTER SCIENCE · HIGHER LEVEL
Every question from Paper 1, all four Paper 2 options (databases, modelling and simulation, web science and object-oriented programming) and the Paper 3 case study, solved step by step in friendly handwriting. Algorithms, SQL and Java are written out in full, with the reasoning behind each line.
Updated

IB Computer Science Higher Level is assessed by three written papers and an internal assessment. Paper 1 (100 marks) covers system fundamentals, computer organization, networks, computational thinking, abstract data structures, resource management and control. Paper 2 (65 marks) tests one option chosen by the school: A databases, B modelling and simulation, C web science or D object-oriented programming in Java. All four are solved here. Paper 3 (30 marks) is based on a case study released in advance; for 2026 it is “An ethical approach to hacking”, about penetration testing at a hospital.
| Paper | Date and session | Time | Questions | Marks |
|---|---|---|---|---|
| Paper 1 | 30 April 2026, afternoon | 2 hours 10 minutes | 15 | 100 |
| Paper 2 · Option A | 4 May 2026, morning | 1 hour 20 minutes | 4 | 65 |
| Paper 2 · Option B | 4 May 2026, morning | 1 hour 20 minutes | 4 | 65 |
| Paper 2 · Option C | 4 May 2026, morning | 1 hour 20 minutes | 5 | 65 |
| Paper 2 · Option D | 4 May 2026, morning | 1 hour 20 minutes | 5 | 65 |
| Paper 3 (case study) | 4 May 2026, morning | 1 hour | 4 | 30 |
The cover of each paper lists Zone A, Zone B and Zone C at the same time of day, so there is one version of each. Paper 1 was held on 30 April 2026 and Papers 2 and 3 on 4 May 2026.
| Command term | What you need to do |
|---|---|
| Identify / State / List | Give short answers with no explanation, usually one mark each. |
| Define | Give the precise meaning of a term. |
| Outline | Give a brief account: a point and a short expansion, often two marks. |
| Describe | Give a detailed account of how something works, step by step. |
| Explain | Give reasons or causes: say what happens and why. |
| Construct | Write the algorithm in pseudocode or the method in code, so that it works for all cases. |
| Determine / Trace | Work out the answer by following the algorithm, showing each step. |
| Evaluate / Justify / Discuss | Give arguments for and against, linked to the context, and reach a conclusion. |
| Code | Meaning |
|---|---|
| Pseudocode | Paper 1 uses IB pseudocode. Logic counts more than exact syntax, but loops, conditions and returns must be clear. |
| Java | Option D answers are written in Java. Use the class’s existing methods where the question allows it. |
| Context | Higher-mark answers must refer to the scenario (the company, the taxi, the hospital), not just general facts. |
| Levels | Long Paper 3 answers are marked against level descriptors: depth, accuracy and a clear conclusion. |
Paper 1 algorithms are written in IB pseudocode, Option A queries in SQL, Option B formulas in spreadsheet syntax and Option D answers in Java. The logic matters more than perfect syntax, but your algorithm must work for every case, including the first and last elements and an empty structure.
30 April 2026 · 100 marks · 2 hours 10 minutes
4 May 2026 · 65 marks · 1 hour 20 minutes
4 May 2026 · 65 marks · 1 hour 20 minutes
4 May 2026 · 65 marks · 1 hour 20 minutes
4 May 2026 · 65 marks · 1 hour 20 minutes
4 May 2026 · 30 marks · 1 hour
COMPUTER SCIENCE HL · 30 APRIL 2026
Identify three characteristics to consider when comparing different types of computers.
Identify three characteristics. [3]
Answer:Processing speed; memory (RAM) and storage capacity; size and portability (any three, including cost or power consumption).
Watch out: “Identify” needs only short answers, one mark each.
Identify two resources that can be shared on a local area network (LAN).
Identify two resources. [2]
Answer:A printer; files on a file server (or an internet connection).
State the purpose of the stack access method pop().
State the purpose of pop(). [1]
Answer:pop() removes the item at the top of the stack and returns it.
State the purpose of the stack access method isEmpty().
State the purpose of isEmpty(). [1]
Answer:isEmpty() returns TRUE if the stack contains no items and FALSE otherwise.
Describe how colours are represented in a computer.
Describe how colours are represented. [3]
Answer:Each pixel stores a binary value for the intensity of red, green and blue (usually 8 bits each, 24 bits in total), giving about 16.7 million colours, often written in hexadecimal.
A truth table has three inputs A, B and C and one output OUT. The inputs form a binary number ABC (for example A = 1, B = 0, C = 1 is ). OUT is 1 if the binary number has an odd number of 1s, or if its decimal value is odd. Otherwise OUT is 0. Zero is even. Construct the truth table.
Construct the truth table. [4]
Answer:OUT = 1 for every row except ABC = 000 and ABC = 110 (see the table).
Watch out: Check both conditions for each row. One true condition is enough for OUT = 1.
A doubly linked list holds Ali (head), Zak, Kim, Mia (end). In order: Zak is deleted, the first node is deleted, the last node is deleted, and Ben is inserted at the beginning. Sketch the resulting doubly linked list.
Sketch the resulting list. [4]
Answer:Head → Ben ⇄ Kim ← End, with null before Ben and null after Kim.
Watch out: Show both pointers in each node, the null pointers at each end, and the head and end labels.
Answer the parts about protocols.
(a) Define the term protocol. [1]
(b) List three reasons why protocols are necessary in computer networks. [3]
Answer:A set of rules that governs the transmission of data between devices.
Answer:Data integrity (error detection), flow control, and compatibility between different devices (also addressing, routing, congestion control).
State one computer program that translates code written in a high-level language into machine-readable code.
State one translator. [1]
Answer:A compiler (or an interpreter).
Outline what is meant by debugging.
Outline debugging. [2]
Answer:Finding and fixing errors in a program, for example by using breakpoints, trace tables or a debugger.
A prototype for a company’s new computer system has been developed. After evaluation and revision, the new system is run in parallel with the old system. The company also promotes its services on the web and by email, and asks customers for their name, email address, home address and date of birth.
(a) State two reasons why the company might not proceed with the new system after evaluating the prototype. [2]
(b) Evaluate parallel running as part of a system installation process. [4]
(c)(i) List three threats to the security of the data collected by the company. [3]
(c)(ii) State the purpose of an email server. [1]
(c)(iii) State two benefits of using email for communication among employees. [2]
(c)(iv) Explain the need for encryption in email communication. [3]
Answer:The prototype shows that the system does not meet the users’ needs; the full system would be too expensive or take too long to build.
Answer:It is very safe (the old system is a backup and results can be compared) but costly and time-consuming (double data entry, more staff). It suits critical systems.
Watch out: “Evaluate” needs both sides and a conclusion.
Answer:Hackers gaining unauthorized access; malware such as viruses or ransomware; phishing attacks on staff (also interception of data, insider misuse, data loss).
Answer:To send, receive and store emails for its users.
Answer:It is fast (and free) and it keeps a written record that can be searched later (also attachments, many recipients).
Answer:Emails can be intercepted in transit; encryption makes them unreadable without the key, protecting personal data and keeping the company within the law.
Answer the parts about memory and the components of the CPU.
(a)(i) Distinguish between primary memory and secondary memory. [3]
(a)(ii) Outline two functions of an operating system (OS) in managing primary memory. [4]
(b)(i) State the role of the memory data register (MDR). [1]
(b)(ii) Explain the use of cache memory. [3]
(b)(iii) Explain the role of buses in CPU operations. [4]
Answer:Primary memory is directly accessible by the CPU, fast and (RAM) volatile; secondary memory is non-volatile, slower and larger, and stores data permanently.
Answer:Allocating and freeing memory for each process; protecting each process’s memory from the others (also managing virtual memory/paging).
Answer:The MDR holds the data or instruction that has just been read from memory, or that is about to be written to memory.
Answer:Cache is fast memory holding frequently used data and instructions, so the CPU can fetch them without accessing slower RAM, which speeds up processing.
Answer:The address bus carries addresses, the data bus carries data and instructions, and the control bus carries signals such as read/write, so the CPU can fetch and store data in memory.
A taxi meter calculates fares from distance and time, displays the fare in real time, applies a preset rate and lets the driver add extra charges. Taxi companies also use GPS-enabled apps on smartphones to measure the distance of a trip and calculate the fare.
(a)(i) Identify two input devices that could be used to collect the data needed to calculate the fare. [2]
(a)(ii) Describe the use of a microprocessor in a taxi meter. [3]
(b)(i) Explain how GPS works. [6]
(b)(ii) State two benefits of a GPS-enabled taxi app for passengers. [2]
(b)(iii) State two benefits of a GPS-enabled taxi app for taxi drivers. [2]
Answer:A distance sensor (for example a wheel-rotation sensor or GPS receiver) and a keypad or touchscreen for the driver to enter extra charges (also a clock/timer).
Answer:It repeatedly reads the sensor and keypad inputs, calculates the fare using the stored rates, and outputs the result to the display in real time.
Answer:Satellites broadcast their position and the time; the receiver measures the travel time from at least four satellites, converts it to distances and uses trilateration to find its position, repeating to track distance.
Watch out: For 6 marks, cover satellites, timing signals, distance from time, at least four satellites and trilateration.
Answer:They see the fare or an estimate before the trip; they can track the route and the taxi’s arrival (also safety, cashless payment).
Answer:Navigation to the passenger and the destination; automatic, accurate fares that avoid disputes (also finding nearby passengers, a record of earnings).
A program has been developed for an embedded system with limited data storage capacity, so execution time and memory usage must be planned precisely. The static integer array A holds 9, 8, 7, 4, 1, 2, 1, 3 at indexes 0 to 7. The recursive sub-program rec(M, A) is shown.
rec (M, A)
if M >= 3
then return A[M] * rec(M-1, A)
else return 1
end if
end rec(a) Outline two disadvantages of using a dynamic data structure in this program. [4]
(b) Determine the value of rec(7, A). Show all your working. [5]
(c) Construct an algorithm in pseudocode for the sub-program isThere(X, ARR), which uses an iterative binary search on ARR (8 integers sorted in ascending order) and returns TRUE if X is in ARR, otherwise FALSE. [6]
Answer:Unpredictable memory use (it may run out of the limited memory, and pointers use extra space); slower and less predictable execution (run-time allocation and sequential access).
Answer:rec(7, A) = 24
Watch out: It multiplies A[3] to A[7]: 4 × 1 × 2 × 1 × 3 = 24.
isThere(X, ARR)
LOW = 0
HIGH = 7
FOUND = FALSE
loop while LOW <= HIGH and FOUND = FALSE
MID = (LOW + HIGH) div 2
if ARR[MID] = X then
FOUND = TRUE
else if ARR[MID] < X then
LOW = MID + 1
else
HIGH = MID - 1
end if
end loop
return FOUND
end isThereAnswer:An iterative binary search that halves the search range until X is found (TRUE) or the range is empty (FALSE), as in the pseudocode.
A music college has a 200-seat concert hall with 20 rows of 10 seats. Ticket types: A (general admission) 15, B (faculty, staff, alumni, senior citizens) 10, C (students) 5. The static two-dimensional char array CONCERT[20][10] stores A, B or C for the ticket type sold for each seat, or X if no ticket was sold. For example, CONCERT[19][0] = ‘C’.
(a) Outline two reasons why a static two-dimensional char array is a suitable data structure to hold this data. [4]
(b) Construct an algorithm in pseudocode for student(CONCERT, ROW), which outputs the number of student tickets sold in that row. [4]
(c) Construct an algorithm in pseudocode for revenue(CONCERT), which outputs the total amount of money from the sale of tickets for a concert. [7]
Answer:The number of seats is fixed (20 × 10), so a static size is ideal; the row and column indexes map directly to seats, giving direct access, and a single char per seat is enough.
student(CONCERT, ROW)
COUNT = 0
loop SEAT from 0 to 9
if CONCERT[ROW][SEAT] = 'C' then
COUNT = COUNT + 1
end if
end loop
output COUNT
end studentAnswer:Count the C entries in row ROW and output the count.
revenue(CONCERT)
TOTAL = 0
loop ROW from 0 to 19
loop SEAT from 0 to 9
if CONCERT[ROW][SEAT] = 'A' then
TOTAL = TOTAL + 15
else if CONCERT[ROW][SEAT] = 'B' then
TOTAL = TOTAL + 10
else if CONCERT[ROW][SEAT] = 'C' then
TOTAL = TOTAL + 5
end if
end loop
end loop
output TOTAL
end revenueAnswer:Nested loops over all 200 seats, adding the price for each A, B or C, then output the total.
COMPUTER SCIENCE HL · 4 MAY 2026
Option A, databases (questions 1 to 4).
A software company employs programmers and managers. Each programmer works on a single project; each project has multiple programmers; each manager oversees multiple projects; each project has one manager. When a programmer changes source code, the changes are written to a database and timestamped. Multiple programmers can work on the same code at the same time.
(a) Construct an entity-relationship diagram (ERD) that shows the relationships between programmer, manager and project. [2]
(b) Outline one benefit of using a database to track changes to source code. [2]
(c) Outline the role of timestamps in maintaining data consistency. [2]
(d) Explain one way in which concurrency can be managed in the database when two programmers update the same line of code at the same time. [5]
(e)(i) Outline what is meant by a consistent database state. [2]
(e)(ii) Describe one recovery method that can be used to restore a database. [3]
Answer:MANAGER 1 —< many PROJECT 1 —< many PROGRAMMER (see the diagram).
Answer:A full, searchable history of changes: the team can see who changed what and when, and roll back to an earlier version if a change introduces a bug.
Answer:Timestamps record the order of updates, so transactions are applied in sequence and conflicting or out-of-date updates can be detected and rejected.
Answer:Record locking: the first transaction locks the record, the second waits until it commits and the lock is released, which prevents lost updates and keeps the data consistent.
Answer:All data satisfies the integrity rules and constraints, with no partly completed transactions.
Answer:Restore the latest backup, then replay the transaction log to redo committed transactions and undo incomplete ones, returning to the last consistent state.
A manager oversees several projects, each for a specific client. PROJECT (ManagerID, ClientID, ProjectID, ProjectName, StartDate, EndDate, Priority). The PROJECT, MANAGER and CLIENT tables and a table of programmers’ professional development are shown.
(a) Suggest a primary key for the PROJECT table. [2]
(b) The Priority field stores only two values: High or Low. Outline an appropriate data type for the Priority field. [2]
(c) Construct a query to find ClientName and ContactNumber for projects managed by Sehee Choi that are High priority. [5]
(d) Construct the database in third normal form (3NF) for the entities shown in Figure 4, using the notation TABLE (Key, Field1, Field2, …). [5]
Answer:ProjectID, because it uniquely identifies each project.
Answer:Boolean (for example IsHighPriority = TRUE/FALSE), because there are only two values; it uses the least storage. (A one-character text field H/L, or an enumerated type, would also work.)
SELECT CLIENT.ClientName, CLIENT.ContactNumber
FROM PROJECT
INNER JOIN CLIENT ON PROJECT.ClientID = CLIENT.ClientID
INNER JOIN MANAGER ON PROJECT.ManagerID = MANAGER.ManagerID
WHERE MANAGER.ManagerName = 'Sehee Choi'
AND PROJECT.Priority = 'High';Answer:Result: Tech Innovators, 0123456789.
Answer:PROGRAMMER (ProgrammerID, ProgrammerName, Level) QUALIFICATION (QualificationID, QualificationName) COMPANY (CompanyID, CompanyName) COURSE (ProgrammerID, QualificationID, CourseDate, CompanyID, Complete, Cost) — the key is the first three fields together, and ProgrammerID, QualificationID and CompanyID are foreign keys.
Watch out: Underline the primary key of every table and show the foreign keys that link them.
A company is developing a database to track employees working remotely, planned with a conceptual schema and a data dictionary. Remote working needs more security. External regulators will be allowed to view the database.
(a) Outline the role of a conceptual schema. [2]
(b) Outline the purpose of a data dictionary. [2]
(c) Describe the role of a data definition language (DDL) in implementing a data model. [3]
(d) List three tasks that a database administrator carries out to ensure data security. [3]
(e) Explain the benefits of allowing external regulators to view the database. [5]
Answer:It describes the whole database logically: all entities, attributes, relationships and constraints, independent of physical storage.
Answer:It stores metadata about every field and table: names, data types, sizes, validation rules, keys and relationships, so everyone uses the data consistently.
Answer:DDL statements (CREATE, ALTER, DROP) build the tables, fields, data types, keys and constraints from the model and record them in the data dictionary.
Answer:Set up user accounts and access rights (permissions/views); make and test regular backups; apply security updates and monitor access logs (also encryption, password policies).
Answer:Regulators can verify compliance directly, which builds trust, finds problems early, avoids penalties and makes audits quicker; read-only views keep the data protected.
A company uses a multidimensional database for data mining, and an ETL process to load a data warehouse. It uses decision trees to predict programming errors, deviation detection to identify copyrighted code, and cluster analysis and classification to study coding practices.
(a) List three benefits of using a multidimensional database model for data mining. [3]
(b) Define the term data warehouse. [1]
(c) Explain the need for data transforming in the ETL process. [5]
(d) Describe how predictive modelling using decision trees can help predict programming errors. [4]
(e) Describe how deviation detection could be used to identify copyrighted code. [2]
(f) Compare cluster analysis and classification techniques in this scenario. [5]
Answer:Fast analysis of large amounts of data; viewing data from several dimensions (slice and dice, drill down); easier discovery of trends and patterns (also pre-aggregated summaries).
Answer:A large central store of integrated, historical data from many sources, used for analysis and decision-making.
Answer:Data from different sources has different formats, errors and duplicates; transforming cleans and standardizes it so the warehouse is consistent and analysis is reliable.
Answer:The tree is trained on past error data, splitting on the attributes that best separate outcomes; new code is classified down the branches to a leaf that predicts likely errors.
Answer:New code is compared with the baseline of the company’s normal coding patterns; code that deviates sharply (or matches known outside code) is flagged as possibly copied.
Answer:Both group data, but clustering is unsupervised and discovers new groups of similar code, whereas classification is supervised and sorts new code into predefined labelled classes.
COMPUTER SCIENCE HL · 4 MAY 2026
Option B, modelling and simulation (questions 5 to 8). The paper lists the school B range as “69 and 84” in one place and “70–84” in Figure 9; the figure’s 70–84 is used, which avoids an overlap with grade C.
A spreadsheet shows five students’ scores at City Walk School. Sem 1 (column B) is out of 40 and Sem 2 (column C) is out of 60. Final % (column D) weights semester 1 by 25% and semester 2 by 75%. The school’s grade boundaries are stored in H2:I6 (35 E, 47 D, 60 C, 70 B, 85 A).
(a)(i) State Elaine Anaya Khan’s percentage for semester 1. [1]
(a)(ii) Construct the formula to calculate the percentage for cell D2. [2]
(b) Construct a formula to automatically add Elaine Anaya Khan’s grade (shown in column I) to cell E2. [3]
(c) The formula =FIND(A2," ") is in F2 and copied down. Outline why cell F4 produced an error. [2]
(d) =ISNUMBER(value) returns TRUE if the value is a number. F2 should be 7 and F4 should be FALSE. Construct a formula for cell F4 as described. [3]
(e) Explain how a last name could be extracted while ignoring a middle name. [4]
Answer:50%
Answer:=(B2/40)*25+(C2/60)*75
Answer:=VLOOKUP(D2,2:6,2,TRUE) (gives D for Elaine)
Watch out: Use TRUE (approximate match), not FALSE, because 50.0 is not exactly in the table.
Answer:Isabella has only one name with no space, so FIND cannot find " " and returns #VALUE!.
=IF(ISNUMBER(FIND(" ",A4)), FIND(" ",A4), FALSE)Answer:=IF(ISNUMBER(FIND(" ",A4)),FIND(" ",A4),FALSE)
=RIGHT(A2, LEN(A2) - FIND("#", SUBSTITUTE(A2, " ", "#",
LEN(A2) - LEN(SUBSTITUTE(A2, " ", "")))))Answer:Find the position of the last space (replace the last space with a marker using SUBSTITUTE, then FIND it) and take the text to its right.
School score ranges: E 35–46, D 47–59, C 60–69, B 70–84, A 85–100. Ministry ranges: E 40–51, D 52–65, C 66–75, B 76–90, A 91–100. The formula scales a school score (MinSS = 35, MaxSS = 85) to the Ministry range. STUDENTS = [Khan, Chanchikova, Hodroge, Naveneethan, Khalil]; SCORES = [50, 88, 73, 68, 40]; MINISTRY = [0, 0, 0, 0, 0].
(a) Calculate KS to one decimal place, where SSS = 60. You must show your working. [2]
(b) Construct an algorithm in pseudocode that takes each value in SCORES, applies the formula, rounds the result to the nearest integer and stores it in MINISTRY. [3]
(c) The portal allows only integers between 40 and 100. Describe one other automated check the Ministry might use to ensure the data is accurate. [3]
(d) Grade A is 91 to 100. Construct an algorithm in pseudocode that counts the number of grade A students and stores the result as a percentage of the total number of students. [4]
Answer:
loop I from 0 to 4
KS = ((SCORES[I] - 35) / (85 - 35)) * (91 - 40) + 40
MINISTRY[I] = round(KS)
end loopAnswer:Loop over the indexes, compute the scaled score with the formula, round it and store it in MINISTRY at the same index.
Answer:A presence check: the system rejects an upload if any required field (name or score) is empty, asking the school to complete it (or a duplicate/lookup check).
COUNT = 0
loop I from 0 to 4
if MINISTRY[I] >= 91 and MINISTRY[I] <= 100 then
COUNT = COUNT + 1
end if
end loop
PERCENT = COUNT / 5 * 100Answer:Count the A grades and convert to a percentage of all students.
The Ministry of Education is developing a real-time simulation to analyse the impact of student attendance on academic performance across all schools. City Walk School is used as a test case. A heat map shows absences against grades for schools in the region.
(a) Outline what is meant by real-time simulation. [2]
(b) Student attendance rate is one variable. Identify three other variables that would be required to model this simulation effectively. [3]
(c) Outline two categories of hardware needed for this simulation. [4]
(d) Discuss one factor that could be used to judge the effectiveness of this test case for assessing the accuracy of the simulation model. [5]
(e) Outline two factors that would affect the memory needs of a 2D visualization such as the heat map. [4]
Answer:A simulation that runs at the same speed as the real world, continuously updated with live data so results reflect the current situation.
Answer:Students’ test scores (grades); lateness or punctuality; study hours or homework completion (also socio-economic background, class size, subject).
Answer:High-performance servers to process the model in real time, and input devices (electronic registers, card readers) to collect attendance data continuously.
Answer:Representativeness: an accurate prediction at City Walk shows the model works only if the school is typical of the region; because it is a single, possibly unusual school, further testing is needed.
Answer:The number of data points plotted (students and schools) and the resolution and colour depth of the rendered image.
The Ministry uses a genetic algorithm to find the best locations for new schools, a chatbot on its website, a neural network for natural language processing of handwritten essays, and an educational tool based on how humans learn languages.
(a) Outline two steps, other than those already stated (initial population; iterate until a stopping condition), that must be taken for the genetic algorithm to find the most suitable locations. [4]
(b)(i) Outline one advantage of using a chatbot. [2]
(b)(ii) Outline one disadvantage of using a chatbot. [2]
(c) Identify two key structures of natural language. [2]
(d) Evaluate the effectiveness of natural language processing for analysing student essays. [4]
(e) Explain two principles of language learning that should be applied in this educational tool. [6]
Answer:Evaluate each candidate with a fitness function; select the fittest and breed a new generation by crossover and mutation.
Answer:It is available 24 hours a day and answers many schools at once instantly, reducing staff workload.
Answer:It may misunderstand complex or unusual questions and give wrong or unhelpful answers, so users still need a human.
Answer:Syntax (grammar and sentence structure) and semantics (meaning); also morphology, pragmatics, phonology.
Answer:Fast and consistent for large volumes and surface features, but limited by handwriting errors, ambiguity and bias, so it should support, not replace, human markers.
Answer:Spaced repetition (review items at increasing intervals to build long-term memory) and contextual, interactive practice with immediate feedback (meaningful input just above the learner’s level).
COMPUTER SCIENCE HL · 4 MAY 2026
Option C, web science (questions 9 to 13).
Callum enters the URL https://www.ibo.org in a web browser. A web page lists the students in a class using Class.xml and Class_style.xsl.
<!-- Class.xml -->
<?xml-stylesheet type="text/xsl" href="class_style.xsl"?>
<class>
<student>
<firstname>John</firstname>
<surname>Doe</surname>
<classname>Mathematics</classname>
</student>
...
</class>
<!-- Class_style.xsl (inside the template) -->
<xsl:for-each select="class/student">
<tr>
<td><xsl:value-of select="firstname"/></td>
<td><xsl:value-of select="surname"/></td>
<td><xsl:value-of select="classname"/></td>
</tr>
</xsl:for-each>(a) State two characteristics of a URL. [2]
(b) Outline two functions of a web browser. [2]
(c) HTTPS is an example of a protocol. Explain why protocols are important. [3]
(d) Identify two characteristics of extensible mark-up language (XML). [2]
(e) With reference to Class.xml and Class_style.xsl, describe how a page connects to the underlying data source. [2]
(f) Identify three characteristics of transmission control protocol (TCP). [3]
Answer:It is unique to a resource; it contains the protocol (https), the domain name (www.ibo.org) and optionally a path to a file.
Answer:It sends requests to web servers using HTTP/HTTPS and receives the responses; it renders HTML, CSS and scripts into a page the user can view (also bookmarks, history, caching).
Answer:Protocols are shared rules that let different devices and software communicate reliably; HTTPS adds encryption so the data is secure.
Answer:Users define their own tags (it is extensible); it is a hierarchical, self-describing and human- and machine-readable text format (also strict well-formed rules).
Answer:Class.xml links to Class_style.xsl, which transforms the XML: it loops through each student and inserts the firstname, surname and classname values into an HTML table.
Answer:Connection-oriented (a three-way handshake); reliable delivery with acknowledgements and retransmission; data is delivered in the correct order (also flow and congestion control, error checking).
It is estimated that the deep web is 500 times larger than the surface web. Developers try to make their sites rank higher in search engine results.
(a) Outline one difference between the deep web and the surface web. [2]
(b) Define the term web crawler. [1]
(c) Outline the web crawling process. [3]
(d) Describe two advantages of parallel web crawling. [4]
(e) Evaluate two white hat techniques that may be used in search engine optimization. [5]
Answer:The surface web is indexed by search engines and found by searching, while the deep web is not indexed (for example pages behind logins, forms or databases).
Answer:A program that automatically visits web pages and follows their links to collect and index content for a search engine.
Answer:Start from seed URLs; fetch and index each page; extract its links and add new ones to the queue; repeat, following robots.txt.
Answer:Many pages are downloaded at the same time, so coverage is larger and faster; the index can be refreshed more often (and the load is spread across locations).
Answer:Quality keyword-relevant content and earning reputable backlinks both improve rankings sustainably within the guidelines, but they take time and effort; still better than risky black hat techniques.
Violet is a photographer with profiles on several social media platforms. Her platform is a community of independent sites connected by open standards such as ActivityPub: a distributed social network.
(a) Distinguish between ubiquitous computing and mobile computing. [4]
(b) Describe how open standards support interoperability. [2]
(c) Explain how distributed social networks support decentralization of the web. [6]
(d) Discuss the challenges faced by distributed social networks with reference to intellectual property. [4]
Answer:Mobile computing is using a portable device on the move; ubiquitous computing embeds many interconnected devices in the environment so computing is everywhere and often invisible.
Answer:Because the specification is public and shared, different platforms implement the same rules and can exchange data and work together.
Answer:Many independently run servers linked by open protocols mean no single owner controls the data, rules or access; users choose or run their own server, and there is no single point of failure.
Answer:Content is copied across many independently owned servers under different rules and laws, with no central authority, so enforcing copyright and takedowns is difficult; licences and watermarks help only partly.
A subgraph represents part of the web with weighted nodes (activity level) and weighted edges: A(3), B(5), C(9), D(4), E(5), F(2), G(1). Edges: A→D 3, A→B 2, B→D 2, D→B 4, B→C 6, C→B 2, C→D 6, D→C 2, D→F 3, D→E 2, C→E 3, E→C 5, F→E 1, E→F 1, F→G 1, E→G 2.
(a) Outline why the figure is best described as a weighted and directed graph. [2]
(b) Explain why some nodes are described as weakly connected and some as strongly connected. [4]
(c) Explain which three nodes would rank highest using the PageRank algorithm. [4]
Answer:The nodes and edges carry numerical weights, and each edge has a direction (a one-way hyperlink).
Answer:B, C, D, E and F can all reach each other along the arrows (strongly connected); A has no incoming links and G no outgoing links, so they are connected only when direction is ignored (weakly connected).
Answer:C, D and E: each receives several links from other well-connected (highly ranked) nodes, which PageRank rewards.
Watch out: PageRank depends on incoming links, not outgoing ones.
An IoT-enabled weather station network collects, analyses and transmits weather data in real time, which represents ambient intelligence. The map shows 13 stations in a town. Stations in people’s homes use meta-tags to describe and categorize data, which is not considered an ontology.
(a) Describe one difference between ambient intelligence and collective intelligence. [2]
(b) Discuss one benefit and one limitation of IoT-enabled weather stations providing accurate weather data. [6]
(c) Outline why this metadata is not considered an ontology. [2]
Answer:Ambient intelligence comes from smart devices embedded in the environment acting automatically; collective intelligence comes from many people combining their knowledge.
Answer:Benefit: dense, real-time coverage gives detailed local data and fast warnings. Limitation: home stations may be badly placed, uncalibrated or unevenly spread, so accuracy varies and data needs checking.
Answer:Meta-tags are informal, user-chosen labels; an ontology is a formal shared vocabulary that defines concepts and their relationships, which the tags do not do.
COMPUTER SCIENCE HL · 4 MAY 2026
Option D, object-oriented programming (questions 14 to 18). The class listings are shortened to the parts that the questions use.
A car rental company uses object-oriented programming to manage rentals. Each time a car is rented an instance of the Rental class (outline below) is created. It uses a class RentDate to store dates.
public class Rental
{
private int customerID;
private boolean priority;
private int carID;
private double costPerDay;
private RentDate startDate;
private RentDate endDate;
public Rental(int customerID, boolean priority, int carID,
double costPerDay, RentDate startDate, RentDate endDate) { ... }
public Rental(int customerID, int carID, double costPerDay,
RentDate startDate, RentDate endDate) // sets priority = false
public int getCustomerID() { return customerID; }
public boolean getPriority() { return priority; }
public int getCarID() { return carID; }
public double getCostPerDay() { return costPerDay; }
public RentDate getStartDate() { return startDate; }
public RentDate getEndDate() { return endDate; }
public int getDays() // returns the number of days between start and end date
public int compareTo(RentDate thisDate) // -1 earlier, 0 same, 1 later
public double getCost() { // code missing }
public String toString() { return "Customer ID" + customerID + ... + costPerDay; }
}(a) Describe, using the Rental class as an example, the difference between a class and an instance of a class. [3]
(b)(i) Outline why having multiple constructors in the Rental class is not a problem when creating a new Rental object. [3]
(b)(ii) State the OOP concept that allows two methods in the same class to share the same name but have different parameters. [1]
(c) Outline one benefit of creating the RentDate class to store the dates of car rentals. [2]
(d) Outline the purpose of the toString() method in the Rental class. [2]
(e) The total cost of a rental is the number of days multiplied by the cost per day. Construct the code for the getCost() method. [4]
Answer:The class Rental is the blueprint that defines the attributes and methods; an instance is a particular rental object created with new, holding its own values (for example customer 2920393 renting car 2934).
Answer:The constructors have different parameter lists (signatures), so the compiler picks the one that matches the arguments given; the 5-parameter one sets priority to false.
Answer:Overloading (a form of polymorphism).
Answer:Encapsulation and reuse: all date data and date operations (such as compareTo) are in one tested class that every rental can reuse.
Answer:It returns a readable String of the rental’s details so that the object can be printed or displayed.
public double getCost()
{
int days = this.getDays();
double total = days * costPerDay;
return total;
}Answer:Return getDays() multiplied by costPerDay.
The RentalShop class stores information about the shop (location) to which the rental cars belong.
public class RentalShop {
private String location;
private Rental theRentals [];
private int noOfRentals;
public RentalShop(String location) {
this.location = location;
this.noOfRentals = 0;
this.theRentals = new Rental[500];
}
public String getLocation() { return location; }
public Rental getRental(int x) { return theRentals[x]; }
public int getNoOfRentals() { return noOfRentals; }
protected void addRental(Rental newRental) {
theRentals[noOfRentals] = newRental;
noOfRentals = noOfRentals + 1;
}
protected Rental [] getTodaysRentals(RentDate today) {
// code missing
}
}(a) The company would like to open a new shop in Beach Side. Construct the code required to create this instance of the RentalShop class. [3]
(b) Describe the use of the modifier protected, with reference to methods in the RentalShop class. [2]
(c) Construct the method getTodaysRentals(RentDate today), which returns an array of all the rentals starting on that day. [6]
(d) The company would like to store information about customers in a separate class. Outline two changes that would need to be made to the existing classes to accommodate this. [4]
RentalShop beachSide = new RentalShop("Beach Side");Answer:RentalShop beachSide = new RentalShop("Beach Side");
Answer:protected limits access to the class itself and its subclasses (and the package), so addRental and getTodaysRentals cannot be called by unrelated classes.
protected Rental[] getTodaysRentals(RentDate today)
{
int count = 0;
for (int i = 0; i < noOfRentals; i++)
{
if (theRentals[i].getStartDate().compareTo(today) == 0)
{
count = count + 1;
}
}
Rental[] todays = new Rental[count];
int j = 0;
for (int i = 0; i < noOfRentals; i++)
{
if (theRentals[i].getStartDate().compareTo(today) == 0)
{
todays[j] = theRentals[i];
j = j + 1;
}
}
return todays;
}Answer:Count the rentals whose start date compares equal to today, create an array of that size, copy them in and return it.
Watch out: Loop only up to noOfRentals, not to 500, or you will meet null elements.
Answer:Replace the int customerID in Rental with a Customer object reference (updating the constructors, accessors and toString); add a collection of Customer objects (for example in RentalShop) so customers can be stored and found.
The full solution is being tested using the following code.
RentalShop[] shops = new RentalShop[3];
shops[0] = new RentalShop("Silverlake");
shops[1] = new RentalShop("Fjord View");
shops[2] = new RentalShop("Sea View");
shops[0].addRental(new Rental(2920393, true, 2934, 54.0,
new RentDate(2026, 2, 12), new RentDate(2026, 2, 22)));
shops[0].addRental(new Rental(2929202, 2944, 64.0,
new RentDate(2026, 2, 14), new RentDate(2026, 2, 23)));
shops[2].addRental(new Rental(2920393, true, 334, 52.0,
new RentDate(2026, 2, 12), new RentDate(2026, 4, 20)));
shops[2].addRental(new Rental(2910222, true, 5645, 65.0,
new RentDate(2026, 2, 13), new RentDate(2026, 4, 20)));(a)(i) State the outcome of IBIO.output(shops[1].getLocation()); [1]
(a)(ii) State the outcome of IBIO.output(shops[0].getRental(0).getCustomerID()); [1]
(a)(iii) State the outcome of IBIO.output(shops[2].getRental(1).getEndDate()); [1]
(b) Outline one ethical issue programmers need to consider when developing code for financial transactions. [2]
(c) Construct the code for the method getTotalIncome(), which finds the total cost of all rentals from all cars in all shops. You can use any previously constructed methods. [5]
(d) The Rental class is dependent on the RentDate class. Explain one reason why the programmers would want to reduce dependencies. [3]
(e) The programmers have worked in a team. Describe one advantage of working as a team. [2]
Answer:Fjord View
Answer:2920393
Answer:The end date of that rental, 20 April 2026 (RentDate(2026, 4, 20)). If RentDate does not override toString(), Java prints an object reference such as RentDate@1b6d3586.
Answer:Accuracy and honesty: the code must calculate charges correctly (for example avoid rounding errors) so customers are not overcharged (also: keeping customers’ financial data secure and private).
public double getTotalIncome(RentalShop[] shops)
{
double total = 0;
for (int s = 0; s < shops.length; s++)
{
if (shops[s] != null)
{
for (int r = 0; r < shops[s].getNoOfRentals(); r++)
{
total = total + shops[s].getRental(r).getCost();
}
}
}
return total;
}Answer:Nested loops over shops and their rentals, adding getCost() of each rental.
Answer:Reducing dependencies (coupling) means that changing one class does not force changes and retesting in others, so the system is easier to maintain and less error-prone.
Answer:Tasks are shared and done in parallel, so the program is finished faster (and code can be peer-reviewed).
The company wants a linked list of Customer objects. When a shop closes, every customer who prefers it needs their preferredShop updated.
public class Customer
{
private int customerID;
private String customerName;
private String preferredShop;
public String getPreferredShop() { return preferredShop; }
public void setPreferredShop(String shop) { preferredShop = shop; }
// remaining accessor and mutator methods implemented but not shown
}(a) Construct the method public int changePreferredShop(LinkedList customers, String preferredShop, String newShop), which changes the preferred shop of every affected customer to newShop and returns the number of customers changed. [6]
(b) Outline two benefits of using a library when developing code. [4]
public int changePreferredShop(LinkedList customers,
String preferredShop, String newShop)
{
int count = 0;
for (int i = 0; i < customers.size(); i++)
{
Customer c = (Customer) customers.get(i);
if (c.getPreferredShop().equals(preferredShop))
{
c.setPreferredShop(newShop);
count = count + 1;
}
}
return count;
}Answer:Traverse the list, update matching customers with setPreferredShop(newShop), count them and return the count.
Watch out: Use .equals() to compare Strings, not ==.
Answer:Reliability (already tested) and saving time (no need to write it yourself); also standard and well documented.
A programmer has produced the following recursive algorithm.
int X (int Y){
if (Y <= 1){
return Y;
}
else{
return Y + X(Y-1);
}
}(a) Outline one benefit of recursion. [2]
(b) Trace the recursive algorithm when called with X(5). [4]
(c) Identify why calling the algorithm with X(-3) would cause an error. [1]
(d) Explain one action a programmer could take to improve the readability of code. [3]
Answer:Recursion gives short, elegant code that mirrors problems that are naturally defined recursively (for example tree traversal).
Answer:X(5) = 15 (it adds 5 + 4 + 3 + 2 + 1).
Answer:It returns −3 straight away (the base case is met), which is a wrong, meaningless result: a logic error, because negative inputs are not validated.
Answer:Use meaningful names (for example sumUpTo(n) instead of X(Y)), so the purpose is clear, which makes the code easier to understand, maintain and debug.
COMPUTER SCIENCE HL · 4 MAY 2026
Paper 3 is based on the pre-released case study “An ethical approach to hacking”, about CyberHealth Security testing the network of MedTechPro Hospital (MTPH) using the PTES process. The short summary in each question gives the context the answer needs.
The case study: CyberHealth Security has been hired to review the cybersecurity of MedTechPro Hospital (MTPH) using the penetration testing execution standard (PTES). In the pre-engagement interactions phase, boundaries and limits are defined.
(a) Identify two types of network topology. [2]
(b) Outline one limit that might be agreed upon during the pre-engagement interactions phase of the PTES process. [2]
Answer:Star and bus (also ring, mesh, tree/hierarchical).
Answer:Life-critical IoT medical devices are excluded (or testing happens only at agreed times), so that the test cannot disrupt patient care.
In the intelligence-gathering phase the team uses open-source intelligence (OSINT) and network scanning.
(a) Describe one benefit and one limitation of using OSINT techniques in the intelligence-gathering phase of the PTES process. [4]
(b) Describe the process of network scanning. [4]
Answer:Benefit: legal, low-cost and non-intrusive, and it reveals what an attacker could find (for example staff details). Limitation: the information can be inaccurate or out of date and is time-consuming to analyse.
Answer:Discover live hosts, scan their ports, identify services and operating systems, then catalogue IP addresses and map the network to find likely vulnerabilities.
Automated tools and manual techniques are used in the vulnerability analysis phase of the PTES process.
Explain two benefits of using automated tools and manual techniques together to conduct vulnerability analysis. [6]
Answer:Automated tools give fast, wide coverage of known vulnerabilities and manual checks confirm them (fewer false positives); manual testing adds depth, finding logic flaws and chained or device-specific weaknesses that tools miss, while protecting fragile medical systems.
Watch out: For 6 marks: name each benefit, explain how it works and link it to the hospital.
MTPH aims to implement a comprehensive response plan that includes proactive measures, such as the PTES process, as well as reactive measures.
Justify the implementation of a comprehensive response plan that includes proactive measures and reactive measures for managing cybersecurity incidents at MTPH. [12]
Answer:Proactive measures (PTES testing, patching, training, segmentation) reduce the likelihood of incidents, but cannot stop every attack; reactive measures (incident response, backups, containment, communication) limit the impact. Given sensitive EHRs, patient safety and legal duties, combining both is justified despite the cost.
Watch out: For 12 marks: cover proactive and reactive measures, link them to the case study, weigh costs against benefits and end with a clear judgement.
The topic map groups the questions into five areas. Programming and data structures (recursion, linked lists, binary search and 2D arrays) carries the most marks in Paper 1, and each Paper 2 option adds 65 marks. You only need the option your school teaches. Use the tables to find every question on a topic you want to practise.
| Syllabus area | Questions | Marks | Share of marks |
|---|---|---|---|
| Option A: databases | 4 | 65 | 17% |
| Option B: modelling and simulation | 4 | 65 | 17% |
| Option C: web science | 5 | 65 | 17% |
| Option D: object-oriented programming | 5 | 65 | 17% |
| Programming and data structures | 7 | 39 | 10% |
| Computer organization and control | 4 | 37 | 9% |
| Case study: ethical hacking | 4 | 30 | 8% |
| System fundamentals and networks | 4 | 24 | 6% |
| Question | Topic | Area | Marks |
|---|---|---|---|
| Paper 1 Q1 | Comparing types of computers | System fundamentals and networks | 3 |
| Paper 1 Q2 | Shared resources on a LAN | System fundamentals and networks | 2 |
| Paper 1 Q3 | Stack method pop() | Programming and data structures | 1 |
| Paper 1 Q4 | Stack method isEmpty() | Programming and data structures | 1 |
| Paper 1 Q5 | Representing colour in binary | Computer organization and control | 3 |
| Paper 1 Q6 | Truth table from a description | Computer organization and control | 4 |
| Paper 1 Q7 | Operations on a doubly linked list | Programming and data structures | 4 |
| Paper 1 Q8 | Network protocols | System fundamentals and networks | 4 |
| Paper 1 Q9 | Translators | Programming and data structures | 1 |
| Paper 1 Q10 | Debugging | Programming and data structures | 2 |
| Paper 1 Q11 | Prototypes, parallel running and email security | System fundamentals and networks | 15 |
| Paper 1 Q12 | Memory, the operating system and the CPU | Computer organization and control | 15 |
| Paper 1 Q13 | Taxi meters and GPS | Computer organization and control | 15 |
| Paper 1 Q14 | Static arrays, recursion and binary search | Programming and data structures | 15 |
| Paper 1 Q15 | Two-dimensional arrays: concert tickets | Programming and data structures | 15 |
| Paper 2, Option A Q1 | ER diagrams, timestamps, concurrency and recovery | Option A: databases | 16 |
| Paper 2, Option A Q2 | Primary keys, data types, SQL and 3NF | Option A: databases | 14 |
| Paper 2, Option A Q3 | Schemas, data dictionaries, DDL and security | Option A: databases | 15 |
| Paper 2, Option A Q4 | Data warehousing and data mining | Option A: databases | 20 |
| Paper 2, Option B Q5 | Spreadsheet formulas and text functions | Option B: modelling and simulation | 15 |
| Paper 2, Option B Q6 | Scaling scores to another range | Option B: modelling and simulation | 12 |
| Paper 2, Option B Q7 | Real-time simulation of attendance | Option B: modelling and simulation | 18 |
| Paper 2, Option B Q8 | Genetic algorithms, chatbots and natural language | Option B: modelling and simulation | 20 |
| Paper 2, Option C Q9 | URLs, browsers, protocols, XML and XSLT | Option C: web science | 14 |
| Paper 2, Option C Q10 | Deep web, web crawling and SEO | Option C: web science | 15 |
| Paper 2, Option C Q11 | Ubiquitous computing and distributed social networks | Option C: web science | 16 |
| Paper 2, Option C Q12 | Weighted directed graphs and PageRank | Option C: web science | 10 |
| Paper 2, Option C Q13 | Ambient intelligence and the IoT | Option C: web science | 10 |
| Paper 2, Option D Q14 | Classes, objects, overloading and getCost() | Option D: object-oriented programming | 15 |
| Paper 2, Option D Q15 | Encapsulation, protected access and arrays of objects | Option D: object-oriented programming | 15 |
| Paper 2, Option D Q16 | Testing, ethics, getTotalIncome() and dependencies | Option D: object-oriented programming | 15 |
| Paper 2, Option D Q17 | Linked lists of objects and libraries | Option D: object-oriented programming | 10 |
| Paper 2, Option D Q18 | Recursion and readability | Option D: object-oriented programming | 10 |
| Paper 3 (case study) Q1 | Network topologies and the PTES pre-engagement phase | Case study: ethical hacking | 4 |
| Paper 3 (case study) Q2 | OSINT and network scanning | Case study: ethical hacking | 8 |
| Paper 3 (case study) Q3 | Automated tools and manual techniques in vulnerability analysis | Case study: ethical hacking | 6 |
| Paper 3 (case study) Q4 | Justifying a comprehensive incident response plan | Case study: ethical hacking | 12 |
Paper 1. Section A has short answers, about one minute per mark. In Section B, spend the most time on the “construct” questions: trace your algorithm with the example data given in the question before you move on.
Paper 2 options. In Option A, practise SQL joins and normalising to 3NF. In Option B, practise spreadsheet lookups and text functions. In Option C, learn graph terms and how PageRank works. In Option D, read the class listings carefully and reuse their methods, such as getDays(), getStartDate().compareTo() and getNoOfRentals(). Loop only up to the number of items stored, compare Strings with equals(), and practise tracing recursion in a table.
Paper 3. Learn the case study vocabulary (PTES phases, OSINT, network scanning, vishing, pretexting, black, white and grey box testing) and always link your answer to the hospital: patient data, IoT medical devices and uninterrupted care.
Work by topic. After a first pass, redo the questions for your weakest syllabus area in the topic map. Seeing three or four questions on the same idea from different papers is the quickest way to see what the examiners expect.
A LITTLE MORE CLARITY
Papers, marks, time zones and how to use the worked solutions.
Tell us about your needsThey are the three written papers for Higher Level Computer Science in May 2026. Paper 1 (30 April 2026, afternoon, 2 hours 10 minutes, 100 marks) covers the core and HL extension. Paper 2 (4 May 2026, morning, 1 hour 20 minutes, 65 marks) is the option paper. Paper 3 (4 May 2026, morning, 1 hour, 30 marks) is based on the pre-released case study.
All of them: Paper 1 (15 questions, 100 marks), every Paper 2 option (A databases, B modelling and simulation, C web science and D object-oriented programming; 18 questions, 65 marks each) and Paper 3 (4 questions, 30 marks). That is 37 questions and 390 marks in total.
Paper 2 has four options: A databases (questions 1 to 4), B modelling and simulation (5 to 8), C web science (9 to 13) and D object-oriented programming (14 to 18). Each student answers only the option their school teaches, so jump straight to yours using the contents list.
The case study “An ethical approach to hacking” follows CyberHealth Security as it tests the network of MedTechPro Hospital (MTPH) using the seven phases of the penetration testing execution standard (PTES): pre-engagement interactions, intelligence gathering, threat modelling, vulnerability analysis, exploitation, post-exploitation and reporting.
Examiners mark the logic: correct loops, conditions, use of the right methods and a correct return value. Small syntax slips are usually not penalised, but the algorithm must work for every case, for example looping only up to the number of items stored.
No. These are original worked solutions written for learners and are not published or approved by the IB. Many questions accept several valid answers, so the solutions show one strong answer and often mention alternatives. For official mark schemes, ask your teacher or use the IB’s own materials.
Use the vocabulary of the case study, link every point to the scenario (here the hospital, its patient data and IoT devices), cover both sides where asked, and finish with a justified conclusion. The 12-mark question is marked with level descriptors, so depth and structure matter.
State, identify and list need short answers. Outline needs a brief explanation. Describe and explain need detail and reasons. Construct means write working pseudocode or code. Evaluate, discuss and justify need balanced arguments and a conclusion. The table on this page lists them all.
Attempt each question first under time pressure, about one minute per mark. Then compare your answer with the steps, check the red notes for common mistakes, and rewrite any algorithm you got wrong without looking a few days later.
YOUR NEXT STEP STARTS HERE
Work one to one with a tutor on pseudocode, SQL, Java, your Paper 2 option and the case study, and turn these papers into marks.