GATE CSE 2024 — Previous Year Questions
Real questions from the 2024 paper with options and answers. Take a timed test →
54 questions · page 1 of 3
Q1 · Computer Science & IT
Let 𝑓: ℝ → ℝ be a function such that 𝑓(𝑥) = max{𝑥, 𝑥3}, 𝑥 ∈ ℝ , where ℝ is the set of all real numbers. The set of all points where 𝑓(𝑥) is NOT differentiable is- A.{−1, 1, 2}
- B.{−2, −1, 1}
- C.{0, 1}
- D.{−1, 0, 1}
Show answer / उत्तर देखें
Answer: D {−1, 0, 1}
Official GATE 2024 answer key: (D).Q2 · Computer Science & IT
The product of all eigenvalues of the matrix [ 1 2 3 4 5 6 7 8 9 ] is- A.−1
- B.0
- C.1
- D.2
Show answer / उत्तर देखें
Answer: B 0
Official GATE 2024 answer key: (B).Q3 · Computer Science & IT
Consider a system that uses 5 bits for representing signed integers in 2’s complement format. In this system, two integers 𝐴 and 𝐵 are represented as 𝐴=01010 and 𝐵=11010. Which one of the following operations will result in either an arithmetic overflow or an arithmetic underflow?- A.𝐴 + 𝐵
- B.𝐴 − 𝐵
- C.𝐵 − 𝐴
- D.2 ∗ 𝐵
Show answer / उत्तर देखें
Answer: B 𝐴 − 𝐵
Official GATE 2024 answer key: (B).Q4 · Computer Science & IT
Consider a permutation sampled uniformly at random from the set of all permutations of {1, 2, 3, ⋯ , 𝑛} for some 𝑛 ≥ 4. Let 𝑋 be the event that 1 occurs before 2 in the permutation, and 𝑌 the event that 3 occurs before 4. Which one of the following statements is TRUE?- A.The events 𝑋 and 𝑌 are mutually exclusive
- B.The events 𝑋 and 𝑌 are independent
- C.Either event 𝑋 or 𝑌 must occur
- D.Event 𝑋 is more likely than event 𝑌
Show answer / उत्तर देखें
Answer: B The events 𝑋 and 𝑌 are independent
Official GATE 2024 answer key: (B).Q5 · Computer Science & IT
A user starts browsing a webpage hosted at a remote server. The browser opens a single TCP connection to fetch the entire webpage from the server. The webpage consists of a top-level index page with multiple embedded image objects. Assume that all caches (e.g., DNS cache, browser cache) are all initially empty. The following packets leave the user’s computer in some order. (i) HTTP GET request for the index page (ii) DNS request to resolve the web server’s name to its IP address (iii) HTTP GET request for an image object (iv) TCP SYN to open a connection to the web server Which one of the following is the CORRECT chronological order (earliest in time to latest) of the packets leaving the computer ?- A.(iv), (ii), (iii), (i)
- B.(ii), (iv), (iii), (i)
- C.(ii), (iv), (i), (iii)
- D.(iv), (ii), (i), (iii)
Show answer / उत्तर देखें
Answer: C (ii), (iv), (i), (iii)
Official GATE 2024 answer key: (C).Q6 · Computer Science & IT
Given an integer array of size N, we want to check if the array is sorted (in either ascending or descending order). An algorithm solves this problem by making a single pass through the array and comparing each element of the array only with its adjacent elements. The worst-case time complexity of this algorithm is- A.both Ο(𝑁) and Ω(𝑁)
- B.Ο(𝑁) but not Ω(𝑁)
- C.Ω(𝑁) but not Ο(𝑁)
- D.neither Ο(𝑁) nor Ω(𝑁)
Show answer / उत्तर देखें
Answer: A both Ο(𝑁) and Ω(𝑁)
Official GATE 2024 answer key: (A).Q7 · Computer Science & IT
Consider the following C program: #include <stdio.h> int main(){ int a = 6; int b = 0; while(a < 10) { a = a / 12 + 1; a += b;} printf(”%d”, a); return 0;} Which one of the following statements is CORRECT?- A.The program prints 9 as output
- B.The program prints 10 as output
- C.The program gets stuck in an infinite loop
- D.The program prints 6 as output
Show answer / उत्तर देखें
Answer: C The program gets stuck in an infinite loop
Official GATE 2024 answer key: (C).Q8 · Computer Science & IT
Consider the following C program: #include <stdio.h> void fX(); int main(){ fX(); return 0;} void fX(){ char a; if((a=getchar()) != ’\n’) fX(); if(a != ’\n’) putchar(a);} Assume that the input to the program from the command line is 1234 followed by a newline character. Which one of the following statements is CORRECT?- A.The program will not terminate
- B.The program will terminate with no output
- C.The program will terminate with 4321 as output
- D.The program will terminate with 1234 as output
Show answer / उत्तर देखें
Answer: C The program will terminate with 4321 as output
Official GATE 2024 answer key: (C).Q9 · Computer Science & IT
Let S be the specification: "Instructors teach courses. Students register for courses. Courses are allocated classrooms. Instructors guide students." Which one of the following ER diagrams CORRECTLY represents S?- A.(i)
- B.(ii)
- C.(iii)
- D.(iv)
Show answer / उत्तर देखें
Answer: D (iv)
Official GATE 2024 answer key: (D).Q10 · Computer Science & IT
In a B+ tree, the requirement of at least half-full (50%) node occupancy is relaxed for which one of the following cases?- A.Only the root node
- B.All leaf nodes
- C.All internal nodes
- D.Only the leftmost leaf node
Show answer / उत्तर देखें
Answer: A Only the root node
Official GATE 2024 answer key: (A).Q11 · Computer Science & IT
Consider a network path P—Q—R between nodes P and R via router Q. Node P sends a file of size 106 bytes to R via this path by splitting the file into chunks of 103 bytes each. Node P sends these chunks one after the other without any wait time between the successive chunk transmissions. Assume that the size of extra headers added to these chunks is negligible, and that the chunk size is less than the MTU. Each of the links P—Q and Q—R has a bandwidth of 106 bits/sec, and negligible propagation latency. Router Q immediately transmits every packet it receives from P to R, with negligible processing and queueing delays. Router Q can simultaneously receive on link P—Q and transmit on link Q—R. Assume P starts transmitting the chunks at time 𝑡 = 0. Which one of the following options gives the time (in seconds, rounded off to 3 decimal places) at which R receives all the chunks of the file?- A.8.000
- B.8.008
- C.15.992
- D.16.000
Show answer / उत्तर देखें
Answer: B 8.008
Official GATE 2024 answer key: (B).Q12 · Computer Science & IT
Consider the following syntax-directed definition (SDD). 𝑆 → 𝐷𝐻𝑇𝑈 { 𝑆. 𝑣𝑎𝑙 = 𝐷. 𝑣𝑎𝑙 + 𝐻. 𝑣𝑎𝑙 + 𝑇. 𝑣𝑎𝑙 + 𝑈. 𝑣𝑎𝑙; } 𝐷 → "M"𝐷1 { 𝐷. 𝑣𝑎𝑙 = 5 + 𝐷1. 𝑣𝑎𝑙; } 𝐷 → 𝜖 { 𝐷. 𝑣𝑎𝑙 = −5; } 𝐻 → "L"𝐻1 { 𝐻. 𝑣𝑎𝑙 = 5 ∗ 10 + 𝐻1. 𝑣𝑎𝑙; } 𝐻 → 𝜖 { 𝐻. 𝑣𝑎𝑙 = −10; } 𝑇 → "C"𝑇1 { 𝑇. 𝑣𝑎𝑙 = 5 ∗ 100 + 𝑇1. 𝑣𝑎𝑙; } 𝑇 → 𝜖 { 𝑇. 𝑣𝑎𝑙 = −5; } 𝑈 → "K" { 𝑈. 𝑣𝑎𝑙 = 5; } Given "MMLK" as the input, which one of the following options is the CORRECT value computed by the SDD (in the attribute 𝑆. 𝑣𝑎𝑙)?- A.45
- B.50
- C.55
- D.65
Show answer / उत्तर देखें
Answer: A 45
Official GATE 2024 answer key: (A).Q13 · Computer Science & IT
Consider the following grammar 𝐺, with 𝑆 as the start symbol. The grammar 𝐺 has three incomplete productions denoted by (1), (2), and (3). 𝑆 → 𝑑𝑎𝑇 | (1) 𝑇 → 𝑎𝑆 | 𝑏𝑇 | (2) 𝑅 → (3) | 𝜖 The set of terminals is {𝑎, 𝑏, 𝑐, 𝑑, 𝑓}. The FIRST and FOLLOW sets of the different non-terminals are as follows. FIRST(𝑆) = {𝑐, 𝑑, 𝑓}, FIRST(𝑇) = {𝑎, 𝑏, 𝜖}, FIRST(𝑅) = {𝑐, 𝜖} FOLLOW(𝑆) = FOLLOW(𝑇) = {𝑐, 𝑓, $}, FOLLOW(𝑅) = {𝑓} Which one of the following options CORRECTLY fills in the incomplete productions?- A.(1) 𝑆 → 𝑅𝑓 (2) 𝑇 → 𝜖 (3) 𝑅 → 𝑐𝑇𝑅
- B.(1) 𝑆 → 𝑓𝑅 (2) 𝑇 → 𝜖 (3) 𝑅 → 𝑐𝑇𝑅
- C.(1) 𝑆 → 𝑓𝑅 (2) 𝑇 → 𝑐𝑇 (3) 𝑅 → 𝑐𝑅
- D.(1) 𝑆 → 𝑅𝑓 (2) 𝑇 → 𝑐𝑇 (3) 𝑅 → 𝑐𝑅
Show answer / उत्तर देखें
Answer: A (1) 𝑆 → 𝑅𝑓 (2) 𝑇 → 𝜖 (3) 𝑅 → 𝑐𝑇𝑅
Official GATE 2024 answer key: (A).Q14 · Computer Science & IT
Consider the following pseudo-code. 𝐿1: 𝑡1 = −1 𝐿2: 𝑡2 = 0 𝐿3: 𝑡3 = 0 𝐿4: 𝑡4 = 4 ∗ 𝑡3 𝐿5: 𝑡5 = 4 ∗ 𝑡2 𝐿6: 𝑡6 = 𝑡5 ∗ 𝑀 𝐿7: 𝑡7 = 𝑡4 + 𝑡6 𝐿8: 𝑡8 = 𝑎[𝑡7] 𝐿9: if 𝑡8 <= 𝑚𝑎𝑥 goto 𝐿11 𝐿10: 𝑡1 = 𝑡8 𝐿11: 𝑡3 = 𝑡3 + 1 𝐿12: if 𝑡3 < 𝑀 goto 𝐿4 𝐿13: 𝑡2 = 𝑡2 + 1 𝐿14: if 𝑡2 < 𝑁 goto 𝐿3 𝐿15: 𝑚𝑎𝑥 = 𝑡1 Which one of the following options CORRECTLY specifies the number of basic blocks and the number of instructions in the largest basic block, respectively ?- A.6 and 6
- B.6 and 7
- C.7 and 7
- D.7 and 6
Show answer / उत्तर देखें
Answer: D 7 and 6
Official GATE 2024 answer key: (D).Q15 · Computer Science & IT
Consider the following two threads T1 and T2 that update two shared variables a and b. Assume that initially a = b = 1. Though context switching between threads can happen at any time, each statement of T1 or T2 is executed atomically without interruption. T1 T2 a = a + 1; b = 2 * b; b = b + 1; a = 2 * a; Which one of the following options lists all the possible combinations of values of a and b after both T1 and T2 finish execution?- A.(a = 4, b = 4); (a = 3, b = 3); (a = 4, b = 3)
- B.(a = 3, b = 4); (a = 4, b = 3); (a = 3, b = 3)
- C.(a = 4, b = 4); (a = 4, b = 3); (a = 3, b = 4)
- D.(a = 2, b = 2); (a = 2, b = 3); (a = 3, b = 4)
Show answer / उत्तर देखें
Answer: A (a = 4, b = 4); (a = 3, b = 3); (a = 4, b = 3)
Official GATE 2024 answer key: (A).Q16 · Computer Science & IT
An array [82, 101, 90, 11, 111, 75, 33, 131, 44, 93] is heapified. Which one of the following options represents the first three elements in the heapified array?- A.82, 90, 101
- B.82, 11, 93
- C.131, 11, 93
- D.131, 111, 90
Show answer / उत्तर देखें
Answer: D 131, 111, 90
Official GATE 2024 answer key: (D).Q17 · Computer Science & IT
Consider the following recurrence relation: 𝑇(𝑛) = {√𝑛𝑇(√𝑛) + 𝑛 for 𝑛 ≥ 1, 1 for 𝑛 = 1. Which one of the following options is CORRECT?- A.𝑇(𝑛) = Θ(𝑛 log log 𝑛)
- B.𝑇(𝑛) = Θ(𝑛 log 𝑛)
- C.𝑇(𝑛) = Θ(𝑛2 log 𝑛)
- D.𝑇(𝑛) = Θ(𝑛2 log log 𝑛)
Show answer / उत्तर देखें
Answer: A 𝑇(𝑛) = Θ(𝑛 log log 𝑛)
Official GATE 2024 answer key: (A).Q18 · Computer Science & IT
Consider a binary min-heap containing 105 distinct elements. Let 𝑘 be the index (in the underlying array) of the maximum element stored in the heap. The number of possible values of 𝑘 is- A.53
- B.52
- C.27
- D.1
Show answer / उत्तर देखें
Answer: A 53
Official GATE 2024 answer key: (A).Q19 · Computer Science & IT
Consider a computer with a 4 MHz processor. Its DMA controller can transfer 8 bytes in 1 cycle from a device to main memory through cycle stealing at regular intervals. Which one of the following is the data transfer rate (in bits per second) of the DMA controller if 1% of the processor cycles are used for DMA?- A.2,56,000
- B.3,200
- C.25,60,000
- D.32,000
Show answer / उत्तर देखें
Answer: C 25,60,000
Official GATE 2024 answer key: (C).Q20 · Computer Science & IT
Let 𝑝 and 𝑞be the following propositions: 𝑝: Fail grade can be given. 𝑞: Student scores more than 50% marks. Consider the statement: “Fail grade cannot be given when student scores more than 50% marks.” Which one of the following is the CORRECT representation of the above statement in propositional logic?- A.𝑞 → ¬𝑝
- B.𝑞 → 𝑝
- C.𝑝 → 𝑞
- D.¬𝑝 → 𝑞
Show answer / उत्तर देखें
Answer: A 𝑞 → ¬𝑝
Official GATE 2024 answer key: (A).Q21 · Computer Science & IT
Consider the following C program. Assume parameters to a function are evaluated from right to left. #include <stdio.h> int g(int p) { printf("%d", p); return p; } int h(int q) { printf("%d", q); return q; } void f(int x, int y) { g(x); h(y); } int main() { f(g(10),h(20)); } Which one of the following options is the CORRECT output of the above C program?- A.20101020
- B.10202010
- C.20102010
- D.10201020
Show answer / उत्तर देखें
Answer: A 20101020
Official GATE 2024 answer key: (A).Q22 · Computer Science & IT
The format of a single-precision floating-point number as per the IEEE 754 standard is: Sign (1bit) Exponent (8 bits) Mantissa (23 bits) Choose the largest floating-point number among the following options.- A.Sign Exponent Mantissa 0 0111 1111 1111 1111 1111 1111 1111 111
- B.Sign Exponent Mantissa 0 1111 1110 1111 1111 1111 1111 1111 111
- C.Sign Exponent Mantissa 0 1111 1111 1111 1111 1111 1111 1111 111
- D.Sign Exponent Mantissa 0 0111 1111 0000 0000 0000 0000 0000 000
Show answer / उत्तर देखें
Answer: B Sign Exponent Mantissa 0 1111 1110 1111 1111 1111 1111 1111 111
Official GATE 2024 answer key: (B).Q23 · Computer Science & IT
Let 𝑇(𝑛) be the recurrence relation defined as follows: 𝑇(0) = 1, 𝑇(1) = 2, and 𝑇(𝑛) = 5𝑇(𝑛 − 1) − 6𝑇(𝑛 − 2) for 𝑛 ≥ 2 Which one of the following statements is TRUE?- A.𝑇(𝑛) = Θ(2𝑛)
- B.𝑇(𝑛) = Θ(𝑛2𝑛)
- C.𝑇(𝑛) = Θ(3𝑛)
- D.𝑇(𝑛) = Θ(𝑛3𝑛)
Show answer / उत्तर देखें
Answer: A 𝑇(𝑛) = Θ(2𝑛)
Official GATE 2024 answer key: (A).Q24 · Computer Science & IT
Let 𝑓(𝑥) be a continuous function from ℝ to ℝ such that 𝑓(𝑥) = 1 − 𝑓(2 − 𝑥) Which one of the following options is the CORRECT value of ∫ 𝑓(𝑥)𝑑𝑥 2 0 ?- A.0
- B.1
- C.2
- D.−1
Show answer / उत्तर देखें
Answer: B 1
Official GATE 2024 answer key: (B).Q25 · Computer Science & IT
Let 𝐴 be the adjacency matrix of a simple undirected graph 𝐺. Suppose 𝐴 is its own inverse. Which one of the following statements is always TRUE?- A.𝐺 is a cycle
- B.𝐺 is a perfect matching
- C.𝐺 is a complete graph
- D.There is no such graph 𝐺
Show answer / उत्तर देखें
Answer: B 𝐺 is a perfect matching
Official GATE 2024 answer key: (B).