Code Companion
Java

Data, files and algorithms checkpoint

Additional challenges

If you have completed the techniques in this section, choose something that lets you use them in a different way while classmates catch up or consolidate. The choices range from games and simulations to open data work and algorithm experiments. They are optional practice, not the checkpoint exam.

Practice before the checkpoint exam

The final checkpoint exam is run separately by your teacher under controlled classroom conditions. It is not available on the site.

Choose a mode

Build a game, run a simulation, explore your own data, investigate an algorithm or design a stack/queue system. The tasks are deliberately not all the same kind of challenge.

Still catching up?

Use this time to finish or revisit technique challenges instead of starting additional work before the underlying ideas are secure.

Checkpoint exam

Your teacher gives the final controlled assessment in class when the section is complete.

Choose by curiosity, not coverage: an additional challenge does not need to force every data structure and algorithm into one program. Use the techniques that make sense for the problem.
HL: the Recursive Mini-Lab is available after T16. Shared students can ignore it.
Challenges Choose one

Choose a challenge that feels appropriate for you. Code heat is only a rough estimate, not a fixed level.

Blackjack

Challenge ID: PC-X02 · Standards: B2.2.2, B2.3.2, B2.3.3, B2.3.4

Create a game of Blackjack between the player and computer. Store each hand in an array or ArrayList. Deal two cards to each side, allow the player to twist or stick, make the dealer draw below 16, treat picture cards as 10 and handle an ace as 1 or 11. The closest valid total to 21 wins. Separate card generation, hand value and turn logic into methods.

A good choice if you want to combine collection processing with a familiar game loop.

A simple educational card-game illustration with cards and a total approaching 21.

National Lottery Simulation

Challenge ID: PC-X03 · Standards: B2.2.2, B2.3.3, B2.3.4

Allow a player to choose six unique numbers from 1 to 59. Generate six unique winning numbers and a bonus ball, then report the matches. Extend the program to simulate many draws and count how often each match category occurs. Decide how you will prevent duplicate numbers and test the program with deliberately awkward input. Do not claim that a small simulation proves the exact theoretical odds.

Useful if you enjoy randomness, repeated experiments and checking collection state.

Numbered balls emerging from a transparent lottery machine.

Explore a Dataset You Care About

Challenge ID: PC-X04 · Standards: B2.2.2, B2.4.1, B2.4.2, B2.4.3, B2.5.1

Choose a small text dataset about something you care about: games, songs, books, films, sports results, recipes, places or another suitable topic. Load the records into a collection and build a simple explorer that can display them and perform at least one meaningful search and one meaningful ordering operation. Use a search and sort technique from this section rather than a library sort/search shortcut for the part you are demonstrating. Explain the precondition of your search choice and the relevant Big O growth.

Keep the dataset small enough to understand by eye. The interesting part is connecting data, file processing and algorithm choice.

Algorithm Experiment

Challenge ID: PC-DATA-CP-C01 · Standards: B2.4.1, B2.4.2, B2.4.3

Choose one pair to investigate: linear search vs binary search, or bubble sort vs selection sort. Instrument your own implementations so they count comparisons or another clearly defined operation. Predict what will happen as input size grows, then test several input sizes and data arrangements. Present the results clearly and explain whether they match the Big O model. Do not use raw execution time as your only evidence.

This is an investigation rather than a large application. A surprising result is fine if you can explain what your measurement actually counted.

Invent a Stack or Queue System

Challenge ID: PC-DATA-X02 · Standards: B2.2.3, B2.2.4

Invent a small scenario where order genuinely matters. It might be turns in a game, jobs waiting to run, actions that can be undone, messages waiting to send, items being served or something completely different. Choose either a stack or a queue because its behaviour fits the scenario, then build a small working simulation that uses the appropriate core operations safely. Finish with a short explanation of why the other structure would behave differently.

Start from the behaviour you need, not from the data-structure name.

Recursive Mini-Lab

Challenge ID: PC-DATA-CP-HL01 · Standards: B2.4.4, B2.4.5

Choose one small problem that can be solved with simple non-branching recursion, such as summing the digits of a positive integer, reversing a string one character at a time, or counting occurrences of one character. Write both an iterative and recursive solution, hand-trace one recursive example through winding and unwinding, then compare clarity and auxiliary memory. If you invent your own problem, it must make exactly one recursive call on each recursive path.

HL only. The aim is to explore when recursion helps or merely adds call-stack overhead, not to build a huge recursive program.

HL students can revisit recursion before choosing the recursive exploration →