The GATE Grind

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

All 65 questions of GATE 2024 CS (CS2) 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 [walk → jog → sprint] is analogous to [bothered → → daunted]. Which one of…
  2. Question 2 (1 mark, Multiple choice) – Two wizards try to create a spell using all the four elements, water, air, fire, and earth. For this, they decide to mix all these elements in all…
  3. Question 3 (1 mark, Multiple choice) – In an engineering college of 10,000 students, 1,500 like neither their core branches nor other branches. The number of students who like their core…
  4. Question 4 (1 mark, Multiple choice) – For positive non-zero real variables x and y, if (x+y2)=12[(x)+(y)], then, the value of xy+yx is
  5. Question 5 (1 mark, Multiple choice) – In the sequence 6, 9, 14, x, 30, 41, a possible value of x is
  6. Question 6 (2 marks, Multiple choice) – Sequence the following sentences in a coherent passage. P: This fortuitous geological event generated a colossal amount of energy and heat that…
  7. Question 7 (2 marks, Multiple choice) – A person sold two different items at the same price. He made 10% profit in one item, and 10% loss in the other item. In selling these two items, the…
  8. Question 8 (2 marks, Multiple choice) – The pie charts depict the shares of various power generation technologies in the total electricity generation of a country for the years 2007 (Coal…
  9. Question 9 (2 marks, Multiple choice) – A cube is to be cut into 8 pieces of equal size and shape. Here, each cut should be straight and it should not stop till it reaches the other end of…
  10. Question 10 (2 marks, Multiple choice) – In the 4 × 4 array shown below, each cell of the first three rows has either a cross (X) or a number. Row 1: 1, X, 4, 3; Row 2: X, 5, 5, 4; Row 3: 3,…
  11. Question 11 (1 mark, Multiple choice) – 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…
  12. Question 12 (1 mark, Multiple choice) – Let p and q be the following propositions: p: Fail grade can be given. q: Student scores more than 50% marks. Consider the statement: "Fail grade…
  13. Question 13 (1 mark, Multiple choice) – Consider the following C program. Assume parameters to a function are evaluated from right to left. Which one of the following options is the CORRECT…
  14. Question 14 (1 mark, Multiple choice) – The format of a single-precision floating-point number as per the IEEE 754 standard is Sign (1 bit), Exponent (8 bits), Mantissa (23 bits). Choose the…
  15. Question 15 (1 mark, Multiple choice) – Let T(n) be the recurrence relation defined as follows: T(0)=1, T(1)=2, and T(n)=5T(n-1)-6T(n-2) for n 2. Which one of the following statements is…
  16. Question 16 (1 mark, Multiple choice) – Let f(x) be a continuous function from R to R such that f(x)=1-f(2-x). Which one of the following options is the CORRECT value of 02 f(x)dx?
  17. Question 17 (1 mark, Multiple choice) – Let A be the adjacency matrix of a simple undirected graph G. Suppose A is its own inverse. Which one of the following statements is always TRUE?
  18. Question 18 (1 mark, Multiple choice) – When six unbiased dice are rolled simultaneously, the probability of getting all distinct numbers (i.e., 1, 2, 3, 4, 5, and 6) is
  19. Question 19 (1 mark, Multiple choice) – Once the DBMS informs the user that a transaction has been successfully completed, its effect should persist even if the system crashes before all its…
  20. Question 20 (1 mark, Multiple choice) – In the context of owner and weak entity sets in the ER (Entity-Relationship) data model, which one of the following statements is TRUE?
  21. Question 21 (1 mark, Multiple choice) – Consider two sets. Set X: P. Lexical Analyzer, Q. Syntax Analyzer, R. Intermediate Code Generator, S. Code Optimizer. Set Y: 1. Abstract Syntax Tree,…
  22. Question 22 (1 mark, Multiple choice) – Which one of the following regular expressions is equivalent to the language accepted by the DFA given below? (Two states: start state q0…
  23. Question 23 (1 mark, Multiple select) – Node X has a TCP connection open to node Y. The packets from X to Y go through an intermediate IP router R. Ethernet switch S is the first switch on…
  24. Question 24 (1 mark, Multiple select) – Which of the following tasks is/are the responsibility/responsibilities of the memory management unit (MMU) in a system with paging-based memory…
  25. Question 25 (1 mark, Multiple select) – Consider a process P running on a CPU. Which one or more of the following events will always trigger a context switch by the OS that results in…
  26. Question 26 (1 mark, Multiple select) – Which of the following file organizations is/are I/O efficient for the scan operation in DBMS?
  27. Question 27 (1 mark, Multiple select) – Which of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?
  28. Question 28 (1 mark, Multiple select) – Which of the following statements about IPv4 fragmentation is/are TRUE?
  29. Question 29 (1 mark, Multiple select) – Which of the following statements is/are FALSE?
  30. Question 30 (1 mark, Multiple select) – For a Boolean variable x, which of the following statements is/are FALSE?
  31. Question 31 (1 mark, Multiple select) – An instruction format has the structure: Instruction Number: Opcode destination reg, source reg-1, source reg-2. Consider the sequence: I1: DIV R3,…
  32. Question 32 (1 mark, Multiple select) – Which of the following fields of an IP header is/are always modified by any router before it forwards the IP packet?
  33. Question 33 (1 mark, Multiple select) – Consider the following C function definition. Which of the following statements is/are TRUE?
  34. Question 34 (1 mark, Numerical answer) – Let P be the partial order defined on the set \1,2,3,4\ as follows: P=\(x,x) x\1,2,3,4\\\(1,2),(3,2),(3,4)\. The number of total orders on \1,2,3,4\…
  35. Question 35 (1 mark, Numerical answer) – Let A be an array containing integer values. The distance of A is defined as the minimum number of elements in A that must be replaced with another…
  36. Question 36 (2 marks, Multiple choice) – What is the output of the following C program?
  37. Question 37 (2 marks, Multiple choice) – Consider a single processor system with four processes A, B, C, and D, where for each process the first value is its arrival time, and the second…
  38. Question 38 (2 marks, Multiple choice) – Which one of the following CIDR prefixes exactly represents the range of IP addresses 10.12.2.0 to 10.12.3.255?
  39. Question 39 (2 marks, Multiple choice) – You are given a set V of distinct integers. A binary search tree T is created by inserting all elements of V one by one, starting with an empty tree.…
  40. Question 40 (2 marks, Multiple choice) – Consider the CFG with start symbol S and terminals a,b,c,d: S AaAb BbBa, A cS, B dS. In the partially-filled LL(1) table, S row has S→AaAb at a,…
  41. Question 41 (2 marks, Multiple choice) – Let M be the 5-state NFA with -transitions shown: start state 1 with ε to 2 and ε to 4; state 2 (accepting) goes 0 to 3; state 3 goes 0 to 2 and ε to…
  42. Question 42 (2 marks, Multiple choice) – Consider an array X of n positive integers. The C code below computes the length of the longest subarray of X containing at most two distinct…
  43. Question 43 (2 marks, Multiple choice) – Consider the expression x[i]=(p+r)*-s[i]+u/w. The triples are: (0) + p r; (1) ?; (2) uminus (1); (3) ?; (4) / u w; (5) + (3) (4); (6) ?; (7) = (6)…
  44. Question 44 (2 marks, Multiple choice) – Let x and y be random variables, not necessarily independent, that take real values in the interval [0,1]. Let z=xy and let the mean values of x,y,z…
  45. Question 45 (2 marks, Multiple choice) – The relation schema, Person(pid, city), describes the city of residence for every person uniquely identified by pid. The following relational algebra…
  46. Question 46 (2 marks, Multiple select) – Consider a multi-threaded program with two threads T1 and T2 sharing semaphores s1 (initialized to 1) and s2 (initialized to 0) and a global variable…
  47. Question 47 (2 marks, Multiple select) – Let A be an n n matrix over the set of all real numbers R. Let B be a matrix obtained from A by swapping two rows. Which of the following statements…
  48. Question 48 (2 marks, Multiple select) – Let S1 and S2 be two stacks. S1 has capacity 4 and already holds 100, 200, 300, 400 (400 on top). S2 has capacity 2 and is empty. Operations: PushToS2…
  49. Question 49 (2 marks, Multiple select) – Which of the following is/are EQUAL to 224 in radix-5 (i.e., base-5) notation?
  50. Question 50 (2 marks, Multiple select) – Consider 4-variable functions f1 = Σ(0,2,3,5,7,8,11,13), f2 = Σ(1,3,5,7,11,13,15), f3 = Σ(0,1,4,11), f4 = Σ(0,2,6,13). The circuit computes Y = (f1…
  51. Question 51 (2 marks, Multiple select) – Let G be an undirected connected graph in which every edge has a positive integer weight. Suppose that every spanning tree in G has even weight. Which…
  52. Question 52 (2 marks, Multiple select) – Consider a context-free grammar G with rules S aS, S aSbS, S c. Let w L(G) and let n a(w), n b(w), n c(w) denote the number of times a,b,c occur in w.…
  53. Question 53 (2 marks, Numerical answer) – Consider a disk with rotation speed of 6000 RPM, average seek time of 5 milliseconds, 500 sectors/track, 512-byte sectors. A file has content stored…
  54. Question 54 (2 marks, Numerical answer) – Consider a TCP connection operating with a congestion window of size 12 MSS when a timeout occurs due to packet loss. Assuming that all the segments…
  55. Question 55 (2 marks, Numerical answer) – Consider an Ethernet segment with a transmission speed of 108 bits/sec and a maximum segment length of 500 meters. If the speed of propagation of the…
  56. Question 56 (2 marks, Numerical answer) – A functional dependency F: X Y is termed as a useful functional dependency if and only if it satisfies: X is not the empty set, Y is not the empty…
  57. Question 57 (2 marks, Numerical answer) – A processor with 16 general purpose registers uses a 32-bit instruction format. The instruction format consists of an opcode field, an addressing mode…
  58. Question 58 (2 marks, Numerical answer) – A non-pipelined unit at 2 GHz takes an average of 6 cycles per instruction of program P. The unit is redesigned as a 5-stage pipeline at 2 GHz with…
  59. Question 59 (2 marks, Numerical answer) – The number of distinct minimum-weight spanning trees of the following graph is (Vertices a,b,c,d,e,f,g; edges: a-b 1, a-f 1, c-d 1, d-e 1, a-g 2, b-g…
  60. Question 60 (2 marks, Numerical answer) – The chromatic number of a graph is the minimum number of colours used in a proper colouring of the graph. The chromatic number of the following graph…
  61. Question 61 (2 marks, Numerical answer) – A processor uses a 32-bit instruction format and supports byte-addressable memory access. The ISA has 150 distinct instructions, equally divided into…
  62. Question 62 (2 marks, Numerical answer) – Let L 1 be the language represented by the regular expression b*ab*(ab*ab*)* and L 2=\w(a+b)* w 4\, where w denotes the length of string w. The number…
  63. Question 63 (2 marks, Numerical answer) – Let Z n be the group of integers \0,1,2,,n-1\ with addition modulo n as the group operation. The number of elements in the group Z 2 Z 3 Z 4 that are…
  64. Question 64 (2 marks, Numerical answer) – Consider a 32-bit system with 4 KB page size and page table entries of size 4 bytes each (1 KB = 210 bytes). The OS uses a 2-level page table with an…
  65. Question 65 (2 marks, Numerical answer) – Consider the augmented grammar parsed with an SLR parser, terminals \a,b,c,d,\#,@\: S' S; S SS Aa bAc Bc bBa; A d\#; B @. Let I 0=CLOSURE(\S' S\). The…