DigiBacc

Practice questions › IB Computer Science › Computational thinking › Approaches to computational thinking
IB Computer Science · Computational thinking

Approaches to computational thinking practice questions.

40 exam-style questions on Approaches to computational thinking — topic B1.1 of Computational thinking in the IB Computer Science syllabus — with answers and explanations. Samples below; the full set is free with an account.

At a glance

About this topic

Syllabus code
B1.1
Subject
IB Computer Science
Topic
B1 · Computational thinking
Questions
40 with worked answers
Question types
13 multiple-choice questions · 10 flashcards · 6 fill-in-the-gap questions · 5 true/false questions · 2 diagram tasks · 2 matching tasks · 2 structured questions
Try it

Sample questions on Approaches to computational thinking

A set of steps for finding the largest value in a list has been written out in pseudocode and has never been entered into any computer. Which statement is correct?

  • It is not an algorithm until it has been written in a real language
  • It is not an algorithm until it has been run and produced an output
  • It is a program, because pseudocode is itself one of the programming languages
  • It is an algorithm, because an algorithm is independent of any language

Answer: It is an algorithm, because an algorithm is independent of any language

An algorithm is a finite, unambiguous sequence of steps that solves a problem, and it exists independently of any language, translator or machine. A program is one particular expression of an algorithm in a language a machine can be made to execute, which is why the same algorithm can appear as many different programs.

A learner's flowchart for deciding whether a parcel is overweight has a decision box from which one single arrow leaves, and that arrow carries no label. Identify the fault this creates for anyone following the flowchart.

  • Only one of the two possible outcomes has a route out of the box.
  • A decision box may not be followed directly by a process box, so the order of the boxes has to be reversed.
  • The flowchart needs a second terminator symbol before the decision box can be used at all.
  • The condition inside the decision box can no longer be written as a single comparison.

Answer: Only one of the two possible outcomes has a route out of the box.

A decision box asks a question with two answers, so it must have two exits, each labelled with the outcome that takes it. With one unlabelled exit the reader cannot tell what happens when the parcel is not overweight.

A flowchart is to output PASS for a mark of 40 or more and RESUBMIT for any lower mark. Its single decision box has its YES branch leading to the box that outputs RESUBMIT. State the condition that must be written inside the decision box.

  • MARK is at least 40
  • MARK is less than 40
  • MARK is greater than 40
  • MARK is exactly 40

Answer: MARK is less than 40

The YES branch must be the one that leads to RESUBMIT, so the question asked in the box has to be the one answered YES by a failing mark. Working backwards from the required output fixes the condition.

A team's model of a bus route holds the names of the stops. The only job of the software is to display the next three stops after a stop that the passenger names. Identify the reason the distances between stops may be left out of the model.

  • The passenger names the starting stop instead of choosing it from a list on the screen.
  • The model is described as a route rather than as a whole network of routes.
  • Nothing that has to be output is worked out from a distance.
  • Only three stops are shown, which is few enough to hold in memory at once.

Answer: Nothing that has to be output is worked out from a distance.

An abstraction may leave out anything that no required output depends on. Ordering the stops needs only their sequence, so distance carries no part of the answer and is removed.

A design checks each pupil in a class against every other pupil for a shared birthday, carrying out exactly one check for each pair. The class is made four times as large. State the factor by which the number of checks grows.

  • about 4
  • about 8
  • about 64
  • about 16

Answer: about 16

The number of pairs is n(n-1)/2, which grows roughly with the square of n. Multiplying n by 4 therefore multiplies the work by about 4 squared, that is about 16.

A team claims that leaving the opening hours of each shop out of a shopping-centre wayfinding model is a safe abstraction. Identify the single observation that would show the abstraction is not safe.

  • A visitor is sent to a shop that is shut at that time.
  • The model holds fewer items of data about each shop than the centre's own records hold.
  • The model has to be redrawn each time a new shop opens in the centre.
  • A route the model gives is longer than the route shown on the printed centre map.

Answer: A visitor is sent to a shop that is shut at that time.

An abstraction is judged only by whether the answers it gives are still right for the problem it serves. Holding less data than the source records is normal and expected; producing a wrong recommendation is the evidence that something essential was dropped.

That was 6 of 40 Approaches to computational thinking questions.

Practise all 40 free
Exam tips

Command terms in this topic

40 Approaches to computational thinking questions — free with an account. Spaced repetition, streaks and full exam simulations included.

Practise them free

This 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.