A. Using pop() removes last, not first element in queue
B. push() is not valid for arrays
C. queue should be declared as object, not array
D. Missing type annotation for queue
Solution
Step 1: Understand queue removal method
Queue removes elements in FIFO order, so first element should be removed.
Step 2: Check method used
pop() removes last element, which breaks FIFO principle.
Final Answer:
Using pop() removes last, not first element in queue -> Option A
Quick Check:
Queue removal must use shift(), not pop() [OK]
Hint: Use shift() to remove first, pop() removes last [OK]
Common Mistakes:
Using pop() instead of shift() for queue
Thinking push() removes elements
Confusing array with object declaration
5. You have a queue implemented as an array in TypeScript. You add elements 1, 2, 3, then remove two elements. What will be the state of the queue after these operations?