Skip to content
Sharp

Object-oriented programming · interview question

In a customer management system, which class should own the logic for verifying customer age?

Multiple choiceMediumchapter-3-curatedpremiumoopobject-responsibility
Choose one answer
Answer and explanation

Correct answer

B. AgeVerifier

Why

The AgeVerifier class should handle the logic for verifying customer age, keeping the verification logic separate and adhering to the principle of single responsibility.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →