250+ MCQs on Mid-Level Design Pattern Categories and Broker Pattern

Software Design Questions and Answers for Experienced people on “Mid-Level Design Pattern Categories and Broker Pattern”.

1. Which of the following does not belong to mid-level design patterns?
a) Broker
b) Iterator
c) Generator
d) Reactor

Answer: b
Clarification: All the rest belongs to mid level design patterns whereas iterator is object oriented mid level design.

2. Which of the following pattern features a client that needs a service from a supplier,but there is some problem with the supplier providing the
service directly to the client?
a) Broker
b) Iterator
c) Generator
d) Reactor

Answer: a
Clarification: Broker pattern features a client that needs service from a supplier.

3. Which of the following pattern includes client that generally creates a instance that registers with a target to carry out tasks in response to target events on behalf of the client?
a) Broker
b) Iterator
c) Generator
d) Reactor

Answer: d
Clarification: Reactor pattern creates reactor instance that registers with the target.

4. Which of the following is true with respect to generator pattern?
a) They have a broker that mediates interactions between a client and a supplier
b) They have a generator that creates instances of a product on behalf of a client
c) They have a reactor that registers with a target to respond to target events on behalf of a client
d) None of the mentioned

Answer: b
Clarification: Generator pattern have a generator that creates instances of a product on behalf of a client.

5. Which of the following is true for broker pattern?
a) Broker patterns are the simplest mid-level design patterns
b) All broker patterns have instances of a Broker class that mediate the interaction between Client and Supplier class instances
c) All of the mentioned
d) None of the mentioned

Answer: c
Clarification: All of the mentioned statement are true.

6. Brokers patterns can be used for which of the following reasons?
a) Simplify the Supplier
b) Decompose the supplier
c) Facilitate Client/Server interface
d) All of the mentioned

Answer: d
Clarification: Broker pattern is used because of all the following reasons.

7. Which of the following involves breaking of complex supplier into parts with a broker presenting a uniform interface to the client and deciding how to route client requests?
a) Simplify the Supplier
b) Decompose the supplier
c) Facilitate Client/Server interface
d) All of the mentioned

Answer: b
Clarification: Decompose of supplier involved breaking of complex supplier.

8. Which of the following is false for broker pattern?
a) Broker classes mediate communications between clients and suppliers, and in doing so they may slow this interaction, causing a performance penalty
b) A broker may sometimes be able to provide some services to clients more cheaply than if the clients interacted directly with the suppliers
c) Brokers always damage performance
d) None of the mentioned

Answer: c
Clarification: Brokers do not always damage performance.

9. Which of the following is considered when broker is compared to iterator pattern?
a) An iterator provides access to the elements of a collection on behalf of a client
b) An iterator do not provides access to the elements of a collection on behalf of a client
c) Broker is not an iterator pattern
d) None of the mentioned

Answer: a
Clarification: An iterator provides access to the elements of a collection on behalf of a client.

10. Which among these are the consequences for the broker pattern?
a) Broker patterns simplify or decompose suppliers, or ease communication between them
b) Broker patterns thus increase changeability, modifiability, and re usability
c) By interposing additional processing, they may degrade performance
d) All of the mentioned

Answer: d
Clarification: All of the mentioned are the consequences.

Leave a Reply

Your email address will not be published. Required fields are marked *