NEW
Font size
WorksheetsQuiz3-SoftDsn-MakScie
Total questions: 40
Worksheet time: 40mins
Which design pattern ensures that only one instance of a class exists?
Factory Method
Singleton
Builder
Prototype
The Factory Method pattern is primarily used to:
Ensure one instance of a class
Create objects without specifying their concrete classes
Clone existing objects
Build complex objects step by step
Which is not a Creational Design Pattern?
Abstract Factory
Prototype
Facade
Builder
The Abstract Factory pattern is used to:
Create families of related objects
Add responsibilities dynamically
Simplify complex interfaces
Create only one object
Which pattern involves cloning an existing object instead of creating a new one?
Builder
Prototype
Singleton
Decorator
The Facade pattern:
Provides a simplified interface to a complex subsystem
Creates objects dynamically
Allows incompatible classes to work together
Hides object creation logic
The Adapter pattern is used to:
Convert one interface into another
Hide complex subsystems
Clone existing objects
Separate abstraction and implementation
Which pattern provides a way to add new behavior to objects dynamically?
Bridge
Decorator
Composite
The Composite pattern helps to:
A. Treat individual and composite objects uniformly
B. Create a single instance of a class
C. Clone existing objects
D. Control access to another object
The Bridge pattern is used to:
Separate abstraction from implementation
Convert interfaces
Simplify subsystems
Clone existing objects
The Proxy pattern:
Provides a placeholder for another object
Adds new behavior at runtime
Builds complex objects
Converts incompatible interfaces
The Flyweight pattern is used to:
Reduce memory usage by sharing objects
Build objects step by step
Control access to an object
Add new behaviors dynamically
14. The pattern that involves centralizing communication between multiple objects is:
Mediator Pattern
Observer Pattern
Singleton Pattern
Decorator Pattern
Which design pattern is described?
Observer
Mediator
Chain of Responsibility
Strategy
The Observer pattern allows:
Multiple objects to be notified of a state change
One object to control access to another
Sequential access of objects
Object cloning
The Command pattern encapsulates:
A request as an object
An interface into another
A tree structure
A complex subsystem
The Strategy pattern allows:
Dynamic selection of an algorithm at runtime
Object cloning
Simplified subsystem access
Tree-like composition of objects
The State pattern allows:
Changing object behavior based on internal state
Adding behavior dynamically
Creating families of related objects
Traversing data sequentially
The Iterator pattern:
Provides sequential access to elements
Creates a single instance
Adds new behavior dynamically
Separates abstraction from implementation
The Chain of Responsibility pattern:
Passes a request along a chain of handlers
Notifies multiple objects about a state change
Creates related families of objects
Provides simplified subsystem access
The Visitor pattern is used to:
Define new operations without changing existing classes
Simplify complex interfaces
Share objects to save memory
Separate construction from representation
The Template Method pattern:
Defines the skeleton of an algorithm in a base class
Allows dynamic behavior changes
Clones existing objects
Converts one interface to another
The Memento pattern:
Saves and restores object states
Adds new operations
Allows communication between objects
The Interpreter pattern:
Defines a grammar for a language
Adds new behaviors dynamically
Clones objects
Simplifies subsystem interfaces
Which pattern provides a way to undo operations?
Command
Memento
Observer
Strategy
Which pattern is best when multiple classes share similar behavior, but logic must vary independently?
Bridge
Strategy
Template Method
Builder
The Abstract Factory pattern is often implemented using:
Composition
Inheritance
Both A and B
None of the above
The Flyweight pattern minimizes memory usage by:
Reusing shared intrinsic data
Cloning existing objects
Separating abstraction and implementation
Creating objects dynamically
Which pattern promotes loose coupling between sender and receiver objects?
Observer
Mediator
Command
Chain of Responsibility
The Decorator and Proxy patterns are similar because they both:
Implement the same interface as the real object
Clone objects
Create families of objects
Define grammar rules
Which pattern is most useful for GUI components like menus and toolbars?
Composite
Singleton
Mediator
The Bridge pattern differs from the Adapter pattern because Bridge:
Is designed before the system is implemented
Converts incompatible interfaces
Simplifies existing subsystems
Creates only one instance
The Factory Method pattern delegates object creation to:
Subclasses
Parent classes
Client code
Interfaces
The Singleton pattern may cause problems when:
Multiple threads access it simultaneously
It is used with Factory
The object is immutable
It uses static methods
The Visitor pattern violates which principle if overused?
Open/Closed Principle
Single Responsibility Principle
Interface Segregation Principle
Dependency Inversion Principle
The Observer pattern is heavily used in:
Event handling systems
Database normalization
Sorting algorithms
Memory management
The State and Strategy patterns are similar because both:
Encapsulate behavior in separate classes
Clone existing objects
Simplify interfaces
Control access to objects
Which pattern provides centralized control to coordinate other objects’ interactions?
Mediator
Facade
Adapter
Decorator
The Prototype pattern is most useful when:
Object creation is expensive and similar objects are needed
Object creation is simple
Data is immutable
The system is event-driven
Which of the following best describes a “Wireframe” in Visily?
A low-fidelity outline showing basic layout and function
The final polished UI
A 3D animation of a website
A compiled website code
