Software Design Questions and Answers – Collection Iterator Pattern

«
»

This set of Software Design Multiple Choice Questions & Answers (MCQs) focuses on “Collection Iterator Pattern”.

1. Which of the following are considered as Mid Level design patterns?
a) Iterator Pattern
b) Collection Pattern
c) All of the mentioned
d) None of the mentioned
View Answer

Answer: c
Explanation: All of the mentioned are mid level design pattern.
advertisement

2. Which of the following can be included as the collection?
a) A Set
b) List
c) Array
d) All of the mentioned
View Answer

Answer: d
Explanation: Collection includes a set, list, array, table and so forth.

3. What does collection iteration means?
a) It is iteration over the collection
b) Traversal and access of each element in a collection
c) All of the mentioned
d) None of the mentioned
View Answer

Answer: c
Explanation: Collection iteration is traversal and access of each element in a collection and is also known as iteration over collection.

4. Which among these are the iteration control facilities?
a) Initialize
b) Information Hiding
c) Multiple iterations
d) All of the mentioned
View Answer

Answer: a
Explanation: Iteration control facilities includes initialize, Access Control, Advance current element, Completion test.

5. Which of these are necessary requirements for Iteration mechanism?
a) Initialize
b) Completion Test
c) Information Hiding
d) Access Current
View Answer

Answer: c
Explanation: Iteration mechanism necessary requirements includes information hiding and multiple simultaneous iteration.
advertisement

6. Which of these prepare iteration mechanism for next traversal?
a) initialize
b) Information Hiding
c) Advance current Test
d) Flexibility
View Answer

Answer: a
Explanation: Initialize prepares the iteration mechanism for next traversal.

7. Which of the possibilities for where an iteration mechanism resides?
a) Programming Language
b) Collection
c) Iterator
d) All of the mentioned
View Answer

Answer: d
Explanation: There are three possibilities for iteration mechanism are programming language, Collection, Iterator.

8. Interface control mechanism can work in which of these ways?
a) Internal
b) External
c) Peripheral
d) Internal & External
View Answer

Answer: d
Explanation: Interface control mechanism works internal as well a external.

9. An iteration mechanism which provides collection element as directed by the client?
a) Internal
b) External
c) Collection
d) None of the mentioned
View Answer

Answer: a
Explanation: An internal iteration mechanism provides with collection element directed by the client.
advertisement

10. Which of the following is true about built-in internal iteration control mechanism?
a) The client must process for each collection iteration and give it to the iteration mechanism
b) The iteration mechanism then traverses the collection applies the processing package
c) Lack of flexibility is the biggest drawback
d) All of the mentioned
View Answer

Answer: d
Explanation: All of the mentioned statements are true with respect to the internal iteration control mechanism.

11. Which of the following is true about built-in external iteration control mechanism?
a) The collection might provide with the following operations to control iterations- reset,get next,has More
b) Reset initializes the iteration
c) Get Next obtains the current value and the advance to the next element
d) All of the mentioned
View Answer

Answer: d
Explanation: All of the mentioned statements are true with respect to the built-in external iteration control mechanism.

12. Placing the iteration mechanism in iterators separate from collection must satisfy which of the following?
a) Multiple Simultaneous Iterations
b) Collection Interface Simplicity
c) All of the mentioned
d) None of the mentioned
View Answer

Answer: c
Explanation: All of the mentioned are the necessary condition to be satisfied.

13. Which of the following is not correct regarding Multiple simultaneous iterations?
a) Each iterator can be responsible for managing one traversal of its associated collection independently of all other iterators
b) Clients can then use several iterators at once to traversal the iterations in various ways simultaneously
c) The iteration control interface is in iterator and not the collection
d) None of the mentioned
View Answer

Answer: c
Explanation: Collection interface simplicity include iteration collection interface in iterator and not in collection.
advertisement

14. Which of the following is correct about Collection interface simplicity?
a) Each iterator can be responsible for managing one traversal of its associated collection independently of all other iterators
b) Clients can then use several iterators at once to traversal the iterations in various ways simultaneously
c) The iteration control interface is in iterator and not the collection
d) None of the mentioned
View Answer

Answer: c
Explanation: Collection interface simplicity include iteration collection interface in iterator and not in collection rest others belongs to multiple simultaneous iterations.

15. An iteration mechanism is able to tolerate changes to its associated collection only when collection meets which of the following?
a) Fault Tolerance
b) Iteration Termination
c) Complete Traversal
d) All of the mentioned
View Answer

Answer: d
Explanation: All of the mentioned requirements meets collection for an iteration mechanism to tolerate change.

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

advertisement
advertisement
advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn