Creational Design Patterns
- Design Patterns - Factory Pattern
- Abstract Factory Pattern
- Design Patterns - Singleton Pattern
- Design Patterns - Builder Pattern
- Design Patterns - Prototype Pattern
Structural Design Patterns
- Design Patterns - Adapter Pattern
- Design Patterns - Bridge Pattern
- Design Patterns - Filter Pattern
- Design Patterns - Composite Pattern
- Design Patterns - Decorator Pattern
- Design Patterns - Facade Pattern
- Design Patterns - Flyweight Pattern
- Design Patterns - Proxy Pattern
- Chain of Responsibility Pattern
Behavioral Design Patterns
- Design Patterns - Command Pattern
- Design Patterns - Interpreter Pattern
- Design Patterns - Iterator Pattern
- Design Patterns - Mediator Pattern
- Design Patterns - Memento Pattern
- Design Patterns - Observer Pattern
- Design Patterns - State Pattern
- Design Patterns - Strategy Pattern
- Design Patterns - Template Pattern
- Design Patterns - Visitor Pattern
J2EE Design Patterns
- Design Patterns - Null Object Pattern
- Design Patterns - MVC Pattern
- Business Delegate Pattern
- Composite Entity Pattern
- Data Access Object Pattern
- Front Controller Pattern
- Intercepting Filter Pattern
- Service Locator Pattern
- Transfer Object Pattern
Design Patterns Useful Resources
Design Patterns Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to Design Patterns Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
Q 1 - Which of the following is correct about Singleton design pattern.
A - This type of design pattern comes under creational pattern.
Answer : D
Explanation
Singleton pattern is one of the simplest design patterns in Java. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object.This pattern involves a single class which is responsible to create an object while making sure that only single object gets created. This class provides a way to access its only object which can be accessed directly without need to instantiate the object of the class.
Q 2 - Which of the following describes the Bridge pattern correctly?
A - This pattern builds a complex object using simple objects and using a step by step approach.
B - This pattern refers to creating duplicate object while keeping performance in mind.
C - This pattern is used when creation of object directly is costly.
Answer : D
Explanation
Bridge pattern is used when we need to decouple an abstraction from its implementation so that the two can vary independently.
Q 3 - Which of the following pattern builds a complex object using simple objects and using a step by step approach?
Answer : A
Explanation
Builder Pattern builds a complex object using simple objects and using a step by step approach. This builder is independent of other objects.
Q 4 - Which of the following pattern provides a way to evaluate language grammar or expression?
Answer : D
Explanation
Interpreter pattern provides a way to evaluate language grammar or expression.
Q 5 - Which of the following describes the Iterator pattern correctly?
B - This pattern is used to reduce communication complexity between multiple objects or classes.
C - This pattern is used to restore state of an object to a previous state.
Answer : A
Explanation
This pattern is used to get a way to access the elements of a collection object in sequential manner without any need to know its underlying representation.
Q 6 - In which of the following pattern, a null object replaces check of NULL object instance?
Answer : B
Explanation
In Null Object pattern, a null object replaces check of NULL object instance.
Q 7 - Which of the following pattern is used to separate application's concerns?
Answer : B
Explanation
MVC pattern is used to separate application's concerns.
Q 8 - In which of the following pattern an interface is responsible for creating a factory of related objects without explicitly specifying their classes?
Answer : B
Explanation
In Abstract Factory Pattern an interface is responsible for creating a factory of related objects without explicitly specifying their classes.
Q 9 - Which type of design patterns are specifically concerned with the presentation tier?
A - Creational Design Patterns
Answer : D
Explanation
J2EE Design Patterns are specifically concerned with the presentation tier.
Q 10 - Which of the following is the correct list of entities of Intercepting pattern?
A - Filter, Filter Chain, Target, Client
B - Filter, Target, Filter Manager, Client
Answer : C
Explanation
Filter, Filter Chain, Target, Filter Manager, Client are the entities of Intercepting pattern.