Full Marks

A-level Computer Science Year 12 · Topic 9

Computational thinking

Computational thinking is the set of mental tools computer scientists use to tackle problems.

We will use abstraction and automation, think ahead about inputs, outputs and preconditions, and think procedurally and logically.

Then we think concurrently, use divide and conquer, backtracking and heuristics, and explore data mining, performance modelling and visualisation.

In this topic

  1. 9.1Abstraction and automationFree below · 28 questions
  2. 9.2Thinking ahead: inputs, outputs, preconditions, caching and reusable componentsOpen in Full Marks · 25 questions
  3. 9.3Thinking procedurally and logically: decomposition, sequencing and decision pointsOpen in Full Marks · 30 questions
  4. 9.4Thinking concurrently and parallel processingOpen in Full Marks · 30 questions
  5. 9.5Problem recognition and solving techniques: divide and conquer, backtracking and heuristicsOpen in Full Marks · 30 questions
  6. 9.6Data mining, performance modelling, pipelining and visualisationOpen in Full Marks · 23 questions

9.1 · Free notes

Abstraction and automation

Diagram: Abstraction and automation

Key points

In more detail

Practice

Abstraction and automation: 10 questions

Pick an answer to check it, or open the answer for the explanation.

1. Which statement best defines abstraction in computational thinking?

  1. Storing data so it can be accessed more quickly
  2. Splitting a problem into smaller sub-problems
  3. Converting a flowchart directly into machine code
  4. Removing unnecessary detail to focus on the essential features
Show answer

D: Removing unnecessary detail to focus on the essential features. Abstraction hides or removes detail that is not needed so the essential features remain. Splitting a problem is decomposition; storing data for speed is caching.

2. The London Underground map shows stations and lines but not true distances. Why is it a good abstraction?

  1. It automatically plans journeys for passengers
  2. It is drawn to an exact scale
  3. It shows every street above each station
  4. It keeps the detail a traveller needs and omits the rest
Show answer

D: It keeps the detail a traveller needs and omits the rest. The map removes irrelevant detail such as geography and distance and keeps stations and connections, which is what journey planning needs.

3. A programmer calls sort(names) without knowing which sorting algorithm is used. Which type of abstraction is this?

  1. Data abstraction
  2. Caching
  3. Procedural abstraction
  4. Automation
Show answer

C: Procedural abstraction. Procedural (functional) abstraction hides how a computation is carried out. The programmer only needs to know what the subroutine does and what parameters it takes.

4. A stack is used through push and pop, and the user does not know whether it is stored as an array or a linked list. This is an example of:

  1. Data abstraction
  2. Automation
  3. Iteration
  4. Problem reduction
Show answer

A: Data abstraction. Data abstraction hides how a data structure is represented. Users interact only through the defined operations, so the implementation can change without affecting them.

5. Which description best matches automation in computational thinking?

  1. Checking that user input is valid
  2. Implementing a model as an algorithm in code that a computer executes
  3. Removing irrelevant detail from a problem
  4. Breaking a problem into modules
Show answer

B: Implementing a model as an algorithm in code that a computer executes. Automation puts an abstracted model into action: algorithms and data structures are coded and run on a computer to solve the problem.

6. Why is abstraction normally carried out before automation?

  1. Abstraction is only needed after testing
  2. Computers cannot run programs until they are abstracted
  3. Automation removes the need for algorithms
  4. The model must be defined before it can be coded and run
Show answer

D: The model must be defined before it can be coded and run. You must first decide what the model contains (abstraction). Only then can you design algorithms and code to execute it (automation).

7. Car, Lorry and Motorbike are grouped as Vehicle, with common attributes such as wheels and speed. This is abstraction by:

  1. Generalisation
  2. Data hiding
  3. Caching
  4. Sequencing
Show answer

A: Generalisation. Grouping items by shared characteristics into a more general category is abstraction by generalisation (categorisation).

8. A programmer replaces the expression 5 * 3 with the subroutine rectangle_area(w, h). What principle is being applied?

  1. Reducing the problem to a known one
  2. Replacing specific values with parameters
  3. Hiding the data structure used
  4. Storing results for reuse
Show answer

B: Replacing specific values with parameters. Procedural abstraction generalises a calculation by replacing fixed values with parameters, so the same subroutine works for any width and height.

9. Which statement about abstraction is correct?

  1. It reduces complexity by hiding detail that is not needed
  2. It makes a model contain more detail than reality
  3. It is only used when designing hardware
  4. It removes the need to write any algorithm
Show answer

A: It reduces complexity by hiding detail that is not needed. Abstraction reduces complexity by hiding or removing irrelevant detail. It applies to software and models, and algorithms are still needed for automation.

10. A web developer uses HTTP without knowing how bits are sent as electrical signals. Which idea does this show?

  1. Caching of repeated requests
  2. Validation of user input
  3. Layers of abstraction hide lower-level detail
  4. Decomposition into parallel tasks
Show answer

C: Layers of abstraction hide lower-level detail. Each network layer provides a service to the layer above and hides how it is done, so the developer need not know the lower-level detail.

Keep going in Full Marks

Full Marks has 28 questions on Abstraction and automation (18 more than here), set out in practice levels. You also get notes and 3D models for all 6 subtopics of Computational thinking, plus games, timed exams and past papers.

On your exam board

All A-level Computer Science Year 12 topics