Only when it maintains object invariants. Frame the concept in practical terms so you can explain it during interview discussion.
Methods should only modify an object's state if they ensure all class invariants are respected. In a `Cart` class, a method adding items should update the total price and quantity while checking that the cart doesn't exceed its item limit.
Additional Notes
When should a class method modify an object’s state?