Common Mistakes in Computational Thinking

160 common pitfalls across 40 concepts, including 40 recurring stuck points

These are the pitfalls students hit across all 40 computational thinking concepts, from Algorithm, Decomposition and Pattern Recognition onward. Each entry names the concept it comes from, so you can tell a slip from a genuine gap and go straight to the explanation.

1
Algorithm
Stuck Point

Algorithms must work for all valid inputs, not just specific examples.

2
Algorithm
Mistake

Writing steps that are ambiguous or assume human judgment the computer cannot replicate

3
Algorithm
Mistake

Forgetting to handle edge cases such as empty input or extreme values

4
Algorithm
Mistake

Creating an algorithm that works for one example but fails on other valid inputs

5
Decomposition
Stuck Point

The parts must be truly independent or have clear dependencies.

6

Splitting a problem into parts that are still too large or too intertwined to solve independently

7

Forgetting to plan how the sub-solutions will be recombined into the final answer

8

Over-decomposing into too many tiny parts, creating unnecessary complexity in integration

9

Correlation isn't causation—patterns can be coincidental and misleading without careful testing.

10

Assuming a pattern found in a few examples always holds universally

11

Confusing correlation with causation when spotting trends in data

12

Overlooking exceptions or edge cases that break the pattern

13
Abstraction
Stuck Point

Too much abstraction loses important information; too little is overwhelming.

14
Abstraction
Mistake

Over-abstracting and removing details that turn out to be important for correctness

15
Abstraction
Mistake

Under-abstracting and keeping so many details that the model is as complex as the original problem

16
Abstraction
Mistake

Confusing abstraction with vagueness—a good abstraction is precise about what it exposes and what it hides

17
Sequence
Stuck Point

Some steps can't be reordered; others can. Understanding dependencies is key.

18
Sequence
Mistake

Placing a statement that uses a variable before the statement that initializes it

19
Sequence
Mistake

Assuming statements run simultaneously when they actually execute one at a time

20
Sequence
Mistake

Reordering steps without checking whether later steps depend on earlier results

21
Selection
Stuck Point

Conditions must be unambiguous—what happens when temperature = 30?

22
Selection
Mistake

Using assignment (=) instead of comparison (==) in the condition, which silently succeeds in some languages

23
Selection
Mistake

Forgetting to handle the else case, leaving unexpected inputs with no defined behavior

24
Selection
Mistake

Writing overlapping conditions in if/else-if chains so that the wrong branch executes

25
Iteration
Stuck Point

The loop must have a way to stop—every iteration should progress toward the stopping condition.

26
Iteration
Mistake

Forgetting to update the loop variable, causing an infinite loop that never terminates

27
Iteration
Mistake

Off-by-one errors where the loop runs one too many or one too few times

28
Iteration
Mistake

Modifying the collection being iterated over during the loop, causing skipped or duplicate elements

29
Variable
Stuck Point

= means 'assign' not 'equals'. x = x + 1 is valid (not a paradox).

30
Variable
Mistake

Using a variable before assigning it a value, causing an undefined or null reference error

31
Variable
Mistake

Choosing vague variable names like 'x' or 'temp' that make code hard to understand later

32
Variable
Mistake

Confusing the assignment operator (=) with the equality comparison operator (==)

33
Data Types
Stuck Point

'5' (text) and 5 (number) are different—some languages convert automatically, some don't.

34
Data Types
Mistake

Assuming '5' (a string) and 5 (an integer) are the same and can be used interchangeably

35
Data Types
Mistake

Forgetting that dividing two integers truncates in languages such as C and Java (7 / 2 gives 3, not 3.5), while Python 3 and JavaScript give 3.5

36
Data Types
Mistake

Not converting user input from string to the appropriate type before performing calculations

37
Boolean Logic
Stuck Point

AND requires both true. OR requires at least one true. NOT flips the value.

38

Confusing AND with OR—AND is stricter (both must be true), OR is more permissive (either suffices)

39

Forgetting De Morgan's laws: NOT (A AND B) equals (NOT A) OR (NOT B)

40

Neglecting operator precedence—NOT binds tighter than AND, which binds tighter than OR

41

Defining a function doesn't run it—you must call the function.

42

Defining a function but forgetting to call it, wondering why nothing happens

43

Making functions that do too many things instead of one well-defined task

44

Confusing parameters (placeholders in the definition) with arguments (actual values passed in the call)

45
Parameters
Stuck Point

Parameter (in definition) vs. argument (in call)—often used interchangeably.

46
Parameters
Mistake

Passing arguments in the wrong order, causing the function to receive incorrect values

47
Parameters
Mistake

Confusing parameters (defined in the function signature) with arguments (passed at the call site)

48
Parameters
Mistake

Forgetting to pass a required parameter, causing a runtime error or unexpected default behavior

49
Array
Stuck Point

Most languages index from 0, not 1. The last element of a 3-item array is at index 2.

50
Array
Mistake

Accessing an index that is out of bounds (e.g., index 5 in a 5-element array, which only has indices 0-4)

51
Array
Mistake

