- 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 Mock Test
This section presents you various set of Mock Tests related to Design Patterns Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
Design Patterns Mock Test IV
Q 1 - Which of the following describes the Singleton pattern correctly?
Answer : C
Explanation
Singleton involves a single class which is responsible to create an object while making sure that only single object gets created.
Q 2 - Which of the following describes the Transfer Object pattern correctly?
Answer : D
Explanation
Transfer Object is used when we want to pass data with multiple attributes in one shot from client to server.
Q 3 - 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 4 - 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 5 - Which of the following pattern involves a single class which is responsible to create an object while making sure that only single object gets created?
Answer : C
Explanation
Singleton Pattern involves a single class which is responsible to create an object while making sure that only single object gets created.
Q 6 - 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 7 - 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 8 - Which type of design patterns provide a way to create objects while hiding the creation logic, rather than instantiating objects directly using new opreator?
A - Creational Design Patterns
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 9 - Which type of design patterns concern class and object composition?
A - Creational Design Patterns
Answer : B
Explanation
Structural Design Patterns concern class and object composition. Concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities.
Q 10 - Which type of design patterns are specifically concerned with communication between objects?
A - Creational Design Patterns
Answer : C
Explanation
Behavioral Design Patterns are specifically concerned with communication between objects.
Q 11 - 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 12 - 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 13 - Which of the following describes the Structural 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 : B
Explanation
Structural Design Patterns concern class and object composition. Concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities.
Q 14 - Which of the following describes the Behavioral 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 : C
Explanation
Behavioral Design Patterns are specifically concerned with communication between objects.
Q 15 - Which of the following describes the J2EE 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 : D
Explanation
J2EE Design Patterns are specifically concerned with the presentation tier.
Q 16 - Which of the following is the correct list of entities of MVC pattern?
Answer : A
Explanation
Model, View, Controller are the entities of MVC Pattern.
Q 17 - Which of the following is the correct list of entities of Business Delegate pattern?
A - Business Delegate, LookUp Service, Business Service
B - Client, Business Delegate, LookUp Service, Business Service
Answer : B
Explanation
Client, Business Delegate, LookUp Service, Business Service are the entities of Business Delegate Pattern.
Q 18 - Which of the following is the correct list of entities of Composite Entity pattern?
A - Composite Entity, Coarse-Grained Object, Strategies
B - Composite Entity, Dependent Object, Strategies
C - Composite Entity, Coarse-Grained Object, Dependent Object, Strategies
D - Composite Entity, Coarse-Grained Object, Dependent Object
Answer : C
Explanation
Composite Entity, Coarse-Grained Object, Dependent Object, Strategies are the entities of Composite Entity Pattern.
Q 19 - Which of the following is the correct list of entities of DAO pattern?
A - Data Access Object Interface, Data Access Object concrete class, Model Object or Value Object
B - Data Access Object Interface, Model Object or Value Object
C - Data Access Object Interface, Data Access Object concrete class
D - Data Access Object concrete class, Model Object or Value Object
Answer : A
Explanation
Data Access Object Interface, Data Access Object concrete class, Model Object or Value Object are the entities of DAO Pattern.
Q 20 - Which of the following is the correct list of entities of Front Controller pattern?
A - Front Controller, Dispatcher, View
B - Front Controller, Dispatcher
Answer : A
Explanation
Front Controller, Dispatcher, View are the entities of Front Controller pattern.
Q 21 - 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.
Q 22 - Which of the following is the correct list of entities of Service Locator pattern?
A - Service, Context, Cache, Client
B - Service, Context, Service Locator, Cache, Client
Answer : B
Explanation
Service, Context, Service Locator, Cache, Client are the entities of Service Locator pattern.
Q 23 - 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.
Q 24 - In MVC pattern, Model represents an object or JAVA POJO carrying data. It can also have logic to update controller if its data changes.
Answer : A
Explanation
True. In MVC pattern, Model represents an object or JAVA POJO carrying data. It can also have logic to update controller if its data changes.
Q 25 - In MVC pattern, View represents the visualization of the data that model contains.
Answer : B
Explanation
True. In MVC pattern, View represents the visualization of the data that model contains.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | C |
2 | D |
3 | A |
4 | B |
5 | C |
6 | D |
7 | D |
8 | A |
9 | B |
10 | C |
11 | D |
12 | A |
13 | B |
14 | C |
15 | D |
16 | A |
17 | B |
18 | C |
19 | A |
20 | A |
21 | C |
22 | B |
23 | A |
24 | A |
25 | B |