Augment Education
  • 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
  • Blog
  • Free tools
  • Grade calculator
  • Subject checker

Company

  • About
  • Help
  • For parents
  • For teachers
  • Student stories
  • Comparisons

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.

PrivacyTerms
  1. Subjects
  2. Computer Science
  3. B2 Programming

B2 Programming

How programming fundamentals, data structures, constructs, algorithms and file processing build on each other in Python and Java, which statements are HL only, and how programming links to the rest of the course.

  • IB Computer Science
  • SL and HL

What B2 covers

From the subject guide: what you need to know and be able to do.

Writing and tracing programs: variables, data structures, loops, algorithms and files.

5 subtopics in Programming

Each one has its own page once something is published for it.

  1. B2.1Programming fundamentals164 questions · notes · 70 quick fire
  2. B2.2Data structures211 questions · notes · 60 quick fire
  3. B2.3Programming constructs183 questions · notes · 60 quick fire
  4. B2.4Programming algorithms181 questions · notes · 75 quick fire
  5. B2.5File processing53 questions · notes · 50 quick fire

An overview of B2 Programming

4 min readLast reviewed 14 Oct 2026

Introduction

Programming turns an algorithm into instructions that a computer can run. The course uses Python or Java, and the topic covers the building blocks shared by both: variables and data types, decisions and loops, subprograms, data structures, standard searching and sorting algorithms, and reading and writing files.

It is the most practical topic in the course. Its ideas are learned by writing, running, tracing and fixing code, and they are applied in every program built for the internal assessment. They also underpin the rest of theme B, since classes in object-oriented programming are made of the same variables, conditions and loops, and abstract data types are built from the same arrays and references.

How the subtopics connect

The subtopics build on each other, though a sensible order of study differs a little from their numbering. Subtopic B2.1, Programming fundamentals, comes first: variables and constants, data types, scope, substrings, exception handling and debugging. Subtopic B2.3, Programming constructs, adds sequence, selection, loops and subprograms, which every later subtopic uses.

Building blocks: B2.1 Programming fundamentals at the base, then B2.3 Programming constructs, then B2.2 Data structures and B2.5 File processing side by side, then B2.4 Programming algorithms at the top. Dashed links to B1, B4 (HL), A1.2 and B3.
A sensible order of study: fundamentals and constructs come first, data structures and files use them, and the algorithms of B2.4 work on data structures. Dashed boxes are other topics.

Subtopic B2.2, Data structures, holds collections of data: static and dynamic structures, arrays and lists in one and two dimensions, and the stack and queue. Subtopic B2.5, File processing, uses loops and exception handling to read, write and append text files, so that data outlives the program. Subtopic B2.4, Programming algorithms, works on arrays and lists: it measures efficiency with Big O notation and constructs and traces linear search, binary search, bubble sort and selection sort.

Subtopics at SL and HL

All five subtopics are studied at SL and HL, and only one of them contains HL-only statements. HL students study those extra statements inside the SL page on programming algorithms, where each has a heading marked "(HL only)" and opens with an HL box.

Subtopic

Level

HL-only statements inside it

B2.1 Programming fundamentals

SL and HL

None

B2.2 Data structures

SL and HL

None

B2.3 Programming constructs

SL and HL

None

B2.4 Programming algorithms

SL and HL

B2.4.4: the idea of recursion (base case, recursive case and the call stack) and its uses, such as quicksort and fractals. B2.4.5: constructing and tracing simple recursive algorithms that make one recursive call each time

B2.5 File processing

SL and HL

None

Every code listing in the course appears in both languages. Where Python and Java differ in a way that matters, such as Java's fixed-length arrays against Python's lists, Java's checked exceptions or Python's integers that never overflow, the subtopic pages explain the difference.

Links to other topics

Programming connects to both themes. Trace tables and flowcharts come from topic B1, Computational thinking, and are used on code throughout. Data types rest on the binary storage of subtopic A1.2, which explains why a Java int overflows past 2,147,483,647. SQL in topic A3 is a contrast: a declarative language that states what result is wanted, where Python and Java state how to compute it.

Computational thinking: Modularisation is decomposition written in code. A program split into subprograms, each with a clear name, parameters and return value, can be tested one piece at a time and reused in other programs.

Programming also leads directly into the HL topics of theme B. Methods in topic B3, Object-oriented programming, are subprograms attached to a class, and the stacks and queues of B2.2 are the first examples of the abstract data types of topic B4 (HL).

Linking question: How might a conditional statement be built from logic gates (A1)? A condition such as age >= 18 and has_ticket is a Boolean expression. The CPU's arithmetic logic unit, built from logic gates, compares age with 18 and combines the result with has_ticket using AND; the single bit that results decides which branch of the if statement runs.

Exam tip

Programming is examined in Paper 2, which is printed in a Python version and a Java version; you answer in the language you studied. Questions can prohibit specific built-in functions such as sort, max or len, so learn the hand-written loop behind each one. Expect to construct code, trace it in a trace table and describe efficiency in Big O notation. HL papers add questions on recursion (B2.4.4 and B2.4.5) and on topics B3 and B4.

Flashcards for B2

The official decks for this part of the syllabus.

  • B2.1 Programming fundamentals374 cards
  • B2.2 Data structures301 cards
  • B2.3 Programming constructs324 cards
  • B2.4 Programming algorithms327 cards
  • B2.5 File processing267 cards

On this page

  • Syllabus points
  • Subtopics
  • Notes
  • Flashcards

Published for B2

Exam-style questions
615
Notes pages
6
Quick-fire questions
330
Key terms
156
Counted on 20 October 2026Open it in Augment

More of IB Computer Science

  • IB Computer ScienceThe Computer Science syllabus, assessment and what Augment has for it.

Carry on with B2 in Augment

With a free account, Augment remembers where you stopped and what you have practiced.

Start freeOpen B2 in Augment