Skip to content
Sharp

Design patterns · interview question

In an e-commerce application, if you need to track changes to a product's stock level and notify other systems, which design pattern would you apply?

Multiple choiceHardchapter-13-curatedpremiumdesign-patternsproxy-and-adapter
Choose one answer
Answer and explanation

Correct answer

B. Observer

Why

The Observer pattern is suitable for tracking changes and notifying other systems. It allows an object (subject) to notify multiple observers of state changes, which is useful for updating stock levels across systems.

Test yourself on Design patterns

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

Start free test
All Design patterns questions →