← All Quizzes
What is the Interface Segregation Principle (ISP)?
Explanation
The Interface Segregation Principle (ISP), the I in SOLID, states that clients should not be forced to depend on interfaces they do not use. This means favoring many small, focused interfaces over few large, general-purpose ones (fat interfaces). ISP prevents clients from being affected by changes in methods they do not use. In Go, small interfaces (io.Reader, io.Writer) exemplify ISP. In TypeScript/Java, splitting large interfaces into role-specific ones reduces coupling and improves cohesion. ISP complements SRP at the interface level.