AMP

Chapter-4 Queue — Online MCQ Test

COMPUTER SCIENCE · Grade 12 · CBSE(NCERT)
Practice Chapter-4 Queue with a free chapter-wise online MCQ test. This chapter covers: queue - FIFO - Python lists - enqueue - dequeue. AI-generated questions from basic to board-exam level, with instant results and explanations.

Start Exam on Full Site →

Chapter-4 Queue — Important Questions & Answers

What does FIFO stand for in the context of queues?
  • A. First In, First Out
  • B. First In, Forever Out
  • C. Fast Input, Fast Output
  • D. File Input, File Output
Answer: A. First In, First Out
FIFO is the fundamental principle of queues where the first element added is the first one to be removed.
In a queue, which end is used for adding elements?
  • A. Front
  • B. Rear
  • C. Middle
  • D. Both ends equally
Answer: B. Rear
Elements are added at the rear (end) of the queue in the enqueue operation.
If you enqueue elements 5, 10, 15 in order into an empty queue, what order will they be dequeued?
  • A. 15, 10, 5
  • B. 5, 10, 15
  • C. 10, 5, 15
  • D. 5, 15, 10
Answer: B. 5, 10, 15
Due to FIFO principle, elements are dequeued in the same order they were enqueued: 5, 10, 15.
If a queue has elements [4, 8, 12, 16] and you perform two dequeue operations followed by two enqueue operations (25, 30), what is the final queue state?
  • A. [12, 16, 25, 30]
  • B. [8, 12, 16, 25, 30]
  • C. [25, 30]
  • D. [4, 8, 25, 30]
Answer: A. [12, 16, 25, 30]
Two dequeues remove 4 and 8, leaving [12, 16]. Then enqueueing 25 and 30 gives [12, 16, 25, 30].
A bank queue system processes customers in FIFO order. If the queue has [C1, C2, C3, C4, C5] and C2 and C4 leave without service, what is the remaining queue after standard dequeue operations?
  • A. [C1, C3, C5]
  • B. [C3, C5]
  • C. [C1, C3, C4, C5]
  • D. Cannot determine with standard queue operations
Answer: D. Cannot determine with standard queue operations
Standard queue operations (enqueue/dequeue) cannot remove arbitrary middle elements like C2 and C4. This would require a custom implementation or removing from front until reaching them.