QuizNot attempted
Liskov & interface segregation
1–4 to choose, Enter to submit
Show answer & explanation
Correct answer:
- Liskov Substitution, then Interface Segregation
- A subtype that throws on
add()can't be used whereverListis expected (Liskov Substitution), and forcing<Avatar>to take a wholeuserwhen it reads two fields makes it depend on what it doesn't use (Interface Segregation). - Not SRP/OCP: neither describes a broken subtype contract or a too-wide input.
- Not DIP then Liskov: no abstraction is being injected, and the order is reversed.
- Not DRY/KISS: nothing is duplicated or overcomplicated.
- Pass
{ name, imageUrl }.