The GATE Grind

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

All 65 questions of GATE 2026 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) – Expedite, hasten, hurry, . Fill the blank by choosing a word with a meaning similar to that of the words given above.
  2. Question 2 (1 mark, Multiple choice) – A black square PQRS has been cut into two parts. One part of it is shown in Panel I. Which one of the shapes in Panel II is the other part?
  3. Question 3 (1 mark, Multiple choice) – A day can only be cloudy or sunny. The probability of a day being cloudy is 0.5, independent of the condition on other days. What is the probability…
  4. Question 4 (1 mark, Multiple choice) – The values of Stock A and Stock B on a particular day are Rs. 50 and Rs. 80, respectively. An investor invests Rs. 100 in Stock A and Rs. 80 in Stock…
  5. Question 5 (1 mark, Multiple choice) – 'When it is raining, peacocks dance.' Based only on this sentence, which one of the following options is necessarily true?
  6. Question 6 (2 marks, Multiple choice) – Water : P :: Food : Q. Choose the P and Q combination from the options below to form a meaningful analogy.
  7. Question 7 (2 marks, Multiple choice) – Two tiles are missing in Panel I. Which one of the options in Panel II is the appropriate choice for the missing tiles?
  8. Question 8 (2 marks, Multiple choice) – Figures (i) and (ii) represent intercity highway systems. The black dots represent cities and the line segments between them represent intercity…
  9. Question 9 (2 marks, Multiple choice) – The figure in Panel I is a grid of cells with four rows and four columns. The numbers on the top and on the left represent the number of cells that…
  10. Question 10 (2 marks, Multiple choice) – An unbiased six-faced die whose faces are marked with numbers 1, 2, 3, 4, 5, and 6 is rolled twice in succession and the number on the top face is…
  11. Question 11 (1 mark, Multiple choice) – For two different persons x and y, the predicate M(x,y) denotes that x knows y. Consider the following statement: There is a person who does not know…
  12. Question 12 (1 mark, Multiple choice) – The set T represents various traversals over a binary tree. The set S represents the order of visiting nodes during a traversal. I: Inorder II:…
  13. Question 13 (1 mark, Multiple choice) – Which one of the following statements is equivalent to the assertion: Turing machine M decides the language L \0,1\*?
  14. Question 14 (1 mark, Multiple choice) – The probability density function f(x) of a random variable X is f(x) = 132 (-x218), x (-,+). Which one of the following statements is correct about…
  15. Question 15 (1 mark, Multiple choice) – In the context of DBMS, consider the two sets T and S given below. I: Logical schema II: Physical schema III: External schema L: Views M: File…
  16. Question 16 (1 mark, Multiple choice) – Which one of the following options is not a property of Boolean algebra? Note: + is OR, is AND, and ' is NOT.
  17. Question 17 (1 mark, Multiple choice) – In the C runtime environment, which one of the following is stored in the heap?
  18. Question 18 (1 mark, Multiple choice) – Consider the following two statements about interrupt handling mechanisms in a CPU. S1: In a non-vectored interrupt mechanism, it usually takes more…
  19. Question 19 (1 mark, Multiple choice) – Consider the following three ANSI C programs, P1, P2, and P3. Which one of the following statements is true?
  20. Question 20 (1 mark, Multiple choice) – Consider concurrent execution of two transactions T 1 and T 2 in a DBMS, both of which access a data object A. For these two transactions to not…
  21. Question 21 (1 mark, Multiple choice) – Consider a file of size 4 million bytes being transferred between two hosts connected via a path consisting of three consecutive links of bandwidth 2…
  22. Question 22 (1 mark, Multiple choice) – Which one of the following protocols may need to broadcast some of its messages?
  23. Question 23 (1 mark, Multiple choice) – Which one of the following CPU scheduling algorithms cannot be preemptive?
  24. Question 24 (1 mark, Multiple choice) – Consider the following functions, where n is a positive integer: n1/3, n, (n!), and 2 n. Which one of the following options lists the functions in…
  25. Question 25 (1 mark, Multiple select) – Which of the following can be recurrence relation(s) corresponding to an algorithm with time complexity (n)?
  26. Question 26 (1 mark, Multiple select) – Let R be a binary relation on the set \1,2,,10\, where (x,y) R if the product xy is the square of an integer. Which of the following properties is/are…
  27. Question 27 (1 mark, Multiple select) – For a real number a, let I(a)= -11(3x2-ax+1)\,dx. Which of the following statements is/are true?
  28. Question 28 (1 mark, Multiple select) – In a system, numbers are represented using 4-bit two's complement form. Consider four numbers N 1=1011, N 2=1101, N 3=1010, and N 4=1001. Which of the…
  29. Question 29 (1 mark, Multiple select) – Which of the following grammars is/are ambiguous?
  30. Question 30 (1 mark, Numerical answer) – The keys 5, 28, 19, 15, 26, 33, 12, 17, and 10 are inserted into a hash table using the hash function h(k)=k 9. Collisions are resolved by chaining.…
  31. Question 31 (1 mark, Numerical answer) – Consider the system of linear equations ax+y=b 16x+ay=24 Suppose the values of a and b are chosen such that the system produces multiple solutions.…
  32. Question 32 (1 mark, Numerical answer) – Consider an array A=[10,7,8,19,41,35,25,31]. Suppose merge sort is executed on A to sort it in increasing order. The algorithm will carry out a total…
  33. Question 33 (1 mark, Numerical answer) – If an IP network uses a subnet mask of 255.255.240.0, the maximum number of IP addresses that can be assigned to network interfaces is . (answer in…
  34. Question 34 (1 mark, Numerical answer) – The 32-bit IEEE 754 single-precision representation of a number is `0xC2710000`. The number in decimal representation is . (rounded off to two decimal…
  35. Question 35 (1 mark, Numerical answer) – A lexical analyzer uses the following token definitions: - letter [A-Za-z] - digit [0-9] - id letter(letter digit)* - number digit+ - ws (blank tab…
  36. Question 36 (2 marks, Multiple choice) – Consider a complete graph K n with n>4 vertices. Each spanning tree of K n is represented as a set of edges. The Jaccard coefficient between two sets…
  37. Question 37 (2 marks, Multiple choice) – Let G be a weighted directed acyclic graph with m edges and n vertices. Given G and a source vertex s, which one of the following options gives the…
  38. Question 38 (2 marks, Multiple choice) – Consider an array A of integers of size n with indices from 1 to n. An algorithm is to be designed to check whether A satisfies i,j \1,,n-1\ such that…
  39. Question 39 (2 marks, Multiple choice) – Consider a table T where the entries T[i][j], 0 i,j n, represent costs of subproblems in a dynamic programming algorithm. The recursive formulation is…
  40. Question 40 (2 marks, Multiple choice) – Consider the 4-variable Boolean function F(A,B,C,D)= m(0,1,2,3,8,9,10,11). Taking A as MSB and D as LSB, which one of the following represents the…
  41. Question 41 (2 marks, Multiple choice) – Consider canonical LR(0) parsing of the grammar below using terminals \a,b,c\ and non-terminals \A,B,C,S\, with S as the start symbol. S ACB A aA C cC…
  42. Question 42 (2 marks, Multiple choice) – In the context of schema normalization in relational DBMS, consider a set F of functional dependencies. The set of all functional dependencies implied…
  43. Question 43 (2 marks, Multiple choice) – Consider the transmission of data bits `110001011000` over a link that uses Cyclic Redundancy Check (CRC) code for error detection. If the generator…
  44. Question 44 (2 marks, Multiple choice) – Consider a processor that has 16 general-purpose registers and uses a 2-byte instruction format for all instructions. Variable-sized opcodes are…
  45. Question 45 (2 marks, Multiple choice) – Consider the control flow graph given below. Which one of the following options is the set of live variables at the exit point of each basic block?
  46. Question 46 (2 marks, Multiple choice) – An index in a DBMS is said to be dense if an index entry appears for every search-key value in the indexed file. Otherwise, it is called a sparse…
  47. Question 47 (2 marks, Multiple choice) – Consider the following two finite automata D 1 and D 2. Which of the following statements is/are true?
  48. Question 48 (2 marks, Multiple select) – Let =\a,b,c,d\ and let L=\ai bj ck dl i,j,k,l 0\. Which of the following constraints ensure(s) that the language is context-free?
  49. Question 49 (2 marks, Multiple select) – Consider a binary search tree (BST) with n leaf nodes, where n>0. All keys are distinct real numbers. For a node V, let Suc(V) denote its inorder…
  50. Question 50 (2 marks, Multiple select) – Consider a stack S and a queue Q, both initially empty and each capable of storing ten elements. The elements 1, 2, 3, 4, and 5 arrive one by one in…
  51. Question 51 (2 marks, Multiple select) – Consider three processes P 1, P 2, and P 3 running identical code shown below. A and B are binary semaphores initialized to 1 and 0, respectively. X…
  52. Question 52 (2 marks, Multiple select) – Consider a system with a processor and a 4 KB direct-mapped cache with block size 16 bytes. The system has a 16 MB physical memory. Four words P, Q,…
  53. Question 53 (2 marks, Numerical answer) – To keep track of free blocks in a file system, the linked-list approach is used. The disk size is 16 GB, the block size is 2 KB, and block numbers are…
  54. Question 54 (2 marks, Numerical answer) – A system has a Translation Lookaside Buffer (TLB) with reach 1 MB. The paging system uses pages of size 4 KB. The virtual address space is 64 GB and…
  55. Question 55 (2 marks, Numerical answer) – Consider contiguous allocation of physical memory to processes using variable partitioning. There are 8 holes of sizes 20 KB, 4 KB, 25 KB, 18 KB, 7…
  56. Question 56 (2 marks, Numerical answer) – Consider a system with 1 MB physical memory and word length 1 byte. The system uses a direct-mapped cache, with block numbers starting from 0. The…
  57. Question 57 (2 marks, Numerical answer) – A non-pipelined instruction execution unit operating at 1.6 GHz takes an average of 5 clock cycles per instruction. A pipelined redesign could operate…
  58. Question 58 (2 marks, Numerical answer) – Consider a new TCP connection between a sender and a receiver. The receiver advertised window is constant at 48 KB, the maximum segment size (MSS) is…
  59. Question 59 (2 marks, Numerical answer) – Consider the digital circuit shown below with two input lines A and B, two select lines S 0 and S 1, and an output line Y. The blocks Q and M…
  60. Question 60 (2 marks, Numerical answer) – Consider the following ANSI C program. The output of this program is . (answer in integer) Note: Assume that the program compiles and runs…
  61. Question 61 (2 marks, Numerical answer) – Consider the following ANSI C function. The maximum possible value that can be returned from this function is . (answer in integer) Note: Ignore…
  62. Question 62 (2 marks, Numerical answer) – The determinant of a 44 matrix A is 3. The value of the determinant of 2A is . (answer in integer)
  63. Question 63 (2 marks, Numerical answer) – Suppose an unbiased coin is tossed 6 times. Each toss is independent. Let E 1 be the event that among the second, fourth, and sixth tosses, there are…
  64. Question 64 (2 marks, Numerical answer) – Consider a function f:(0,1)\0,1\ defined as follows. For a real number r(0,1), f(r)=1 if the second digit after the decimal point in r is one of the…
  65. Question 65 (2 marks, Numerical answer) – It is necessary to design a link-layer protocol between two hosts directly connected over a lossless link of length 3000 kilometers. Assume the link…