IAE Academy

PAPERS · GATE CS

GATE CSE 2025 Set 1 question paper with solutions

All 65 questions of the GATE 2025 Set 1 Computer Science and Information Technology paper, in order, with the official answer key from IIT Roorkee. 16 have a full solution.

questions · 100 marks
65questions · 100 marks
with a full solution
16with a full solution
question types
30 MCQ · 13 MSQ · 22 NATquestion types

GATE CSE 2025 Set 1 answer key

Official answers to every question of GATE CSE 2025 Set 1
QuestionTypeMarksAnswer
Q.1MCQ1A
Q.2MCQ1B
Q.3MCQ1C
Q.4MCQ1A
Q.5MCQ1C
Q.6MCQ2C
Q.7MCQ2A
Q.8MCQ2A
Q.9MCQ2A
Q.10MCQ2B
Q.11MCQ1A
Q.12MCQ1C
Q.13MCQ1B
Q.14MCQ1A
Q.15MCQ1C
Q.16MCQ1B
Q.17MCQ1D
Q.18MCQ1B
Q.19MCQ1A
Q.20MCQ1A
Q.21MSQ1B, D
Q.22MSQ1B, D
Q.23MSQ1A, D
Q.24MSQ1B, D
Q.25MSQ1B, D
Q.26MSQ1A, B
Q.27MSQ1A, B, C
Q.28MSQ1D
Q.29NAT121
Q.30NAT1195
Q.31NAT1-2.1 to -1.9
Q.32NAT10.49 to 0.51
Q.33NAT1435
Q.34NAT125
Q.35NAT15
Q.36MCQ2A
Q.37MCQ2B
Q.38MCQ2A
Q.39MCQ2A
Q.40MCQ2A
Q.41MCQ2D
Q.42MCQ2A
Q.43MCQ2C
Q.44MCQ2C
Q.45MCQ2C
Q.46MSQ2A, D
Q.47MSQ2B, C
Q.48MSQ2B, D
Q.49MSQ2B
Q.50MSQ2C
Q.51NAT265468
Q.52NAT26
Q.53NAT211.83 to 11.87
Q.54NAT26
Q.55NAT226
Q.56NAT20.949 to 0.952
Q.57NAT27
Q.58NAT20.300 to 0.302
Q.59NAT25
Q.60NAT27 to 8
Q.61NAT25
Q.62NAT25
Q.63NAT246
Q.64NAT25
Q.65NAT210 to 11

