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

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 where we need to treat a group of objects in similar way as a single object?

A - Composite Pattern

B - Facade Pattern

C - Flyweight Pattern

D - Decorator Pattern

Answer : A

Explanation

Composite Pattern is used where we need to treat a group of objects in similar way as a single object.

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.

Q 5 - Which of the following pattern is used to get a way to access the elements of a collection object in sequential manner without any need to know its underlying representation?

A - Iterator Pattern

B - Mediator Pattern

C - Memento Pattern

D - Observer Pattern

Answer : A

Explanation

Iterator pattern is used to get a way to access the elements of a collection object in sequential manner without any need to know its underlying representation.

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

Answer : A

Explanation

Data Access Object Interface, Data Access Object concrete class, Model Object or Value Object are the entities of DAO Pattern.

design_pattern_questions_answers.htm
Advertisements