Decomposition Examples in CS Thinking
Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Decomposition.
This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in CS Thinking.
Concept Recap
Breaking a complex problem into smaller, more manageable parts that are easier to solve.
Eating an elephant: one bite at a time. Big problems become many small ones.
Read the full concept explanation โHow to Use These Examples
- Read the first worked example with the solution open so the structure is clear.
- Try the practice problems before revealing each solution.
- Use the related concepts and background knowledge badges if you feel stuck.
What to Focus On
Core idea: Solve each small independent part, then combine the solutions into a complete answer.
Common stuck point: The parts must be truly independent or have clear dependencies.
Worked Examples
Example 1
easyYou need to plan a school sports day. Decompose this problem into smaller sub-problems.
Solution
- 1 Step 1: Identify the major areas: events/activities, equipment, scheduling, participants, venue.
- 2 Step 2: Break each area down further โ e.g., Events: choose sports, set rules, assign referees. Scheduling: set times, allocate fields, plan breaks.
- 3 Step 3: Each sub-problem is now small enough to tackle individually.
Answer
Sub-problems: choose events, organise equipment, create schedule, register participants, prepare venue, plan prizes.
Decomposition breaks a complex problem into smaller, manageable parts. Each part can be solved independently, making the overall problem less overwhelming.
Example 2
mediumDecompose the task of building a simple calculator program.
Practice Problems
Try these problems on your own first, then open the solution to compare your method.
Example 1
easyDecompose the problem of creating a sandwich into at least 4 sub-tasks.
Example 2
mediumDecompose building a class voting app into four modules, and identify one dependency between them.