Design Patterns · Junior · Question 29 of 75
What is the Interface Segregation Principle (ISP) about?
- ✓Correct answer: Clients shouldn't depend on methods and data they don't need
- 2Each TypeScript interface should live in a separate file
- 3UI and API interfaces should be developed by different teams
Explanation
An Avatar component that takes the whole user object with dozens of fields depends on too much. It's better to pass src and name. Narrow interfaces simplify reuse and tests.