GATE CSE 2026 Set 1 question paper with solutions
All 65 questions of the GATE 2026 Set 1 Computer Science and Information Technology paper, in order, with the official answer key from IIT Guwahati. 17 have a full solution; 2 more show the official answer only.
- questions · 100 marks
- 65questions · 100 marks
- with a full solution
- 17with a full solution
- question types
- 28 MCQ · 24 MSQ · 13 NATquestion types
GATE CSE 2026 Set 1 answer key
| Question | Type | Marks | Answer |
|---|---|---|---|
| Q.1 | MCQ | 1 | B |
| Q.2 | MCQ | 1 | C |
| Q.3 | MCQ | 1 | C |
| Q.4 | MCQ | 1 | D |
| Q.5 | MCQ | 1 | C |
| Q.6 | MCQ | 2 | B |
| Q.7 | MCQ | 2 | D |
| Q.8 | MCQ | 2 | A |
| Q.9 | MCQ | 2 | A |
| Q.10 | MCQ | 2 | C |
| Q.11 | MCQ | 1 | B |
| Q.12 | MCQ | 1 | A |
| Q.13 | MCQ | 1 | A |
| Q.14 | MCQ | 1 | B |
| Q.15 | MCQ | 1 | D |
| Q.16 | MCQ | 1 | B |
| Q.17 | MCQ | 1 | A |
| Q.18 | MCQ | 1 | D |
| Q.19 | MSQ | 1 | A, C, D |
| Q.20 | MSQ | 1 | B, D |
| Q.21 | MSQ | 1 | A, C |
| Q.22 | MSQ | 1 | B, C |
| Q.23 | MSQ | 1 | B, C |
| Q.24 | MSQ | 1 | C |
| Q.25 | MSQ | 1 | A, B, C |
| Q.26 | MSQ | 1 | B, D |
| Q.27 | MSQ | 1 | C |
| Q.28 | MSQ | 1 | C |
| Q.29 | MSQ | 1 | A, C |
| Q.30 | MSQ | 1 | C, D |
| Q.31 | MSQ | 1 | A, B, C |
| Q.32 | NAT | 1 | 3 |
| Q.33 | NAT | 1 | 11 |
| Q.34 | NAT | 1 | 9 |
| Q.35 | NAT | 1 | 6 |
| Q.36 | MCQ | 2 | C |
| Q.37 | MCQ | 2 | B |
| Q.38 | MCQ | 2 | A |
| Q.39 | MCQ | 2 | B |
| Q.40 | MCQ | 2 | D |
| Q.41 | MCQ | 2 | A |
| Q.42 | MCQ | 2 | D |
| Q.43 | MCQ | 2 | B |
| Q.44 | MCQ | 2 | B |
| Q.45 | MCQ | 2 | B |
| Q.46 | MSQ | 2 | A, C, D |
| Q.47 | MSQ | 2 | A |
| Q.48 | MSQ | 2 | B, D |
| Q.49 | MSQ | 2 | A, D |
| Q.50 | MSQ | 2 | B, D |
| Q.51 | MSQ | 2 | C |
| Q.52 | MSQ | 2 | B, D |
| Q.53 | MSQ | 2 | A, B, D |
| Q.54 | MSQ | 2 | B, C |
| Q.55 | MSQ | 2 | B, C |
| Q.56 | MSQ | 2 | A, B, C |
| Q.57 | NAT | 2 | 34 |
| Q.58 | NAT | 2 | 4.24 to 4.26 |
| Q.59 | NAT | 2 | 77.3 |
| Q.60 | NAT | 2 | 95 |
| Q.61 | NAT | 2 | 65536 |
| Q.62 | NAT | 2 | 7 |
| Q.63 | NAT | 2 | 4 |
| Q.64 | NAT | 2 | 9.5 |
| Q.65 | NAT | 2 | 6 |
General Aptitude Q.1 to Q.10
- Q.1MCQ · 1 markOfficial answer: B
- Q.2MCQ · 1 markOfficial answer: C
- Q.3MCQ · 1 markOfficial answer: C
- Q.4MCQ · 1 markOfficial answer: D
- Q.5MCQ · 1 markOfficial answer: C
- Q.6MCQ · 2 marksOfficial answer: B
- Q.7MCQ · 2 marksOfficial answer: D
- Q.8MCQ · 2 marksOfficial answer: A
- Q.9MCQ · 2 marksOfficial answer: A
- Q.10MCQ · 2 marksOfficial answer: C
Computer Science and Information Technology Q.11 to Q.65
- Q.11MCQ · 1 markOfficial answer: B
- Q.12MCQ · 1 markOfficial answer: A
- Q.13MCQ · 1 markOfficial answer: A
- Q.14MCQ · 1 markOfficial answer: B
Computer Organization and Architecture › Instructions & addressing
Each addressing mode's structural definition maps directly onto a matching high-level-language construct: immediate (value in the instruction) ↔ constant; indirect (dereference through a stored address) ↔ pointer; base+index (base + a value that varies to step through elements) ↔ array element; base+displacement (base + a fixed, compile-time offset) ↔ record/structure field.
WATCH OUT FORFull solutionSwapping base-with-index and base-with-offset/displacement (R and S): both add a base register to something, so it's easy to conflate them. The distinguishing feature is whether that "something" varies at run time (index register → array traversal) or is a fixed constant baked into the instruction (displacement → a specific, unchanging field offset in a record).
- Q.15MCQ · 1 markOfficial answer: D
Computer Organization and Architecture › Instructions & addressing
In a load-store (register-register) architecture, only LOAD and STORE instructions may reference memory; every arithmetic/logic instruction (like ADD) must have all its operands — source and destination — in registers.
WATCH OUT FORFull solutionAssuming an ADD can have one memory operand as long as it also uses a register (as in options B and C), rather than recognizing that a load-store ISA forbids ANY memory operand on a non-load/store instruction.
- Q.16MCQ · 1 markOfficial answer: B
Computer Organization and Architecture › Pipelining
In a simple in-order pipeline, only a true (flow) dependency — a later instruction reading a register before an earlier instruction has finished writing it — can produce an incorrect result; this is the Read-After-Write (RAW) hazard.
WATCH OUT FORFull solutionConfusing RAW (a true data dependency that causes a real hazard even in a simple in-order pipeline) with WAR/WAW (anti- and output-dependencies, which only matter under out-of-order or overlapped-write execution) — or picking RAR by mistakenly treating any repeated access as hazardous.
- Q.17MCQ · 1 markOfficial answer: A
Data Structures and Algorithms › Complexity
Solve the inner recurrence T2 first with the Master theorem, then substitute the resulting Θ-bound into the outer recurrence T1 and apply the Master theorem a second time.
WATCH OUT FORFull solutionApplying the Master theorem to T1 using the printed f(n) = T2(n) symbolically (or assuming T2(n) = Θ(n) / Θ(log n) without first solving it), instead of substituting the actual closed form Θ(n^{log_4 5}) for T2(n) before comparing against n^{log_2 4} = n².
- Q.18MCQ · 1 markOfficial answer: D
- Q.19MSQ · 1 markOfficial answer: A, C, D
- Q.20MSQ · 1 markOfficial answer: B, D
- Q.21MSQ · 1 markOfficial answer: A, C
- Q.22MSQ · 1 markOfficial answer: B, C
- Q.23MSQ · 1 markOfficial answer: B, C
Data Structures and Algorithms › Trees & heaps
In a 1-indexed array representation of an -node binary heap, node is internal iff (its children still lie within ), and node is a leaf iff . For odd , , so the last internal index is and the first leaf index is .
WATCH OUT FORFull solutionConfusing the leaf-boundary index (the first leaf) with the last internal node. Since is itself the LAST internal node (not a leaf), and is the FIRST leaf, it is easy to mislabel option (A), , as non-leaf, or to mislabel (B), , as a leaf, by an off-by-one slip in the floor computation.
- Q.24MSQ · 1 markOfficial answer: C
Data Structures and Algorithms › Sorting & hashing
Simulate linear probing step by step: compute h(x)=(x+7) mod 11 for each key, and if that slot is occupied, probe the next slots (wrapping around) until an empty one is found.
WATCH OUT FORFull solutionForgetting to wrap the probe sequence around from index 10 back to index 0 (linear probing is circular), or mis-tracking which slots are already occupied by the time a later collision occurs.
- Q.25MSQ · 1 markOfficial answer: A, B, C
- Q.26MSQ · 1 markOfficial answer: B, D
- Q.27MSQ · 1 markOfficial answer: C
- Q.28MSQ · 1 markOfficial answer: C
- Q.29MSQ · 1 markOfficial answer: A, C
- Q.30MSQ · 1 markOfficial answer: C, D
- Q.31MSQ · 1 markOfficial answer: A, B, C
- Q.32NAT · 1 markOfficial answer: 3
- Q.33NAT · 1 markOfficial answer: 11
Data Structures and Algorithms › Trees & heaps
In a full binary tree (every node has 0 or 2 children) with internal nodes, leaves , so ; to maximise height, chain the internal nodes into a single skewed path, giving one leaf off each internal node except the last (which contributes two leaves), so height.
WATCH OUT FORFull solutionConfusing "full" binary tree (every node has 0 or 2 children — degenerate/skewed shapes are still allowed as long as no node has exactly one child) with "complete" or "perfect" binary tree, and instead computing the height of a perfect/complete tree with 23 nodes (which gives a much smaller height, around ), or forgetting that the last internal node in the skewed chain must take two leaf children (not one), which would misalign the leaf count.
- Q.34NAT · 1 markOfficial answer: 9
Programming in C › Functions & scope
A variable declared inside a block
{ ... }exists only until that block's closing}. While it exists it hides any outer variable with the same name. Once the block closes, the name refers to the outer variable again, which in this program is the parameteri.WATCH OUT FORFull solutionTreating the
printfas part of theifblock and printing the inneri, which ends at 10. Theifblock closes before theprintf, so the inneriis out of scope at that point and the parameteri= 9 is printed. - Q.35NAT · 1 markOfficial answer: 6
- Q.36MCQ · 2 marksOfficial answer: C
- Q.37MCQ · 2 marksOfficial answer: B
- Q.38MCQ · 2 marksOfficial answer: A
Computer Organization and Architecture › Memory & cache
Tag = Total address bits − Block offset bits − Index (set) bits. Block offset is fixed (7 bits) regardless of mapping scheme; only the number of sets (hence index bits) changes between direct-mapped and K-way set-associative caches of the same total capacity and block size.
WATCH OUT FORFull solutionForgetting that increasing associativity (K-way) shrinks the number of sets by a factor of K, so it REDUCES the index bits and thus INCREASES the tag bits — students often think higher associativity increases index bits, leading them to pick B (N = M − L) instead of A.
- Q.39MCQ · 2 marksOfficial answer: B
Data Structures and Algorithms › Linear structures
A recursive size/length function over a linked list needs its base case and recursive step to move in lockstep: the base case must fire exactly once per traversal (at the true last node, detected by
head->next == NULL, not by overshooting tohead == NULL), and the recursive call must always advance the pointer it tests (getListSize(head->next), never the unchangedhead) or it never terminates.WATCH OUT FORFull solutionPicking option (C) (E1: head==NULL, E2: 1+getListSize(head->next)) — this looks like the "natural" NULL-terminated recursion pattern but it makes one extra call past the last node (into NULL), overcounting every list by exactly 1. Equally common is picking (A) or (D) where E2 recurses on the unchanged
headpointer, causing infinite recursion / a crash rather than a wrong count. - Q.40MCQ · 2 marksOfficial answer: D
Data Structures and Algorithms › Trees & heaps
In a BST built by successive insertions, a node's parent must already be in the tree before the node itself can be inserted, so a node at shape-depth (root at depth 0) needs prior insertions (its ancestors) and can therefore appear no earlier than insertion number — and, since the other branches of the tree are independent, it CAN appear at any position from up to by freely interleaving unrelated nodes.
WATCH OUT FORThe question and its official answerAssuming that only nodes whose minimum possible position equals exactly 3 (i.e., only depth-2 nodes) can ever occupy position 3, and forgetting that a shallower node (depth 0 or 1) can also be delayed to position 3 by inserting other independent nodes first.
- Q.41MCQ · 2 marksOfficial answer: A
Data Structures and Algorithms › Graph algorithms
d_k(u) is monotone non-increasing in k because the set of length-<=k paths is a subset of the length-<=(k+1) paths, so the minimum can only get smaller or stay the same (S1). The claim that d_k(u) <= d_k(v) whenever (u,v) lies on a shortest path to v is false because reaching u may require strictly more hops than reaching v via a different, cheaper route (S2).
WATCH OUT FORFull solutionAssuming S2 must be true by analogy with the Bellman-Ford relaxation step d_{k+1}(v) <= d_k(u) + w(u,v); that inequality involves k and k+1 with an added edge weight, not d_k(u) <= d_k(v) at the same k with no weight term, so the analogy does not transfer and a hop-count counterexample breaks it.
- Q.42MCQ · 2 marksOfficial answer: D
- Q.43MCQ · 2 marksOfficial answer: B
- Q.44MCQ · 2 marksOfficial answer: B
- Q.45MCQ · 2 marksOfficial answer: B
- Q.46MSQ · 2 marksOfficial answer: A, C, D
- Q.47MSQ · 2 marksOfficial answer: A
- Q.48MSQ · 2 marksOfficial answer: B, D
- Q.49MSQ · 2 marksOfficial answer: A, D
Data Structures and Algorithms › Graph algorithms
Because all edge weights are unique, has a unique MST, and two classical results pin down every option: the cycle property (in any cycle, the strictly max-weight edge is never in an MST) and the cut property (across any cut, the strictly min-weight crossing edge is in every MST). Applying the cut property to the trivial cut — whose crossing edges are exactly 's incident edges — shows the minimum edge at each vertex is forced into every MST.
WATCH OUT FORFull solutionConfusing "every cycle's minimum edge is safe/must be in the MST" (false — it can be excluded once a cheaper path already connects its endpoints, as Kruskal shows) with the correct cut-property statement about a vertex's minimum incident edge; and assuming an edge's local extremal property (largest/smallest at a vertex) behaves symmetrically to its extremal property in a cycle, when cycles and cuts are genuinely dual/opposite structures in MST theory.
- Q.50MSQ · 2 marksOfficial answer: B, D
Data Structures and Algorithms › Graph algorithms
The DFS Parenthesis Theorem gives exactly four possible relations between the [d,f] intervals of two vertices u, v for an edge (u,v): tree/forward (nested, u outer), back (nested, v outer), cross (disjoint, v's interval entirely before u's), and a fourth "partial overlap" pattern, which the theorem rules out for ANY DFS on ANY directed graph — it is not graph-type dependent. Separately, a DAG has no back edges by definition (a back edge always creates a cycle with the tree-path from v to u). So one excluded pattern (D) comes from the parenthesis theorem itself, and the other (B) comes specifically from the DAG constraint — the two impossibilities have different sources, but both must be excluded here.
WATCH OUT FORFull solutionTwo distinct traps: (1) treating this as "there is only one impossible pattern" — students often stop after correctly ruling out the back-edge pattern via the DAG property and forget that option D is ALSO impossible, but for the separate, more fundamental reason (parenthesis theorem) that has nothing to do with the graph being acyclic. (2) Confusing which nesting direction is the back edge: back edge is v (ancestor, still open) containing u (descendant) — i.e., d[v] < d[u] < f[u] < f[v] — not the other nesting direction, which is the tree/forward-edge pattern.
- Q.51MSQ · 2 marksOfficial answer: C
- Q.52MSQ · 2 marksOfficial answer: B, D
- Q.53MSQ · 2 marksOfficial answer: A, B, D
- Q.54MSQ · 2 marksOfficial answer: B, C
Computer Organization and Architecture › Memory & cache
A TLB hit implies the page table would also hit (a TLB entry cannot outlive its page's residency), and — because the cache is physically indexed — any page-table miss (page fault) means the page was not resident, so by the problem's own invalidation-on-eviction rule its cache blocks cannot hold valid data: the access that follows a page-table miss must be a cache miss, never a hit.
WATCH OUT FORThe question and its official answerAssuming a page-table miss means the cache is simply "skipped" rather than reasoning that translation does complete (via page-fault service) and the cache IS probed, but is guaranteed to miss — the given eviction-invalidation clue is what rules out a hit here, not an absence of cache access. Also mistakenly assuming TLB and page-table lookups are independent, missing that a TLB hit forces a page-table hit.
- Q.55MSQ · 2 marksOfficial answer: B, C
Data Structures and Algorithms › Graph algorithms
2-colorability of a graph is exactly bipartiteness, and bipartiteness is testable in linear time by a single BFS/DFS coloring pass.
WATCH OUT FORFull solutionConfusing "2-colorable" with "properly colored graphs can have any cycle type" — a bipartite (2-colorable) graph can never contain an odd cycle, since traversing an odd cycle forces two adjacent vertices to receive the same color; students sometimes pick (A) by only checking small examples instead of proving the general impossibility.
- Q.56MSQ · 2 marksOfficial answer: A, B, C
- Q.57NAT · 2 marksOfficial answer: 34
- Q.58NAT · 2 marksOfficial answer: 4.24 to 4.26
- Q.59NAT · 2 marksOfficial answer: 77.3
- Q.60NAT · 2 marksOfficial answer: 95
Computer Organization and Architecture › Pipelining
When a functional unit (here, the EX stage) is not internally pipelined and one instruction's operation takes longer than one clock cycle, the unit must hold that instruction for multiple cycles before it can accept the next one — a structural hazard. An instruction whose EX time is nanoseconds occupies the EX stage for clock cycles (since the clock period is 1 ns), so it delays (stalls) the instruction behind it by cycles. Total stall cycles for the program = over all instruction types.
WATCH OUT FORFull solutionTwo common errors: (1) using itself (the total cycles occupied) instead of (the stall cycles caused) as the per-instruction penalty, which overcounts by exactly instructions with ; (2) rounding to the nearest integer instead of taking the ceiling (e.g., treating 1.5 ns or 2.5 ns as needing only 1–2 cycles), which understates the number of clock cycles actually required to complete the operation.
- Q.61NAT · 2 marksOfficial answer: 65536
foocounts how many timesbarmust be applied to bringndown to 1, plus one;baritself computes (the number of integer-halvings needed to reach 1). Since is non-decreasing in , the smallest reaching a target value after nested applications ofbaris built from the inside out: at each stage pick the smallest number whose equals the previous stage's smallest value, i.e. exactly .WATCH OUT FORFull solutionConfusing
bar(n)withnhalved once (givingbar(n) = n/2) instead of recognizing it as the iterated-halving count ; this leads to solving , missing thatfoocallsbarfresh on each level (nesting four times, not dividing by 2 four times). - Q.62NAT · 2 marksOfficial answer: 7
Data Structures and Algorithms › Trees & heaps
In a BST, a preorder listing splits uniquely at each node into (root, values less than root = left subtree preorder, values greater than root = right subtree preorder). Recursively rebuild both subtrees this way, then compute postorder (left, right, root) on the rebuilt tree.
WATCH OUT FORFull solutionTrying to compute the postorder position of 60 without fully separating each subtree's preorder segment first — e.g. misplacing 70 as a left child of 75 instead of the right child of 60, or misplacing 77 as the right child of 75 instead of the left child of 80 — which shifts the final position count.
- Q.63NAT · 2 marksOfficial answer: 4
- Q.64NAT · 2 marksOfficial answer: 9.5
- Q.65NAT · 2 marksOfficial answer: 6