IB Computer Science HL

HL extension

Compare HL models and algorithms

Use inheritance, recursion, and model evaluation to defend design decisions.

Examples use Python. HL includes additional lessons beyond the SL path.

Model a valid substitution

Inheritance models an is-a relationship. A subclass can provide specialized behavior while preserving the contract expected by code using the base type. Composition models a has-a relationship instead: a booking has a customer rather than being a customer.

Polymorphism lets a call select behavior from the actual object's type. Test both the common contract and each specialized behavior. A hierarchy that shares field names but cannot preserve the expected behavior is a weak model.

Compare cost and evidence

For recursion, identify a base case, a smaller subproblem, and work waiting on the call stack. Compare a linear traversal with repeated scans of the same data. Space used by recursive calls is part of the algorithm's resource cost.

For a classifier, inspect a confusion matrix and performance across relevant groups rather than reporting only one overall accuracy. A higher score on leaked or unrepresentative data is not a reliable improvement. Explain which costs and mistakes matter in the application.

Check yourself

Why might composition fit a Booking and Customer better than inheritance?Show answer

A booking has a customer; it is not a kind of customer and cannot substitute for one.

References used to build these lessons

We used these official documents as references when building this course's lessons. They are the sources for the syllabus structure and course requirements.

International Baccalaureate · First assessment 2027

This PDF is the public IB subject brief. The complete subject guide and assessment requirements are available through your school or the IB Programme Resource Centre.