beginnerSOLID Principles

Single Responsibility Principle — give a bad example and refactored good example.

Tests whether you can actually spot an SRP violation in code and refactor it, not just define the principle.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to What is the Decompose by Business Capability pattern?← Back to all Design Patterns & LLD questions