Skip to main content
InterviewHubPRO
Section Overview
Q5

Question 5 of 50

Part 1: Core SOLID Principles & Fundamentals (1 - 10)

10%
SOLID & OOP Principles (50 Qs)•Part 1: Core SOLID Principles & Fundamentals (1 - 10)

What is the Interface Segregation Principle (ISP)?

junior LevelTypeScript

In Simple Words: Many client-specific, granular interfaces are better than one bloated, "fat" interface:

  • Violation: A monolithic Worker interface with work(), eat(), and sleep(). A Robot class implementing Worker is forced to implement empty dummy methods for eat() and sleep().
  • Refactoring: Split into Workable and Feedable interfaces. Humans implement both; robots implement only Workable.