Software Design Questions and Answers – Mid-Level Design Pattern Categories and Broker Pattern

This set of Software Design Questions and Answers for Experienced people focuses 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
View Answer

Answer: b
Explanation: 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
View Answer

Answer: a
Explanation: 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
View Answer

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

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
View Answer

Answer: b
Explanation: 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
View Answer

Answer: c
Explanation: 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
View Answer

Answer: d
Explanation: 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
View Answer

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

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
View Answer

Answer: c
Explanation: 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
View Answer

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

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
View Answer

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

Sanfoundry Global Education & Learning Series – Software Architecture and Design.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.