250+ MCQs on Collection Iterator Pattern and Answers

Software Design Multiple Choice Questions 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

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

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

Answer: d
Clarification: 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

Answer: c
Clarification: 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

Answer: a
Clarification: 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

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

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

Answer: a
Clarification: 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

Answer: d
Clarification: 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

Answer: d
Clarification: 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

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

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

Answer: d
Clarification: 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

Answer: d
Clarification: 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

Answer: c
Clarification: 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

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

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

Answer: c
Clarification: 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

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

Leave a Reply

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