Skip to content
Sharp

Object-oriented programming · interview question

What issue arises if CartItem duplicates Product fields such as name and price?

Multiple choiceHardchapter-2-curatedpremiumoopobject-interaction
Choose one answer
Answer and explanation

Correct answer

A. Data inconsistency and maintenance difficulties.

Why

Duplicating Product fields in CartItem can lead to data inconsistency and maintenance challenges, as changes in Product would not automatically reflect in CartItem.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →