IAE Academy

PAPERS · GATE CS

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

Official answers to every question of GATE CSE 2026 Set 1
QuestionTypeMarksAnswer
Q.1MCQ1B
Q.2MCQ1C
Q.3MCQ1C
Q.4MCQ1D
Q.5MCQ1C
Q.6MCQ2B
Q.7MCQ2D
Q.8MCQ2A
Q.9MCQ2A
Q.10MCQ2C
Q.11MCQ1B
Q.12MCQ1A
Q.13MCQ1A
Q.14MCQ1B
Q.15MCQ1D
Q.16MCQ1B
Q.17MCQ1A
Q.18MCQ1D
Q.19MSQ1A, C, D
Q.20MSQ1B, D
Q.21MSQ1A, C
Q.22MSQ1B, C
Q.23MSQ1B, C
Q.24MSQ1C
Q.25MSQ1A, B, C
Q.26MSQ1B, D
Q.27MSQ1C
Q.28MSQ1C
Q.29MSQ1A, C
Q.30MSQ1C, D
Q.31MSQ1A, B, C
Q.32NAT13
Q.33NAT111
Q.34NAT19
Q.35NAT16
Q.36MCQ2C
Q.37MCQ2B
Q.38MCQ2A
Q.39MCQ2B
Q.40MCQ2D
Q.41MCQ2A
Q.42MCQ2D
Q.43MCQ2B
Q.44MCQ2B
Q.45MCQ2B
Q.46MSQ2A, C, D
Q.47MSQ2A
Q.48MSQ2B, D
Q.49MSQ2A, D
Q.50MSQ2B, D
Q.51MSQ2C
Q.52MSQ2B, D
Q.53MSQ2A, B, D
Q.54MSQ2B, C
Q.55MSQ2B, C
Q.56MSQ2A, B, C
Q.57NAT234
Q.58NAT24.24 to 4.26
Q.59NAT277.3
Q.60NAT295
Q.61NAT265536
Q.62NAT27
Q.63NAT24
Q.64NAT29.5
Q.65NAT26

General Aptitude Q.1 to Q.10

  1. Q.1MCQ · 1 markOfficial answer: B
  2. Q.2MCQ · 1 markOfficial answer: C
  3. Q.3MCQ · 1 markOfficial answer: C
  4. Q.4MCQ · 1 markOfficial answer: D
  5. Q.5MCQ · 1 markOfficial answer: C
  6. Q.6MCQ · 2 marksOfficial answer: B
  7. Q.7MCQ · 2 marksOfficial answer: D
  8. Q.8MCQ · 2 marksOfficial answer: A
  9. Q.9MCQ · 2 marksOfficial answer: A
  10. Q.10MCQ · 2 marksOfficial answer: C

Computer Science and Information Technology Q.11 to Q.65

  1. Q.11MCQ · 1 markOfficial answer: B
  2. Q.12MCQ · 1 markOfficial answer: A
  3. Q.13MCQ · 1 markOfficial answer: A
  4. 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 FOR

    Swapping 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).

    Full solution
  5. 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 FOR

    Assuming 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.

    Full solution
  6. 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 FOR

    Confusing 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.

    Full solution
  7. 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 FOR

    Applying 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².

    Full solution
  8. Q.18MCQ · 1 markOfficial answer: D
  9. Q.19MSQ · 1 markOfficial answer: A, C, D
  10. Q.20MSQ · 1 markOfficial answer: B, D
  11. Q.21MSQ · 1 markOfficial answer: A, C
  12. Q.22MSQ · 1 markOfficial answer: B, C
  13. 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 FOR

    Confusing 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.

    Full solution
  14. 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 FOR

    Forgetting 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.

    Full solution
  15. Q.25MSQ · 1 markOfficial answer: A, B, C
  16. Q.26MSQ · 1 markOfficial answer: B, D
  17. Q.27MSQ · 1 markOfficial answer: C
  18. Q.28MSQ · 1 markOfficial answer: C
  19. Q.29MSQ · 1 markOfficial answer: A, C
  20. Q.30MSQ · 1 markOfficial answer: C, D
  21. Q.31MSQ · 1 markOfficial answer: A, B, C
  22. Q.32NAT · 1 markOfficial answer: 3
  23. 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 FOR

    Confusing "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.

    Full solution
  24. 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 parameter i.

    WATCH OUT FOR

    Treating the printf as part of the if block and printing the inner i, which ends at 10. The if block closes before the printf, so the inner i is out of scope at that point and the parameter i = 9 is printed.

    Full solution
  25. Q.35NAT · 1 markOfficial answer: 6
  26. Q.36MCQ · 2 marksOfficial answer: C
  27. Q.37MCQ · 2 marksOfficial answer: B
  28. 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 FOR

    Forgetting 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.

    Full solution
  29. 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 to head == NULL), and the recursive call must always advance the pointer it tests (getListSize(head->next), never the unchanged head) or it never terminates.

    WATCH OUT FOR

    Picking 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 head pointer, causing infinite recursion / a crash rather than a wrong count.

    Full solution
  30. 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 FOR

    Assuming 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.

    The question and its official answer
  31. 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 FOR

    Assuming 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.

    Full solution
  32. Q.42MCQ · 2 marksOfficial answer: D
  33. Q.43MCQ · 2 marksOfficial answer: B
  34. Q.44MCQ · 2 marksOfficial answer: B
  35. Q.45MCQ · 2 marksOfficial answer: B
  36. Q.46MSQ · 2 marksOfficial answer: A, C, D
  37. Q.47MSQ · 2 marksOfficial answer: A
  38. Q.48MSQ · 2 marksOfficial answer: B, D
  39. 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 FOR

    Confusing "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.

    Full solution
  40. 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 FOR

    Two 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.

    Full solution
  41. Q.51MSQ · 2 marksOfficial answer: C
  42. Q.52MSQ · 2 marksOfficial answer: B, D
  43. Q.53MSQ · 2 marksOfficial answer: A, B, D
  44. 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 FOR

    Assuming 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.

    The question and its official answer
  45. 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 FOR

    Confusing "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.

    Full solution
  46. Q.56MSQ · 2 marksOfficial answer: A, B, C
  47. Q.57NAT · 2 marksOfficial answer: 34
  48. Q.58NAT · 2 marksOfficial answer: 4.24 to 4.26
  49. Q.59NAT · 2 marksOfficial answer: 77.3
  50. 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 FOR

    Two 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.

    Full solution
  51. Q.61NAT · 2 marksOfficial answer: 65536

    Programming in C › Recursion

    foo counts how many times bar must be applied to bring n down to 1, plus one; bar itself computes (the number of integer-halvings needed to reach 1). Since is non-decreasing in , the smallest reaching a target value after nested applications of bar is 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 FOR

    Confusing bar(n) with n halved once (giving bar(n) = n/2) instead of recognizing it as the iterated-halving count ; this leads to solving , missing that foo calls bar fresh on each level (nesting four times, not dividing by 2 four times).

    Full solution
  52. 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 FOR

    Trying 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.

    Full solution
  53. Q.63NAT · 2 marksOfficial answer: 4
  54. Q.64NAT · 2 marksOfficial answer: 9.5
  55. Q.65NAT · 2 marksOfficial answer: 6