In a GUI toolkit using the Composite pattern, what would a 'Dialog Box' be considered?
Client
Leaf
Composite
Iterator
Which of the following is NOT a core participant in the Iterator Pattern?
Aggregate
Factory
ConcreteIterator
Which of these is NOT a common use case for the Flyweight pattern?
Text editors handling character formatting.
Game development for managing large numbers of units or particles.
Implementing a logging system with different log levels.
Representing and rendering a complex 3D model with shared textures.
In which scenario would the Prototype Pattern be LESS suitable?
When object creation is a lightweight operation.
When you have a large number of objects with minor variations.
When you need to create objects based on a configuration file at runtime.
When you want to avoid dependencies on concrete product classes.
In a language like Java, how is object cloning often achieved within the Prototype Pattern?
By using the spread operator.
spread
By using the Object.assign() method.
Object.assign()
By directly copying object properties.
By implementing the Cloneable interface.
Cloneable
In the Flyweight pattern, what is the role of the 'intrinsic state'?
Data that is unique to each object and cannot be shared.
A factory method that creates and manages Flyweight objects.
An interface that defines operations for interacting with Flyweights.
Data that is common to multiple objects and can be shared.
What is the primary purpose of the Iterator Pattern in software development?
To define a family of algorithms, encapsulate each one, and make them interchangeable.
To ensure that a class has only one instance and provides a global point of access to it.
To provide a way to access elements of an aggregate object sequentially without exposing its underlying representation.
To create objects from a class without specifying the exact class to create.
Which principle of object-oriented design does the State Pattern primarily promote?
Dependency Inversion Principle
Open/Closed Principle
Single Responsibility Principle
Liskov Substitution Principle
What is the primary goal of the State Pattern in object-oriented programming?
To manage and transition between different states of an object.
To create objects without specifying their concrete classes.
To define a family of algorithms and encapsulate each one.
To provide a way to access elements of an aggregate object sequentially.
What type of Proxy is used to control access to a resource based on access rights?
Remote Proxy
Protection Proxy
Virtual Proxy
Caching Proxy