Skip to content
Sharp

Classes and Objects · interview question

What is the clearest sign that code around factories should be refactored?

Multiple choiceHardchapter-7-curatedpremiumclasses-and-objectsfactories
Choose one answer
Answer and explanation

Correct answer

D. When the rule is no longer easy to trace, explain, or change without breaking nearby behavior.

Why

A refactor is justified when the code stops communicating its intent. Use class methods when a named construction path explains the domain better than one raw initializer signature.

Test yourself on Classes and Objects

A free test with instant, explained results. No account needed.

Start free test
All Classes and Objects questions →