General Aptitude Q.1 to Q.10

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

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

  1. Q.11MCQ · 1 markOfficial answer: A

    Computer Organization and Architecture › I/O, interrupts & DMA

    Interrupt handling in a non-pipelined processor follows a fixed order dictated by hardware necessity: interrupts are checked and honored only at instruction boundaries, and the return address (PC) must be preserved before it is overwritten with the ISR's address.

    WATCH OUT FOR

    Assuming the PC is loaded with the ISR address before or without first saving it, or forgetting that a non-pipelined processor only recognizes interrupts at instruction boundaries (so the current instruction must finish first).

    Full solution
  2. Q.12MCQ · 1 markOfficial answer: C
  3. Q.13MCQ · 1 markOfficial answer: B
  4. Q.14MCQ · 1 markOfficial answer: A
  5. Q.15MCQ · 1 markOfficial answer: C
  6. Q.16MCQ · 1 markOfficial answer: B
  7. Q.17MCQ · 1 markOfficial answer: D
  8. Q.18MCQ · 1 markOfficial answer: B

    Data Structures and Algorithms › Graph algorithms

    A minimum spanning tree only removes edges from ; it never adds a shorter route. So every path available inside is also available inside , meaning shortest-path distance can only stay the same or shrink when you move from to : , always.

    WATCH OUT FOR

    Assuming a "minimum" spanning tree must preserve shortest-path distances (confusing MST with a shortest-path tree) and picking (A); or reasoning direction backwards and picking (C) by thinking "the tree is smaller so distances in it must be smaller."

    Full solution
  9. Q.19MCQ · 1 markOfficial answer: A
  10. Q.20MCQ · 1 markOfficial answer: A

    Data Structures and Algorithms › Complexity

    When a recurrence has the form T(n) = 2T(n-1) + f(n)·2^n, dividing through by 2^n turns the exponential recurrence into a simple additive one: define S(n) = T(n)/2^n, and the recurrence collapses to S(n) = S(n-1) + f(n), which can be solved by direct summation.

    WATCH OUT FOR

    Solving the recurrence directly by repeated substitution and losing track of the accumulating n·2^n terms (or mis-summing them) leads to an off-by-one-degree answer such as Θ(n2ⁿ) (option B) or assuming the extra n factor doesn't compound, missing that it must be summed over n terms to give the n² factor.

    Full solution
  11. Q.21MSQ · 1 markOfficial answer: B, D
  12. Q.22MSQ · 1 markOfficial answer: B, D
  13. Q.23MSQ · 1 markOfficial answer: A, D
  14. Q.24MSQ · 1 markOfficial answer: B, D
  15. Q.25MSQ · 1 markOfficial answer: B, D
  16. Q.26MSQ · 1 markOfficial answer: A, B

    Data Structures and Algorithms › Trees & heaps

    A root-to-node path cannot repeat a node, so in any -node tree it has at most edges. A skewed BST reaches that limit. Inorder traversal of a BST (left, node, right) always gives the keys in sorted order. Search cost depends on the height, which can be as large as , so an unbalanced BST has worst-case search. A left child is always smaller than its parent, so a BST with any left child cannot be a min-heap.

    WATCH OUT FOR

    The common mistake is to read (A) as "every BST has height " and reject it because a balanced BST is only deep. The statement gives the largest length a root-to-node path can have in any BST, and is that upper bound. It is reached by a skewed tree. A second mistake is to accept (C) by assuming the BST is balanced. A plain BST has no such guarantee.

    Full solution
  17. Q.27MSQ · 1 markOfficial answer: A, B, C

    Computer Organization and Architecture › ALU & control unit

    Mux_A and Mux_B are controlled by two separate, independent select lines ("Select RA/immediate" and "Select RB/immediate"), so all four combinations of their inputs (RA/RB, RA/immediate, immediate/RB, immediate/immediate) are physically realizable at the ALU's two operand ports.

    WATCH OUT FOR

    Assuming the two multiplexer select lines must be tied together (i.e., both muxes always pick "register" or both always pick "immediate" in lock-step), which would wrongly eliminate option (C) and make (D) look correct. The figure shows two independent select lines ("Select RA/immediate" and "Select RB/immediate"), so each mux can be controlled separately.

    Full solution
  18. Q.28MSQ · 1 markOfficial answer: D
  19. Q.29NAT · 1 markOfficial answer: 21
  20. Q.30NAT · 1 markOfficial answer: 195
  21. Q.31NAT · 1 markOfficial answer: -2.1 to -1.9
  22. Q.32NAT · 1 markOfficial answer: 0.49 to 0.51
  23. Q.33NAT · 1 markOfficial answer: 435

    Data Structures and Algorithms › Sorting & hashing

    This pseudocode is bubble sort with the comparison A[j] > A[j+1] triggering a swap — the standard scheme that sorts an array into ascending order. When the input is already sorted in the exact opposite (fully descending) order, this is the worst case for bubble sort: every comparison the algorithm ever makes finds a violation and swaps, so the swap count equals the comparison count, which equals the total number of inversions in the array, .

    WATCH OUT FOR

    Confusing "number of comparisons" with "number of swaps" when the array is NOT already sorted the way the algorithm wants: students correctly compute n(n-1)/2 comparisons but then assume swaps must be fewer (e.g. by miscounting how many passes actually trigger a swap), forgetting that a strictly descending input is exactly the worst case for this ascending-sorting bubble sort, where every comparison is also a swap.

    Full solution
  24. Q.34NAT · 1 markOfficial answer: 25

    Programming in C › Pointers & arrays

    foo receives a pointer p and a value x. Since p is a copy of z (i.e., p also holds the address of a), the statement *p = x writes through the pointer directly into a in main, overwriting it with the value of x (a copy of b).

    WATCH OUT FOR

    Confusing pass-by-value with pass-by-reference: assuming that because b (value 25) is passed by value, the assignment inside foo cannot affect the caller's variables — missing that it is the pointer z (holding &a) that is passed, and dereferencing it writes directly into a.

    Full solution
  25. Q.35NAT · 1 markOfficial answer: 5

    Data Structures and Algorithms › Trees & heaps

    A binary heap is stored as a complete binary tree. For nodes, a complete binary tree of height (height = max edges on a root-to-leaf path) satisfies , equivalently .

    WATCH OUT FOR

    Confusing "height" (edges, 0 for a single node) with "number of levels" (which would give for ), or using the wrong bound direction () and getting .

    Full solution
  26. Q.36MCQ · 2 marksOfficial answer: A

    Computer Organization and Architecture › Memory & cache

    In direct-mapped caches, the address splits into Tag | Line Index | Block Offset. The total tag storage for the whole cache is (tag bits per line) × (number of lines) — a per-line quantity, not a fraction of the total address space.

    WATCH OUT FOR

    Computing only the tag width per line (6 bits) and stopping there, or matching it to an option like / by confusing "bits per tag" with "total tag storage across the cache"; also miscounting the number of lines by forgetting to divide cache size by block size before comparing to the address bits.

    Full solution
  27. Q.37MCQ · 2 marksOfficial answer: B

    Computer Organization and Architecture › Instructions & addressing

    Fixed-length instruction encoding: bits for opcode (enough to distinguish all instruction types) plus bits for each explicitly encoded register operand are subtracted from the total instruction width; whatever remains is available for the immediate field.

    WATCH OUT FOR

    Assuming the instruction needs two 6-bit register fields (source and destination) as in a generic three-address or two-address format, which would leave only 14 bits for the immediate and match no option — the given instruction ADD R1, #25 uses R1 as both source and destination, so only one register field is encoded.

    Full solution
  28. Q.38MCQ · 2 marksOfficial answer: A
  29. Q.39MCQ · 2 marksOfficial answer: A
  30. Q.40MCQ · 2 marksOfficial answer: A
  31. Q.41MCQ · 2 marksOfficial answer: D
  32. Q.42MCQ · 2 marksOfficial answer: A
  33. Q.43MCQ · 2 marksOfficial answer: C

    Data Structures and Algorithms › Graph algorithms

    See keyIdea field above.

    WATCH OUT FOR

    See commonMistake field above.

    Full solution
  34. Q.44MCQ · 2 marksOfficial answer: C
  35. Q.45MCQ · 2 marksOfficial answer: C
  36. Q.46MSQ · 2 marksOfficial answer: A, D
  37. Q.47MSQ · 2 marksOfficial answer: B, C
  38. Q.48MSQ · 2 marksOfficial answer: B, D
  39. Q.49MSQ · 2 marksOfficial answer: B
  40. Q.50MSQ · 2 marksOfficial answer: C
  41. Q.51NAT · 2 marksOfficial answer: 65468
  42. Q.52NAT · 2 marksOfficial answer: 6
  43. Q.53NAT · 2 marksOfficial answer: 11.83 to 11.87

    Computer Organization and Architecture › Memory & cache

    When a figure gives each level's access time as "including the miss penalty of the level(s) above," those numbers are already the total time incurred once that level is reached — so AMAT is simply the probability-weighted sum of the three mutually exclusive, exhaustive outcomes (L1 hit; L1 miss & L2 hit; L1 miss & L2 miss), using each stated time directly with no separate addition of the upstream access time.

    WATCH OUT FOR

    Adding a fresh L1-access-time term (10 ns) on top of the already-inclusive L2 and main-memory figures — e.g. computing 0.95×10 + 0.05×0.85×(10+20) + 0.05×0.15×(10+200) — which double-counts the L1 access time, since the figure explicitly states the L2 and main-memory times already include the penalty of the level(s) above missing.

    Full solution
  44. Q.54NAT · 2 marksOfficial answer: 6
  45. Q.55NAT · 2 marksOfficial answer: 26
  46. Q.56NAT · 2 marksOfficial answer: 0.949 to 0.952
  47. Q.57NAT · 2 marksOfficial answer: 7
  48. Q.58NAT · 2 marksOfficial answer: 0.300 to 0.302
  49. Q.59NAT · 2 marksOfficial answer: 5
  50. Q.60NAT · 2 marksOfficial answer: 7 to 8
  51. Q.61NAT · 2 marksOfficial answer: 5

    Programming in C › Recursion

    The function walks the array with a "current index / remaining size" recursion, adding 1 whenever the current element differs from the next one and skipping the count (just recursing on the smaller window) whenever it matches — effectively counting "boundaries" between unequal adjacent elements while chaining through a run of equal ones, until only one element (or zero) is left.

    WATCH OUT FOR

    Losing track of which two elements are being compared at each recursive call (since the array pointer shifts by one each time but the comparison is always between the first two elements of the current window, i.e. positions i and i+1 of the original array), or forgetting that a "match" case still advances the pointer by one without adding to the count — leading to either double-counting or missing a boundary.

    Full solution
  52. Q.62NAT · 2 marksOfficial answer: 5
  53. Q.63NAT · 2 marksOfficial answer: 46

    Programming in C › C basics

    The function alternately drops and keeps digits of n, most-significant first: turn starts false (0) so the leading digit is dropped, then toggles true/false each iteration. For 14362 (digits 1,4,3,6,2 from MSD), digit 1 is dropped, 4 is kept, 3 is dropped, 6 is kept, 2 is dropped, leaving newnum built from 4 then 6 giving 46.

    WATCH OUT FOR

    Forgetting that turn starts at 0 (false) and toggles AFTER each digit is examined, so the loop skips appending the very first (most significant) digit — leading to including digit 1 and wrongly getting 146 instead of 46. Another slip is misjudging where the first while loop stops: it multiplies t until t first EXCEEDS n (t=100000), and only the following t/=10 brings it to the leading digit's place value (10000), not to 1000.

    Full solution
  54. Q.64NAT · 2 marksOfficial answer: 5

    Data Structures and Algorithms › Graph algorithms

    An edge is in every MST exactly when it is the strictly lightest edge crossing some cut. Here that cut is {B, D} versus {A, C}. The other edges crossing it weigh 6, 7 and 8, so B–C must weigh strictly less than 6. The largest integer that works is 5.

    WATCH OUT FOR

    Treating a tie as good enough and answering 6. When x = 6, B–C ties with A–D = 6 across the cut {B, D} | {A, C}. Kruskal's algorithm can then pick A–D instead, which gives an MST without B–C. "Included in SOME MST" allows ties, but "included in EVERY MST" needs a strict inequality.

    Full solution
  55. Q.65NAT · 2 marksOfficial answer: 10 to 11

    Data Structures and Algorithms › Sorting & hashing

    In double hashing, the probe sequence for a key is for ; since never depends on , each key traces a fixed "skip" sequence through the table until it lands on an empty slot.

    WATCH OUT FOR

    Forgetting that once a slot is found occupied, the probe sequence must be recomputed with the next value of i (not restarted or incremented incorrectly), and mixing up which key already occupies a slot — leading students to place 24 in slot 6 or slot 2 by mistake.

    Full solution