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
| Question | Type | Marks | Answer |
|---|---|---|---|
| Q.1 | MCQ | 1 | A |
| Q.2 | MCQ | 1 | D |
| Q.3 | MCQ | 1 | A |
| Q.4 | MCQ | 1 | C |
| Q.5 | MCQ | 1 | A |
| Q.6 | MCQ | 2 | C |
| Q.7 | MCQ | 2 | A |
| Q.8 | MCQ | 2 | C |
| Q.9 | MCQ | 2 | A |
| Q.10 | MCQ | 2 | A |
| Q.11 | MCQ | 1 | D |
| Q.12 | MCQ | 1 | B |
| Q.13 | MCQ | 1 | B |
| Q.14 | MCQ | 1 | B |
| Q.15 | MCQ | 1 | C |
| Q.16 | MCQ | 1 | C |
| Q.17 | MCQ | 1 | A |
| Q.18 | MCQ | 1 | C |
| Q.19 | MCQ | 1 | C |
| Q.20 | MCQ | 1 | D |
| Q.21 | MCQ | 1 | A |
| Q.22 | MSQ | 1 | A, C |
| Q.23 | MSQ | 1 | C, D |
| Q.24 | MSQ | 1 | D |
| Q.25 | MSQ | 1 | B, C |
| Q.26 | MSQ | 1 | A, D |
| Q.27 | MSQ | 1 | B, C |
| Q.28 | MSQ | 1 | A, C |
| Q.29 | MSQ | 1 | A, D |
| Q.30 | MSQ | 1 | A, B, C |
| Q.31 | MSQ | 1 | A, C |
| Q.32 | NAT | 1 | 2 |
| Q.33 | NAT | 1 | 6 |
| Q.34 | NAT | 1 | 16 |
| Q.35 | NAT | 1 | 2 |
| Q.36 | MCQ | 2 | B |
| Q.37 | MCQ | 2 | A |
| Q.38 | MCQ | 2 | A |
| Q.39 | MCQ | 2 | D |
| Q.40 | MCQ | 2 | A |
| Q.41 | MCQ | 2 | D |
| Q.42 | MCQ | 2 | A |
| Q.43 | MCQ | 2 | A |
| Q.44 | MSQ | 2 | B, C, D |
| Q.45 | MSQ | 2 | C |
| Q.46 | MSQ | 2 | B, C, D |
| Q.47 | MSQ | 2 | A, B |
| Q.48 | MSQ | 2 | B, D |
| Q.49 | MSQ | 2 | A |
| Q.50 | MSQ | 2 | B, C |
| Q.51 | MSQ | 2 | B, C |
| Q.52 | MSQ | 2 | B, D |
| Q.53 | MSQ | 2 | B, C |
| Q.54 | NAT | 2 | 4096 |
| Q.55 | NAT | 2 | 3 |
| Q.56 | NAT | 2 | 3.00 |
| Q.57 | NAT | 2 | 14 |
| Q.58 | NAT | 2 | 40 |
| Q.59 | NAT | 2 | 179 |
| Q.60 | NAT | 2 | 60 |
| Q.61 | NAT | 2 | 44 |
| Q.62 | NAT | 2 | 6596 |
| Q.63 | NAT | 2 | 0.370 to 0.380 |
| Q.64 | NAT | 2 | 4 |
| Q.65 | NAT | 2 | 6 |
General Aptitude Q.1 to Q.10
- Q.1MCQ · 1 markOfficial answer: A
- Q.2MCQ · 1 markOfficial answer: D
- Q.3MCQ · 1 markOfficial answer: A
- Q.4MCQ · 1 markOfficial answer: C
- Q.5MCQ · 1 markOfficial answer: A
- Q.6MCQ · 2 marksOfficial answer: C
- Q.7MCQ · 2 marksOfficial answer: A
- Q.8MCQ · 2 marksOfficial answer: C
- Q.9MCQ · 2 marksOfficial answer: A
- Q.10MCQ · 2 marksOfficial answer: A
Computer Science and Information Technology Q.11 to Q.65
- Q.11MCQ · 1 markOfficial answer: D
- Q.12MCQ · 1 markOfficial answer: B
- Q.13MCQ · 1 markOfficial answer: B
- Q.14MCQ · 1 markOfficial answer: B
- 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 FORFull solutionConfusing "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.
- Q.16MCQ · 1 markOfficial answer: C
- 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 FORFull solutionAssuming 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.
- Q.18MCQ · 1 markOfficial answer: C
Integer division truncates toward zero in C, so once
abecomes small (≤ 11),a / 12always evaluates to 0 andacollapses to the fixed point 1; sincebis never modified, the loop state never changes and the loop cannot terminate.WATCH OUT FORFull solutionAssuming
awill eventually grow toward 10 because of the+= bstep, without noticing thatbis initialized to 0 and never updated anywhere in the program, so it contributes nothing andais permanently trapped at 1 after the first iteration. - Q.19MCQ · 1 markOfficial answer: C
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 FORFull solutionExpecting 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.
- Q.20MCQ · 1 markOfficial answer: D
- Q.21MCQ · 1 markOfficial answer: A
- Q.22MSQ · 1 markOfficial answer: A, C
- Q.23MSQ · 1 markOfficial answer: C, D
- Q.24MSQ · 1 markOfficial answer: D
- Q.25MSQ · 1 markOfficial answer: B, C
- Q.26MSQ · 1 markOfficial answer: A, D
- Q.27MSQ · 1 markOfficial answer: B, C
- Q.28MSQ · 1 markOfficial answer: A, C
- Q.29MSQ · 1 markOfficial answer: A, D
- 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 FORFull solutionAssuming 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).
- Q.31MSQ · 1 markOfficial answer: A, C
- Q.32NAT · 1 markOfficial answer: 2
- Q.33NAT · 1 markOfficial answer: 6
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 FORFull solutionAssuming "+" 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.
- Q.34NAT · 1 markOfficial answer: 16
- Q.35NAT · 1 markOfficial answer: 2
- Q.36MCQ · 2 marksOfficial answer: B
- Q.37MCQ · 2 marksOfficial answer: A
- Q.38MCQ · 2 marksOfficial answer: A
- Q.39MCQ · 2 marksOfficial answer: D
- Q.40MCQ · 2 marksOfficial answer: A
- 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 FORFull solutionSifting 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.
- 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 FORFull solutionStopping after finding and forgetting to re-substitute into the -side, so students report (option B) instead of correctly reducing to get .
- 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 FORFull solutionAssuming 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.
- Q.44MSQ · 2 marksOfficial answer: B, C, D
- 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 FORFull solutionAssuming 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.
- Q.46MSQ · 2 marksOfficial answer: B, C, D
- Q.47MSQ · 2 marksOfficial answer: A, B
- Q.48MSQ · 2 marksOfficial answer: B, D
The loop runs exactly times, and each iteration replaces
xbyx=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 FORFull solutionReading
x=x+x+yasx = 2xand forgetting the+yterm 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 ). - Q.49MSQ · 2 marksOfficial answer: A
- Q.50MSQ · 2 marksOfficial answer: B, C
- Q.51MSQ · 2 marksOfficial answer: B, C
- Q.52MSQ · 2 marksOfficial answer: B, D
- 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 FORFull solutionAssuming 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.
- 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 FORFull solutionForgetting 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.
- Q.55NAT · 2 marksOfficial answer: 3
- 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 FORFull solutionApplying 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.
- Q.57NAT · 2 marksOfficial answer: 14
- Q.58NAT · 2 marksOfficial answer: 40
- Q.59NAT · 2 marksOfficial answer: 179
- 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 FORFull solutionTreating 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 .
- Q.61NAT · 2 marksOfficial answer: 44
- Q.62NAT · 2 marksOfficial answer: 6596
- Q.63NAT · 2 marksOfficial answer: 0.370 to 0.380
- Q.64NAT · 2 marksOfficial answer: 4
- Q.65NAT · 2 marksOfficial answer: 6