- 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.
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 Prototype 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 works as a bridge between two incompatible interfaces.
Answer : B
Explanation
Prototype pattern refers to creating duplicate object while keeping performance in mind.
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 - In which of the following pattern a class represents functionality of another class?
Answer : A
Explanation
In proxy pattern, a class represents functionality of another class. In proxy pattern, we create object having original object to interface its functionality to outer world.
Q 5 - Which of the following pattern is used to reduce communication complexity between multiple objects or classes?
Answer : B
Explanation
Mediator pattern is used to reduce communication complexity between multiple objects or classes.
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 Composite Entity 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 : D
Explanation
Composite Entity pattern is used in EJB persistence mechanism.
Q 8 - Which of the following pattern creates object without exposing the creation logic to the client and refer to newly created object using a common interface?
Answer : A
Explanation
Factory Pattern creates object without exposing the creation logic to the client and refer to newly created object using a common interface.
Q 9 - Which of the following pattern is used when we want to pass data with multiple attributes in one shot from client to server?
Answer : D
Explanation
Transfer Object Pattern is used when we want to pass data with multiple attributes in one shot from client to server.
Q 10 - Which of the following is the correct list of entities of Transfer Object pattern?
A - Business Object , Transfer Object, Client
Answer : A
Explanation
Business Object , Transfer Object, Client are the entities of Transfer Object pattern.