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

Design patterns represent the best practices used by experienced object-oriented software developers. Design patterns are solutions to general problems that software developers faced during software development. These solutions were obtained by trial and error by numerous software developers over quite a substantial period of time.

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 creation of object directly is costly?

A - Bridge Pattern

B - Adapter Pattern

C - Prototype Pattern

D - Filter Pattern

Answer : A

Explanation

Prototype pattern is used when creation of object directly is costly.

Q 4 - Which of the following pattern creates a chain of receiver objects for a request?

A - Proxy Pattern

B - Chain of Responsibility Pattern

C - Command Pattern

D - Interpreter Pattern

Answer : B

Explanation

As the name suggests, the chain of responsibility pattern creates a chain of receiver objects for a request.

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

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 involves a single class which is responsible to create an object while making sure that only single object gets created?

A - Factory Pattern

B - Abstract Factory Pattern

C - Singleton Pattern

D - Transfer Object Pattern

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 9 - Which of the following pattern is used when we want to pass data with multiple attributes in one shot from client to server?

A - Factory Pattern

B - Abstract Factory Pattern

C - Singleton Pattern

D - Transfer Object Pattern

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 Front Controller pattern?

A - Front Controller, Dispatcher, View

B - Front Controller, Dispatcher

C - Controller, Dispatcher, View

D - Front Controller, View

Answer : A

Explanation

Front Controller, Dispatcher, View are the entities of Front Controller pattern.

design_pattern_questions_answers.htm
Advertisements