Atlasलॉग इन
Black FridayHalf off Premium, through Sunday, Nov 29.See plans
Practice exam

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.

Take the full practice exam →Try 2 questions

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.

खंडप्रश्नसमयभार
पेपर 172 h50%
पेपर 282 h50%

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

TopicShare of the exam
A1.1 Computer hardware and operation (incl. GPUs, pipelining)3%–4%
A1.2 Data representation2%–3%
A1.2 Computer logic2%–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 transmissions2%–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 ethics2%–4%
B1.1 Approaches to computational thinking2%–4%
B2.1 Programming fundamentals4%–6%
B2.3 Programming constructs4%–6%
B2.2 Data structures; B2.5 File processing5%–7%
B2.4 Programming algorithms7%–10%
B3.1–B3.2 OOP for a single class and multiple classes11%–17%
A1.4 Translation2%–3%
A3.4 Alternative databases and data warehouses2%–4%
A4.2–A4.3 Data preprocessing; machine learning approaches6%–10%
B4.1 Abstract data types: linked lists, stacks, queues4%–7%
B4.1 Abstract data types: sets and hash tables3%–4%
B4.1 Abstract data types: binary search trees4%–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.

  1. 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.

    1. (a)

      (a) Outline the roles of the memory address register (MAR) and the memory data register (MDR) when the CPU fetches an instruction. [2]

    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]

    3. (c)

      (c) Explain why a program that loops through a large array element by element usually has a high cache hit rate. [2]

    4. (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)

  2. 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.

    प्रक्रियाCPU time needed (ms)
    P15
    P23
    P31
    1. (a)

      (a) Outline two functions of an operating system other than scheduling. [2]

    2. (b)

      (b) Determine the time at which each process finishes. [2]

    3. (c)

      (c) Calculate the average turnaround time. [1]

    4. (d)

      (d) Explain why the operating system uses interrupts, rather than polling, to handle key presses. [2]

    5. (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)

Take the full IB Computer Science HL exam →

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