W3Reference.com
Toggle Menu
Home
Online Rust Compiler
Tutorials
Python Tutorial
Java Tutorial
Rust Tutorial
TypeScript Tutorial
ReactJS Tutorial
HTML & CSS Basics
Docker Containers Guide
Kubernetes Tutorial
Software Design Patterns
Blog
All Posts
Software Design Patterns
Review your understanding of common design patterns like Singleton,Factory,and Observer.
1. Which design pattern ensures a class has only one instance and provides a global point of access to it?
Factory
Singleton
Observer
Adapter
2. Which of the following are behavioral design patterns? (Select all that apply)
Observer
Strategy
Adapter
Command
Decorator
3. The Factory pattern is classified as a structural design pattern.
True
False
4. What design pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable? (one word)
5. Which pattern separates the construction of a complex object from its representation, allowing the same construction process to create different representations?
Builder
Prototype
Flyweight
Facade
6. Which of the following patterns promote loose coupling between objects? (Select all that apply)
Observer
Singleton
Strategy
Adapter
Decorator
7. The Decorator pattern allows adding new functionality to an existing object without altering its structure.
True
False
8. What pattern provides a unified interface to a set of interfaces in a subsystem, simplifying its use? (one word)
9. Which pattern is used to create a duplicate of an existing object efficiently by copying its properties?
Factory Method
Prototype
Abstract Factory
Builder
10. Which of the following are creational design patterns? (Select all that apply)
Singleton
Adapter
Factory Method
Abstract Factory
Observer
11. The Command pattern encapsulates a request as an object, allowing for parameterization of clients with different requests.
True
False
12. What pattern passes a request along a chain of handlers, where each handler decides to process the request or pass it to the next handler? (two words)
13. Which pattern defines the skeleton of an algorithm in a method, deferring some steps to subclasses?
Template Method
Strategy
Command
State
14. Which structural patterns use object composition to combine objects into larger structures? (Select all that apply)
Decorator
Composite
Adapter
Observer
Strategy
15. The Observer pattern establishes a one-to-many dependency between objects.
True
False
16. What creational pattern provides an interface for creating families of related or dependent objects without specifying their concrete classes? (two words)
17. Which pattern lets you define a new operation without changing the classes of the elements on which it operates?
Visitor
Iterator
Mediator
Memento
18. Which behavioral patterns manage communication between objects? (Select all that apply)
Mediator
Observer
Command
Flyweight
Adapter
19. The Prototype pattern is used to create new objects by cloning an existing object.
True
False
20. What pattern dynamically changes an object's behavior when its internal state changes? (one word)
Reset
Answered 0 of 0 — 0 correct