Skip to content
ExamSpine

Practice Paper 1, HL, set 1

HL · 120 minutes · 80 marks

Instructions

  • Answer every question in Section A and Section B.

  • The marks for each question are shown in square brackets, such as [3].

  • Answer on paper or on screen. Each question links to its own page, where you can type an answer and mark it against its marking points.

  • Times and marks follow public descriptions of the new course, which Spine has not yet checked against the IB's subject guide. Your school's mocks may differ.

Section A

Answer all questions.

Question 1

A bike-share docking station's processor runs a loop millions of times a day. Each time round, it reads the same few instructions and the same few variables (such as the number of free docks) from memory.

Explain how CPU cache memory speeds up this loop, referring to a cache hit and a cache miss. [3]

Answer it on its own page and mark it yourself

Question 2

A barcode scanner is plugged into a school library computer. Instead of the processor checking the scanner over and over (polling), the scanner sends an interrupt each time a book is scanned.

(a) Explain how the processor handles this interrupt. [3]

(b) State one advantage of using interrupts rather than polling for the scanner. [1]

[4]

Answer it on its own page and mark it yourself

Question 3

A games console's processor splits each instruction into three stages: fetch, decode and execute. Each stage takes one clock cycle.

(a) Explain how pipelining raises the number of instructions completed per second. [2]

(b) Calculate how many clock cycles it takes to complete 6 instructions without pipelining and with a three-stage pipeline. Assume the pipeline never stalls. [2]

[4]

Answer it on its own page and mark it yourself

Question 4

A school coding club writes small programs during lunch, testing and changing them every few minutes. At the end of the year, the club will give its finished timetable app to every student, on many different kinds of computer.

Evaluate the use of an interpreter, rather than a compiler, for the club's work. [6]

Answer it on its own page and mark it yourself

Question 5

The TCP/IP model describes network communication as four layers.

(a) State the names of the four layers, in order from the top. [1]

(b) State the layer that adds port numbers, so the data reaches the right program on the destination computer. [1]

(c) State the layer that is responsible for routing packets between networks using logical addresses. [1]

[3]

Answer it on its own page and mark it yourself

Question 6

A school keeps student devices on their own subnet, written in CIDR notation as 10.20.30.64/26.

(a) State how many bits of the address identify the network. [1]

(b) State the first and last addresses in this block, including the network and broadcast addresses. [1]

(c) State whether a tablet with the address 10.20.30.130 is on this subnet, with a reason. [1]

[3]

Answer it on its own page and mark it yourself

Question 7

A student types the address of a school sports club's website, clubs.harbourview.example, into a browser for the first time. The browser needs the website's IP address before it can request the page.

(a) Describe how the domain name is resolved to an IP address. [3]

[3]

Answer it on its own page and mark it yourself

Question 8

A student at home uploads a large photo of a science poster to the school's file server. The photo is sent across the internet using packet switching.

(a) State one item, other than part of the photo itself, that each packet carries. [1]

(b) Explain why the packets can arrive at the file server in a different order from the one they were sent in. [2]

[3]

Answer it on its own page and mark it yourself

Question 9

A member of a school's office staff receives an email that looks as if it comes from the school's IT team. It links to a fake login page, and they type their password there. The next day, an attacker logs in to the staff member's account from another country and reads student records.

(a) Identify the type of attack that was used. [1]

(b) Suggest three countermeasures of different kinds (for example technical, procedural and detection) that together would protect the school against this kind of attack. Justify each one, and justify using more than one. [4]

[5]

Answer it on its own page and mark it yourself

Question 10

A school café records orders in one table, OrderLine. Its primary key is the composite key (order_id, item_code). The table is already in first normal form.

order_iditem_codeorder_datecustomer_idcustomer_nameitem_nameunit_pricequantity
501C12026-10-1277LenaFlat white3.202
501P42026-10-1277LenaCroissant2.501
502C12026-10-1280SamFlat white3.201
503T22026-10-1377LenaMint tea2.802

Assume that each order is placed by one customer on one date, and that an item's unit_price is its current price, which is the same on every order.

(a) Identify one partial dependency in OrderLine. [1]

(b) Identify one transitive dependency in OrderLine. [1]

(c) Construct a set of tables in third normal form that holds the same data as OrderLine. For each table, give its name and attributes, and state its primary key and any foreign keys. [4]

[6]

Answer it on its own page and mark it yourself

Question 11

A school canteen records every sale in a table, Sale.

sale_iditemquantitysale_date
1Wrap42026-10-19
2Soup32026-10-19
3Wrap52026-10-19
4Salad22026-10-20
5Soup62026-10-20
6Wrap32026-10-20
7Salad42026-10-21
8Soup22026-10-21

(a) Construct an SQL query that shows each item with the total quantity sold of it, but only for items whose total quantity is more than 10. [3]

(b) State the rows returned by this query. [2]

SELECT item, COUNT(*)
FROM Sale
WHERE quantity >= 3
GROUP BY item;

