Login Account

Design Patterns Questions

A
Apratim Gupta
Score: 🔥 19
Intermediate
Took 1 month
Coding Principles
Design Patterns
0%
Questions Attempted
2 / 15
Correct Answers
0
Incorrect Answers
15
Points Earned
🔥 0

Question 1

What is a key difference between a deep copy and a shallow copy in the context of the Prototype Pattern?

Explanation:

This difference is crucial in Prototype. Deep copies prevent unintended side effects by ensuring that modifications on cloned objects don't impact the original prototypes or their nested members.

Question 2

Which principle of object-oriented design does the Iterator Pattern promote by decoupling the traversal mechanism from the aggregate object?

Explanation:

The Iterator Pattern aligns with the Open/Closed Principle because it allows for the introduction of new iteration algorithms or behaviors without modifying the existing aggregate class, promoting extensibility.