How do we anticipate the inputs, outputs and reusable parts of a solution, and order its steps procedurally?
Thinking ahead: identifying inputs and outputs, preconditions, caching and reusable program components; thinking procedurally: identifying the steps and the order of a solution and the components that can be reused.
An OCR H446 answer on the computational thinking skills of thinking ahead and thinking procedurally: identifying inputs, outputs, preconditions, caching and reusable components, and determining the steps and the order of a procedural solution.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
OCR wants thinking ahead (identifying inputs, outputs, preconditions, caching and reusable components) and thinking procedurally (working out the steps of a solution and their order, and which components can be reused). Expect questions asking you to apply both to a described problem.
The answer
Thinking ahead
Caching and reusable components
Thinking procedurally
Examples in context
A compiler caches the symbol table to avoid re-deriving identifiers. APIs document their inputs, outputs and preconditions so callers use them correctly. Reusable validation and formatting routines appear across every screen of an app. Thinking procedurally produces the ordered algorithm that thinking logically then refines with conditions. OCR links this to abstraction and decomposition, to subroutines and parameters, and to the design stage of the Programming Project, where inputs, outputs and reusable modules are planned up front.
Try this
Q1. State what a precondition is, with an example. [2 marks]
- Cue. A condition that must hold for a solution to work correctly, for example a list must be sorted before a binary search can be used.
Q2. State one benefit and one risk of caching. [2 marks]
- Cue. Benefit: faster access by avoiding recomputation or refetching. Risk: the cached data can become out of date (stale).
Q3. State what thinking procedurally determines about a solution. [1 mark]
- Cue. The steps required and the order in which they must be carried out (and which components are reusable).
Exam-style practice questions
Practice questions written in the style of OCR exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
OCR 20206 marksExplain what is meant by caching and identifying reusable components when thinking ahead about a solution, giving an example of each.Show worked answer →
Caching (up to 3): caching stores the results of operations (or data likely to be needed soon) so they can be reused without recomputing or refetching, improving performance. Thinking ahead means anticipating what will be needed and preparing it. Example: a web browser caches recently visited pages, or a program caches the results of an expensive calculation so repeat requests are instant. The cost is that cached data can become out of date.
Reusable components (up to 3): identifying parts of a solution that can be written once and used many times, as subroutines, modules or library functions, saving development effort and improving reliability through tested code. Example: a "validate date" routine reused across every form. Markers reward storing results to avoid recomputation for caching, and write-once-use-many for reusable components, each with an example.
OCR 20215 marksA program must take a user's exam marks and produce a sorted list of grades. Explain how thinking ahead (inputs, outputs and preconditions) and thinking procedurally would be applied.Show worked answer →
Thinking ahead (up to 3): identify the inputs (the exam marks, perhaps with subject names), the outputs (a sorted list of grades), and the preconditions that must hold for the solution to work, for example marks are numeric and within to , and the grade boundaries are known in advance. Anticipating these prevents errors and guides validation.
Thinking procedurally (up to 2): determine the ordered steps, read and validate the marks, convert each mark to a grade using the boundaries, sort the grades, then output them, and identify which steps are reusable subroutines (for example "mark to grade"). Markers reward correct inputs/outputs/preconditions plus a sensible ordered sequence of steps.
Related dot points
- Thinking abstractly: the nature and need for abstraction, representational and procedural abstraction, and the use of models; thinking ahead and decomposition: breaking a problem into smaller sub-problems.
An OCR H446 answer on the computational thinking skills of abstraction and decomposition: the nature and need for abstraction, representational and procedural abstraction and the use of models, and decomposing a problem into smaller, more manageable sub-problems.
- Thinking logically: identifying the decision points and conditions that affect the flow of a solution; computational methods including problem recognition, divide and conquer, backtracking, heuristics, performance modelling and visualisation.
An OCR H446 answer on thinking logically and computational methods: identifying decision points and conditions in a solution, and the methods of problem recognition, divide and conquer, backtracking, heuristics, performance modelling and visualisation that make problems solvable.
- Thinking concurrently: determining which parts of a problem can be tackled at the same time, the benefits and limitations of concurrent and parallel processing, and the difference between true parallel processing and concurrent processing on a single processor.
An OCR H446 answer on thinking concurrently: identifying which parts of a problem can be done at the same time, the benefits and limitations of concurrency and parallelism, and the difference between true parallel processing on multiple cores and concurrent processing on a single processor.
- Programming techniques: sequence, selection and iteration, recursion, the use of subroutines (procedures and functions) with parameters passed by value and by reference, local and global variable scope, and the features of an integrated development environment (IDE).
An OCR H446 answer on programming techniques: sequence, selection and iteration, recursion, subroutines (procedures and functions) with parameters passed by value or by reference, local and global variable scope, and the features of an integrated development environment.
- Object-oriented programming techniques in practice: defining classes with attributes and methods, constructors and instantiation, getters and setters for encapsulation, inheritance and method overriding for polymorphism, and the benefits of an object-oriented design.
An OCR H446 answer on object-oriented programming techniques in practice: defining classes with attributes and methods, constructors and instantiation, getters and setters for encapsulation, inheritance with method overriding for polymorphism, and the benefits of object-oriented design.