Problem Decomposition
Computer ScienceΒ· Unit 13: Computational thinking & problem solvingΒ· 10 min read
1. What is Problem Decomposition?β βββββ± 3 min
Problem decomposition (also called top-down decomposition or divide-and-conquer) is the foundational first step for solving any complex computational problem. It involves splitting a large, unmanageable problem into smaller, self-contained sub-problems.
Problem Decomposition
A core computational thinking technique that breaks a complex problem into smaller, independent sub-problems, each with a clear, specific goal.
Example:
Decomposing a school attendance system into sub-problems for data entry, report generation, and user authentication.
Good decomposition delivers three key benefits for development: it reduces cognitive load by letting developers work on one small part at a time, enables parallel work for team projects, and simplifies testing by isolating errors to individual sub-problems.
Decompose the problem of building a simple online coffee ordering app
- 1
First, list all core requirements of the app to identify natural divisions: users place orders, admins manage the menu, the system processes payments.
- 2
Split the problem into three independent top-level sub-problems: 1) User-facing order placement, 2) Admin menu management, 3) Payment processing.
- 3
Decompose each top-level sub-problem further. For example, user-facing order placement splits into: browse menu, select items, modify order, submit order.
- 4
Each final sub-problem is now small enough to design, code, and test independently before integrating all solutions.
2. Common Decomposition Methodsβ β ββββ± 5 min
In CIE 9618, you can use two standard decomposition methods depending on the problem type and programming approach you will use later.
The two most widely used methods for exam problems are:
Functional Decomposition
Split the problem based on the actions/functions the system needs to perform. Each sub-problem corresponds to one function.
+ Pros: Simple for small problems, aligns with procedural programming
β Cons: Harder to scale and maintain for large systems
Object-Oriented Decomposition
Split the problem based on core entities (objects) in the system. Each sub-problem covers the attributes and methods of one entity.
+ Pros: Aligns with OOP, easier to scale for large systems
β Cons: Overkill for small, simple problems
Decompose a student grade book using both methods
- 1
Functional decomposition: Split by required actions: add student grade, calculate average grade, generate grade report, search for student. Each action is a separate sub-problem.
- 2
Object-oriented decomposition (first level): Identify core entities: Student, GradeBook, Report. Each entity is a main sub-problem.
- 3
Object-oriented decomposition (second level): Split each entity by requirements. For Student: store ID/name, add grade, return grades. For GradeBook: store all students, search for student, calculate overall average.
3. Exam Requirements for Decomposition Questionsβ β ββββ± 4 min
To get full marks in CIE 9618 decomposition questions, your answer needs to match the expectations of the command term used.
Test your understanding of exam requirements:
Which of these is a characteristic of good decomposition?
All sub-problems are interdependent
Each sub-problem can be solved independently
Sub-problems are the same size as the original problem
Decomposition stops after one level
Reveal answer
1 βCorrect. Independent sub-problems are the core goal of decomposition, to simplify testing and development.
How many levels of decomposition should you show in an exam answer at minimum?
1
2
5
Any number
Reveal answer
1 βCorrect. CIE examiners expect at least two levels to show you can break problems down into manageable parts.
4. Common Pitfalls
Wrong move:
Stopping decomposition after only one level, leaving large, complex sub-problems
Why:
Large sub-problems retain the same complexity as the original problem, defeating the purpose of decomposition
Correct move:
Decompose repeatedly until each final sub-problem is small enough to code as a single function or class
Wrong move:
Creating overlapping sub-problems that share the same responsibilities
Why:
Overlap leads to duplicated code and makes debugging much harder when changes are needed
Correct move:
Ensure each sub-problem has one clear responsibility with no overlapping functionality
Wrong move:
Starting decomposition before understanding all requirements of the original problem
Why:
If you do not know what the problem needs to do, your decomposition will miss key requirements
Correct move:
Always list all requirements of the original problem first before splitting into sub-problems
Wrong move:
Mixing decomposition methods without a clear structure in exam answers
Why:
Unstructured mixed decomposition is hard for examiners to follow, leading to lost marks
Correct move:
Pick one method, stick to it, and explicitly state which method you are using
5. Quick Reference Cheatsheet
Key Principle | Exam Note |
|---|---|
Split into small sub-problems | Decompose until each solves one clear task |
Keep sub-problems independent | Minimise dependencies to simplify testing |
Show at least 2 levels | Required for full marks in most decomposition questions |
Pick the right method | Functional for procedural code, OO for OOP problems |
When this came up on past exams
AI-estimated based on syllabus patterns β cross-check with official past papers for accuracy. Use only as revision-focus signals.
- 2022 Β· 12
Decompose a cinema ticket booking system
- 2024 Β· 11
Explain benefits of problem decomposition
Going deeper
What's Next
Problem decomposition is the foundational first step of all computational problem solving, and the quality of your decomposition directly impacts how easy it is to design, code, and test your final solution. It is the starting point for all other core computational thinking techniques, including pattern recognition, abstraction, and algorithm design. For OOP-based problems, decomposition is also how you identify core classes and objects, making it a critical skill for object-oriented design questions. Mastering decomposition will make all subsequent programming and problem solving topics easier to learn and apply in exams.
