Augment Education
    • Question bank
    • Quick fire
    • Worksheets
    • Flashcards
    • Notes
    • Try a quick-fire round
    • All features
    • Business
    • Digital Society
    • Economics
    • Geography
    • Global Politics
    • History
    • Philosophy
    • Psychology
    • Anthropology
    • World Religions
    • Biology
    • Chemistry
    • Physics
    • Computer Science
    • Design Technology
    • ESS
    • SEHS
    • Language and literature
    • Language acquisition
    • Maths AA
    • Maths AI
    • Dance
    • Film
    • Music
    • Theatre
    • Visual Arts
    • Grade calculator
    • Grade boundaries
    • Subject checker
    • Focus timer
    • Exam countdown
    • All free tools
    • IB guide
    • All subjects
  • Blog

Search

Search subjects, the syllabus, glossary terms, the booklets, the IB guide, help and the blog

Log inStart free
augment

Augment Education

IB Diploma revision built around the syllabus.

contact@augment-education.com

Product

  • Features
  • Question bank
  • Quick fire
  • Worksheets
  • Flashcards
  • Notes
  • Subjects
  • What's new

Learn

  • IB guide
  • Booklets, explained
  • Glossary
  • Blog
  • Free tools
  • Grade calculator
  • Subject checker

Company

  • About
  • Help
  • For parents
  • For teachers
  • Comparisons

Subjects

  • English A Lit
  • English A Lang & Lit
  • Chinese A Lit
  • Chinese A Lang & Lit
  • Spanish A Lit
  • Spanish A Lang & Lit
  • English Lit & Perf
  • Spanish Lit & Perf
  • English B
  • Mandarin B
  • Spanish B
  • English ab initio
  • Mandarin ab initio
  • Spanish ab initio
  • Business
  • Digital Society
  • Economics
  • Geography
  • Global Politics
  • History
  • Philosophy
  • Psychology
  • Anthropology
  • World Religions
  • Biology
  • Chemistry
  • Physics
  • Computer Science
  • Design Technology
  • ESS
  • SEHS
  • Maths AA
  • Maths AI
  • Dance
  • Film
  • Music
  • Theatre
  • Visual Arts

Augment Education is developed independently of the International Baccalaureate Organization and is not endorsed by it. “IB” and “International Baccalaureate” are its trademarks.

© 2026 Augment Education. All rights reserved.

  • Privacy
  • Terms
  1. Subjects
  2. Computer Science
  3. Question bank

IB Computer Science question bank

Augment’s own questions for Computer Science, written in the style of IB exams, each with its markscheme. They are not past papers. One from each topic is below to try.

  • IB Computer Science
  • SL and HL
  • 1,965 questions

What the Computer Science question bank holds

Every question has a markscheme.

Exam-style questions
1,965
For both SL and HL
1,264
HL only
701
Counted on 29 October 2026

Computer Science questions by paper

The paper each question is written for, so you can practice one paper at a time.

  1. Paper 1Extended-response questions on theme A, then questions on the pre-released case study.995 questions
  2. Paper 2Extended-response questions on theme B, in Python or Java.970 questions

Computer Science questions by topic

Each topic in syllabus order, with its subtopics. Lines with notes link to them. Under each topic is one question to try, its markscheme folded until you open it.

A1 Computer fundamentals

274 questions
  1. A1.1Computer hardware and operation95 questions
  2. A1.2Data representation and computer logic95 questions
  3. A1.3Operating systems and control systems65 questions
  4. A1.4TranslationHL only41 questions
One to try · CS-000715 marks

A coastal weather station measures wind speed and humidity. Each reading is stored as an 8-bit unsigned binary integer before it is sent to a central server.

  1. (a)

    The latest wind speed reading is 1011 0110. State this value in decimal.

    [1]1 mark

  2. (b)

    The latest humidity reading is 203 in decimal. State this value in hexadecimal.

    [1]1 mark

  3. (c)

    State the largest value that one reading can hold.

    [1]1 mark

  4. (d)

    Outline one reason why the station's engineers display readings in hexadecimal rather than binary when testing the equipment.

    [2]2 marks

Markscheme (a)

182;

Markscheme (b)

CB;

Note: Accept CB16CB16​, 0xCB or lower case cb.

Markscheme (c)

255;

Note: Do not accept 256.

Markscheme (d)

