Forty5
EN
Download the app Open the app

Sciences

IB Computer Science SL and HL

94 lessons at SL. 152 at HL, with every HL-only topic. Five-minute lessons, exam-style questions and timed mock papers.

Units
8
SL lessons
94
HL lessons
152
Questions
639
Key terms
105
Formulas
15

What you will study

Every lesson follows the current IB guide. Lessons marked HL are in the HL course only. The first unit is free.

A1 Computer fundamentals18 SL · 22 HL lessons · free
  1. A1.1The CPU and memory
  2. A1.1Buses and processor types
  3. A1.1CPU or GPU?
  4. A1.1The memory hierarchy
  5. A1.1Storage, compression and the cloud
  6. A1.1Choosing secondary storage
  7. A1.1Run-length encoding
  8. A1.1Transform coding
  9. A1.1Pipelines in multi-core processorsHL
  10. A1.2Binary and hexadecimal
  11. A1.2Converting to binary and hex
  12. A1.2Storing sound and video
  13. A1.2Logic gates
  14. A1.2Simplifying with Boolean algebra
  15. A1.2Karnaugh maps
  16. A1.2Building logic diagrams
  17. A1.3Operating systems and control systems
  18. A1.3Scheduling algorithms
  19. A1.3Polling and interrupts
  20. A1.3Multitasking and deadlockHL
  21. A1.3Control systems in the real worldHL
  22. A1.4Translators and pipeliningHL
A2 Networks13 SL · 17 HL lessons
  1. A2.1Network types and models
  2. A2.1Network hardware
  3. A2.1What servers do
  4. A2.1Encapsulation and ports
  5. A2.1Application-layer protocols
  6. A2.2Network topologies
  7. A2.2Subnets and VLANsHL
  8. A2.3Data transmission
  9. A2.3IPv4 and IPv6
  10. A2.3Private addresses and NAT
  11. A2.3Static and dynamic routingHL
  12. A2.4Network security
  13. A2.4How firewalls decide
  14. A2.4Intrusion detection and prevention
  15. A2.4Securing a wireless network
  16. A2.4Digital certificates and TLSHL
  17. A2.4Hashing and digital signaturesHL
A3 Databases15 SL · 20 HL lessons
  1. A3.1Relational databases
  2. A3.1Limits of relational databases
  3. A3.1Database design and normalisation
  4. A3.1ERDs: cardinality and modality
  5. A3.1Building tables with constraints
  6. A3.1Normalising to 1NF
  7. A3.1From 1NF to 2NF
  8. A3.1From 2NF to 3NF
  9. A3.1Denormalisation
  10. A3.2Querying with SQL
  11. A3.2DDL and DML
  12. A3.2Queries across two tables
  13. A3.2GROUP BY and HAVING
  14. A3.2Virtual and materialised views
  15. A3.2COMMIT and ROLLBACK
  16. A3.3Beyond relational: NoSQL and data warehousesHL
  17. A3.3Features of a data warehouseHL
  18. A3.3OLAP operationsHL
  19. A3.3Data mining techniquesHL
  20. A3.3Fragmentation and replicationHL
A4 Machine learning6 SL · 20 HL lessons
  1. A4.1What is machine learning?
  2. A4.1Kinds of machine learning
  3. A4.1Transfer learning
  4. A4.1Hardware for machine learning
  5. A4.2Preparing dataHL
  6. A4.2Missing values and outliersHL
  7. A4.2Feature selection methodsHL
  8. A4.2Dimensionality reductionHL
  9. A4.3Linear regressionHL
  10. A4.3k-nearest neighbours in detailHL
  11. A4.3Decision treesHL
  12. A4.3Precision, recall and F1HL
  13. A4.3Hyperparameter tuningHL
  14. A4.3k-means clusteringHL
  15. A4.3Association rulesHL
  16. A4.3How an agent learns to decideHL
  17. A4.3Inside an artificial neuronHL
  18. A4.3Convolutional neural networksHL
  19. A4.4Ethics of machine learning
  20. A4.4Ethics of online communication
B1 Computational thinking14 lessons
  1. B1.1Thinking like a computer scientist
  2. B1.1Writing a problem statement
  3. B1.1Inputs, outputs and evaluation criteria
  4. B1.1Decomposition and structure charts
  5. B1.1Pattern recognition and generalisation
  6. B1.1Abstraction in models and code
  7. B1.1Ways to express an algorithm
  8. B1.1Computational thinking on a full problem
  9. B1.1Computational thinking across computer science
  10. B1.1Flowcharts and trace tables
  11. B1.1Loops in flowcharts
  12. B1.1Flowcharts with several decisions
  13. B1.1From flowchart to code
  14. B1.1Flowcharts for standard algorithms
B2 Programming20 SL · 23 HL lessons
  1. B2.1Variables, types and operators
  2. B2.1Indexing and slicing strings
  3. B2.1String methods and searching
  4. B2.1Handling exceptions
  5. B2.1Debugging techniques
  6. B2.2Arrays and lists
  7. B2.2Static and dynamic data structures
  8. B2.2List operations
  9. B2.2Row and column totals in 2D arrays
  10. B2.3Selection and iteration
  11. B2.3Nested and compound conditions
  12. B2.3Sentinel and validation loops
  13. B2.3Nested loops
  14. B2.3Functions and files
  15. B2.3Variable scope
  16. B2.4Searching and sorting
  17. B2.4Best and worst cases
  18. B2.4Algorithm efficiency
  19. B2.4Working out Big O from code
  20. B2.4RecursionHL
  21. B2.4Designing recursive functionsHL
  22. B2.4Recursive binary searchHL
  23. B2.5Reading and processing a file
B3 Object-oriented programming8 SL · 18 HL lessons
  1. B3.1Classes and objects
  2. B3.1Objects as models
  3. B3.1Advantages and limits of OOP
  4. B3.1Designing a class with UML
  5. B3.1Static and instance members
  6. B3.1Object references
  7. B3.1Lists of objects
  8. B3.1Information hiding
  9. B3.2Inheritance and polymorphismHL
  10. B3.2Subclass constructorsHL
  11. B3.2Inheritance hierarchiesHL
  12. B3.2Overloading and default parametersHL
  13. B3.2Abstract classes in codeHL
  14. B3.2InterfacesHL
  15. B3.2Composition and aggregationHL
  16. B3.2The singleton patternHL
  17. B3.2The factory patternHL
  18. B3.2The observer patternHL
B4 Abstract data types0 SL · 18 HL lessons
  1. B4.1.1Stacks and queuesHL
  2. B4.1.1What makes a type abstractHL
  3. B4.1.2Linked listsHL
  4. B4.1.2Searching a linked listHL
  5. B4.1.2Inserting at the head and tailHL
  6. B4.1.2Deleting nodes safelyHL
  7. B4.1.2Doubly linked listsHL
  8. B4.1.2Circular linked listsHL
  9. B4.1.3Trees, hash tables and setsHL
  10. B4.1.3Building a binary search treeHL
  11. B4.1.3Pre-order and post-orderHL
  12. B4.1.3Deleting from a BSTHL
  13. B4.1.3Balance and efficiencyHL
  14. B4.1.4Set operationsHL
  15. B4.1.4Sets: properties and usesHL
  16. B4.1.5Hash functionsHL
  17. B4.1.5Chaining and open addressingHL
  18. B4.1.5Load factor and resizingHL

Coursework: IB Computer Science IA guide, step by step, with how it is marked and a checklist.

Revising: how to study for IB Computer Science, with the habits and mistakes that matter most.

Formulas: IB Computer Science formula sheet, every formula in the course by unit.

The course, unit by unit

What each unit is about, and the exam habits that save marks in it.

A1 Computer fundamentals

A1 is about what happens inside a computer: the CPU and its registers running the fetch–decode–execute cycle, primary memory and secondary storage, how text, images and sound are stored in binary, the logic gates that process bits and the operating system that manages everything. HL adds compilers and interpreters, pipelining and control systems.

Exam tips

  • Describe the fetch–decode–execute cycle step by step and name the register used at each step (PC → MAR, instruction → MDR, PC incremented, CU decodes, execute). “The CPU gets the instruction and runs it” earns very little.
  • Show your working in conversions and file-size calculations: write the place values, or pixels × bits per pixel ÷ 8 for bytes, and give the unit. Most lost marks come from mixing up bits and bytes.

A2 Networks

A2 explains how devices communicate: the kinds of network and the hardware that connects them, the layered TCP/IP model and its protocols, how data travels as packets over different media and is checked for errors, and how networks are attacked and defended.

Exam tips

  • Name the layer and the protocol together and say what it does: “TCP, at the transport layer, numbers the packets and resends any that are lost” scores more than “TCP makes it reliable”.
  • In transfer-time calculations, convert the file size to bits (× 8) using the prefixes given in the question, divide by the bandwidth in bits per second, and give the answer in seconds.

A3 Databases

A3 is about storing data so that it stays accurate and useful: relational tables linked by keys, designs normalised to 3NF, SQL to query and change data, and integrity rules and transactions that keep data safe when many users work at once. HL looks beyond relational databases to NoSQL models, data warehouses and distributed databases.

