IAE Academy

PAPERS · GATE CS

GATE CSE 2024 Set 1 question paper with solutions

All 65 questions of the GATE 2024 Set 1 Computer Science and Information Technology paper, in order, with the official answer key from IISc Bengaluru. 15 have a full solution.

questions · 100 marks
65questions · 100 marks
with a full solution
15with a full solution
question types
29 MCQ · 20 MSQ · 16 NATquestion types

GATE CSE 2024 Set 1 answer key

Official answers to every question of GATE CSE 2024 Set 1
QuestionTypeMarksAnswer
Q.1MCQ1A
Q.2MCQ1D
Q.3MCQ1A
Q.4MCQ1C
Q.5MCQ1A
Q.6MCQ2C
Q.7MCQ2A
Q.8MCQ2C
Q.9MCQ2A
Q.10MCQ2A
Q.11MCQ1D
Q.12MCQ1B
Q.13MCQ1B
Q.14MCQ1B
Q.15MCQ1C
Q.16MCQ1C
Q.17MCQ1A
Q.18MCQ1C
Q.19MCQ1C
Q.20MCQ1D
Q.21MCQ1A
Q.22MSQ1A, C
Q.23MSQ1C, D
Q.24MSQ1D
Q.25MSQ1B, C
Q.26MSQ1A, D
Q.27MSQ1B, C
Q.28MSQ1A, C
Q.29MSQ1A, D
Q.30MSQ1A, B, C
Q.31MSQ1A, C
Q.32NAT12
Q.33NAT16
Q.34NAT116
Q.35NAT12
Q.36MCQ2B
Q.37MCQ2A
Q.38MCQ2A
Q.39MCQ2D
Q.40MCQ2A
Q.41MCQ2D
Q.42MCQ2A
Q.43MCQ2A
Q.44MSQ2B, C, D
Q.45MSQ2C
Q.46MSQ2B, C, D
Q.47MSQ2A, B
Q.48MSQ2B, D
Q.49MSQ2A
Q.50MSQ2B, C
Q.51MSQ2B, C
Q.52MSQ2B, D
Q.53MSQ2B, C
Q.54NAT24096
Q.55NAT23
Q.56NAT23.00
Q.57NAT214
Q.58NAT240
Q.59NAT2179
Q.60NAT260
Q.61NAT244
Q.62NAT26596
Q.63NAT20.370 to 0.380
Q.64NAT24
Q.65NAT26

