![Design Patterns Tutorial](/design_pattern/images/java-design-patterns-mini-logo.jpg)
- Design Patterns Tutorial
- Design Patterns - Home
- Design Patterns - Overview
- Design Patterns - Factory Pattern
- Abstract Factory Pattern
- Design Patterns - Singleton Pattern
- Design Patterns - Builder Pattern
- Design Patterns - Prototype Pattern
- 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
- 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 - Null Object Pattern
- Design Patterns - Strategy Pattern
- Design Patterns - Template Pattern
- Design Patterns - Visitor 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 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.
![Questions and Answers](/images/questions_and_answers.png)
Answer : A
Explanation
true. It is possible to get a clone of singleton object. Throw exception within the body of clone() method to prevent cloning.
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 is used where we need to treat a group of objects in similar way as a single object?
Answer : A
Explanation
Composite Pattern is used where we need to treat a group of objects in similar way as a single object.
Q 4 - Which of the following pattern hides the complexities of the system and provides an interface to the client using which the client can access the system?
Answer : B
Explanation
Facade pattern hides the complexities of the system and provides an interface to the client using which the client can access the system.
Q 5 - Which of the following describes the Memento 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 : C
Explanation
This pattern is used to restore state of an object to a previous state.
Q 6 - Which of the following describes the Business Delegate pattern correctly?
B - This pattern is used to separate application's concerns.
C - This pattern is used to decouple presentation tier and business tier.
Answer : C
Explanation
Business Delegate pattern is used to decouple presentation tier and business tier.
Q 7 - Which of the following describes the Intercepting pattern correctly?
D - This pattern is used when we want to locate various services using JNDI lookup.
Answer : C
Explanation
Intercepting pattern, is used when we want to do some pre-processing / post-processing with request or response of the application.
Q 8 - Which of the following pattern is used when we want to locate various services using JNDI lookup?
Answer : D
Explanation
Service Locator Pattern is used when we want to locate various services using JNDI lookup.
Q 9 - Which of the following describes the Creational pattern correctly?
C - This type of pattern are specifically concerned with communication between objects.
D - This type of pattern are specifically concerned with the presentation tier.
Answer : A
Explanation
Creational Design Patterns provide a way to create objects while hiding the creation logic, rather than instantiating objects directly using new opreator.
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.