Explore: GATE CS hub · All GATE CS topics · Syllabus & pattern · GATE CS 2026
Answer first
Programming & Data Structures has appeared in 11 of the 11 official GATE CS papers from 2016–2026, with 77 questions in all. It averages 10.7 marks a year, which puts it 1st of 11 technical subjects. The last three papers gave it 12 (2026), 11 (2025), 8 (2024).
The concepts that came back most often are C Programming, Recursion, Heaps. C Programming, Recursion, Heaps, C Pointers appeared in at least 7 of the 11 years. 43% of the questions are NAT, so you have to work out an exact value with no options to eliminate.
Marks per year
One official set per year (set 1 where GATE CS ran two sessions). Marks are as printed in the official answer key.
| Year | Questions | Marks |
|---|---|---|
| GATE CS 2026 | 8 | 12 |
| GATE CS 2025 | 7 | 11 |
| GATE CS 2024 | 5 | 8 |
| GATE CS 2023 | 7 | 10 |
| GATE CS 2022 | 7 | 10 |
| GATE CS 2021 | 5 | 8 |
| GATE CS 2020 | 9 | 13 |
| GATE CS 2019 | 7 | 12 |
| GATE CS 2018 | 7 | 10 |
| GATE CS 2017 | 7 | 11 |
| GATE CS 2016 | 8 | 13 |
Most-asked concepts
Sorted by how many years a concept appeared in, then by marks.
| Concept | Questions | Marks | Years asked |
|---|---|---|---|
| C Programming | 13 | 23 | 2025, 2024, 2023, 2022, 2021, 2020, 2019, 2017 |
| Recursion | 10 | 18 | 2026, 2025, 2024, 2020, 2019, 2018, 2017, 2016 |
| Heaps | 10 | 17 | 2026, 2025, 2024, 2023, 2020, 2019, 2018, 2016 |
| C Pointers | 10 | 12 | 2025, 2022, 2020, 2019, 2018, 2017, 2016 |
| Linked Lists | 7 | 9 | 2026, 2025, 2023, 2022, 2020, 2018, 2017 |
| Binary Search Trees | 9 | 12 | 2026, 2025, 2022, 2021, 2020, 2017 |
| Hashing | 6 | 8 | 2026, 2025, 2023, 2022, 2021, 2020 |
| Stacks & Queues | 5 | 8 | 2023, 2022, 2021, 2016 |
| Binary Trees | 3 | 4 | 2026, 2023, 2018 |
| Arrays | 2 | 4 | 2022, 2016 |
| Scoping & Parameter Passing | 2 | 3 | 2026, 2016 |
How to practise Programming & Data Structures from these PYQs
- Start with the concepts at the top of the table above. They repeat, so they pay off first.
- Open the official PDF for a year, solve only that year’s Prog & DS questions against the clock (about 3 minutes a mark), then check the official key listed below.
- Log each miss by concept and type (MCQ, MSQ, NAT). An MSQ with one extra option scores zero, so log those separately.
- Once a concept is clean across two or three years, move on to the next one.
- Then sit a full year paper from the GATE CS hub so the subject drill turns into exam timing.
Questions by year
Each line gives the official question number, marks, type and concept, our one-line summary and the official key. The full question is in the official PDF linked under each year.
GATE CS 2026 (CS1)
- Q.23 · 1 mark · MSQ · Heaps: Array indices that cannot be leaves of an n-element min-heap (key: B, C)
- Q.24 · 1 mark · MSQ · Hashing: Final table after linear-probing insertions (key: C)
- Q.33 · 1 mark · NAT · Binary Trees: Maximum height of a full binary tree with 23 nodes (key: 11)
- Q.34 · 1 mark · NAT · Scoping & Parameter Passing: Output of a C function with a shadowed block variable (key: 9)
- Q.39 · 2 marks · MCQ · Linked Lists: Completing a recursive linked-list length function (key: B)
- Q.40 · 2 marks · MCQ · Binary Search Trees: Elements that can never be inserted third into a complete BST (key: D)
- Q.61 · 2 marks · NAT · Recursion: Smallest n for which nested recursive functions return 5 (key: 65536)
- Q.62 · 2 marks · NAT · Binary Search Trees: Position of a key in postorder from a BST's preorder (key: 7)
Paper: official PDF · GATE CS 2026 page
GATE CS 2025 (CS1)
- Q.26 · 1 mark · MSQ · Binary Search Trees: True properties of a BST with n distinct keys (key: A, B)
- Q.34 · 1 mark · NAT · C Pointers: Output of a C program that writes through a pointer parameter (key: 25)
- Q.35 · 1 mark · NAT · Heaps: Height of a min-heap holding 32 keys (key: 5)
- Q.61 · 2 marks · NAT · Recursion: Value printed by a recursive C function counting changes in an array (key: 5)
- Q.62 · 2 marks · NAT · Linked Lists: Result of a C function operating on two linked lists (key: 5)
- Q.63 · 2 marks · NAT · C Programming: Value returned by a C function that picks alternate digits (key: 46)
- Q.65 · 2 marks · NAT · Hashing: Probe position of a key under double hashing (key: 10–11)
Paper: official PDF · GATE CS 2025 page
GATE CS 2024 (CS1)
- Q.18 · 1 mark · MCQ · C Programming: Behaviour of a C while loop with integer division (key: C)
- Q.19 · 1 mark · MCQ · Recursion: Output of a recursive C function reading characters with getchar (key: C)
- Q.41 · 2 marks · MCQ · Heaps: First three elements after heapifying an array into a max-heap (key: D)
- Q.43 · 2 marks · MCQ · Heaps: Possible positions of the maximum element in a binary min-heap (key: A)
- Q.48 · 2 marks · MSQ · C Programming: Return values of a C loop function for given inputs (key: B, D)
Paper: official PDF · GATE CS 2024 page
GATE CS 2023
- Q.12 · 1 mark · MCQ · Heaps: Which array sequence forms a valid max-heap (key: B)
- Q.13 · 1 mark · MCQ · Linked Lists: Time complexity of node deletion in singly versus doubly linked lists (key: D)
- Q.20 · 1 mark · MCQ · Hashing: Worst-case collisions when an adversary chooses keys for a hash table (key: C)
- Q.35 · 1 mark · NAT · C Programming: Output of a C program using a static local variable (key: 7)
- Q.46 · 2 marks · MCQ · Heaps: Time complexity of insert and extract-max on a max-heap priority queue (key: B)
- Q.47 · 2 marks · MCQ · Binary Trees: Output of a recursive C function summing subtree values of a binary tree (key: C)
- Q.59 · 2 marks · NAT · Stacks & Queues: Result of interleaved stack and queue operations on a sequence (key: 8)
Paper: official PDF · GATE CS 2023 page
GATE CS 2022
- Q.15 · 1 mark · MCQ · Linked Lists: Time complexity of reversing a singly linked list in O(1) space (key: A)
- Q.16 · 1 mark · MCQ · Hashing: Expected keys per slot when odd and even keys use different hash functions (key: B)
- Q.21 · 1 mark · MCQ · C Pointers: Output of a C program that updates variables through pointers (key: D)
- Q.28 · 1 mark · NAT · Binary Search Trees: Array index of the third largest element in a complete BST of 1000 nodes (key: 509)
- Q.43 · 2 marks · MCQ · Arrays: Output of a C program that prints a 3D array with nested loops (key: A)
- Q.44 · 2 marks · MCQ · C Programming: Output of a C program using bitwise operators on characters (key: A)
- Q.62 · 2 marks · NAT · Stacks & Queues: Minimum enqueues to reverse a queue using two queues (key: 0)
Paper: official PDF · GATE CS 2022 page
GATE CS 2021 (set 1)
- Q.10 · 1 mark · MCQ · Binary Search Trees: Time to pick a BST element smaller than the maximum (key: D)
- Q.21 · 1 mark · NAT · Stacks & Queues: Values popped and dequeued after a sequence of operations (key: 86)
- Q.37 · 2 marks · MCQ · C Programming: Output of a loop with short-circuit evaluation (key: B)
- Q.47 · 2 marks · MSQ · Hashing: Insertion order producing a given dynamic hashing state (key: C)
- Q.48 · 2 marks · NAT · C Programming: Value returned by a Horner-style C function (key: 1023)
Paper: official PDF · GATE CS 2021 page
GATE CS 2020
- Q.5 · 1 mark · MCQ · Binary Search Trees: Postorder traversal of a BST from its preorder (key: B)
- Q.6 · 1 mark · MCQ · Binary Search Trees: Worst-case time to insert many elements into an AVL tree (key: C)
- Q.16 · 1 mark · MCQ · Linked Lists: Worst-case time to build a sorted linked list by insertion (key: C)
- Q.22 · 1 mark · NAT · C Pointers: Output of pointer arithmetic on a 2D array (key: 19)
- Q.23 · 1 mark · NAT · Hashing: Probe address under double hashing (key: 13)
- Q.41 · 2 marks · MCQ · Binary Search Trees: Time to report all keys in a range in a balanced BST (key: B)
- Q.46 · 2 marks · NAT · Recursion: Return value of mutually recursive functions with static variables (key: 55)
- Q.47 · 2 marks · NAT · Heaps: Comparisons needed to find the maximum in a min-heap (key: 511)
- Q.48 · 2 marks · NAT · C Programming: Output of a C program computing a power by binary expansion (key: 81)
Paper: official PDF · GATE CS 2020 page
GATE CS 2019
- Q.18 · 1 mark · NAT · C Programming: Output of a C program passing arguments by value (key: 26)
- Q.24 · 1 mark · NAT · C Pointers: Output of pointer arithmetic on an array (key: 6)
- Q.26 · 2 marks · MCQ · Recursion: Behaviour of a recursive binary-printing function (key: D)
- Q.27 · 2 marks · MCQ · C Programming: Output of a for loop using a static counter function (key: B)
- Q.40 · 2 marks · MCQ · Heaps: Which statements about max-heaps and BSTs are true (key: A)
- Q.52 · 2 marks · NAT · C Programming: How many times a floating-point loop prints (key: 5)
- Q.53 · 2 marks · NAT · C Pointers: Output of a loop using pointer arithmetic on an array (key: 10)
Paper: official PDF · GATE CS 2019 page
GATE CS 2018
- Q.2 · 1 mark · MCQ · C Pointers: Output of a C program reading struct bytes via a char pointer (key: A)
- Q.3 · 1 mark · MCQ · Linked Lists: Complexity of enqueue and dequeue on a linked-list queue (key: B)
- Q.20 · 1 mark · NAT · Binary Trees: Tree height from postorder and inorder traversals (key: 4)
- Q.21 · 1 mark · NAT · Recursion: Number of calls made by a recursive C function (key: 4)
- Q.29 · 2 marks · MCQ · C Pointers: Output after swapping strings via single and double pointers (key: A)
- Q.45 · 2 marks · NAT · Recursion: Number of stars printed by a recursive pseudo-code function (key: 10230)
- Q.46 · 2 marks · NAT · Heaps: Number of distinct min-heaps on seven values (key: 80)
Paper: official PDF · GATE CS 2018 page
GATE CS 2017 (set 1)
- Q.6 · 1 mark · MCQ · Binary Search Trees: Minimum and maximum height of a 15-node BST (key: B)
- Q.8 · 1 mark · MCQ · Linked Lists: Behaviour of a C function joining two linked lists (key: B)
- Q.13 · 1 mark · MCQ · C Pointers: Problems in a C program using malloc and pointer reassignment (key: D)
- Q.35 · 2 marks · MCQ · Recursion: Output of two mutually recursive C functions (key: A)
- Q.36 · 2 marks · MCQ · Recursion: Termination behaviour of two recursive C functions (key: C)
- Q.53 · 2 marks · NAT · C Programming: Output of a C program comparing unsigned string lengths (key: 3.0)
- Q.55 · 2 marks · NAT · C Programming: Output of a C program counting set bits with static variables (key: 23.0)
Paper: official PDF · GATE CS 2017 page
GATE CS 2016 (set 1)
- Q.10 · 1 mark · MCQ · Stacks & Queues: Time complexity of enqueue and dequeue on an array queue (key: A)
- Q.12 · 1 mark · MCQ · C Pointers: Which call expression to a C function causes a compile error (key: D)
- Q.15 · 1 mark · NAT · C Pointers: Output of a C program that swaps pointer parameters (key: 2016.0 : 2016.0)
- Q.34 · 2 marks · MCQ · Arrays: Loop condition to find the maximum of an array with two indices (key: D)
- Q.35 · 2 marks · MCQ · Recursion: Output of a recursive C function with a static variable (key: A)
- Q.36 · 2 marks · MCQ · Scoping & Parameter Passing: Output with call-by-reference and dynamic scoping (key: D)
- Q.37 · 2 marks · MCQ · Heaps: Time complexity of deleting an arbitrary node from a binary heap (key: B)
- Q.41 · 2 marks · NAT · Stacks & Queues: Iterations of a stack-queue procedure on sixteen numbers (key: 256.0 : 256.0)
Paper: official PDF · GATE CS 2016 page
Other GATE CS subjects
- General Aptitude
- Engineering Mathematics
- Discrete Mathematics
- Digital Logic
- Computer Organization & Architecture
- Algorithms
- Theory of Computation
- Compiler Design
- Operating Systems
- Databases (DBMS)
- Computer Networks
FAQ
How many marks does Programming & Data Structures carry in GATE CS?
Across the official GATE CS papers from 2016–2026 (one set per year), Programming & Data Structures carried 10.7 marks a year on average, from 8 in 2024 to 13 in 2020.
Which Programming & Data Structures topics repeat most in GATE CS?
By the number of years they appeared in: C Programming, Recursion, Heaps. The concept table on this page lists every concept with its question count and years.
Are these the official GATE CS Programming & Data Structures questions?
Yes. Each question comes from the official GATE CS question paper for that year, and the key, marks and question type come from the official answer key. Summaries are ours; open the official PDF for the full question.
What question types does Programming & Data Structures use in GATE CS?
Of 77 questions: 39 MCQ, 5 MSQ and 33 NAT. MSQ only appears from 2021 onwards. 41 of the 77 questions carry 2 marks.