Practice Pattern Recognition in CS Thinking

Use these practice problems to test your method after reviewing the concept explanation and worked examples.

Quick Recap

Pattern recognition is the process of identifying similarities, trends, or regularities across data or problems in order to build general solutions. By spotting what is the same across different cases, you can create reusable strategies instead of solving each case from scratch.

Spotting what's the same across different examples so you can apply one solution to many.

Example 1

easy
Look at the sequence: 2, 6, 18, 54, ... Identify the pattern and predict the next number.

Example 2

medium
Three programs are described: (a) calculates total price of items in a shopping cart, (b) calculates total marks of a student across subjects, (c) calculates total rainfall over a week. What pattern do they share?

Example 3

easy
Identify the pattern: Monday โ†’ M, Tuesday โ†’ T, Wednesday โ†’ W. How would you extract the first letter of any day?

Example 4

medium
Three tasks all require counting items that meet a condition: counting even numbers in a list, counting absent students, and counting defective bulbs. What common algorithm pattern can be reused?