The GATE Grind

GATE 2024 CS (CS1) – Previous Year Questions with Solutions

All 65 questions of GATE 2024 CS (CS1) with answers and explanations. Read each question, then practise it by topic or as a full paper.

Practise this paper in The GATE Grind →

  1. Question 1 (1 mark, Multiple choice) – If '→' denotes increasing order of intensity, then the meaning of the words [dry → arid → parched] is analogous to [diet → fast → ]. Which one of the…
  2. Question 2 (1 mark, Multiple choice) – If two distinct non-zero real variables x and y are such that (x+y) is proportional to (x-y) then the value of xy
  3. Question 3 (1 mark, Multiple choice) – Consider the following sample of numbers: 9, 18, 11, 14, 15, 17, 10, 69, 11, 13. The median of the sample is
  4. Question 4 (1 mark, Multiple choice) – The number of coins of ₹1, ₹5, and ₹10 denominations that a person has are in the ratio 5:3:13. Of the total amount, the percentage of money in ₹5…
  5. Question 5 (1 mark, Multiple choice) – For positive non-zero real variables p and q, if (p2+q2)= p+ q+2 3, then the value of p4+q4p2q2 is
  6. Question 6 (2 marks, Multiple choice) – In the given text, the blanks are numbered (i)−(iv). Select the best match for all the blanks. Steve was advised to keep his head (i) before heading…
  7. Question 7 (2 marks, Multiple choice) – A rectangular paper sheet of dimensions 54 cm × 4 cm is taken. The two longer edges of the sheet are joined together to create a cylindrical tube. A…
  8. Question 8 (2 marks, Multiple choice) – The pie chart presents the percentage contribution of different macronutrients to a typical 2,000 kcal diet of a person (Carbohydrates 35%, Proteins…
  9. Question 9 (2 marks, Multiple choice) – A rectangular paper of 20 cm × 8 cm is folded 3 times. Each fold is made along the line of symmetry, which is perpendicular to its long edge. The…
  10. Question 10 (2 marks, Multiple choice) – The least number of squares to be added in the figure to make AB a line of symmetry is
  11. Question 11 (1 mark, Multiple choice) – Let f:RR be a function such that f(x)=\x,x3\, xR, where R is the set of all real numbers. The set of all points where f(x) is NOT differentiable is
  12. Question 12 (1 mark, Multiple choice) – The product of all eigenvalues of the matrix bmatrix1&2&3\\4&5&6\\7&8&9bmatrix is
  13. Question 13 (1 mark, Multiple choice) – Consider a system that uses 5 bits for representing signed integers in 2's complement format. In this system, two integers A and B are represented as…
  14. Question 14 (1 mark, Multiple choice) – Consider a permutation sampled uniformly at random from the set of all permutations of \1,2,3,,n\ for some n 4. Let X be the event that 1 occurs…
  15. Question 15 (1 mark, Multiple choice) – Which one of the following statements is FALSE?
  16. Question 16 (1 mark, Multiple choice) – A user starts browsing a webpage hosted at a remote server. The browser opens a single TCP connection to fetch the entire webpage. The webpage…
  17. Question 17 (1 mark, Multiple choice) – 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…
  18. Question 18 (1 mark, Multiple choice) – Consider the following C program: Which one of the following statements is CORRECT?
  19. Question 19 (1 mark, Multiple choice) – Consider the following C program: Assume that the input to the program from the command line is 1234 followed by a newline character. Which one of the…
  20. Question 20 (1 mark, Multiple choice) – Let S be the specification: "Instructors teach courses. Students register for courses. Courses are allocated classrooms. Instructors guide students."…
  21. Question 21 (1 mark, Multiple choice) – In a B+ tree, the requirement of at least half-full (50%) node occupancy is relaxed for which one of the following cases?
  22. Question 22 (1 mark, Multiple select) – Which of the following statements about a relation R in first normal form (1NF) is/are TRUE?
  23. Question 23 (1 mark, Multiple select) – Let L 1,L 2 be two regular languages and L 3 a language which is not regular. Which of the following statements is/are always TRUE?
  24. Question 24 (1 mark, Multiple select) – Which of the following statements about threads is/are TRUE?
  25. Question 25 (1 mark, Multiple select) – Which of the following process state transitions is/are NOT possible?
  26. Question 26 (1 mark, Multiple select) – Which of the following is/are Bottom-Up Parser(s)?
  27. Question 27 (1 mark, Multiple select) – Let A and B be two events in a probability space with P(A)=0.3, P(B)=0.5, and P(A B)=0.1. Which of the following statements is/are TRUE?
  28. Question 28 (1 mark, Multiple select) – Consider the circuit shown below where the gates may have propagation delays. Assume that all signal transitions occur instantaneously and that wires…
  29. Question 29 (1 mark, Multiple select) – TCP client P successfully establishes a connection to TCP server Q. Let N P denote the sequence number in the SYN sent from P to Q. Let N Q denote the…
  30. Question 30 (1 mark, Multiple select) – Consider a 5-stage pipelined processor with Instruction Fetch (IF), Instruction Decode (ID), Execute (EX), Memory Access (MEM), and Register Writeback…
  31. Question 31 (1 mark, Multiple select) – Which of the following fields is/are modified in the IP header of a packet going out of a network address translation (NAT) device from an internal…
  32. Question 32 (1 mark, Numerical answer) – Let A and B be non-empty finite sets such that there exist one-to-one and onto functions (i) from A to B and (ii) from A A to A B. The number of…
  33. Question 33 (1 mark, Numerical answer) – Consider the operator precedence and associativity rules for the integer arithmetic operators given in the table: + (Highest, Left), - (High, Right),…
  34. Question 34 (1 mark, Numerical answer) – The number of spanning trees in a complete graph of 4 vertices labelled A, B, C, and D is
  35. Question 35 (1 mark, Numerical answer) – Consider two relations R(A,B) with tuples (10,20),(20,30),(30,40),(30,50),(50,95) and S(A,C) with tuples (10,90),(30,45),(40,80). The total number of…
  36. Question 36 (2 marks, Multiple choice) – Consider a network path P—Q—R via router Q. Node P sends a file of size 106 bytes to R by splitting it into chunks of 103 bytes each, sent…
  37. Question 37 (2 marks, Multiple choice) – Consider the SDD: S→DHTU S.val=D.val+H.val+T.val+U.val; D→"M"D1 D.val=5+D1.val; D→ε D.val=−5; H→"L"H1 H.val=5*10+H1.val; H→ε H.val=−10; T→"C"T1…
  38. Question 38 (2 marks, Multiple choice) – Consider grammar G with start symbol S: S→daT (1); T→aS bT (2); R→(3) ε. Terminals are a,b,c,d,f. FIRST(S)=c,d,f, FIRST(T)=a,b,ε, FIRST(R)=c,ε;…
  39. Question 39 (2 marks, Multiple choice) – Consider the pseudo-code with lines L1: t1=−1; L2: t2=0; L3: t3=0; L4: t4=4*t3; L5: t5=4*t2; L6: t6=t5*M; L7: t7=t4+t6; L8: t8=a[t7]; L9: if t8<=max…
  40. Question 40 (2 marks, Multiple choice) – Two threads T1 (a=a+1; b=b+1;) and T2 (b=2*b; a=2*a;) update shared variables a and b, initially a=b=1. Each statement is atomic. Which option lists…
  41. Question 41 (2 marks, Multiple choice) – 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…
  42. Question 42 (2 marks, Multiple choice) – Consider the recurrence T(n)=n\,T(n)+n for n 1... with T(1)=1. Which one of the following options is CORRECT?
  43. Question 43 (2 marks, Multiple choice) – Consider a binary min-heap containing 105 distinct elements. Let k be the index (in the underlying array) of the maximum element stored in the heap.…
  44. Question 44 (2 marks, Multiple select) – The symbol → indicates functional dependency in the context of a relational database. Which of the following options is/are TRUE?
  45. Question 45 (2 marks, Multiple select) – Let G be a directed graph and T a depth first search (DFS) spanning tree in G rooted at a vertex v. Suppose T is also a breadth first search (BFS)…
  46. Question 46 (2 marks, Multiple select) – Consider the read-write schedule S over three transactions T 1,T 2,T 3: S: r 1(z); w 1(z); r 2(x); r 3(y); w 3(y); r 2(y); w 2(x); w 2(y);. Which of…
  47. Question 47 (2 marks, Multiple select) – Consider a Boolean expression given by F(X,Y,Z)=(3,5,6,7). Which of the following statements is/are CORRECT?
  48. Question 48 (2 marks, Multiple select) – Consider the C function: Which of the following statements is/are TRUE about the above function?
  49. Question 49 (2 marks, Multiple select) – Let A be any n m matrix, where m>n. Which of the following statements is/are TRUE about the system of linear equations Ax=0?
  50. Question 50 (2 marks, Multiple select) – Consider the 5-state DFA M accepting the language L(M)(0+1)* shown in the figure (start/accepting state 1; 1-0->2, 2-0->3, 3-0->1, 2-1->1, 3-1->2,…
  51. Question 51 (2 marks, Multiple select) – The chromatic number of a graph is the minimum number of colours used in a proper colouring of the graph. Let G be any graph with n vertices and…
  52. Question 52 (2 marks, Multiple select) – Consider the operators and defined by a b=a+2b, a b=ab, for positive integers. Which of the following statements is/are TRUE?
  53. Question 53 (2 marks, Multiple select) – Consider two set-associative cache architectures: WBC (write back policy) and WTC (write through policy). Both use LRU replacement. The cache is…
  54. Question 54 (2 marks, Numerical answer) – Consider a 512 GB hard disk with 32 storage surfaces. There are 4096 sectors per track and each sector holds 1024 bytes of data. The number of…
  55. Question 55 (2 marks, Numerical answer) – The baseline execution time of a program on a 2 GHz single core machine is 100 ns. The code corresponding to 90% of the execution time can be fully…
  56. Question 56 (2 marks, Numerical answer) – A given program has 25% load/store instructions. The ideal CPI without memory stalls is 2. The program exhibits 2% miss rate on instruction cache and…
  57. Question 57 (2 marks, Numerical answer) – Consider the code: The total number of times the printf statement is executed is
  58. Question 58 (2 marks, Numerical answer) – A router has forwarding entries: 10.1.1.0/24→R1, 10.1.1.128/25→R2, 10.1.1.64/26→R3, 10.1.1.192/26→R4. The router forwards 20 packets each to 5 hosts…
  59. Question 59 (2 marks, Numerical answer) – Let G=(V,,S,P) be a context-free grammar in Chomsky Normal Form with =\a,b,c\ and V containing 10 variable symbols including the start symbol S. The…
  60. Question 60 (2 marks, Numerical answer) – The number of edges present in the forest generated by the DFS traversal of an undirected graph G with 100 vertices is 40. The number of connected…
  61. Question 61 (2 marks, Numerical answer) – Consider the two regular expressions over the alphabet \0,1\: r=0*+1* and s=01*+10*. The total number of strings of length less than or equal to 5,…
  62. Question 62 (2 marks, Numerical answer) – Consider a memory management system that uses a page size of 2 KB. Assume that both the physical and virtual addresses start from 0. Pages 0, 1, 2,…
  63. Question 63 (2 marks, Numerical answer) – A bag contains 10 red balls and 15 blue balls. Two balls are drawn randomly without replacement. Given that the first ball drawn is red, the…
  64. Question 64 (2 marks, Numerical answer) – Consider three 2-to-1 multiplexers M1, M2, M3. X1 and X2 are inputs of M1, X3 and X4 are inputs of M2, and A, B, C are the select lines of M1, M2, M3…
  65. Question 65 (2 marks, Numerical answer) – Consider sending an IP datagram of size 1420 bytes (including 20 bytes of IP header) from a sender to a receiver over a path of two links with a…