Stack Data Structure: 17 MCQs
All 17 multiple-choice questions from this kit, free and with no sign-up.
Warm-up · 7 questions
Q1. Which principle governs the order of operations in a stack?
BeginnerAnswers and explanations are in the Veda app.
Q2. At which position does a stack allow insertion and deletion?
BeginnerAnswers and explanations are in the Veda app.
Q3. Which operation returns the top element without removing it?
BeginnerAnswers and explanations are in the Veda app.
Q4. What is the time complexity of the push operation on a stack?
BeginnerAnswers and explanations are in the Veda app.
Q5. A stack is called an abstract data type (ADT) because it:
BeginnerAnswers and explanations are in the Veda app.
Q6. Calling pop on an empty stack causes:
BeginnerAnswers and explanations are in the Veda app.
Q7. A stack enforces LIFO order, meaning the most recently pushed element is the first to be popped.
BeginnerAnswers and explanations are in the Veda app.
Building up · 5 questions
Q8. In a linked-list implementation of a stack, which node acts as the top?
IntermediateAnswers and explanations are in the Veda app.
Q9. A fixed-size array stack of capacity 5 already holds 5 elements. What happens on the next push?
IntermediateAnswers and explanations are in the Veda app.
Q10. Why does a stack suit balanced-bracket checking?
IntermediateAnswers and explanations are in the Veda app.
Q11. Which statement about a stack's access pattern is correct?
IntermediateAnswers and explanations are in the Veda app.
Q12. A program calls function f, which calls g, which calls h. Which function's frame is popped first when returns begin?
IntermediateAnswers and explanations are in the Veda app.
Topper level · 5 questions
Q13. Which situation is a genuine advantage of a linked-list stack over a fixed-size array stack?
AdvancedAnswers and explanations are in the Veda app.
Q14. A recursive function has no base case and keeps calling itself. What is the most likely outcome?
AdvancedAnswers and explanations are in the Veda app.
Q15. You need a structure where the most recently added item is processed first, and you also need to inspect that item before removing it. Which combination fits best?
AdvancedAnswers and explanations are in the Veda app.
Q16. Consider a stack implemented using a linked list. If you push three elements onto the stack, then pop two elements and finally push one more element, what will be the top element of the stack?
AdvancedAnswers and explanations are in the Veda app.
Q17. You have a stack that can hold a maximum of 10 elements. If you perform a series of operations: push 5 elements, pop 2 elements, push 4 elements, and then pop 1 element, what will be the current size of the stack?
AdvancedAnswers and explanations are in the Veda app.
Your notes can be a kit like these
Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free to start, in more than 40 languages.
- Chapter notes
- Flashcards
- Practice MCQs
- Scored tests
- Paper Solver
Get Veda free See what students get
Free to start · Android app and web · More than 40 languages