General Aptitude Q.1 to Q.10

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

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

  1. Q.11MCQ · 1 markOfficial answer: D
  2. Q.12MCQ · 1 markOfficial answer: B
  3. Q.13MCQ · 1 markOfficial answer: B
  4. Q.14MCQ · 1 markOfficial answer: B
  5. Q.15MCQ · 1 markOfficial answer: C

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

    Compare each option against standard I/O/DMA facts: cycle stealing (one word per stolen cycle), burst mode (higher throughput than cycle stealing for bulk transfer), programmed I/O (CPU busy-waits, so WORSE utilization than interrupt-driven I/O — this inverts the fact, making it the false statement), and vectored interrupts (faster ISR dispatch than non-vectored, which needs a polling/query sequence).

    WATCH OUT FOR

    Confusing "faster/simpler to implement" with "better CPU utilization" — programmed I/O is simpler but wastes CPU cycles polling, so it has WORSE utilization than interrupt-driven I/O, not better.

    Full solution
  6. Q.16MCQ · 1 markOfficial answer: C
  7. Q.17MCQ · 1 markOfficial answer: A

    Data Structures and Algorithms › Complexity

    A single pass over an N-element array that only compares adjacent pairs makes at most N-1 comparisons, so the running time is bounded above by O(N) in every case. In the worst case (e.g. an array that actually is sorted, or one whose only violation is at the very last adjacent pair) the algorithm cannot conclude the answer without inspecting every adjacent pair, so it must also perform Omega(N) work. A bound that is simultaneously O(N) and Omega(N) is Theta(N), so the worst-case complexity satisfies both O(N) and Omega(N).

    WATCH OUT FOR

    Assuming that because the algorithm might exit early on finding a violation, its worst-case lower bound could be less than Omega(N) — but the worst case includes inputs (e.g. an already-sorted array) where no early exit is possible, forcing all N-1 comparisons, so the lower bound Omega(N) still holds for the worst case.

    Full solution
  8. Q.18MCQ · 1 markOfficial answer: C

    Programming in C › C basics

    Integer division truncates toward zero in C, so once a becomes small (≤ 11), a / 12 always evaluates to 0 and a collapses to the fixed point 1; since b is never modified, the loop state never changes and the loop cannot terminate.

    WATCH OUT FOR

    Assuming a will eventually grow toward 10 because of the += b step, without noticing that b is initialized to 0 and never updated anywhere in the program, so it contributes nothing and a is permanently trapped at 1 after the first iteration.

    Full solution
  9. Q.19MCQ · 1 markOfficial answer: C

    Programming in C › Recursion

    Each call keeps its own local character and prints it only after the deeper call returns, so characters read left to right are printed right to left: the recursion reverses the input.

    WATCH OUT FOR

    Expecting the characters in the order they were read (1234, option D), or thinking the newline stops all output (option B). The newline only stops the recursion and is itself never printed; every earlier call still prints its own character on the way back.

    Full solution
  10. Q.20MCQ · 1 markOfficial answer: D
  11. Q.21MCQ · 1 markOfficial answer: A
  12. Q.22MSQ · 1 markOfficial answer: A, C
  13. Q.23MSQ · 1 markOfficial answer: C, D
  14. Q.24MSQ · 1 markOfficial answer: D
  15. Q.25MSQ · 1 markOfficial answer: B, C
  16. Q.26MSQ · 1 markOfficial answer: A, D
  17. Q.27MSQ · 1 markOfficial answer: B, C
  18. Q.28MSQ · 1 markOfficial answer: A, C
  19. Q.29MSQ · 1 markOfficial answer: A, D
  20. Q.30MSQ · 1 markOfficial answer: A, B, C

    Computer Organization and Architecture › Pipelining

    Forwarding (bypassing) routes a computed result directly from the pipeline stage that produces it to the pipeline stage that needs it, bypassing the register file/writeback, but it needs dedicated bypass wires, multiplexers, and forwarding-unit control logic, and it still cannot eliminate a load-use hazard (where the needed value does not exist yet when the dependent instruction reaches EX).

    WATCH OUT FOR

    Assuming forwarding is a "free" software-level trick with no hardware cost (missing why D is false), or assuming forwarding alone eliminates every stall and forgetting the load-use hazard, which still forces at least one bubble even with full forwarding (which is why C is true, not false).

    Full solution
  21. Q.31MSQ · 1 markOfficial answer: A, C
  22. Q.32NAT · 1 markOfficial answer: 2
  23. Q.33NAT · 1 markOfficial answer: 6

    Programming in C › C basics

    Precedence decides which operator's operand-groups are formed first (tighter binding = evaluated/collapsed first); the lowest-precedence operator present at any level is the one whose split happens outermost/last. Associativity only matters for resolving a chain of equal-precedence operators.

    WATCH OUT FOR

    Assuming "+" being listed first / "Highest" automatically means it is evaluated last (as in standard math where low precedence like + is outermost); here the table explicitly reassigns precedence so + is tightest-binding and / is loosest-binding — using everyday PEMDAS intuition instead of the table gives a different (wrong) grouping and answer.

    Full solution
  24. Q.34NAT · 1 markOfficial answer: 16
  25. Q.35NAT · 1 markOfficial answer: 2
  26. Q.36MCQ · 2 marksOfficial answer: B
  27. Q.37MCQ · 2 marksOfficial answer: A
  28. Q.38MCQ · 2 marksOfficial answer: A
  29. Q.39MCQ · 2 marksOfficial answer: D
  30. Q.40MCQ · 2 marksOfficial answer: A
  31. Q.41MCQ · 2 marksOfficial answer: D

    Data Structures and Algorithms › Trees & heaps

    Building a max-heap from an unordered array (Floyd's build-heap / bottom-up heapify) processes nodes from the last internal node (index ) down to the root (index 0), sift-down (percolate-down) each one against its children, swapping with the larger child whenever a child exceeds the parent, and continuing the sift-down at the new position until no child is larger.

    WATCH OUT FOR

    Sifting down only once per node instead of continuing the sift-down after a swap (e.g. stopping after swapping index 0 with index 1 without also sifting the displaced value further down through index 4), or processing nodes top-down instead of bottom-up, both of which leave the heap property violated deeper in the tree and can change which elements land at the top.

    Full solution
  32. Q.42MCQ · 2 marksOfficial answer: A

    Data Structures and Algorithms › Complexity

    A recurrence with a argument is solved by the double substitution (turning into a halving of ), then dividing through by the multiplicative factor so the recurrence becomes a plain additive one in , solvable directly or via the Master theorem.

    WATCH OUT FOR

    Stopping after finding and forgetting to re-substitute into the -side, so students report (option B) instead of correctly reducing to get .

    Full solution
  33. Q.43MCQ · 2 marksOfficial answer: A

    Data Structures and Algorithms › Trees & heaps

    In a min-heap the maximum element can never occupy any internal (non-leaf) node, because every internal node is each of its children, so a node with a child cannot hold the overall maximum; hence the maximum must sit at some leaf, and every leaf position is achievable by some valid heap on the multiset.

    WATCH OUT FOR

    Assuming the maximum must be at the "last" leaf or at one of the two children of the root (confusing max-heap intuition), or miscounting leaves by using instead of for the boundary between internal nodes and leaves, or forgetting to check that every leaf position, not just some of them, is actually achievable.

    Full solution
  34. Q.44MSQ · 2 marksOfficial answer: B, C, D
  35. Q.45MSQ · 2 marksOfficial answer: C

    Data Structures and Algorithms › Graph algorithms

    When one tree is simultaneously a DFS tree and a BFS tree rooted at v, tree-depth equals BFS-level for every vertex. The BFS invariant level(w) ≤ level(u)+1 (for every edge (u,w) of G) then rules out forward edges outright, since a forward edge would force level(w) ≥ level(u)+2 — but it does not rule out back edges or cross edges, both of which are easy to realize with an explicit small graph.

    WATCH OUT FOR

    Assuming that once T is forced to be both the DFS and BFS tree, ALL non-tree edges are excluded (picking only C, or picking C together with A on the mistaken belief that DFS-of-a-tree-that-is-also-BFS can only ever have back edges). The safe check is to actually build a small counterexample graph and see which of A, B, D can be made false — only the forward-edge argument (C) is a genuine, unconditional proof; A, B and D each need — and have — explicit counterexamples.

    Full solution
  36. Q.46MSQ · 2 marksOfficial answer: B, C, D
  37. Q.47MSQ · 2 marksOfficial answer: A, B
  38. Q.48MSQ · 2 marksOfficial answer: B, D

    Programming in C › C basics

    The loop runs exactly times, and each iteration replaces x by x=x+x+y, i.e. the linear recurrence . Unrolling this recurrence gives a closed form , which lets every option be checked by a single arithmetic comparison instead of by re-running the loop by hand.

    WATCH OUT FOR

    Reading x=x+x+y as x = 2x and forgetting the +y term each iteration (or, symmetrically, treating the recurrence as instead of ), which changes the growth rate and can flip (D) to false when it is actually true; also common is comparing the final value to instead of the specific power asked for in each option (e.g. checking against for option A instead of ).

    Full solution
  39. Q.49MSQ · 2 marksOfficial answer: A
  40. Q.50MSQ · 2 marksOfficial answer: B, C
  41. Q.51MSQ · 2 marksOfficial answer: B, C
  42. Q.52MSQ · 2 marksOfficial answer: B, D
  43. Q.53MSQ · 2 marksOfficial answer: B, C

    Computer Organization and Architecture › Memory & cache

    In a write-back cache, memory is updated only when a dirty (modified) block is evicted, so the cache's dirty bit tracks which blocks are out of sync with memory; in a write-through cache every write goes to memory immediately, so no cache block is ever dirty and eviction never needs a write-back.

    WATCH OUT FOR

    Assuming LRU somehow "protects" dirty blocks from being chosen as the eviction victim on a read miss (it does not — LRU picks purely by recency, so a dirty block can absolutely be evicted, triggering a write-back first), and conversely forgetting that in write-through caches no block is ever dirty, so eviction is a silent, cost-free operation with respect to memory.

    Full solution
  44. Q.54NAT · 2 marksOfficial answer: 4096

    Computer Organization and Architecture › Memory & cache

    Disk capacity factors as (cylinders) × (surfaces, i.e. tracks per cylinder) × (sectors per track) × (bytes per sector). Compute bytes per track, multiply by the number of surfaces to get bytes per cylinder (across all surfaces), then divide total capacity by that to get the number of cylinders — keeping everything in powers of 2 avoids arithmetic slips.

    WATCH OUT FOR

    Forgetting to divide by the number of surfaces (computing cylinders as total bytes ÷ bytes-per-track only, i.e. treating the disk as single-surface), or using 1 GB = 10^9 bytes instead of the GATE convention 2^30 bytes, both of which give a wrong power of two.

    Full solution
  45. Q.55NAT · 2 marksOfficial answer: 3
  46. Q.56NAT · 2 marksOfficial answer: 3.00

    Computer Organization and Architecture › Memory & cache

    Memory stall cycles per instruction are added on top of the ideal (memory-stall-free) CPI to get the real CPI; speedup from a perfect cache is the ratio of real CPI to ideal CPI, since clock rate and instruction count are unchanged.

    WATCH OUT FOR

    Applying the data-cache miss rate to every instruction instead of scaling it by the 25% load/store fraction (or forgetting to add both instruction-cache and data-cache stalls), which gives a wrong real CPI and hence a wrong speedup.

    Full solution
  47. Q.57NAT · 2 marksOfficial answer: 14
  48. Q.58NAT · 2 marksOfficial answer: 40
  49. Q.59NAT · 2 marksOfficial answer: 179
  50. Q.60NAT · 2 marksOfficial answer: 60

    Data Structures and Algorithms › Graph algorithms

    A DFS (or BFS) traversal of an undirected graph produces a spanning forest with exactly one tree per connected component, and a spanning tree on vertices has exactly edges.

    WATCH OUT FOR

    Treating the graph's total edge count as equal to the forest's edge count (ignoring that non-tree/back edges are excluded from the DFS forest), or forgetting the per component and computing instead of .

    Full solution
  51. Q.61NAT · 2 marksOfficial answer: 44
  52. Q.62NAT · 2 marksOfficial answer: 6596
  53. Q.63NAT · 2 marksOfficial answer: 0.370 to 0.380
  54. Q.64NAT · 2 marksOfficial answer: 4
  55. Q.65NAT · 2 marksOfficial answer: 6