Forgetting that arrays are zero-indexed, leading to off-by-one errors

52
Array
Mistake

Confusing the array length with the last valid index (length 5 means last index is 4)

53
Debugging
Stuck Point

The bug might not be where the error appears—trace backward.

54
Debugging
Mistake

Making random changes hoping to fix the bug instead of systematically isolating the cause

55
Debugging
Mistake

Fixing the symptom instead of the root cause, which leads to the bug reappearing in different forms

56
Debugging
Mistake

Not testing the fix thoroughly, accidentally introducing new bugs while fixing the original one

57
Input/Output
Stuck Point

Input needs validation—users may enter unexpected or invalid values that crash the program.

58
Input/Output
Mistake

Not validating user input, leading to crashes or security vulnerabilities when unexpected data is entered

59
Input/Output
Mistake

Forgetting that input from the keyboard is usually a string and needs type conversion for numeric use

60
Input/Output
Mistake

Mixing up the order of input prompts and output displays, confusing the user

61
Binary
Stuck Point

Each position is a power of 2 (1, 2, 4, 8 ...). Reading right-to-left: position 0 = 1, position 1 = 2, etc.

62
Binary
Mistake

Reading binary digits left-to-right instead of right-to-left when assigning powers of 2

63
Binary
Mistake

Forgetting that position 0 (rightmost) has value 20=1, not 21=2

64
Binary
Mistake

Confusing binary arithmetic carries (1 + 1 = 10 in binary, not 2)

65
Bits and Bytes
Stuck Point

KB, MB, GB are 1024× each other, not 1000× (though marketing often uses 1000).

66

Confusing bits (b) with bytes (B) in speed and storage measurements

67

Forgetting that n bits represent 2n values, not n values

68

Mixing decimal units (KB = 1000 bytes) with binary units (KiB = 1024 bytes), such as expecting a '500 GB' drive to show as 500 GiB rather than about 466 GiB

69
Recursion
Stuck Point

Without a base case, recursion never ends—the program crashes with a stack overflow error.

70
Recursion
Mistake

Forgetting the base case, causing infinite recursion and a stack overflow error

71
Recursion
Mistake

Writing a recursive case that does not make the problem smaller, so the base case is never reached

72
Recursion
Mistake

Not trusting the recursion—trying to trace every level mentally instead of trusting that the recursive call returns the correct result for the smaller problem

73

Big O ignores constant factors—2n and 100n are both O(n) because the growth rate is what matters.

74

Confusing Big O (upper bound) with exact running time

75

Ignoring nested loops when counting operations

76

Assuming a faster algorithm is always better (ignoring constant factors for small inputs)

77
Searching
Stuck Point

Binary search requires sorted data—but is much faster than linear search.

78
Searching
Mistake

Applying binary search to unsorted data, which gives incorrect results

79
Searching
Mistake

Not handling the case where the target value is not found in the collection

80
Searching
Mistake

Using linear search on large sorted datasets when binary search would be orders of magnitude faster

81
Sorting
Stuck Point

Stable sort preserves original order of equal elements; unstable doesn't.

82
Sorting
Mistake

Using an O(n2) algorithm like bubble sort on large datasets when an O(nlog⁡n) algorithm is available

83
Sorting
Mistake

Not specifying the sort order clearly, leading to confusion about ascending vs. descending results

84
Sorting
Mistake

Forgetting that stable vs. unstable sorting matters when elements have equal keys but different associated data

85
Event
Stuck Point

Events can occur in any order—the program must handle any sequence.

86
Event
Mistake

Forgetting to register the event handler, so the event fires but nothing happens

87
Event
Mistake

Assuming events occur in a predictable order when users can interact in any sequence

88
Event
Mistake

Writing event handlers that take too long to execute, making the program feel unresponsive

89

Different representations have trade-offs (quality vs. size).

90

Assuming all text uses the same encoding—ASCII, UTF-8, and UTF-16 represent characters differently

91

Forgetting that higher-quality representations (more bits per sample) produce larger files

92

Confusing the data itself with its representation—the same image can be stored as PNG, JPEG, or BMP with different trade-offs

93
Simulation
Stuck Point

Simulations are only as good as their underlying assumptions—garbage in, garbage out.

94
Simulation
Mistake

Trusting simulation results without validating the model against known real-world data first

95
Simulation
Mistake

Including too many variables, making the simulation complex and slow without improving accuracy

96
Simulation
Mistake

Ignoring that small errors in assumptions can compound over many simulation steps, producing wildly inaccurate long-term predictions

97
Testing
Stuck Point

Test edge cases: empty input, zero, maximum values, unexpected types.

98
Testing
Mistake

Only testing the happy path (normal inputs) and neglecting edge cases and error conditions

99
Testing
Mistake

Writing tests that depend on each other's execution order instead of being independent

100
Testing
Mistake

Assuming that passing all tests means the program is bug-free—testing can only show the presence of bugs, not their absence

101
Modular Design
Stuck Point

Modules should have minimal dependencies on each other (loose coupling).

102

Creating modules that are too large and do too many things (low cohesion)

