Test your SOLID Principles knowledge with a free interactive quiz — 30 questions with answers and explanations. No signup needed to play.
Question 1/5Score 0
Which sentence best captures the Liskov Substitution Principle (LSP)?
Questions in this quiz
Which sentence best captures the Liskov Substitution Principle (LSP)?
Which sentence best captures the Open/Closed Principle (OCP)?
Which statement best contrasts SRP and ISP?
A `PaymentProcessor` class directly instantiates `new StripeClient()` in its constructor. Which principle does this violate?
How does DIP differ from "dependency injection" (DI)?
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?
What does the "S" in SOLID stand for?
A new junior on the team writes a 1500-line `God` class that handles parsing, validation, persistence, and notifications. The single SOLID principle most directly relevant is:
Which sentence best captures the Interface Segregation Principle (ISP)?
`OrderShipper extends Order` so it can reuse the `total()` method. Per SOLID, this is usually: