Engineering Questions with Answers - Multiple Choice Questions

MCQs on Collection Iterator Pattern

1 - Question

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.




2 - Question

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 - Question

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 - Question

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 - Question

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.




6 - Question

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 - Question

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 - Question

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 - Question

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.




10 - Question

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 - Question

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 - Question

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 - Question

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.




14 - Question

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 - Question

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.

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