Skills101
← All practice quizzes

Quiz: SOLID Principles

5 questionsNo time limitPass: 60%+10 XP on first pass

Single responsibility, open/closed, Liskov substitution, interface segregation and dependency inversion — each with a bad example, a fix in Python, and why it matters.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    Which principle says "a class should have only one reason to change"?

  2. Question 2

    Adding a new payment type by writing a new class, without editing existing code, follows:

  3. Question 3

    A Square subclass that breaks code written for Rectangle violates:

  4. Question 4

    Passing a database object into a service's constructor instead of creating it inside is an example of:

  5. Question 5

    A fat interface forcing classes to implement methods they don't need violates: