exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 1 question 1 discussion

Actual exam question from Microsoft's 70-483
Question #: 1
Topic #: 1
[All 70-483 Questions]

You are developing an application that includes a class named Order. The application will store a collection of Order objects.
The collection must meet the following requirements:
✑ Use strongly typed members.
✑ Process Order objects in first-in-first-out order.
✑ Store values for each Order object.
✑ Use zero-based indices.
You need to use a collection type that meets the requirements.
Which collection type should you use?

  • A. Queue<T>
  • B. SortedList
  • C. LinkedList<T>
  • D. HashTable
  • E. Array<T>
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️
Queues are useful for storing messages in the order they were received for sequential processing. Objects stored in a Queue<T> are inserted at one end and removed from the other.
References: http://msdn.microsoft.com/en-us/library/7977ey2c.aspx

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Take2
Highly Voted 4 years, 7 months ago
Hi all. Some of you are wondering why Queue is the correct answer when you are specifically asked to access the collection through 'zero-based indices'. I was also confused about this. The answer is that queues in C# have a method called 'ElementAt()' which takes an int, and returns the correlation object, which is why A is the correct answer. :)
upvoted 11 times
Take2
4 years, 7 months ago
Hope this helped!
upvoted 2 times
...
Weldryn
4 years, 2 months ago
This is still not correct as ElementAt() is a LINQ extension method usable on any IEnumerable<> collections. Index based access is always O(1) whereas ElementAt() is O(n) for collections that does not supports index based access. Queues are all about FIFO so the they do not allow the access of any element exept the head (and sometimes the tail). The question is ill-formed because of that. If you want a FIFO collection that allows element access with indices, choose an array and manage the FIFO mechanism yourself
upvoted 2 times
...
...
apostolin
Highly Voted 5 years, 8 months ago
Correct answer is : A. Queue<T>
upvoted 6 times
...
zzMichielzz
Most Recent 4 years, 6 months ago
A makes me happy
upvoted 2 times
...
kmvbatista
4 years, 7 months ago
answer A
upvoted 2 times
...
devpride
4 years, 8 months ago
Correct answer is - A: Queue<T>
upvoted 2 times
...
Solis
4 years, 8 months ago
To repeat what Weldryn said, "Queued items are not accessible through indices". Any idea on this?
upvoted 2 times
...
lh2607
4 years, 10 months ago
A is correct
upvoted 2 times
...
veroMarce
4 years, 11 months ago
Correct answer is A
upvoted 2 times
...
robinnirola
5 years ago
Correct Ans :A
upvoted 2 times
...
Weldryn
5 years, 1 month ago
Queued items are not accessible through indices though
upvoted 4 times
...
wealsegun
5 years, 3 months ago
Correct
upvoted 2 times
...
Rajput
5 years, 4 months ago
Correct.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago