Lesson 2.1.2
2.1.2 Inputs, outputs, preconditions, caching and reusable components Quiz: OCR Computer Science, Unit 6
20 questions
In partnership with Revision Ninja
Lesson 2.1.2, Inputs, outputs, preconditions, caching and reusable components: 20 multiple choice questions for the OCR Computer Science (H446), Unit 6: Elements of computational thinking, written with Revision Ninja.
Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.
The 20 questions
-
Which term describes requirements that must be met before a function or algorithm can safely execute?
- Postconditions
- Parameters
- Preconditions
- Invariants
-
What is the primary benefit of caching recently accessed data in memory?
- Increased data security
- Simpler code structure
- Faster retrieval speed
- Reduced memory usage
-
Which software development practice involves using pre-written, tested code modules across multiple projects?
- Code obfuscation
- Concurrent processing
- Procedural abstraction
- Code reusability
-
What is a potential drawback of web browser caching?
- Slower page loads
- Displaying stale data
- Increased CPU usage
- Higher bandwidth usage
-
In a subroutine declaration, what are the values passed into the subroutine called?
- Parameters
- Return values
- Preconditions
- Global variables
-
Which concept describes identifying what data a system needs to receive and produce?
- Input and output
- Concurrency
- Caching
- Recursion
-
Which algorithm technique saves intermediate results of expensive function calls to avoid recalculation?
- Paging
- Backtracking
- Memoisation
- Pipelines
-
Why should reusable software components be modular and self-contained?
- Automatic error correction
- Easy integration
- Lower RAM usage
- Faster CPU execution
-
What type of caching is implemented directly on a processor chip?
- Web cache
- DNS cache
- Disk cache
- CPU cache
-
What happens if a function is called without fulfilling its specified preconditions?
- Optimal performance
- Compilation success
- Unpredictable errors
- Automatic parameter repair
-
Which component specification details what data type a subroutine will return?
- Postcondition
- Precondition
- Input specification
- Output specification
-
How does using external libraries for reusable components affect development time?
- Increases development time
- Has no effect
- Doubles testing time
- Reduces development time
-
A navigation app caches local map data on a phone. What is the main advantage?
- Offline availability
- Increased storage space
- Better GPS accuracy
- Real-time traffic updates
-
Which condition ensures that data passed to a square root function is non-negative?
- Global invariant
- Precondition
- Output parameter
- Postcondition
-
What is the main risk of relying heavily on third-party reusable code libraries?
- Unused local variables
- External dependencies
- Loss of caching
- Slower compilation
-
In computational thinking, what does 'thinking ahead' primarily involve?
- Designing user interfaces
- Debugging syntax errors
- Writing code immediately
- Planning inputs/outputs
-
Which cache strategy determines which item to remove when the cache memory is full?
- Replacement policy
- Parameter passing
- Modular breakdown
- Precondition check
-
A function calculates compound interest. What are the principal, rate, and time?
- Preconditions
- Outputs
- Inputs
- Cached values
-
What is the primary purpose of a function header in a reusable code library?
- Data caching
- Hardware abstraction
- Interface definition
- Memory allocation
-
Which factor makes a subroutine easiest to reuse in another project?
- Hardcoded input values
- Complex nested loops
- No global variables
- Using global variables
Related quizzes
- The nature and need for abstraction and abstract models Quiz · 2.1.1 · 20 questions
- Components of problems and solutions, step order and sub-procedures Quiz · 2.1.3 · 20 questions
- Decision points, logical conditions and program flow Quiz · 2.1.4 · 20 questions
- Concurrent parts of problems and trade-offs of concurrent processing Quiz · 2.1.5 · 20 questions
- Processor components: ALU, control unit, registers and buses Quiz · 1.1.1a · 20 questions
- Operating systems and memory management Quiz · 1.2.1a · 20 questions
- Compression, encryption and hashing Quiz · 1.3.1 · 20 questions
- Primitive data types and binary number representation Quiz · 1.4.1a · 20 questions
- Data Protection Act 1998 and Computer Misuse Act 1990 Quiz · 1.5.1a · 20 questions
- Programming constructs, recursion and variable scope Quiz · 2.2.1a · 20 questions