Before you write any program, you need to understand the problem. Real-world problems are often messy: people describe them vaguely, important details are mixed with irrelevant details, and the solution is not obvious at first.
Computational thinking
Computational thinking is a way of analysing problems so that they can be solved using a computer. It uses ideas such as decomposition, abstraction and algorithmic thinking.
Computational thinking is not the same as programming. Programming is writing code. Computational thinking is the planning and reasoning you do before, during and after coding.
The three principles work together: split the problem up, focus on the right details, then create clear steps for the computer to follow.

The big picture
Computational thinking helps you define a problem clearly and then refine the solution until it is precise enough to turn into an algorithm or program.
A problem is the task you want the computer system to help solve. To define it properly, you usually need to identify:
For example, “make a quiz app” is vague. A better problem definition would say who uses it, what questions are asked, how answers are marked, what score is shown, and whether the quiz has a time limit.
Defining a quiz program
Decomposition
Decomposition means breaking a large problem down into smaller, more manageable sub-problems.
This makes a problem less overwhelming. Each sub-problem can be understood, designed, tested and improved separately.
For example, a food-ordering app could be decomposed into:
This helps you refine the problem because you can notice missing parts. If you forget “confirming the order”, users might pay but not know whether the order was accepted.
Breaking down a library borrowing system
Listing random features
Do not just list everything the system might contain. Decomposition should split the problem into useful sub-problems that help you design the solution.
Abstraction
Abstraction means focusing on the important details of a problem and ignoring details that are not relevant to the solution.
A computer solution does not need every detail from the real world. It needs the details that affect the result.
Suppose you are designing a cinema booking system. The system probably needs the film, show time, seat number, ticket type and price. It does not need the colour of the cinema carpet or the customer’s favourite snack unless those details affect the booking.
Choosing details for a cinema booking system
A useful abstraction question
Ask: “Would changing this detail change the output of the program?” If not, it is probably irrelevant for this solution.
Removing too much detail
Abstraction does not mean deleting details at random. If a detail affects the result, rules or output, it should usually be kept.
Algorithmic thinking
Algorithmic thinking means designing a clear, ordered set of steps that can solve a problem.
Algorithm
An algorithm is a finite sequence of precise instructions for solving a problem.
Algorithms often use three basic structures:
IF, ELSE or a conditionA computer needs precise steps. “Check the password” is not detailed enough. The algorithm needs to say what data is compared, what happens if it matches, and what happens if it does not.
Planning a password check
enteredPassword == storedPassword, set loggedIn to true; otherwise the attempt has failed.attempts < 3 AND loggedIn == false.loggedIn == true, output “Access granted”; otherwise, after 3 failed attempts, output “Account locked”.Vague instructions
Instructions such as “deal with the user” or “sort it out” are not algorithmic. A computer needs precise actions and conditions.
In real problem solving, you usually move between the three principles rather than using them once in a fixed order.
| Principle | Question to ask | How it helps refine the problem |
|---|---|---|
| Decomposition | What smaller parts are inside this problem? | Reveals missing tasks and connections |
| Abstraction | Which details actually matter? | Removes clutter and focuses the design |
| Algorithmic thinking | What exact steps solve each part? | Turns the plan into something implementable |
To refine a solution means to improve it by making it clearer, more complete or more precise. Refining often happens after testing your idea against examples.
For instance, a ticket-price algorithm might seem finished until you test edge cases such as someone exactly 16 years old, or someone with a discount card.
Refining a ticket-price algorithm
age < 16 for a child ticket, not age <= 16, if the rule says “under 16”.Define, then refine
A strong solution usually starts as a clear problem definition, then improves through decomposition, abstraction, algorithmic thinking and testing.
In OCR J277, you may be asked to describe these principles, identify them in a scenario, or explain how they help solve a problem. You do not need to memorise a single “perfect” wording, but you do need to use the terms accurately.
For example:
In the exam
Check yourself
Test yourself with 5 quick questions on this guide. Answer them all correctly to complete it.
Test yourself on this topic, or move on to the next guide.
How was this guide?