A program reads the same 20 values from memory thousands of times inside a loop. Why are the reads after the first pass faster than the first pass?
Free IB Computer Science check
15 questions, 15 minutes. Your score by area and the topic to fix first.
15:00 left · 0 of 15 answered
A laptop joins a café's Wi-Fi and is given the address 192.168.1.37 without the user typing anything. A week later it is given 192.168.1.52. Which explanation fits best?
An invented school stores tutors and students in two tables.
Table Tutor (invented data):
| TutorID | TutorName | Room |
|---|---|---|
| T1 | Mr Okoro | B2 |
| T2 | Ms Lind | C4 |
| T3 | Mrs Patel | B2 |
Table Student (invented data):
| StudentID | Name | TutorID |
|---|---|---|
| 101 | Isla | T2 |
| 102 | Omar | T1 |
| 103 | Priya | T3 |
| 104 | Theo | T2 |
| 105 | Yusuf | T1 |
Which names does the query return, in the order shown?
SELECT Student.Name
FROM Student JOIN Tutor ON Student.TutorID = Tutor.TutorID
WHERE Tutor.Room = 'B2'
ORDER BY Student.Name;An invented research team has only 900 labelled scans of a rare condition. It starts from a network already trained on millions of everyday photographs and retrains only the final layers on the scans. Which statement best describes this?
Which of these is the clearest example of decomposition?
The program takes a substring of a word and joins a number to it. What does it print?
word = "PROGRAMMING"
part = word[3:7].lower()
print(part + str(len(word)))This program searches a sorted list for 50 and prints each value it examines. What does it print?
items = [3, 8, 12, 17, 21, 26, 30, 34, 39, 45, 50, 57, 61, 68, 72]
target = 50
low = 0
high = len(items) - 1
found = -1
while low <= high and found == -1:
mid = (low + high) // 2
print(items[mid])
if items[mid] == target:
found = mid
elif items[mid] < target:
low = mid + 1
else:
high = mid - 1Three Ticket objects are created. What does this program print?
class Ticket:
__issued = 0
def __init__(self, seat):
Ticket.__issued = Ticket.__issued + 1
self.__number = Ticket.__issued
self.__seat = seat
def getNumber(self):
return self.__number
@staticmethod
def getIssued():
return Ticket.__issued
t1 = Ticket("A1")
t2 = Ticket("A2")
t3 = Ticket("B4")
print(t2.getNumber(), Ticket.getIssued())In the invented Corvale scenario, a robot moving at 1.5 metres per second needs to stop for a child who steps out. A round trip to the cloud over the mobile network takes about 200 ms and sometimes fails. Why is pedestrian detection run on the robot's own computer rather than in the cloud?
An HL student sits both written papers. How long are they in the exam room in total, not counting breaks?
A clinic archives X-ray scans that doctors must later see pixel for pixel. A video service streams films to phones over mobile data. Which pairing of compression suits them?
A video calling app sends live audio and video between two people. Which transport protocol suits the live stream, and why?
An invented school shop lists its prices in pounds.
Table Item (invented data):
| ItemID | Name | Price |
|---|---|---|
| 1 | Pencil case | 4.50 |
| 2 | Ruler | 5.00 |
| 3 | Calculator | 12.00 |
| 4 | Notebook | 7.25 |
| 5 | Highlighter set | 10.00 |
| 6 | Compass | 3.80 |
Which names does the query return, in the order shown?
SELECT Name FROM Item
WHERE Price BETWEEN 5 AND 10
ORDER BY Price DESC;This code should print the whole-number average of the four marks (integer division: // in Python, / between two ints in Java). The total is 30, so it should print 7, but it prints 6. Which change fixes it?
marks = [6, 8, 7, 9]
total = 0
for i in range(1, len(marks)):
total = total + marks[i]
print(total // len(marks))Which condition must hold for a binary search to find any value in a list correctly?
15 left blank