Skip to content
Sharp

Collections · interview question

Which operation would you use to access the front element of a Queue without removing it?

Multiple choiceEasychapter-4-curatedpremiumcollectionsqueue-and-deque-basics
Choose one answer
Answer and explanation

Correct answer

A. Peek()

Why

The peek() method retrieves the head of the queue without removing it, allowing you to view the current front element safely.

Test yourself on Collections

A free test with instant, explained results. No account needed.

Start free test
All Collections questions →