GCSE Algorithms and Programming — Questions and Answers
Question 1: What term describes a precise, step-by-step set of instructions used to solve a problem?
- An algorithm (Correct answer)
- A variable
- A compiler
- A database
Correct answer: An algorithm
An algorithm is an unambiguous sequence of steps designed to solve a specific problem.
Algorithms can be represented in several ways, including pseudocode, flowcharts, or structured English, and form the basis of all computer programs, which are algorithms translated into a programming language.
Question 2: What is the process of breaking a complex problem down into smaller, more manageable sub-problems called?
- Decomposition (Correct answer)
- Abstraction
- Compilation
- Iteration
Correct answer: Decomposition
Decomposition splits a large problem into smaller parts that are easier to understand and solve individually.
Decomposition is a core computational thinking skill; it allows programmers to tackle each sub-problem separately, test them individually, and then combine the solutions to solve the original, larger problem.
Question 3: Which searching algorithm repeatedly divides a sorted list in half to quickly locate a target value?
- Binary search (Correct answer)
- Linear search
- Bubble sort
- Merge sort
Correct answer: Binary search
Binary search works only on sorted data and eliminates half the remaining items with each comparison.
Because binary search discards half of the remaining data at each step, it is much faster than linear search for large sorted datasets, though the data must be sorted first for it to work correctly.
Question 4: Which searching algorithm checks every item in a list one at a time, starting from the beginning, until it finds the target or reaches the end?
- Linear search (Correct answer)
- Binary search
- Insertion sort
- Merge sort
Correct answer: Linear search
Linear search examines each element in sequence and works on both sorted and unsorted lists.
Linear search is simple to implement and works on any list, but it can be slow for large datasets since, in the worst case, it must check every single item before finding the target or confirming it is absent.
Question 5: What is the process of removing unnecessary detail to focus only on the important features of a problem called?
- Abstraction (Correct answer)
- Decomposition
- Iteration
- Compilation
Correct answer: Abstraction
Abstraction filters out irrelevant detail, allowing a programmer to focus on what matters for solving the problem.
Abstraction simplifies a problem by ignoring details that are not relevant to the solution, such as ignoring the exact colour of a car when writing a program that only needs to calculate its speed.
Question 6: Which sorting algorithm repeatedly compares adjacent items in a list and swaps them if they are in the wrong order?
- Bubble sort (Correct answer)
- Binary search
- Linear search
- Decomposition
Correct answer: Bubble sort
Bubble sort passes through the list multiple times, swapping adjacent out-of-order items until the list is sorted.
Bubble sort is simple to understand and implement but inefficient for large lists, as it may require many passes through the data, each comparing and potentially swapping adjacent pairs.
What term describes a precise, step-by-step set of instructions used to solve a problem?