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
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
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
Explanation: 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
View Answer
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
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
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
Explanation: 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
View Answer
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
Explanation: 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
View Answer
Explanation: All of the mentioned are the consequences.
Sanfoundry Global Education & Learning Series – Software Architecture and Design.
- Get Free Certificate of Merit in Software Architecture and Design
- Participate in Software Architecture and Design Certification Contest
- Become a Top Ranker in Software Architecture and Design
- Take Software Architecture and Design Tests
- Chapterwise Practice Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Chapterwise Mock Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Buy Computer Science Books
- Apply for Software Architecture and Design Internship
- Buy MCA Books
- Practice MCA MCQs
- Apply for Computer Science Internship