Class 11 Computer Science · Chapter 4 · Test 2
Stacks and Queues
38 MCQs Covers LIFO and FIFO, push and pop, enqueue and dequeue, the queue module, and real-life uses. Includes code-output questions on stacks and queues built with lists and with queue.Queue.
38 questions · 35 min · 38 marks
Want to try first? Take the free Computer Science test: SDLC and Waterfall Model
Sample questions
The first 5 of 38. Try each one, then tap to see the answer.
Question 1
What is the key principle of a stack?
- AFIFO
- BLIFO
- CLILO
- DFILO
Show answerHide answer
Answer: B
Last In, First Out.
Question 2
Which method adds an item to the stack in Python?
- Apush()
- Badd()
- Cinsert()
- Dappend()
Show answerHide answer
Answer: D
A Python list uses append() as push. (Textbook key.)
Question 3
Which method removes the top item from the stack?
- Apop()
- Bdelete()
- Cremove()
- Dclear()
Show answerHide answer
Answer: A
pop() removes the last item added.
Question 4
Which end is used for insertion and deletion in a stack?
- AFront
- BEnd
- CTop
- DBottom
Show answerHide answer
Answer: C
Both operations happen at the top.
Question 5
Which type of Python structure is used to create a stack?
- ADictionary
- BList
- CString
- DSet
Show answerHide answer
Answer: B
A list works as a stack.
More tests in Computational Structures
Practise with a free account
Save your scores, see which chapters need work, and keep a notebook of every question you got wrong.