Award [1] for the reason and [1] for the development, up to [2 max].
Hexadecimal is shorter / more compact (two digits instead of eight);
so it is quicker to read and copy, with fewer transcription errors;
Each hex digit maps to exactly four bits;
so it converts to and from binary easily (unlike decimal);

Note: Do not accept "hexadecimal uses less memory": the stored data is still binary.

A2 Networks

264 questions
  1. A2.1Network fundamentals113 questions
  2. A2.2Network architecture69 questions
  3. A2.3Data transmissions66 questions
  4. A2.4Network security103 questions
One to try · CS-0011112 marks

A dental clinic has the network shown in Figure 1. Every device is connected by its own cable to one switch.

  1. (a)

    Identify the topology used inside the clinic.

    [1]1 mark

  2. (b)

    Outline the effect on the clinic if the cable to Surgery 2 PC is cut.

    [2]2 marks

  3. (c)

    Outline the effect on the clinic if the switch fails.

    [2]2 marks

  4. (d)

    Explain how using a switch at the centre of the star helps to avoid data collisions on the clinic's network.

    [3]3 marks

  5. (e)

    The clinic manager suggests replacing the star with a full mesh, in which every device is cabled directly to every other device.

    Discuss whether this would be a sensible change for the clinic.

    [4]4 marks

Markscheme (a)

Star (topology);

Markscheme (b)

Award [1] for the effect on Surgery 2 PC and [1] for the effect on the rest of the network.
Surgery 2 PC can no longer reach the file server / printer / internet;
the other devices carry on working normally / are unaffected (because each has its own link to the switch);

Markscheme (c)

Award [1] for the effect and [1] for the reason.
No device can communicate with any other device / no PC can reach the file server, printer or internet;
because all traffic passes through the switch / the switch is a single point of failure;

Markscheme (d)

Award [1] per point, up to [3 max].
Each device has its own dedicated link/port to the switch;
the switch reads the destination (MAC) address of each frame;
and forwards it only to the port of the destination device / does not send it to every device;
so two devices can transmit at the same time without their signals interfering;
(full-duplex links mean) a device can send and receive at the same time;
any frames arriving together for the same port are buffered/queued by the switch rather than colliding;

Markscheme (e)

Award [1] for each relevant point, up to [3 max] for points on one side only, and [1] for a conclusion that follows from the points made, up to [4 max].
For a mesh: no single point of failure / losing one link or device does not cut off the others;
traffic has alternative paths so reliability is higher;
Against a mesh: the number of cables grows rapidly / the 7 devices (including the router) would need 21 links instead of 7;
each device would need many network ports/NICs, raising the cost;
installation and fault-finding are far more complex;
the clinic is small, so the extra reliability is not worth the cost / a spare switch would be cheaper;
the router/internet link would still be a single point of failure;
Conclusion: e.g. a mesh is not sensible; a spare switch or a second switch with redundant links gives most of the benefit at far lower cost;

Note: Accept a conclusion in favour of the mesh if it is justified by the clinic's need for reliability.

A3 Databases

260 questions
  1. A3.1Database fundamentals87 questions
  2. A3.2Database design91 questions
  3. A3.3Database programming98 questions
  4. A3.4Alternative databases and data warehousesHL only43 questions
One to try · CS-000344 marks

A veterinary clinic stores details of pets and their owners in a relational database. Sample data from two of its tables is shown.

Owner

OwnerID

OwnerName

Phone

OW101

Amira Haddad

0412 556 019

OW102

Tomas Lindqvist

0420 773 145

OW103

Grace Okafor

0433 908 262

Pet

PetID

PetName

Species

OwnerID

P5001

Biscuit

Dog

OW102

P5002

Luna

Cat

OW101

P5003

Pepper

Rabbit

OW102

P5004

Max

Dog

OW103

  1. (a)

    Identify the primary key of the Owner table.

    [1]1 mark

  2. (b)

    Identify the foreign key in the Pet table.

    [1]1 mark

  3. (c)

    Explain why the value OW102 may appear more than once in the Pet table but only once in the Owner table.

    [2]2 marks

Markscheme (a)

OwnerID;

Note: Do not accept OwnerName or Phone.

Markscheme (b)

OwnerID (in Pet);

Markscheme (c)

Award [1] for the Owner side and [1] for the Pet side.
In Owner, OwnerID is the primary key so each value must be unique / identifies exactly one owner;
In Pet, OwnerID is a foreign key, which does not need to be unique;
because one owner can have many pets / one-to-many relationship (Tomas owns Biscuit and Pepper);

Note: Award [2 max].

A4 Machine learning

254 questions
  1. A4.1Machine learning fundamentals90 questions
  2. A4.2Data preprocessingHL only52 questions
  3. A4.3Machine learning approachesHL only92 questions
  4. A4.4Ethical considerations90 questions
One to try · CS-000016 marks

A hospital has 40 000 chest X-ray images. A radiologist has tagged each image as either pneumonia or healthy. The hospital wants a machine learning model that flags new X-rays that may show pneumonia.

  1. (a)

    Identify the type of machine learning the hospital should use.

    [1]1 mark

  2. (b)

    Outline why the radiologist's tags are needed to train this model.

    [2]2 marks

  3. (c)

    Describe how the trained model would be used when a new patient's X-ray is taken.

    [3]3 marks

Markscheme (a)

Supervised learning;

Note: Accept "supervised learning using deep learning". Do not accept "deep learning" alone.

Markscheme (b)

Award [1] for the point and [1] for the development.

The tags are the labels / correct answers for each training image;
the model learns the link between image features and the label / compares its prediction with the tag and adjusts;
without labels the model would have no way of knowing which images show pneumonia;
so it could not learn to predict the category for new images;

Markscheme (c)

Award [1] per point, up to [3 max].

The new image is input to the trained model;
the model applies the patterns it learned in training (it is not retrained);
it outputs a predicted class / pneumonia or healthy;
(often) with a confidence score / probability;
images flagged as possible pneumonia are passed to / prioritised for a radiologist to check;
the final diagnosis is made by a clinician;

B1 Computational thinking

206 questions
  1. B1.1Approaches to computational thinking206 questions
One to try · CS-009335 marks

A college print room sends every print job to a single printer. Jobs wait in a queue and the printer always takes the job at the front. The queue starts empty, and then these operations happen in order:

enqueue(J1), enqueue(J2), enqueue(J3), dequeue(), enqueue(J4), dequeue(), enqueue(J5)

  1. (a)

    State the job that the printer will print next.

    [1]1 mark

  2. (b)

    State the contents of the queue after the operations, from front to rear.

    [2]2 marks

  3. (c)

    Outline one reason why a queue is a suitable structure for the print jobs.

    [2]2 marks

Markscheme (a)

J3;

Markscheme (b)

Award [1] for J3 at the front and [1] for J4, J5 following in that order.
J3 at the front;
then J4, then J5 at the rear;

Note: Accept a labelled diagram of the queue.

Markscheme (c)

Award [1] for the reason and [1] for the expansion.
a queue is first in, first out / FIFO;
so jobs are printed in the order they were sent / no job is overtaken;

new jobs are added only at the rear;
so it is fair to the people who sent their jobs earlier;

the printer only ever needs the job at the front;
so dequeue gives it the next job directly without searching;

B2 Programming

615 questions
  1. B2.1Programming fundamentals164 questions
  2. B2.2Data structures211 questions
  3. B2.3Programming constructs183 questions
  4. B2.4Programming algorithms181 questions
  5. B2.5File processing53 questions
One to try · CS-009516 marks

A fitness app stores a user's daily step counts in a list (Python) or array (Java) called steps, holding n values. The app uses the four functions/methods below.

Python

Python
def first_day(steps):
    return steps[0]

def total_steps(steps):
    total = 0
    for s in steps:
        total = total + s
    return total

def count_beaten(steps):
    count = 0
    for i in range(len(steps)):
        for j in range(len(steps)):
            if steps[i] > steps[j]:
                count = count + 1
    return count

def doublings(steps):
    k = 1
    count = 0
    while k < len(steps):
        k = k * 2
        count = count + 1
    return count

Java

Java
public static int firstDay(int[] steps) {
    return steps[0];
}

public static int totalSteps(int[] steps) {
    int total = 0;
    for (int s : steps) {
        total = total + s;
    }
    return total;
}

public static int countBeaten(int[] steps) {
    int count = 0;
    for (int i = 0; i < steps.length; i++) {
        for (int j = 0; j < steps.length; j++) {
            if (steps[i] > steps[j]) {
                count = count + 1;
            }
        }
    }
    return count;
}

