The GATE Grind

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

All 65 questions of GATE 2025 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) – Despite his initial hesitation, Rehman's to contribute to the success of the project never wavered. Select the most appropriate option to complete the…
  2. Question 2 (1 mark, Multiple choice) – Bird : Nest :: Bee : Select the correct option to complete the analogy.
  3. Question 3 (1 mark, Multiple choice) – If Pex = Qe-x for all real values of x, which one of the following statements is true?
  4. Question 4 (1 mark, Multiple choice) – The paper as shown in the figure is folded to make a cube where each square corresponds to a particular face of the cube. Which one of the following…
  5. Question 5 (1 mark, Multiple choice) – Let p 1 and p 2 denote two arbitrary prime numbers. Which one of the following statements is correct for all values of p 1 and p 2?
  6. Question 6 (2 marks, Multiple choice) – Based only on the conversation below, identify the logically correct inference: "Even if I had known that you were in the hospital, I would not have…
  7. Question 7 (2 marks, Multiple choice) – If IMAGE and FIELD are coded as FHBNJ and EMFJG respectively then, which one among the given options is the most appropriate code for BEACH ?
  8. Question 8 (2 marks, Multiple choice) – Which one of the following options is correct for the given data in the table? Iteration (i) 0 1 2 3 --- --- --- --- --- Input (I) 20 -4 10 15 Output…
  9. Question 9 (2 marks, Multiple choice) – In the given figure, PQRS is a square of side 2 cm and PLMN is a rectangle. The corner L of the rectangle is on the side QR. Side MN of the rectangle…
  10. Question 10 (2 marks, Multiple choice) – The diagram below shows a river system consisting of 7 segments, marked P, Q, R, S, T, U, and V. It splits the land into 5 zones, marked Z1, Z2, Z3,…
  11. Question 11 (1 mark, Multiple choice) – If A = pmatrix1 & 2\\2 & -1pmatrix, then which ONE of the following is A8 ?
  12. Question 12 (1 mark, Multiple choice) – The value of x such that x > 1, satisfying the equation 1x t t\,dt = 14 is
  13. Question 13 (1 mark, Multiple choice) – Consider a binary tree T in which every node has either zero or two children. Let n > 0 be the number of nodes in T. Which ONE of the following is the…
  14. Question 14 (1 mark, Multiple choice) – Let L, M, and N be non-singular matrices of order 3 satisfying the equations L2 = L-1, M = L8 and N = L2. Which ONE of the following is the value of…
  15. Question 15 (1 mark, Multiple choice) – Let P(x) be an arbitrary predicate over the domain of natural numbers. Which ONE of the following statements is TRUE?
  16. Question 16 (1 mark, Multiple choice) – Consider the following statements: (i) Address Resolution Protocol (ARP) provides a mapping from an IP address to the corresponding hardware…
  17. Question 17 (1 mark, Multiple choice) – Consider the routing protocols given in List I and the names given in List II: List I List II --- --- (i) Distance vector routing (a) Bellman-Ford…
  18. Question 18 (1 mark, Multiple choice) – A machine receives an IPv4 datagram. The protocol field of the IPv4 header has the protocol number of a protocol X. Which ONE of the following is NOT…
  19. Question 19 (1 mark, Multiple choice) – Consider the following C program: Which ONE of the following will be the output of the program?
  20. Question 20 (1 mark, Multiple choice) – Consider an unordered list of N distinct integers. What is the minimum number of element comparisons required to find an integer in the list that is…
  21. Question 21 (1 mark, Multiple choice) – Consider the following statements about the use of backpatching in a compiler for intermediate code generation: (I) Backpatching can be used to…
  22. Question 22 (1 mark, Multiple choice) – Given the following syntax directed translation rules: Rule 1: R AB\ \B.i = R.i - 1;\ A.i = B.i;\ R.i = A.i + 1;\ Rule 2: P CD\ \P.i = C.i + D.i;\ D.i…
  23. Question 23 (1 mark, Multiple choice) – Consider a network that uses Ethernet and IPv4. Assume that IPv4 headers do not use any options field. Each Ethernet frame can carry a maximum of 1500…
  24. Question 24 (1 mark, Multiple choice) – Which ONE of the following languages is accepted by a deterministic pushdown automaton?
  25. Question 25 (1 mark, Multiple choice) – Let G 1, G 2 be Context Free Grammars (CFGs) and R be a regular expression. For a grammar G, let L(G) denote the language generated by G. Which ONE…
  26. Question 26 (1 mark, Multiple choice) – Processes P1, P2, P3, P4 arrive in that order at times 0, 1, 2, and 8 milliseconds respectively, and have execution times of 10, 13, 6, and 9…
  27. Question 27 (1 mark, Multiple select) – An audit of a banking transactions system has found that on an earlier occasion, two joint holders of account A attempted simultaneous transfers of…
  28. Question 28 (1 mark, Multiple select) – Which of the following is/are part of an Instruction Set Architecture of a processor?
  29. Question 29 (1 mark, Multiple select) – Which of the following statements regarding Breadth First Search (BFS) and Depth First Search (DFS) on an undirected simple graph G is/are TRUE?
  30. Question 30 (1 mark, Multiple select) – Consider the two lists List I and List II given below: List I List II --- --- (i) Context free languages (a) Closed under union (ii) Recursive…
  31. Question 31 (1 mark, Multiple select) – Consider the following logic circuit diagram. [Figure: inputs X and Y feed a NAND gate, a NOT gate on X, and an AND gate taking X and Y; the three…
  32. Question 32 (1 mark, Numerical answer) – The following two signed 2's complement numbers (multiplicand M and multiplier Q) are being multiplied using Booth's algorithm: M: 1100 1101 1110 1101…
  33. Question 33 (1 mark, Numerical answer) – The output of the given C code segment is . (Answer in integer)
  34. Question 34 (1 mark, Numerical answer) – In a 4-bit ripple counter, if the period of the waveform at the last flip-flop is 64 microseconds, then the frequency of the ripple counter in kHz is…
  35. Question 35 (1 mark, Numerical answer) – Suppose the values 10, -4, 15, 30, 20, 5, 60, 19 are inserted in that order into an initially empty binary search tree. Let T be the resulting binary…
  36. Question 36 (2 marks, Multiple choice) – Suppose we are transmitting frames between two nodes using Stop-and-Wait protocol. The frame size is 3000 bits. The transmission rate of the channel…
  37. Question 37 (2 marks, Multiple choice) – Let G be an edge-weighted undirected graph with positive edge weights. Suppose a positive constant is added to the weight of every edge. Which ONE of…
  38. Question 38 (2 marks, Multiple choice) – A meld operation on two instances of a data structure combines them into one single instance of the same data structure. Consider the following data…
  39. Question 39 (2 marks, Multiple choice) – For a direct-mapped cache, 4 bits are used for the tag field and 12 bits are used to index into a cache block. The size of each cache block is one…
  40. Question 40 (2 marks, Multiple choice) – Given a Context-Free Grammar G as follows: S Aa bAc dc bda A d Which ONE of the following statements is TRUE?
  41. Question 41 (2 marks, Multiple choice) – An array A of length n with distinct elements is said to be bitonic if there is an index 1 i n such that A[1..i] is sorted in the non-decreasing order…
  42. Question 42 (2 marks, Multiple select) – Let F be the set of all functions from \1,,n\ to \0,1\. Define the binary relation on F as follows: f, g F,\ f g if and only if x \1,,n\,\ f(x) g(x),…
  43. Question 43 (2 marks, Multiple select) – Given the following Karnaugh Map for a Boolean function F(w,x,y,z) (rows wx = 00, 01, 11, 10; columns yz = 00, 01, 11, 10): wx yz 00 01 11 10 --- ---…
  44. Question 44 (2 marks, Multiple select) – Consider a system of linear equations PX = Q where P R33 and Q R31. Suppose P has an LU decomposition, P = LU, where L = bmatrix1 & 0 & 0\ 21 & 1 & 0\…
  45. Question 45 (2 marks, Multiple select) – Consider a stack data structure into which we can PUSH and POP records. Assume that each record pushed in the stack has a positive integer key and…
  46. Question 46 (2 marks, Multiple select) – Consider the following relational schema along with all the functional dependencies that hold on them. R1(A, B, C, D, E): D E,\ EA B,\ EB C R2(A, B,…
  47. Question 47 (2 marks, Multiple select) – Consider a demand paging system with three frames, and the following page reference string: 1 2 3 4 5 4 1 6 4 5 1 3 2. The contents of the frames are…
  48. Question 48 (2 marks, Multiple select) – P = \P 1, P 2, P 3, P 4\ consists of all active processes in an operating system. R = \R 1, R 2, R 3, R 4\ consists of single instances of distinct…
  49. Question 49 (2 marks, Multiple select) – Three floating point numbers X, Y, and Z are stored in three registers R X, R Y, and R Z, respectively in IEEE 754 single precision format as given…
  50. Question 50 (2 marks, Multiple select) – Which of the following Boolean algebraic equation(s) is/are CORRECT?
  51. Question 51 (2 marks, Multiple select) – Consider two grammars G 1 and G 2 with the production rules given below: G 1: S if\ E\ then\ S if\ E\ then\ S\ else\ S a E b G 2: S if\ E\ then\ S M M…
  52. Question 52 (2 marks, Multiple select) – Let = \a, b, c\. For x *, and , let \# (x) denote the number of occurrences of in x. Which one or more of the following option(s) define(s) regular…
  53. Question 53 (2 marks, Multiple select) – Consider the database transactions T1 and T2, and data items X and Y. Which of the schedule(s) is/are conflict serializable? Transaction T1: R1(X),…
  54. Question 54 (2 marks, Multiple select) – Consider the following relational schema: Students (rollno: integer, name: string, age: integer, cgpa: real) Courses (courseno: integer, cname:…
  55. Question 55 (2 marks, Numerical answer) – Given a computing system with two levels of cache (L1 and L2) and a main memory. The first level (L1) cache access time is 1 nanosecond (ns) and the…
  56. Question 56 (2 marks, Numerical answer) – A 5-stage instruction pipeline has stage delays of 180, 250, 150, 170, and 250, respectively, in nanoseconds. The delay of an inter-stage latch is 10…
  57. Question 57 (2 marks, Numerical answer) – In a B+-tree where each node can hold at most four key values, a root to leaf path consists of the following nodes: A = (49, 77, 83, -), B = (7, 19,…
  58. Question 58 (2 marks, Numerical answer) – A computer system supports a logical address space of 232 bytes. It uses two-level hierarchical paging with a page size of 4096 bytes. A logical…
  59. Question 59 (2 marks, Numerical answer) – Consider the following algorithm someAlgo that takes an undirected graph G as input. someAlgo(G) 1. Let v be any vertex in G. Run BFS on G starting at…
  60. Question 60 (2 marks, Numerical answer) – Let = \1,2,3,4\. For x *, let prod(x) be the product of symbols in x modulo 7. We take prod() = 1, where is the null string. For example, prod(124) =…
  61. Question 61 (2 marks, Numerical answer) – An application executes 6.4 108 number of instructions in 6.3 seconds. There are four types of instructions, the details of which are given in the…
  62. Question 62 (2 marks, Numerical answer) – Consider the following C program: The output of the above program is . (Answer in integer)
  63. Question 63 (2 marks, Numerical answer) – Consider the following C program: The output of the given C program is . (Answer in integer)
  64. Question 64 (2 marks, Numerical answer) – A quadratic polynomial (x - )(x - ) over complex numbers is said to be square invariant if (x - )(x - ) = (x - 2)(x - 2). Suppose from the set of all…
  65. Question 65 (2 marks, Numerical answer) – The unit interval (0,1) is divided at a point chosen uniformly distributed over (0,1) in R into two disjoint subintervals. The expected length of the…