Skip to main content
InterviewHubPRO
Section Overview
Q22

Question 22 of 50

Part 2: Object-Oriented Design, Code Smells & Refactoring (11 - 24)

44%
SOLID & OOP Principles (50 Qs)•Part 2: Object-Oriented Design, Code Smells & Refactoring (11 - 24)

What are Preconditions and Postconditions in Design by Contract (LSP)?

junior Levelsolid-principlesObject-Oriented Design

In Simple Words:

  • Preconditions: Cannot be strengthened in a subtype (cannot demand stricter inputs).
  • Postconditions: Cannot be weakened in a subtype (cannot guarantee less outputs).