Creational Design Patterns

Structural Design Patterns

Behavioral Design Patterns

J2EE Design Patterns

Design Patterns Useful Resources

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

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 - Integer.valueOf is an example of Factory pattern.

A - false

B - true

Answer : B

Explanation

true. Integer.valueOf() returns a Integer instance representing the specified int value.

Q 3 - Which of the following pattern is used when we need to decouple an abstraction from its implementation so that the two can vary independently?

A - Bridge Pattern

B - Adapter Pattern

C - Prototype Pattern

D - Filter Pattern

Answer : A

Explanation

Bridge pattern is used when we need to decouple an abstraction from its implementation so that the two can vary independently.

Answer : C

Explanation

Interpreter pattern provides a way to evaluate language grammar or expression. This type of pattern comes under behavioral pattern. This pattern involves implementing an expression interface which tells to interpret a particular context.

Answer : A

Explanation

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

Q 7 - 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 8 - 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.

Answer : B

Explanation

Client, Business Delegate, LookUp Service, Business Service are the entities of Business Delegate Pattern.

design_pattern_questions_answers.htm
Advertisements