Design Patterns Online Quiz


Advertisements


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

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.

Q 2 - Event handling frameworks like swing, awt use Observer Pattern.

A - false

B - true

Answer : B

Explanation

true. Event handling frameworks like swing, awt use Observer Pattern.

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.

Answer : B

Explanation

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

Q 5 - Which of the following pattern a request is wrapped under an object as command and passed to invoker object?

A - Proxy Pattern

B - Chain of Responsibility Pattern

C - Command Pattern

D - Interpreter Pattern

Answer : C

Explanation

A request is wrapped under an object as command and passed to invoker object. Invoker object looks for the appropriate object which can handle this command and passes the command to the corresponding object which executes the command.

Q 6 - 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 10 - In MVC pattern, Model represents an object or JAVA POJO carrying data. It can also have logic to update controller if its data changes.

A - true

B - false

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.


design_pattern_questions_answers.htm

Advertisements