Skip to main content
InterviewHubPRO
Section Overview
Q15

Question 15 of 50

Part 2: Object-Oriented Design, Code Smells & Refactoring (11 - 24)

30%
SOLID & OOP Principles (50 Qs)•Part 2: Object-Oriented Design, Code Smells & Refactoring (11 - 24)

What is Command Query Separation (CQS) at the class and method level?

junior Levelsolid-principlesObject-Oriented Design

In Simple Words: Every method should either be:

  • A Command: Mutates system state, returns void.
  • A Query: Returns a value, has zero side-effects on system state.