103

Having modules depend heavily on each other's internal details (tight coupling)

104

Not defining clear interfaces between modules, leading to spaghetti dependencies

105
Binary Search
Stuck Point

Binary search only works on sorted data — applying it to unsorted data gives wrong results.

106

Applying binary search to an unsorted list, which produces incorrect results

107

Computing the midpoint as (low + high) / 2, which can cause integer overflow in languages with fixed-size integers, such as Java or C—use low + (high - low) / 2 instead

108

Getting the boundary updates wrong (using mid instead of mid+1 or mid-1), causing infinite loops

109
Linear Search
Stuck Point

Linear search works on any list; binary search is faster but requires sorted data.

110

Using linear search on large sorted datasets when binary search would be dramatically faster

111

Forgetting to handle the case where the element is not found, leading to index errors

112

Stopping at the first match when you need to find all occurrences of the target value

113
Merge Sort
Stuck Point

Merge sort uses extra memory proportional to the input size (unlike in-place sorts).

114
Merge Sort
Mistake

Forgetting that merge sort requires O(n) extra memory for the temporary arrays during merging

115
Merge Sort
Mistake

Incorrectly implementing the merge step by not handling the case when one half is exhausted before the other

116
Merge Sort
Mistake

Confusing merge sort's guaranteed O(nlog⁡n) with quicksort's average O(nlog⁡n) but worst-case O(n2)

117
Bubble Sort
Stuck Point

Bubble sort is O(n²) — avoid it for large data; use merge sort or quick sort instead.

118
Bubble Sort
Mistake

Not optimizing with an early exit—if a pass makes no swaps, the list is already sorted and you can stop

119
Bubble Sort
Mistake

Comparing elements beyond the sorted portion at the end of the array, wasting comparisons

120
Bubble Sort
Mistake

Using bubble sort for large datasets when O(nlog⁡n) algorithms are available and dramatically faster

121
Generalization
Stuck Point

A good general rule must fit all intended cases, not just the first two examples you notice.

122

Building a rule from too few examples and missing exceptions

123

Writing a rule that is too specific to one example instead of using variables

124

Ignoring the conditions under which the general rule is supposed to work

125
Divide and Conquer
Stuck Point

You still need a clear combine step. Splitting a problem is not enough if you cannot reconstruct the final answer.

126

Splitting the problem without reducing its size enough to reach a base case

127

Forgetting the combine step after the recursive calls finish

128

Using divide and conquer when the subproblems are not actually similar to the original problem

129
Error Types
Stuck Point

Logic errors are often the hardest because the program still runs, so the bug is less obvious.

130
Error Types
Mistake

Calling every wrong answer a syntax problem even when the code runs

131
Error Types
Mistake

Fixing one runtime crash without checking whether a deeper logic problem remains

132
Error Types
Mistake

Ignoring compiler or interpreter messages that already identify the error category

133

Resolution and file format are different ideas. Two images can have the same resolution but different file sizes.

134

Thinking a larger displayed image must contain more pixels

135

Confusing image resolution with compression format

136

Ignoring that more color depth increases file size

137

A higher sample rate is not the same as a louder sound. It means the waveform is measured more often.

138

Confusing sample rate with volume

139

Assuming compressed audio stores the exact same data as the original

140

Ignoring that stereo audio stores two channels, not one

141
Random Numbers
Stuck Point

Pseudo-random does not mean useless. It means the values come from an algorithm instead of true physical randomness.

142

Assuming pseudo-random numbers are truly unpredictable in every context

143

Using random values without checking whether the intended distribution is uniform

144

Forgetting that the same seed can recreate the same sequence

145
Modeling
Stuck Point

A model is not supposed to include everything. Its job is to include the right things.

146
Modeling
Mistake

Adding too many details that do not help answer the question

147
Modeling
Mistake

Forgetting to state the assumptions behind the model

148
Modeling
Mistake

Treating model output as perfect truth instead of an approximation

149
Data Compression
Stuck Point

Smaller is not always better. You must decide whether exact recovery matters.

150

Assuming every compressed file can be restored perfectly

151

Ignoring the quality loss caused by repeated lossy compression

152

Comparing compressed files without checking whether they use the same format and settings

153
Logical Operators
Stuck Point

AND requires ALL conditions true; OR only requires ONE — easy to confuse.

154

Confusing AND with OR in complex conditions, reversing the intended logic

155

Forgetting operator precedence—NOT binds before AND, which binds before OR—leading to unexpected results without parentheses

156

Using natural language intuition that fails in code: 'x is 5 or 10' must be written as 'x == 5 OR x == 10', not 'x == 5 OR 10'

157
Truth Tables
Stuck Point

With n variables there are 2ⁿ rows — 3 variables means 8 rows, 4 means 16.

158
Truth Tables
Mistake

Forgetting to include all 2n rows, missing some input combinations

159
Truth Tables
Mistake

Evaluating compound expressions without respecting operator precedence (NOT before AND before OR)

160
Truth Tables
Mistake

Assuming two expressions are equivalent after checking only a few rows instead of all possible combinations