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 Factory design pattern.
A - This type of design pattern comes under creational pattern.
B - Factory pattern creates object without exposing the creation logic to the client.
C - Factory pattern refers to newly created object using a common interface.
Factory pattern is one of most used design pattern in Java. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object. In Factory pattern, we create object without exposing the creation logic to the client and refer to newly created object using a common interface.
true. Each java application uses Runtime as a single object.
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?
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 allows a user to add new functionality to an existing object without altering its structure?
Decorator Pattern allows a user to add new functionality to an existing object without altering its structure.
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.
This pattern is used to restore state of an object to a previous state.
Q 6 - Which of the following describes the MVC pattern correctly?
B - This pattern is used to separate application's concerns.
C - This pattern is used to decouple presentation tier and business tier.
MVC pattern is used to separate application's concerns.
Q 7 - Which of the following pattern is used in EJB persistence mechanism?
Composite Entity pattern is used in EJB persistence mechanism.
Q 8 - Which of the following pattern is used to provide a centralized request handling mechanism so that all requests will be handled by a single handler?
Front Controller Pattern is used to provide a centralized request handling mechanism so that all requests will be handled by a single handler.
Q 9 - Which type of design patterns are specifically concerned with the presentation tier?
A - Creational Design Patterns
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
Filter, Filter Chain, Target, Filter Manager, Client are the entities of Intercepting pattern.