IB Computer Science HL practice exam
The whole exam in its real format, timed, with free response graded on the rubric and a predicted 1–7 score. Try 2 real free-response questions below first.
Your first full exam is free with an account. Premium has no limit, and every exam is new.
What the IB Computer Science HL exam looks like
2 sections, 4 h in all. The Atlas practice exam keeps the same sections, question counts, timing and weights.
| Section | Questions | Time | Weight |
|---|---|---|---|
| Paper 1 | 7 | 2 h | 50% |
| Paper 2 | 8 | 2 h | 50% |
The free-response questions: Concepts question: hardware, data and logic, Concepts question: operating systems and networks, Concepts question: databases, Concepts question: machine learning, Concepts question: HL systems and networks, Concepts question: HL databases and machine learning, Case study (HL), Programming question: fundamentals and constructs, Programming question: data structures, Programming question: algorithms, Programming question: files and computational thinking, Programming question: object-oriented programming, Programming question: HL multiple classes, Programming question: HL linked lists, stacks and queues, Programming question: HL trees, sets and hash tables.
Topics on the exam
| Topic | Share of the exam |
|---|---|
| A1.1 Computer hardware and operation (incl. GPUs, pipelining) | 3%–4% |
| A1.2 Data representation | 2%–3% |
| A1.2 Computer logic | 2%–2% |
| A1.3 Operating systems and control systems (incl. multitasking, control systems) | 2%–4% |
| A2.1–A2.2 Network fundamentals and architecture (incl. TCP/IP model, servers) | 3%–5% |
| A2.3 Data transmissions | 2%–2% |
| A2.4 Network security (incl. vulnerabilities, countermeasures) | 2%–4% |
| A3.1–A3.3 Database fundamentals, design and programming (incl. aggregates, views, transactions) | 6%–10% |
| A4.1 and A4.4 Machine learning fundamentals and ethics | 2%–4% |
| B1.1 Approaches to computational thinking | 2%–4% |
| B2.1 Programming fundamentals | 4%–6% |
| B2.3 Programming constructs | 4%–6% |
| B2.2 Data structures; B2.5 File processing | 5%–7% |
| B2.4 Programming algorithms | 7%–10% |
| B3.1–B3.2 OOP for a single class and multiple classes | 11%–17% |
| A1.4 Translation | 2%–3% |
| A3.4 Alternative databases and data warehouses | 2%–4% |
| A4.2–A4.3 Data preprocessing; machine learning approaches | 6%–10% |
| B4.1 Abstract data types: linked lists, stacks, queues | 4%–7% |
| B4.1 Abstract data types: sets and hash tables | 3%–4% |
| B4.1 Abstract data types: binary search trees | 4%–6% |
Weights from the IB subject guide.
2 free IB Computer Science HL practice free-response questions
Real questions from the Atlas exam pool, with a sample answer of the kind the rubric rewards.
A student edits 4K video on a laptop with 8 GB of RAM. While editing, the operating system reports that programs need about 11 GB of memory, and the solid-state drive is in constant use. The laptop's CPU has a cache with an access time of 2 ns; main memory (RAM) has an access time of 60 ns.
- (a)
(a) Outline the roles of the memory address register (MAR) and the memory data register (MDR) when the CPU fetches an instruction. [2]
- (b)
(b) The cache hit rate is 90%. On a miss, the CPU spends the cache access time and then the RAM access time. Calculate the average memory access time. [2]
- (c)
(c) Explain why a program that loops through a large array element by element usually has a high cache hit rate. [2]
- (d)
(d) The student can afford either an upgrade to 16 GB of RAM or a new laptop whose CPU has a larger cache but still 8 GB of RAM. Evaluate the two options for this student. [3]
Show a sample answer
(a)
The MAR holds the address of the memory location to be read (copied from the program counter). The MDR holds the instruction (data) read from that address before it is copied to the current instruction register.
(b)
Average = 2 + (1 − 0.90) × 60 = 2 + 6 = 8 ns.
(c)
Elements of an array are stored next to each other (spatial locality). When one element is fetched, a whole block containing its neighbors is copied into cache, so the next several accesses are hits. The loop code itself is reused on every pass (temporal locality), so it stays in cache too.
(d)
More cache would raise the hit rate and cut the average access time a little, but it cannot help when the data does not fit in RAM. With 11 GB needed and 8 GB installed, the OS is paging/swapping to the SSD (virtual memory), which is thousands of times slower than RAM; that is the bottleneck. 16 GB holds the whole working set, so swapping stops. The RAM upgrade is the better choice for this student.
Concepts question: hardware, data and logic · A1.1 Computer hardware and operation (incl. GPUs, pipelining)
- (a)
A single-core computer uses round-robin scheduling with a time slice of 2 ms. Three processes all arrive at time 0 and join the ready queue in the order P1, P2, P3. A process that uses up its time slice goes to the back of the queue. Ignore the time for context switches.
Process CPU time needed (ms) P1 5 P2 3 P3 1 - (a)
(a) Outline two functions of an operating system other than scheduling. [2]
- (b)
(b) Determine the time at which each process finishes. [2]
- (c)
(c) Calculate the average turnaround time. [1]
- (d)
(d) Explain why the operating system uses interrupts, rather than polling, to handle key presses. [2]
- (e)
(e) Evaluate round-robin scheduling compared with first-come, first-served (FCFS) for a desktop computer used interactively. [2]
Show a sample answer
(a)
Memory management: allocating RAM to processes and keeping each process out of the others' memory. File management: organizing files in directories and controlling access to them.
(b)
0–2 P1 (3 left), 2–4 P2 (1 left), 4–5 P3 finishes at 5, 5–7 P1 (1 left), 7–8 P2 finishes at 8, 8–9 P1 finishes at 9.
(c)
(9 + 8 + 5) / 3 = 22/3 ≈ 7.33 ms. (ECF from (b).)
(d)
With polling the CPU would repeatedly check the keyboard, wasting cycles even when no key is pressed. With interrupts the keyboard signals the CPU only when a key is pressed; the CPU saves its state, runs the handler, then resumes, so CPU time is used for other processes in between and the response is still immediate.
(e)
Round robin gives every process a slice in turn, so a short interactive task (P3 here finishes at 5 ms rather than 8 ms under FCFS) is never stuck behind a long job; the system feels responsive. Its cost is context-switch overhead and longer completion for long jobs. For interactive use, round robin is better.
Concepts question: operating systems and networks · A1.3 Operating systems and control systems (incl. multitasking, control systems)
- (a)
Questions people ask
- Is this IB Computer Science HL practice exam free?
- Yes, with a free Atlas account: your first full practice exam is free, free response graded too. The sample free-response questions on this page need no account. Atlas Premium gives unlimited practice exams, and every exam is new, drawn from a pool of checked questions.
- How long is the IB Computer Science HL exam?
- 4 h in all: paper 1 in 2 h (50% of the score); paper 2 in 2 h (50% of the score). The Atlas practice exam keeps the same sections, timing and weights.
- How is the practice exam scored?
- Free response is graded part by part against a rubric to predict a grade from 1 to 7. On Atlas's scale a 7 takes about 70% of the points, a 6 about 58% and a 5 about 47%; the IB sets the real boundaries each year.
More: every practice exam · the Computer Science chapters · how Atlas compares