Design Patterns Mock Test


Advertisements

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.

Questions and Answers

Design Patterns Mock Test III

Q 4 - In which of the following pattern, a class behavior changes based on its state?

A - State Pattern

B - Null Object Pattern

C - Strategy Pattern

D - Template Pattern

Answer : A

Explanation

In State pattern, a class behavior changes based on its state.

Q 5 - In which of the following pattern, a null object replaces check of NULL object instance?

A - State Pattern

B - Null Object Pattern

C - Strategy Pattern

D - Template Pattern

Answer : B

Explanation

In Null Object pattern, a null object replaces check of NULL object instance.

Q 6 - In which of the following pattern, a class behavior or its algorithm can be changed at run time?

A - State Pattern

B - Null Object Pattern

C - Strategy Pattern

D - Template Pattern

Answer : C

Explanation

In Strategy pattern, a class behavior or its algorithm can be changed at run time.

Q 7 - In which of the following pattern, an abstract class exposes defined way(s)/template(s) to execute its methods?

A - State Pattern

B - Null Object Pattern

C - Strategy Pattern

D - Template Pattern

Answer : D

Explanation

In Template pattern, an abstract class exposes defined way(s)/template(s) to execute its methods.

Answer : A

Explanation

In Visitor pattern, a visitor class is used which changes the executing algorithm of an element class.

Answer : C

Explanation

Business Delegate pattern is used to decouple presentation tier and business tier.

Q 12 - In which of the following pattern, a visitor class is used which changes the executing algorithm of an element class?

A - Visitor Pattern

B - MVC Pattern

C - Business Delegate Pattern

D - Composite Entity Pattern

Answer : A

Explanation

In Visitor pattern, a visitor class is used which changes the executing algorithm of an element class.

Q 13 - Which of the following pattern is used to separate application's concerns?

A - Visitor Pattern

B - MVC Pattern

C - Business Delegate Pattern

D - Composite Entity Pattern

Answer : B

Explanation

MVC pattern is used to separate application's concerns.

Q 14 - Which of the following pattern is used to to decouple presentation tier and business tier?

A - Visitor Pattern

B - MVC Pattern

C - Business Delegate Pattern

D - Composite Entity Pattern

Answer : C

Explanation

Business Delegate pattern is used to decouple presentation tier and business tier.

Q 15 - Which of the following pattern is used in EJB persistence mechanism?

A - Visitor Pattern

B - MVC Pattern

C - Business Delegate Pattern

D - Composite Entity Pattern

Answer : D

Explanation

Composite Entity pattern is used in EJB persistence mechanism.

Q 20 - Which of the following pattern is used to separate low level data accessing API or operations from high level business services?

A - DAO Pattern

B - Front Controller Pattern

C - Intercepting Pattern

D - Service Locator Pattern

Answer : A

Explanation

DAO Pattern is used to separate low level data accessing API or operations from high level business services.

Q 21 - 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?

A - DAO Pattern

B - Front Controller Pattern

C - Intercepting Pattern

D - Service Locator Pattern

Answer : B

Explanation

Front Controller Pattern is used to provide a centralized request handling mechanism so that all requests will be handled by a single handler.

Q 22 - Which of the following pattern is used when we want to do some pre-processing / post-processing with request or response of the application?

A - DAO Pattern

B - Front Controller Pattern

C - Intercepting Pattern

D - Service Locator Pattern

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 23 - Which of the following pattern is used when we want to locate various services using JNDI lookup?

A - DAO Pattern

B - Front Controller Pattern

C - Intercepting Pattern

D - Service Locator Pattern

Answer : D

Explanation

Service Locator Pattern is used when we want to locate various services using JNDI lookup.

Answer Sheet

Question Number Answer Key
1 B
2 C
3 D
4 A
5 B
6 C
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 D
20 A
21 B
22 C
23 D
24 A
25 B
design_pattern_questions_answers.htm
Advertisements