[5]

Answer it on its own page and mark it yourself

Question 12

A school canteen app lets students send credit to each other. When Mia (student_id 31) sends 5 credits to Leo (student_id 42), the app runs these two statements on the Wallet table.

UPDATE Wallet SET balance = balance - 5
WHERE student_id = 31;
UPDATE Wallet SET balance = balance + 5
WHERE student_id = 42;

(a) Explain why the two statements must be run as a single transaction. [2]

(b) The server crashes after the first statement has run but before the second. Outline what ROLLBACK does in this situation. [1]

(c) After COMMIT, the server loses power. State the ACID property that guarantees the transfer is still recorded when it restarts. [1]

[4]

Answer it on its own page and mark it yourself

Question 13

A school tests a new filter that labels each email as phishing or genuine. It runs the filter on 1000 emails whose true class is already known. The results are shown.

Actual classLabelled phishingLabelled genuine
Phishing (20 emails)515
Genuine (980 emails)10970

(a) Calculate the accuracy of the filter. Show your working. [2]

(b) Explain why the accuracy is misleading as a measure of how good this filter is. [2]

[4]

Answer it on its own page and mark it yourself

Question 14

A student trains a decision tree to predict whether a library book will be returned late. She tries three values for the maximum depth of the tree and measures the accuracy each time, on the training data and on separate test data.

Maximum depthAccuracy on training dataAccuracy on test data
271%70%
686%84%
20100%68%

(a) State whether the maximum depth is a hyperparameter or a learned parameter, and give a reason. [1]

(b) Explain which maximum depth causes overfitting, and how the table shows it. [2]

[3]

Answer it on its own page and mark it yourself

Section B: practice scenario

Section B is in the case-study format, on a practice scenario written by Spine. It is not the IB's case study for your exam year. Read the scenario first. Each question refers to it.

Practice scenario (written by Spine, not an IB case study):

Larkford is a small city with a community bike-share called LarkBikes. It has 40 docking stations, each with between 10 and 20 docks. Each dock has a sensor that detects whether a bike is locked in it and reads the bike's ID tag. Every station sends its sensor readings to a central server over the mobile phone network every 5 minutes.

Riders register in the LarkBikes app with their name, email address, home postcode and date of birth. When a rider unlocks a bike, a trip starts. The server keeps riders, bikes, stations and trips in a relational database. Each trip record holds the rider, the bike, the start station, the end station, and the start and end times. The database now holds two years of trips.

Every evening, a machine learning model is trained on the trip records together with the hour of the day, the day of the week, whether it is a school holiday, and the weather. For each station, it predicts how many bikes will be taken in each hour of the next day. A van crew uses these predictions to move bikes to stations that are expected to run out.

The 28 stations in the city centre are busy. The 12 stations in the outer districts were added last year and record far fewer trips.

Question 15

(a) State whether the LarkBikes model performs classification or regression, and give a reason. [2]

(b) Identify one feature the model uses and the label it learns to predict. [2]

[4]

Answer it on its own page and mark it yourself

Question 16

(a) Suggest a primary key for the Trip table, and explain why the rider's ID would not work as the primary key on its own. [2]

(b) Describe how the Trip table is linked to the Station table, and identify the relationship between Station and Trip. [2]

[4]

Answer it on its own page and mark it yourself

Question 17

The manager of LarkBikes suggests a change. The model would also take, as a feature, each station's current number of bikes from the latest sensor readings. It would still be retrained once each evening, on the past trips and the stored sensor readings. During the day, the trained model would be run again every 5 minutes on the newest readings, to update the predictions for the rest of the day. All of this would run on the existing central server.

Evaluate this suggestion. [4]

Answer it on its own page and mark it yourself

Question 18

Before training, the LarkBikes team checks the trip records and finds two problems.

Problem 1: when a station loses its mobile connection, it sends its readings again once it reconnects, and some trips from those stations are stored twice. Problem 2: about 3% of trips have no end station, because a dock sensor failed to read the bike's ID tag when the bike was returned.

(a) Explain how problem 1 would affect the predictions if the records were not cleaned. [2]

(b) Suggest a treatment for problem 2, and justify it. [2]

[4]

Answer it on its own page and mark it yourself

Question 19

A data analyst trains the model on all two years of trips. She then measures its error on the same trips and reports that its predictions are wrong by only 0.3 bikes per hour on average.

(a) Explain why this figure does not show how well the model will predict tomorrow's demand. [2]

(b) A colleague suggests holding back the most recent two months of trips, training on the rest, and measuring the error on those two months. Explain why this is a better test for this model than holding back a random selection of hours (each station's count for those hours). [2]

[4]

Answer it on its own page and mark it yourself

Question 20

The model predicts few trips at the outer-district stations, so the van rarely brings bikes there. Riders in the outer districts often find those stations empty.

Discuss whether it is fair to use the model's predictions to decide where the van takes bikes. [4]

Answer it on its own page and mark it yourself

Finished? Open the markscheme