Class 12 Computer Science Stack PYQ, free to download as a 31-page PDF with 18 solved questions: 11 from the 2022 to 2026 board papers and 7 from CBSE's official sample papers. Stack belongs to Unit I, Computational Thinking and Programming - 2, which carries 40 of the 70 theory marks.
The questions keep returning to push functions (16 questions), pop functions (14), displaying the stack (14), an empty-stack or underflow message (11), list-based stacks (13) and stacks built from dictionary or tuple data (5).
On this page you get:
- 18 questions with a worked solution each: 1 MCQ, 2 short answers and 15 programs
- An Answer Key that lists the 1 MCQ at a glance
- Question counts by topic, so you know whether to start with push, pop or display
- A marks-wise table of questions (1, 2 and 3 mark)
- The common mistakes students make, such as pushing a product priced exactly 50 when the condition is "more than 50", and a short FAQ
Stack Weightage in the Class 12 Computer Science Paper
CBSE does not print a mark figure for Stack alone. In the Class 12 Computer Science (083) syllabus, Unit I, Computational Thinking and Programming - 2, carries 40 of the 70 theory marks, and Stack is one of its topics along with Python revision, exception handling and file handling. The 40 is a unit-level figure, so check the current syllabus on cbseacademic.nic.in. In this set the 3-mark program is the usual form. The unit marks are as reported by prep sites and the published syllabus summaries, and we could not confirm them on a CBSE document, so treat them as unofficial.
The table shows how many questions the set holds at each mark value.
| Marks per Question | Questions in the Set |
|---|---|
| 1 mark | 1 |
| 2 marks | 2 |
| 3 marks | 15 |
| 4 marks | 0 |
| 5 marks | 0 |
Stack Questions by Topic
Almost every question asks you to write functions on a stack held in a Python list. 16 of the 18 ask for a push function, usually with a condition: a price below 100 for FruitStack in 2026, five or more digits for BigNums in 2024, the room type 'Delux' for the Hotel stack in 2023, or a vowel-free word for PushNv() in 2022. 14 ask for pop, normally with the message "Underflow" or "Stack Empty" once nothing is left, and 11 questions mention an empty stack in some form.
Display is asked in 14 questions, either by popping everything or, as in display_all() and peep(), by printing without deleting. 13 questions build the stack from a list, 4 from a dictionary such as Vehicle or R, and one each from a tuple list and a nested list like the city and country records. The 1-mark MCQ is an assertion-reason item on LIFO, and the 2-mark questions ask for the LIFO order, the list method pop() and two characteristics of a stack.
Counts come from keyword matches over the question text, so a question that names two things is counted under both.
Source: Barkha Mam - App Tech Guru
How to Approach the Set
Start with the one MCQ, then do the two short answers, which need only the LIFO order and the pop() method. Spend most of your time on the 15 programs. Write the push function first, test the condition on the sample list in the question, then write pop and check that the output order is reversed. The 2025-26 and 2026-27 sample papers ask the same shape again: Push_element() and Pop_element() over a list of tuples, with "Stack Empty" printed at the end. Practise one version that returns the popped value and one that prints it.
Common Mistakes in Stack Questions
- Pushing Pen, priced exactly 50, when the condition is "more than 50". It must stay out.
- Forgetting the empty check in pop, so pop() on an empty list raises an error instead of printing "Underflow".
- Printing the stack from index 0 and calling that the top first order. The top is the last element, so display must walk backwards.
- Calling the Reason in the 2023 assertion-reason question a correct explanation. A stack is LIFO by definition, not because append() adds after the last element, so the answer is (C).
- Changing the stack inside display_all() or peep() with pop(). These must read without deleting.
- Missing "TATA" in different cases in the 2023 Vehicle question. Compare after converting to upper case.
Using the Answer Key and Solutions
The PDF is 31 pages and free to download. Each section is sorted newest year first, the Answer Key lists the MCQ at a glance, and each question links to its worked solution and back. Attempt the code yourself first, check the key, then read the solution. The solutions are written by Collegedunia's Computer Science experts and are not official CBSE marking schemes.
Class 12 Computer Science PYQs by Chapter
Stack Class 12 Computer Science PYQ FAQs
Ques. How many questions are in the Stack Class 12 Computer Science PYQ PDF?
Ans. The PDF has 18 questions: 11 from the 2022 to 2026 board papers and 7 from CBSE's official sample papers. One is a 1-mark assertion-reason MCQ, 2 are 2-mark short answers and 15 are 3-mark programs.
Ques. Does this PYQ PDF include solutions, or only the questions?
Ans. All 18 questions have a worked solution in the PDF, and the one MCQ is also listed in the Answer Key before the solutions.
Ques. Are the solutions official?
Ans. No. They are written by Collegedunia's Computer Science experts, run and checked against CBSE's marking schemes where CBSE has published them (the 2023, 2024 and 2025 board papers and the sample papers). The 2022 and 2026 board papers have no published scheme, so those answers were worked out and run by hand. They are not an official CBSE marking scheme.
Ques. How many marks does Stack carry in the Class 12 Computer Science paper?
Ans. CBSE publishes marks per unit, not per chapter. Stack sits in Unit I, Computational Thinking and Programming - 2, which carries 40 of the 70 theory marks. Check cbseacademic.nic.in for the current syllabus.
Ques. What kind of questions are asked from Stack?
Ans. In this set 16 of the 18 questions ask you to write push functions and 14 ask for pop. 14 also ask for a display of the stack, and 11 mention an empty stack or underflow message.
Ques. Do I need to write the full program or only the functions?
Ans. Most questions ask only for user-defined functions such as Push_element() and Pop_element(). Two questions, from 2022, also ask for a main program that takes input and calls the function.








Comments