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.

Host this setFree Play

The 20 questions

  1. Which term describes requirements that must be met before a function or algorithm can safely execute?

    • Postconditions
    • Parameters
    • Preconditions
    • Invariants
  2. What is the primary benefit of caching recently accessed data in memory?

    • Increased data security
    • Simpler code structure
    • Faster retrieval speed
    • Reduced memory usage
  3. Which software development practice involves using pre-written, tested code modules across multiple projects?

    • Code obfuscation
    • Concurrent processing
    • Procedural abstraction
    • Code reusability
  4. What is a potential drawback of web browser caching?

    • Slower page loads
    • Displaying stale data
    • Increased CPU usage
    • Higher bandwidth usage
  5. In a subroutine declaration, what are the values passed into the subroutine called?

    • Parameters
    • Return values
    • Preconditions
    • Global variables
  6. Which concept describes identifying what data a system needs to receive and produce?

    • Input and output
    • Concurrency
    • Caching
    • Recursion
  7. Which algorithm technique saves intermediate results of expensive function calls to avoid recalculation?

    • Paging
    • Backtracking
    • Memoisation
    • Pipelines
  8. Why should reusable software components be modular and self-contained?

    • Automatic error correction
    • Easy integration
    • Lower RAM usage
    • Faster CPU execution
  9. What type of caching is implemented directly on a processor chip?

    • Web cache
    • DNS cache
    • Disk cache
    • CPU cache
  10. What happens if a function is called without fulfilling its specified preconditions?

    • Optimal performance
    • Compilation success
    • Unpredictable errors
    • Automatic parameter repair
  11. Which component specification details what data type a subroutine will return?

    • Postcondition
    • Precondition
    • Input specification
    • Output specification
  12. How does using external libraries for reusable components affect development time?

    • Increases development time
    • Has no effect
    • Doubles testing time
    • Reduces development time
  13. 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
  14. Which condition ensures that data passed to a square root function is non-negative?

    • Global invariant
    • Precondition
    • Output parameter
    • Postcondition
  15. What is the main risk of relying heavily on third-party reusable code libraries?

    • Unused local variables
    • External dependencies
    • Loss of caching
    • Slower compilation
  16. In computational thinking, what does 'thinking ahead' primarily involve?

    • Designing user interfaces
    • Debugging syntax errors
    • Writing code immediately
    • Planning inputs/outputs
  17. Which cache strategy determines which item to remove when the cache memory is full?

    • Replacement policy
    • Parameter passing
    • Modular breakdown
    • Precondition check
  18. A function calculates compound interest. What are the principal, rate, and time?

    • Preconditions
    • Outputs
    • Inputs
    • Cached values
  19. What is the primary purpose of a function header in a reusable code library?

    • Data caching
    • Hardware abstraction
    • Interface definition
    • Memory allocation
  20. Which factor makes a subroutine easiest to reuse in another project?

    • Hardcoded input values
    • Complex nested loops
    • No global variables
    • Using global variables

All OCR Computer Science quizzes