Test your SOLID Principles knowledge with a free interactive quiz — 30 questions with answers and explanations. No signup needed to play.
Question 1/12Score 0
A `Penguin` class extends `Bird` and overrides `fly()` to throw `UnsupportedOperationException`. Which principle does this violate?
In this round
A `Penguin` class extends `Bird` and overrides `fly()` to throw `UnsupportedOperationException`. Which principle does this violate?
`OrderShipper extends Order` so it can reuse the `total()` method. Per SOLID, this is usually:
A common downside of over-applying SOLID in a small codebase is:
A `User` class has 20 methods, half about authentication and half about profile editing. The clearest refactor per SRP is:
Which sentence best captures the Liskov Substitution Principle (LSP)?
A function contains a long `switch` over a `shapeType` field, computing area for each shape. Adding a new shape requires editing the function. Which principle does this most directly violate?
Who popularized the SOLID acronym?
Which scenario is a textbook application of OCP rather than a violation?
Which sentence best captures the Single Responsibility Principle (SRP)?
What does the "O" in SOLID stand for?
A `UserService` class loads users from the database, formats them as JSON, sends a welcome email, and writes audit logs. Which principle does it most clearly violate?
Which sentence best captures the Dependency Inversion Principle (DIP)?