All quizzes
Free quiz · 30 questions in the bank

SOLID Principles quiz

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
  1. A `Penguin` class extends `Bird` and overrides `fly()` to throw `UnsupportedOperationException`. Which principle does this violate?
  2. `OrderShipper extends Order` so it can reuse the `total()` method. Per SOLID, this is usually:
  3. A common downside of over-applying SOLID in a small codebase is:
  4. A `User` class has 20 methods, half about authentication and half about profile editing. The clearest refactor per SRP is:
  5. Which sentence best captures the Liskov Substitution Principle (LSP)?
  6. 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?
  7. Who popularized the SOLID acronym?
  8. Which scenario is a textbook application of OCP rather than a violation?
  9. Which sentence best captures the Single Responsibility Principle (SRP)?
  10. What does the "O" in SOLID stand for?
  11. 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?
  12. Which sentence best captures the Dependency Inversion Principle (DIP)?
Gaps to close?
Read the curated SOLID Principles notes — core concepts, patterns, interview prep.
SOLID Principles notes

More quizzes

AccessibilityAlgorithmsAngularApache KafkaAWSBootstrap