Skip to content
ExamSpine

IB Computer Science Paper 2: what it tests and how to practise

From May 2027, IB Computer Science Paper 2 examines Theme B: computational thinking, programming, object-oriented programming and, at HL, abstract data types. Every student, SL included, answers programming questions in the language their school teaches, Java or Python. The fastest way to get better at it is to write real code and see straight away whether it works.

What is on Paper 2

  • B1 Computational thinking: breaking a problem down, spotting patterns, abstraction and algorithm design.
  • B2 Programming: variables and types, strings, selection and loops, lists and arrays, searching and sorting, and reading and writing files.
  • B3 Object-oriented programming: classes and objects for everyone; inheritance, polymorphism and several classes working together at HL.
  • B4 Abstract data types (HL): stacks, queues, linked lists, trees and similar structures.

It is reported as 1 h 15 min at SL and 2 h at HL, with a Java version and a Python version of the paper.

How to practise

  1. Learn one idea at a time. Each lesson is one small step with a short reading and exercises.
  2. Write the code, then run it. In Python, every coding question runs your answer against tests, shows which ones pass, and says what a failing test was checking. In Java, you compare your code with a worked solution for now.
  3. Trace by hand. Paper 2 also asks you to follow code without a computer. Trace table questions mark every row.
  4. Practise exam mode. Write code as on paper, without running it, then compare with a worked solution.

Java or Python?

You use the language your school teaches; you do not get to choose in the exam. Every lesson and question here is written for both. Pick yours once at the top of any lesson and the site remembers it.

Questions students ask

Do SL students have to program in IB Computer Science Paper 2?
Yes. From 2027 every student is assessed on programming in Paper 2, at SL and HL.
Is IB Computer Science Paper 2 in Java or Python?
Both are supported. The paper is reported to come in a Java version and a Python version, and you answer in the language your school teaches.