21 exam-style questions on Computational thinking with answers and explanations. Six real samples below — the full set is free with an account.
A design team splits a hospital appointment system into a booking part, a reminder part and a billing part, and writes a separate specification for each. Which approach to computational thinking are they applying?
Answer: Decomposition
Breaking a system into parts that can each be specified, built and tested on their own is decomposition. Abstraction would mean discarding detail from the situation, not creating separate parts of the solution.
A delivery company models a city as a set of junctions joined by roads, each road labelled with an average travel time. Street names, road surfaces and building heights are left out. Which statement best describes what the designers have done?
Answer: They have kept only the detail that the route calculation needs
Representing a real situation with only the features that affect the result is abstraction; travel time changes the chosen route, a street name does not. A model is not wrong because it omits detail, only if it omits detail the calculation needs.
A programmer notices that marking a spelling test, a times-table test and a vocabulary test all follow the same three steps: read the response, compare it with the key, add to the score. Which approach lets a single marking subprogram serve all three tests?
Answer: Recognising the structure shared by the three tasks
Spotting that separate tasks repeat the same structure is pattern recognition, and it is what makes one reusable solution possible. Decomposition would produce three separate marking routines rather than one shared one.
Which requirement must a sequence of steps meet before it can properly be called an algorithm?
Answer: It must finish after a finite number of steps
An algorithm has to be finite and unambiguous, so a set of steps that can run forever is not one. It may be written in pseudocode or drawn as a flowchart, and a straight sequence with no loop is still an algorithm.
In a flowchart, which symbol is used for a step at which the algorithm chooses between two paths?
Answer: A diamond
The diamond holds a condition and has two exits that must both be labelled, usually yes and no. A rectangle is a process, a parallelogram is input or output and an oval marks the start or the stop.
Two designs find the highest mark in an unsorted list of 500 marks. Design X sorts the whole list and then takes the last value. Design Y makes one pass through the list, keeping the largest value seen so far. Which comparison of the two designs is correct?
Answer: Design Y does less work because it inspects each mark once
Both designs are correct, so the choice is decided by the work done: Y looks at each of the 500 marks once, while X first rearranges the whole list and then reads one value. Producing the right answer and producing it efficiently are separate questions.
21 Computational thinking questions — free with an account. Spaced repetition, streaks and full exam simulations included.
Practise them freeThis platform is independently developed and is not endorsed by, affiliated with, or sponsored by the International Baccalaureate Organization. “International Baccalaureate” and “IB” are registered trademarks of the IBO.