Skip to content
Android waitlistTry on iPad

Defensive design: OCR GCSE Computer Science questions

Every OCR GCSE Computer Science exam question on 2.3.1 Defensive design, 2022–2025, with its mark scheme and examiner’s report.

Paper
All papers
Exam
All years
Calculations

282 questions

  1. Q1(b)(i)

    June 2025 · Paper 2

    The whole paper ↗
  2. Q5(d)

    June 2025 · Paper 2

    The whole paper ↗
  3. Q4(b)

    June 2024 · Paper 2

    The whole paper ↗
  4. Q8(a)

    June 2024 · Paper 2

    The whole paper ↗
  5. Q9(c)(i)

    June 2024 · Paper 2

    The whole paper ↗
  6. Q5(b)

    June 2023 · Paper 2

    The whole paper ↗
  7. Q4(a)

    June 2022 · Paper 2

    The whole paper ↗
  8. Q5(b)(i)

    June 2022 · Paper 2

    The whole paper ↗
  9. Q7(a)

    Specimen · Paper 2

    The whole paper ↗
  10. Q8(b)(i)

    Specimen · Paper 2

    The whole paper ↗
All 10 questions on Defensive design, as a list
  1. June 2025, Paper 2, Q1(b)(i) (3 marks): Complete the algorithm for the program. num = input("Enter a number between 1 and 100") if num AND then print("accepted") print("not accepted") endif [3]
  2. June 2025, Paper 2, Q5(d) (6 marks): As part of the security system, the user is asked to choose a 4-digit value for their PIN. This PIN cannot be 1234 or 4321 Create an algorithm that: • takes the
  3. June 2024, Paper 2, Q4(b) (2 marks): Describe one method of defensive design that can be used when creating the program. [2]
  4. June 2024, Paper 2, Q8(a) (4 marks): Describe two ways to improve the maintainability of the algorithm. 1 2 [4]
  5. June 2024, Paper 2, Q9(c)(i) (4 marks): Write an algorithm to: • take the height jumped as input • output "VALID" or "NOT VALID" depending on the height input. You must use either: • OCR Exam Referenc
  6. June 2023, Paper 2, Q5(b) (6 marks): Validating inputs can reduce errors when a program is being run. Identify two methods of validation and explain how they can be used on this game. Validation me
  7. June 2022, Paper 2, Q4(a) (2 marks): Give two ways that the maintainability of this program could be improved. 1 2 [2]
  8. June 2022, Paper 2, Q5(b)(i) (5 marks): Complete the following program to validate the inputs. You must use either: • OCR Exam Reference Language, or • a high-level programming language that you have
  9. Specimen, Paper 2, Q7(a) (4 marks): Explain, using examples from the program, two ways to improve the maintainability of the program. 1 ………………………………………………………………………………………………………………. …………………………………………
  10. Specimen, Paper 2, Q8(b)(i) (3 marks): Complete the following program to output "Invalid input" if the data does not meet the validation rule. You must use either: • OCR Exam Reference Language, or •

Questions, mark schemes and examiner’s reports are © OCR, from their published past papers. Plumi isn’t affiliated with any exam board. Want whole papers? Full past papers.

Rather write your answers by hand on iPad? Plumi marks them against the same mark schemes.