IB Computer Science 2027 Paper 2: Python or Java?

9 min read

Nov 03, 2026

#IB Computer Science 2027#IB Computer Science Paper 2#Python and Java Programming#IB Computer Science Revision
IB Computer Science 2027 Paper 2: Python or Java? cover image

The IB Computer Science syllabus has changed, and students taking their first examinations in May 2027 face a different Paper 2 from previous cohorts.

Programming is now central to the assessment. Students can answer using Python or Java, but they must demonstrate computational thinking, algorithm design and debugging skills rather than simply memorising code.

This creates an important question: Should you prepare in Python or Java, and what exactly will the examination expect you to do?

A September 2026 r/IBO discussion shared study notes and examination-style resources for the 2027 and 2028 cohorts, reflecting interest in materials aligned with revised IB syllabuses.

The most useful Computer Science preparation is not collecting large amounts of code. It is learning to trace, construct, debug and explain algorithms confidently in your chosen language.

This guide covers the official Paper 2 format, differences between Python and Java, original worked problems and practical revision strategies.

What Changed in IB Computer Science for 2027?

According to the official IB Computer Science curriculum update, the revised course began teaching in August 2025, with first assessment in May 2027.

The course is organised into two themes.

Theme A: Concepts of computer science covers computer fundamentals, networks, databases and machine learning.

Theme B: Computational thinking and problem-solving focuses on algorithms, programming and the application of computational techniques.

Paper 1 assesses Theme A, including a pre-seen case study.

Paper 2 assesses Theme B.

The previous option papers have been removed, and the former HL Paper 3 no longer exists.

Importantly, programming is now an assessed requirement for both SL and HL students.

Older resources focused on pseudocode and optional syllabus topics may therefore be unsuitable as the main preparation material.

IB Computer Science Paper 2: Official Exam Format

The IB Computer Science subject brief confirms the examination structure.

Assessment detailSLHL
Duration1 hour 15 minutes2 hours
Maximum marks5080
Final grade weighting35%40%
Main contentTheme B, SL topicsTheme B, SL and HL topics
Programming languagePython or JavaPython or Java
Question formatCompulsory extended responsesCompulsory extended responses

All questions within the selected language option are compulsory.

One question focuses on algorithmic thinking without requiring students to interpret or write program code.

The remaining questions assess programming and problem-solving skills.

HL students also encounter additional questions involving more advanced object-oriented programming and abstract data types.

Python or Java: Which Should You Choose?

The official assessment provides two language options.

Option A uses Java.

Option B uses Python.

According to the IB's Computer Science FAQ for first assessment in 2027, the corresponding questions assess equivalent skills and are designed to be of equal difficulty.

Students must answer the option for the language they have studied and must not mix questions from both options.

ConsiderationPythonJava
SyntaxUsually concise, indentation defines blocksMore explicit syntax with braces and declared types
VariablesDynamically typedStatically typed
CollectionsLists and other built-in structuresArrays, ArrayLists and other collections
Object-oriented programmingSupported through classes and objectsSupported through classes and objects
Examination expectationDemonstrate the required algorithmsDemonstrate the same underlying algorithms

Python may feel more approachable to beginners because of its shorter syntax.

Java may appeal to students already comfortable with explicit data types and class structures.

However, the IB does not treat one language option as easier than the other.

The best choice is generally the language taught by your school and the one in which you can solve problems confidently.

Changing languages shortly before the examination can introduce unnecessary syntax and debugging difficulties.

Is Pseudocode Still Required?

This is one of the most important changes for the 2027 examination.

The official IB FAQ clarifies that pseudocode is not required in Paper 2.

Students are not expected to write pseudocode, and examination questions will not present algorithms in pseudocode.

Teachers may still use pseudocode as a learning tool.

It can help students plan a solution before translating it into Python or Java.

However, revision should not revolve around memorising the pseudocode conventions from the previous syllabus.

Students must become comfortable interpreting and constructing algorithms in their chosen programming language.

What Programming Content Should You Revise?

Theme B covers several connected areas.

Syllabus areaSkills to practise
B1: Computational thinkingDecomposition, abstraction, pattern recognition, algorithm design and flowcharts
B2: Programming fundamentalsVariables, data types, strings, exception handling and debugging
B2: Data structuresArrays, lists, stacks and queues
B2: Programming constructsSelection, iteration, functions and variable scope
B2: AlgorithmsLinear search, binary search, bubble sort, selection sort and efficiency
B2: File processingReading, writing and appending text files
B3: Object-oriented programmingClasses, objects, constructors, encapsulation and related concepts
B4: Abstract data typesAdditional HL content including linked lists, binary search trees, sets and hash tables

The 2027 Computer Science guide specifies the required depth for each topic.

Students should not assume that every algorithm or data structure found in a university programming course is examinable.

Prioritise the specific syllabus statements and command terms.

Worked Example 1: A Simple Algorithm in Python and Java

Consider this original examination-style task:

Write a function that receives a list of student scores and a threshold. Return the number of scores strictly greater than the threshold. Do not use a built-in counting function.

For example:

Scores: [48, 70, 70, 85, 42]

Threshold: 70

Expected result: 1

Only the score of 85 is strictly greater than 70.

Python solution

def count_above(scores, threshold):
    count = 0

    for score in scores:
        if score > threshold:
            count += 1

    return count

Java solution

public static int countAbove(int[] scores, int threshold) {
    int count = 0;

    for (int score : scores) {
        if (score > threshold) {
            count++;
        }
    }

    return count;
}

Both solutions use the same algorithm.

They initialise a counter, examine every element, increment the counter when the condition is satisfied and return the result.

The syntax differs, but the computational thinking is identical.

How to Trace the Algorithm

Tracing means following the execution of an algorithm and recording how variables change.

For the previous example:

Score examinedIs score greater than 70?Counter after iteration
48No0
70No0
70No0
85Yes1
42No1

Final output: 1

Now consider a common error.

If the condition were written as score >= threshold, the result would be 3.

That is incorrect because the problem specifies strictly greater than.

This illustrates why students must read conditions carefully rather than assume that a familiar algorithm automatically matches the question.

Binary search is another important algorithm in the revised syllabus.

It searches an ordered collection by repeatedly eliminating approximately half the remaining search space.

Consider the sorted list:

[3, 7, 12, 18, 26, 40, 51]

The task is to find the index of 26, using zero-based indexing.

Python solution

def binary_search(values, target):
    left = 0
    right = len(values) - 1

    while left <= right:
        middle = (left + right) // 2

        if values[middle] == target:
            return middle
        elif values[middle] < target:
            left = middle + 1
        else:
            right = middle - 1

    return -1

Java solution

public static int binarySearch(int[] values, int target) {
    int left = 0;
    int right = values.length - 1;

    while (left <= right) {
        int middle = left + (right - left) / 2;

        if (values[middle] == target) {
            return middle;
        } else if (values[middle] < target) {
            left = middle + 1;
        } else {
            right = middle - 1;
        }
    }

    return -1;
}

Both functions return the matching index or -1 when no match exists.

Trace Binary Search Step by Step

For target 26:

StepLeftRightMiddleMiddle valueAction
106318Search right half
246540Search left half
344426Target found

The result is index 4.

The key prerequisite is that the values are sorted.

Applying this algorithm to an unsorted list can produce incorrect results.

Binary search has logarithmic time complexity, commonly expressed as O(log n), because the remaining search space is repeatedly reduced.

A basic linear search has O(n) worst-case time complexity because it may inspect every element.

Paper 2 can test both the ability to construct these algorithms and the reasoning behind their efficiency.

The code examples in this article are original educational exercises, not official IB examination questions.

Learn Debugging as a Separate Examination Skill

The revised syllabus explicitly includes debugging techniques.

Students should be able to identify and correct errors using trace tables, printed output, breakpoints and step-by-step execution.

Consider this incorrect Python loop:

for i in range(len(scores) + 1):
    print(scores[i])

If the list contains five elements, the valid indices are 0 through 4.

The loop attempts to access index 5, producing an IndexError.

The corrected version is:

for i in range(len(scores)):
    print(scores[i])

The equivalent Java problem occurs when a loop allows the index to reach scores.length.

A correct array traversal normally uses a condition such as i < scores.length.

When debugging, distinguish between:

Syntax errors: The program violates the language's grammatical rules.

Runtime errors: Execution fails, such as accessing an invalid array index.

Logic errors: The program runs but produces an incorrect result.

A strong answer identifies the error, explains its effect and provides a suitable correction.

What About Object-Oriented Programming?

Object-oriented programming is included at both SL and HL, but the required depth differs.

SL students must understand concepts such as classes, objects, constructors, methods and encapsulation.

For example, a simple StudentRecord class could store a student's score and provide a method that checks whether the score meets a threshold.

The important concepts are the relationship between the class definition, object state and method behaviour.

HL students extend this understanding to multiple-class designs.

Additional topics include inheritance, polymorphism, abstraction, composition, aggregation and relevant design patterns.

The IB subject guide identifies the additional HL requirements under B3.2.

Do not skip OOP simply because you are studying at SL.

Equally, do not assume every advanced OOP concept is required at SL.

Understand Abstract Data Types at HL

HL students study additional abstract data types, including linked lists, binary search trees, sets and hashing-related structures.

A question may require selecting an appropriate structure, explaining how its operations work or applying it to a programming problem.

For example, a linked list can support insertion and deletion without shifting every subsequent array element, although locating a particular node may require traversal.

A binary search tree organises values using ordering relationships, but its efficiency depends on the tree's shape.

Students should understand the trade-offs rather than memorise a single claim that one data structure is always faster.

SL students still need conceptual understanding of stacks and queues.

These are included in the shared B2 data structures content.

Can You Use Python Built-In Functions?

Python includes useful functions and methods that simplify common programming tasks.

However, the IB Computer Science FAQ confirms that some Paper 2 questions will prohibit particular built-in functions.

Restrictions will be stated explicitly in the examination question.

For instance, a question assessing selection sort may require students to construct the sorting algorithm rather than call Python's built-in sorting functionality.

That does not mean built-in functions are universally prohibited.

The correct strategy is to read the question carefully and implement the required algorithm.

Students should also practise manual approaches so they understand the operations that convenient library functions perform.

Python and Java: Common Mistakes to Avoid

MistakeWhy it mattersBetter approach
Mixing Python and Java syntaxProduces incorrect code for the chosen optionPractise consistently in one language
Confusing = and ==Changes assignment or comparison behaviourCheck conditional expressions
Ignoring index boundariesCan cause out-of-range errorsTrace first and final iterations
Using binary search on unsorted dataViolates the algorithm's prerequisiteCheck ordering before searching
Calling prohibited built-in functionsMay fail to demonstrate the required algorithmFollow restrictions in the question
Forgetting a termination conditionCan create an infinite loopVerify how loop variables change
Memorising code without tracing itMakes unfamiliar variations difficultPredict outputs and explain each step

The IB FAQ explains that minor syntax mistakes are considered in context, but errors that affect execution or demonstrate misunderstanding may lead to lost marks.

Accuracy matters, even though the assessment focuses on problem-solving rather than perfect typing.

A Seven-Day Paper 2 Revision Plan

DayRevision focusPractical activity
1Computational thinkingPractise decomposition and trace flowcharts
2Programming fundamentalsWrite functions with loops and conditions
3Data structuresManipulate arrays and lists; explain stacks and queues
4AlgorithmsTrace linear search, binary search and sorting
5Debugging and file processingCorrect broken programs and practise text-file operations
6Object-oriented programmingConstruct and trace classes; add HL extensions where applicable
7Timed examination practiceComplete relevant specimen questions and review errors

For HL, include dedicated practice with additional OOP concepts, recursion and abstract data types.

Use the IB Programme Resource Centre through your school to obtain official specimen papers and markschemes.

The first live examinations for this syllabus take place in May 2027, so older past papers must be used selectively rather than treated as exact models of the new format.

Final Checklist for IB Computer Science Paper 2 2027

Before your examination, confirm that you can:

  1. Explain decomposition, abstraction and algorithmic thinking.
  2. Trace algorithms and flowcharts accurately.
  3. Construct working programs in your selected language.
  4. Manipulate arrays, lists and strings.
  5. Apply selection, iteration and modular functions.
  6. Implement and trace required searching and sorting algorithms.
  7. Identify syntax, runtime and logic errors.
  8. Explain appropriate algorithmic efficiency.
  9. Apply the OOP and data structure content required at your level.
  10. Follow restrictions on built-in functions and answer only your selected language option.

The best language for IB Computer Science Paper 2 2027 is the one you understand well enough to use for unfamiliar problems.

Python and Java provide different syntax, but the assessment tests the same underlying computational thinking.

Focus on designing algorithms, tracing their execution, explaining decisions and debugging mistakes.

When you can solve the same problem confidently without relying on a memorised program, you are preparing for what the revised Paper 2 is designed to assess.

For definitive details, consult the IB Computer Science curriculum updates, the official subject brief and your school's 2027 subject guide and specimen papers.

Written By

Author Profile Picture

Aditi Sneha

Growth Strategist

Reviewed by Ayisha Shahani, IB Content Head at Koncepts.

Loading suggested posts