Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Principles of Computational Thinking: Abstraction

Total questions: 64

Worksheet time: 11hrs 40mins

Name
Class
Date
1.

Which statement best describes abstraction in computing?

a)

Removing unnecessary details to focus on key features

b)

Breaking a problem into smaller parts for easy coding

c)

Writing detailed algorithms for every program step

d)

Collecting user data to customize application behavior

2.

Which set lists the three main principles of computational thinking?

a)

Abstraction, decomposition, algorithmic thinking

b)

Virtualization, parallelism, caching

c)

Iteration, recursion, data validation

d)

Encapsulation, inheritance, polymorphism

3.

Which is a real-world example of abstraction used in software?

a)

A compiler exposing all machine registers

b)

A database with every passenger’s biography

c)

A map showing only routes and stations

d)

A sensor reading raw signals without filtering

4.

When developing a program, what should be identified to apply abstraction effectively?

a)

User passwords stored in plain text files

b)

Every technical detail of hardware drivers

c)

All possible edge cases for future updates

d)

Important features that contribute to the solution

5.

The map shown uses a straight brown line with station names listed vertically. What feature has been abstracted to make the map easier to use?

a)

Order of stations along the line

b)

Station names and interchange icons

c)

Accessibility information for stations

d)

Exact street geography and distances

6.

On the schematic map, why are interchange icons displayed next to some stations?

a)

To display historical station facts

b)

To mark stations with ticket barriers

c)

To indicate connections to other lines

d)

To show real-time train capacity

7.

What is decomposition as described in the material?

a)

Testing only the final combined program

b)

Eliminating all features from a problem

c)

Breaking a large problem into smaller problems

d)

Combining tasks into one large process

8.

Which statement best describes decomposition in computing?

a)

Testing programs using multiple input data sets

b)

Writing code with fewer lines for faster execution

c)

Splitting a complex problem into manageable chunks

d)

Translating pseudocode directly into a programming language

9.

What is algorithmic thinking?

a)

Choosing a language with built-in libraries

b)

Drawing system diagrams before any coding

c)

Remembering common code patterns for exams

d)

Creating step-by-step instructions to solve problems

10.

Which statement links abstraction and decomposition to algorithmic thinking?

a)

They help identify each step before forming rules

b)

They automatically generate working source code

c)

They remove the need to plan test data

d)

They make all solutions fully automated by default

11.

Which everyday example illustrates algorithmic thinking leading to automation?

a)

A gamer choosing difficulty in the menu

b)

A human sketching game characters on paper

c)

A set of traffic lights operating by fixed rules

d)

A student buying components for a PC build

12.

Which statement best describes a searching algorithm?

a)

Random guesses to find data in a dataset

b)

A visual chart used to store information

c)

Shortcuts that always avoid comparisons

d)

Exact step-by-step instructions for locating data

13.

What key requirement must be true before running a binary search?

a)

The data must be in order

b)

The list must be very small

c)

Numbers must be all even

d)

All values must be unique

14.

During binary search, what is compared at each step?

a)

Target value with every value sequentially

b)

All values with each other

c)

First value with the last value

d)

Target value with the middle value

15.

If the target is smaller than the middle value in binary search, what should you do next?

a)

Search the left half of the list

b)

Search the right half of the list

c)

Restart from the beginning

d)

Swap the first and last values

16.

Which option correctly lists two common searching algorithms?

a)

Binary search and linear search

b)

Depth-first and breadth-first

c)

Insertion sort and quick sort

d)

Bubble sort and merge sort

17.

How does binary search operate on word datasets?

a)

Ignores case and order entirely

b)

Converts words to random numbers

c)

Counts number of letters per word

d)

Compares alphabetic order of words

18.

Which step should happen first in a binary search process?

a)

Identify the middle value

b)

Remove duplicate entries

c)

Pick a random starting index

d)

Sort only the right half

19.

In the example list [2, 5, 7, 12, 15, 22, 46], why does the search move left when looking for 7 after checking 12?

a)

Because 12 is not in the list

b)

Because 7 equals the middle value

c)

Because 7 is smaller than 12

d)

Because 7 is larger than 12

20.

In the word example, the first middle value chosen from the list is which item?

a)

Hip Hop

b)

Techno

c)

Rock

d)

Jazz

21.

After comparing 'Hip Hop' with target 'Rock', which half of the list should be kept?

a)

Keep only the middle element

b)

Keep entire list unchanged

c)

Keep left half before Hip Hop

d)

Keep right half after Hip Hop

22.

Given the sublist [Jazz, Rock, Techno], what is the next middle element?

a)

Techno

b)

Jazz

c)

Rock

d)

Country

23.

In Python, which expression correctly computes the middle index using low and high pointers?

a)

mid = (high - low) // 2

b)

mid = (low + high) // 2

c)

mid = low + high

d)

mid = (low + high) / 2

24.

When data[mid] > target in the Python code, which pointer is updated and how?

a)

high = high + 1

b)

high = mid - 1

c)

low = mid + 1

d)

low = low - 1

25.

What loop condition ensures the binary search continues while the search range is valid?

a)

while high < low

b)

while low < 0

c)

while found is True

d)

while low <= high

26.

Which statement best describes a linear search on a list of values?

a)

Uses a hash to jump directly to target

b)

Sorts list first then compares adjacent values

c)

Divides list in half and checks middle value

d)

Starts at first item and checks each sequentially

27.

When performing a linear search, what should you do immediately after checking the first value and it is not the target?

a)

Check the last value immediately

b)

Sort the dataset before continuing

c)

Restart the search from the first value

d)

Move to the next value and check it

28.

Which dataset condition allows linear search but prevents binary search from working correctly?

a)

Values are stored in a single array

b)

Values contain duplicates in places

c)

Values are all unique numbers

d)

Values are unsorted or in random order

29.

Which is an advantage of linear search compared to binary search?

a)

Requires complex implementation steps

b)

Guarantees constant-time searching

c)

Always faster on huge datasets

d)

Works on unsorted datasets reliably

30.

Which is a disadvantage of linear search?

a)

Cannot be implemented in Python

b)

Fails on small datasets frequently

c)

Requires data to be sorted first

d)

Slow for large datasets overall

31.

Binary search is typically faster than linear search for large datasets because it

a)

Starts at the first index always

b)

Checks every value sequentially

c)

Halves the search space each step

d)

Uses random indices for probing

32.

In a Python linear search, which variable is commonly used to track whether the target was found?

a)

A Boolean flag such as found

b)

An integer counter named mid

c)

A list storing checked indices

d)

A string variable holding target

33.

For repeated searches on the same large, sorted dataset, which algorithm is generally more efficient?

a)

Binary search with ordered data

b)

Linear search with random order

c)

Linear search starting each time

d)

Brute force with nested loops

34.

Which statement best defines a sorting algorithm in computer science?

a)

A method with precise step-by-step rules

b)

A hardware technique for storing files

c)

A visualization tool for datasets only

d)

A random process that reorders data

35.

What is the main action performed during bubble sort when two adjacent items are in the wrong order?

a)

Swap the pair immediately

b)

Skip the pair and continue

c)

Insert a new placeholder

d)

Delete the larger item

36.

In bubble sort, what does one complete run from the start to the end of the list represent?

a)

An insertion into the list

b)

A single swap operation

c)

The algorithm’s termination

d)

A single pass through data

37.

When does a bubble sort stop?

a)

After exactly two passes

b)

When the list is half sorted

c)

When the first item is smallest

d)

When no swaps occur in a pass

38.

During a pass, which pairs are compared in bubble sort?

a)

First and last only

b)

Every third element

c)

Pairs chosen randomly

d)

Adjacent pairs left to right

39.

Starting list: 5, 2, 4, 1, 6, 3. After the first comparison and necessary action, what does the list become?

a)

2, 4, 5, 1, 6, 3

b)

5, 2, 1, 4, 6, 3

c)

5, 4, 2, 1, 6, 3

d)

2, 5, 4, 1, 6, 3

40.

In the same list, which comparison results in no swap during pass 1?

a)

Comparing 5 and 6

b)

Comparing 5 and 4

c)

Comparing 2 and 1

d)

Comparing 6 and 3

41.

After completing pass 1 on 5, 2, 4, 1, 6, 3, which item is guaranteed to be in its final position?

a)

The middle item unchanged

b)

No item guaranteed fixed

c)

The smallest item at the start

d)

The largest item at the end

42.

Which statement about repeating passes in bubble sort is correct?

a)

Repeat until two items equal

b)

Repeat a fixed number always

c)

Repeat passes while swaps occur

d)

Stop after first successful swap

43.

A dataset of words must be sorted alphabetically. What determines swaps when comparing adjacent words?

a)

Lexicographic order of strings

b)

Vowel count in words

c)

Position in the file

d)

Length of each word

44.

In the provided Python bubble sort, what is the role of the variable swaps within the while loop?

a)

Holds the list length

b)

Indexes the current pair

c)

Controls loop continuation

d)

Stores the largest value

45.

Which line correctly performs a swap of two adjacent elements in the Python example?

a)

swap(nums[y], nums[y+1])

b)

temp = nums[y]; nums[y] = nums[y+1]; nums[y+1] = temp

c)

nums[y] = nums[y+1] + temp

d)

