Skip to content
Sharp

Object-oriented programming · interview question

Which design decision is the best fit for representing a 'Discount' that may apply to multiple products in a store model?

Multiple choiceMediumchapter-2-curatedpremiumoopbasic-modeling
Choose one answer
Answer and explanation

Correct answer

C. Create a Discount class and associate it with Product

Why

Creating a Discount class allows you to define discount logic independently and associate it with multiple products, promoting reusability and clean design.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →