Skip to content
Sharp

Design patterns · interview question

Why might using the Proxy pattern be preferred over directly accessing a database in a Java application?

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

Correct answer

B. To add a layer of control and delay resource-intensive operations

Why

Using the Proxy pattern allows for adding a layer of control, such as caching or access control, and deferring resource-intensive operations until necessary, improving efficiency.

Test yourself on Design patterns

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

Start free test
All Design patterns questions →