Exam tips

  • When asked why a table is not in 3NF, name the exact dependency (“MemberName depends on MemberID, which is not the key”), then show the new tables with their primary and foreign keys.
  • Write SQL clauses in the order SELECT, FROM, WHERE, GROUP BY, ORDER BY; put text and date values in quotes; and use the table and field names exactly as the question gives them.

A4 Machine learning

A4 covers how machines learn from data: training and testing a model, the three kinds of learning (supervised, unsupervised and reinforcement), judging a model with accuracy and a confusion matrix, and the ethical questions ML raises. HL adds preparing data, neural networks and genetic algorithms.

Exam tips

  • Justify the kind of learning from the data in the scenario: “past payments are labelled fraud or genuine, so supervised classification is suitable”. Naming the type without a reason rarely earns full marks.
  • When one class is rare, explain why accuracy misleads and use the confusion matrix, saying what a false negative and a false positive mean in the scenario (a missed fraud, an honest customer blocked).

B1 Computational thinking

B1 is how computer scientists approach a problem before writing code: decomposition, pattern recognition, abstraction and algorithmic design. Algorithms are then written as code or flowcharts, checked by dry running them in trace tables and tested with normal, boundary and erroneous data.

Exam tips

  • In a trace table, add a row each time a variable changes, keep the columns in the order given and put printed values in the output column. A table that only shows the final values earns little.
  • When you identify an error, say which line, what kind it is and why: a logic error runs but gives a wrong result (range(1, n) skips index 0); a runtime error stops the program while it runs (dividing by zero).

B2 Programming

B2 is programming itself: variables, data types and operators; selection and iteration; 1D and 2D arrays; the standard searching and sorting algorithms and how Big O compares them; and functions and files that make programs modular and lasting. HL adds recursion.

Exam tips

  • Write code answers in the language you studied (Python or Java), with meaningful names and consistent indentation, then dry run your code on a small example before moving on.
  • Know the standard algorithms well enough to write them from memory: totals and counts, finding a maximum, linear search, binary search with low, high and mid, and bubble sort.

B3 Object-oriented programming

B3 builds programs from objects: a class defines attributes and methods, a constructor creates each instance, and encapsulation hides data behind accessors and mutators that can check it. HL extends this with inheritance, aggregation and composition, polymorphism and abstract classes.

Exam tips

  • When you construct a class, write a constructor that sets every attribute, keep attributes private, and put the validation inside the mutator (for example, reject a negative amount).
  • Explain with the scenario’s names: “because _visits is private, only check_in() can change it, so it cannot be set to a negative number” is stronger than a general definition of encapsulation.

B4 Abstract data types

B4 (HL) studies abstract data types, defined by what they do rather than how they are stored: stacks and queues, linked lists of nodes and pointers, binary search trees, hash tables and sets. The key skill is choosing the structure whose operations and costs fit the problem.

Exam tips

  • Trace stack and queue operations in a small table, one row per operation, showing the contents and any value returned, and say which end is the top or the front.
  • Describe linked-list changes as pointer updates in the right order (the new node’s pointer first, then the previous node’s), and remember the empty-list and head cases.

Key terms from unit 1

Flashcards from “A1 Computer fundamentals”, the free first unit. Cover each meaning, say it, then check.

CPU
The central processing unit, which fetches, decodes and executes instructions.
ALU
The arithmetic logic unit, which performs calculations and comparisons.
Register
A tiny, very fast storage location inside the CPU.
Cache
Small, fast memory that keeps frequently used data close to the CPU.
Secondary storage
Non-volatile storage such as SSDs and hard drives that keeps data long term.
Cloud computing
Delivering computing services such as storage and software over the internet.
Hexadecimal
A base-16 number system using digits 0–9 and letters A–F.
Colour depth
The number of bits used to store the colour of each pixel.
Unicode
A character set that can represent characters from almost every writing system.
Logic gate
A component that produces a binary output from one or more binary inputs.

Try a question

From “The CPU and memory”.

Questions are in English, like the exam. Every answer comes with an explanation.

Why does cache memory speed up a computer?

  1. AIt keeps frequently used data close to the CPU, so slower RAM is accessed less often
  2. BIt stores data permanently when the power is off
  3. CIt increases the size of the hard drive
  4. DIt replaces the ALU
Show the answer

A. It keeps frequently used data close to the CPU, so slower RAM is accessed less often

Cache is much faster than RAM, so each cache hit saves time.

Start Computer Science today.

The first unit is free. No card needed.

Open Forty5

Official IB information

For the rules and the current subject guides, check the IB’s own pages: