Engineering Questions with Answers - Multiple Choice Questions

MCQs on Mid-Level Design Pattern Categories and Broker Pattern

1 - Question

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

View Answer

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




2 - Question

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

View Answer

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




3 - Question

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

View Answer

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




4 - Question

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

View Answer

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




5 - Question

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

View Answer

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




6 - Question

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

View Answer

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




7 - Question

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

View Answer

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




8 - Question

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

View Answer

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




9 - Question

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

View Answer

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




10 - Question

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

View Answer

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

Get weekly updates about new MCQs and other posts by joining 18000+ community of active learners