public static int doublings(int[] steps) {
    int k = 1;
    int count = 0;
    while (k < steps.length) {
        k = k * 2;
        count = count + 1;
    }
    return count;
}
  1. (a)

    State the time complexity, in Big O notation, of each of the four functions/methods.

    [4]4 marks

  2. (b)

    Identify which function/method would scale least well as the user keeps recording steps for several years, and outline why.

    [2]2 marks

Markscheme (a)

Award [1] for each correct complexity, up to [4 max].
first_day / firstDay: O(1)O(1);
total_steps / totalSteps: O(n)O(n);
count_beaten / countBeaten: O(n2)O(n2);
doublings: O(log⁡n)O(logn);

Note: Accept O(log⁡2n)O(log2​n) for doublings. Accept "constant", "linear", "quadratic", "logarithmic" if clearly matched to each function.

Markscheme (b)

Award [1] for identifying the function and [1] for the outline.
count_beaten / countBeaten;
its nested loops each run n times, so the number of comparisons grows with n2n2 / doubling the number of days multiplies the work by about four;

Note: Allow FT from part (a) only if the function identified has the highest complexity given in (a).

B3 Object-oriented programming

245 questions
  1. B3.1Fundamentals of OOP for a single class155 questions
  2. B3.2Fundamentals of OOP for multiple classesHL only115 questions
One to try · CS-0111714 marks

A school library keeps a record of every book it owns. Each book is represented by an object of the class Book.

Python

Python
class Book:
    def __init__(self, isbn, title, author):
        self.__isbn = isbn
        self.__title = title
        self.__author = author
        self.__on_loan = False

    def get_title(self):
        return self.__title

    def get_author(self):
        return self.__author

    def is_on_loan(self):
        return self.__on_loan

    def return_book(self):
        self.__on_loan = False

Java

Java
public class Book {
    private String isbn;
    private String title;
    private String author;
    private boolean onLoan;

    public Book(String isbn, String title, String author) {
        this.isbn = isbn;
        this.title = title;
        this.author = author;
        this.onLoan = false;
    }

    public String getTitle() { return title; }
    public String getAuthor() { return author; }
    public boolean isOnLoan() { return onLoan; }

    public void returnBook() {
        onLoan = false;
    }
}
  1. (a)

    State the name of one accessor method in the class Book.

    [1]1 mark

  2. (b)

    Construct a statement that creates a Book object for Frankenstein by Mary Shelley, ISBN 978-0-14-143947-1, and stores it in a variable called b.

    [2]2 marks

  3. (c)

    Construct the method check_out() (Python) / checkOut() (Java). If the book is not already on loan, the method marks it as on loan and returns true. If the book is already on loan, it returns false and changes nothing.

    [3]3 marks

  4. (d)

    The library stores its books in a list (Python) / an array of 500 Book references (Java) called books. Unused positions hold None (Python) / null (Java).

    Construct the function/method count_available(books, author) / countAvailable(books, author) that returns the number of books by the given author that are not on loan.

    [5]5 marks

  5. (e)

    Explain why the attribute that records whether a book is on loan is private and can only be changed through check_out / checkOut and return_book / returnBook.

    [3]3 marks

Markscheme (a)

get_title / getTitle;
get_author / getAuthor;
is_on_loan / isOnLoan;

Note: Award [1] for any one. Do not accept return_book / returnBook (it changes the state of the object).

Markscheme (b)

Award [1] for each point, up to [2 max].
new object created with the class name (and new in Java) / constructor called;
the three arguments in the correct order (ISBN, title, author) as strings;
result assigned to a variable b (of type Book in Java);

Example answer (Python):

Python
b = Book("978-0-14-143947-1", "Frankenstein", "Mary Shelley")

Example answer (Java):

Java
Book b = new Book("978-0-14-143947-1", "Frankenstein", "Mary Shelley");

Markscheme (c)

Award [1] for each point, up to [3 max].
checks whether the book is currently on loan (tests the attribute);
sets the on-loan attribute to true only when it was false;
returns false when already on loan and true after a successful loan;
correct method header (Java: public boolean; Python: self parameter);

Example answer (Python):

Python
def check_out(self):
    if self.__on_loan:
        return False
    self.__on_loan = True
    return True

Example answer (Java):

Java
public boolean checkOut() {
    if (onLoan) {
        return false;
    }
    onLoan = true;
    return true;
}

Note: Accept an if/else with a single return of a Boolean variable.