nums[y+1] = nums[y] and temp

46.

Which best describes the divide step in merge sort?

a)

Swap out-of-order neighboring values

b)

Split dataset into halves recursively

c)

Compare adjacent values repeatedly

d)

Place each value into final position

47.

During merging in merge sort, how are pairs of sub-datasets combined?

a)

Concatenate lists without comparison

b)

Add sums of corresponding elements

c)

Randomly pick elements from each half

d)

Compare first elements and append smaller

48.

What is the main strategy behind merge sort?

a)

Divide and conquer approach

b)

Hash and distribute method

c)

Greedy selection process

d)

Backtracking exploration

49.

After splitting into single-element sub-datasets, what happens next in merge sort?

a)

Duplicates are removed automatically

b)

Indices are reset to zero

c)

Elements are shuffled randomly

d)

Sub-datasets are merged in sorted order

50.

Which sequence shows the final sorted output when merging 7, 4, 1, 2, 6, 3, 8, 5 using merge sort?

a)

1, 3, 2, 4, 6, 5, 7, 8

b)

7, 6, 5, 4, 3, 2, 1, 8

c)

2, 1, 4, 3, 6, 5, 8, 7

d)

1, 2, 3, 4, 5, 6, 7, 8

51.

What repeats until one dataset remains in merge sort?

a)

Merging pairs of sub-datasets

b)

Calculating pivot positions

c)

Swapping adjacent items

d)

Selecting minimum from whole list

52.

Why might an exam skip the divide stage and ask you only to demonstrate the conquer stage?

a)

Conquer happens before divide stage

b)

Divide can be pre-done to focus merging

c)

Divide is not part of algorithm

d)

Divide requires special hardware only

53.

Which statement distinguishes merge sort from insertion sort in this material?

a)

Merge sort merges sorted sublists; insertion places items

b)

Merge sort swaps neighbors; insertion divides halves

c)

Merge sort uses pivots; insertion concatenates lists

d)

Merge sort randomizes order; insertion sorts by buckets

54.

In insertion sort, what happens to the first element of the list at the start?

a)

It is swapped with the smallest

b)

It is discarded from the list

c)

It is moved to the list’s end

d)

It becomes the sorted sublist start

55.

During insertion sort, which parts of the list are tracked while the algorithm runs?

a)

A sorted left and unsorted right

b)

Two unsorted halves only

c)

Three rotating partitions

d)

Only a temporary buffer

56.

When comparing the next value to the sorted part in insertion sort, what occurs if it is smaller than the first sorted value?

a)

Reverse the whole list

b)

Swap the entire sublist

c)

Duplicate the smaller value

d)

Insert it to the left position

57.

Which step is repeated in insertion sort until all values have been processed?

a)

Compare then insert or keep

b)

Delete then append values

c)

Merge equal-sized blocks

d)

Randomly shuffle elements

58.

Given the list [54, 27, 17, 9, 40, 12], what is the list after inserting 27 into its correct position on the first pass?

a)

[17, 27, 54, 9, 40, 12]

b)

[54, 27, 17, 9, 40, 12]

c)

[27, 54, 17, 9, 40, 12]

d)

[27, 17, 54, 9, 40, 12]

59.

Continuing insertion sort on [54, 27, 17, 9, 40, 12], what is the list after correctly placing 17?

a)

[17, 27, 54, 9, 40, 12]

b)

[17, 27, 9, 54, 40, 12]

c)

[27, 17, 54, 9, 40, 12]

d)

[17, 54, 27, 9, 40, 12]

60.

After inserting 9 in the same process, what should the list look like?

a)

[9, 17, 54, 27, 40, 12]

b)

[9, 27, 17, 54, 40, 12]

c)

[9, 17, 27, 40, 12, 54]

d)

[9, 17, 27, 54, 40, 12]

61.

Which statement best describes the goal of insertion sort for strings instead of numbers?

a)

Order by string length only

b)

Order by ASCII code only

c)

Order by random character

d)

Order alphabetically A to Z

62.

In Python, which variable typically stores the number of items when starting insertion sort?

a)

length = len(numbers)

b)

total = sum(numbers)

c)

count = size(numbers)

d)

n = measure(numbers)

63.

What does insertion sort do when the current item is not smaller than elements in the sorted sublist?

a)

Delete and reinsert later

b)

Move it to list front

c)

Swap with the last element

d)

Keep it in the same place

64.

How do you feel about your knowledge about:

computational Thinking, Searching & Sorting and the concepts of abstraction, decomposition, algorithms, searching & sort?

a)

I am still developing my knowledge of this topic.

b)

I have a secure knowledge of this topic

c)

I am confident about this topic.

d)

I need to do more revision on this topic