Markscheme (d)

Award [1] for each point, up to [5 max].
correct header with both parameters (Java: int return type, Book[] and String parameters);
counter initialised to 0 before the loop;
loop that visits every element of books;
skips None / null entries (before calling a method on them);
uses the accessor methods to compare the author (Java: .equals) and to test that the book is not on loan;
increments the counter when both conditions hold, and returns it after the loop;

Example answer (Python):

Python
def count_available(books, author):
    count = 0
    for b in books:
        if b is not None and b.get_author() == author and not b.is_on_loan():
            count = count + 1
    return count

Example answer (Java):

Java
public static int countAvailable(Book[] books, String author) {
    int count = 0;
    for (int i = 0; i < books.length; i++) {
        if (books[i] != null && books[i].getAuthor().equals(author)
                && !books[i].isOnLoan()) {
            count++;
        }
    }
    return count;
}

Note: Accept == for string comparison in Java. Do not award the null-check mark if the null test comes after a method call on the element. Accept a for-each loop.

Markscheme (e)

Award [1] per point, up to [3 max].
private means code outside the class cannot read or assign the attribute directly;
so every change has to go through the class's own methods;
which can apply rules (e.g. a book already on loan cannot be lent again);
this keeps the object in a valid / consistent state (integrity);
other parts of the program do not depend on how the loan status is stored, so it can be changed without breaking them;

Note: The answer must go beyond "it is private so it is hidden" for more than [1].

B4 Abstract data types

HL only201 questions
  1. B4.1Fundamentals of ADTs201 questions
One to try · CS-010618 marks

A music streaming company is designing a new app. Before anyone writes code, the lead developer publishes a description of a Playlist abstract data type (ADT) with these operations:

Operation

Description

addTrack(t)

adds track t to the end of the playlist

removeTrack(t)

removes the first occurrence of track t

nextTrack()

returns the track after the one currently playing

isEmpty()

returns true if the playlist holds no tracks

  1. (a)

    Define the term abstract data type.

    [2]2 marks

  2. (b)

    The description does not say whether the tracks are stored in an array or in a linked list.

    Outline why the description leaves this out.

    [2]2 marks

  3. (c)

    Explain two benefits to the development team of agreeing the Playlist ADT before the code is written.

    [4]4 marks

Markscheme (a)

Award [1] per point, up to [2 max].
A (logical/mathematical) model / description of a data type;
defined by the values it can hold and the operations that can be performed on it;
without specifying how the data is stored / how the operations are implemented;

Note: Do not accept "a data structure" on its own.

Markscheme (b)

Award [1] for the point and [1] for the development.
An ADT separates what the operations do (the interface) from how they are carried out (the implementation);
so programmers using Playlist only need the operations / are not affected by the storage choice;
the implementation can be chosen later / changed without changing code that uses the playlist;

Note: Award [2 max].

Markscheme (c)

Award [1] for a benefit and [1] for a development, x2. Mark the first two benefits only.
Developers can work in parallel / different team members can write the user interface and the playlist storage at the same time;
because each side only relies on the agreed operations / interface;

The storage can be changed (e.g. from an array to a linked list) later;
without rewriting the parts of the app that call addTrack, nextTrack etc. / with less maintenance;

The complexity is hidden (abstraction);
so programmers using the playlist can concentrate on the app's features / are less likely to make errors with the internal data;

The operations can be tested separately;
against the description of what each operation should do, before the rest of the app exists;

The ADT can be reused;
in other apps or features (e.g. a queue of podcasts) that need the same operations;

On this page

  • What it holds
  • By paper
  • A1 Computer fundamentals
  • A2 Networks
  • A3 Databases
  • A4 Machine learning
  • B1 Computational thinking
  • B2 Programming
  • B3 Object-oriented programming
  • B4 Abstract data types

Practice them all

In Augment you can filter the Computer Science questions by paper and difficulty, mark yourself against each markscheme and see which topics are holding up.

Open in Augment

More for IB Computer Science

  • IB Computer ScienceThe Computer Science syllabus topic by topic, and every notes page.
  • Computer Science assessmentEach Computer Science paper, the internal assessment and grade boundaries.
  • Exam skills notesHow to tackle each Computer Science paper, and how each is marked.

Practice every Computer Science question

A free account opens the whole question bank, keeps a record of what you have marked, and builds worksheets from the topics you pick.

Start free