The GATE Grind

GATE 2023 CS – Previous Year Questions with Solutions

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

65 questions worth 100 marks in all (30 1-mark, 35 2-mark). Subjects covered: Engineering Mathematics (11), General Aptitude (10), Programming and Data Structures (6), Operating System (6), Compiler Design (5), Theory of Computation (5), Computer Networks (5), Digital Logic (5).

Practise this paper in The GATE Grind →

  1. Question 1 (1 mark, Multiple choice) – We reached the station late, and missed the train.
  2. Question 2 (1 mark, Multiple choice) – Kind : : : Often : Frequently (By word meaning)
  3. Question 3 (1 mark, Multiple choice) – A series of natural numbers F 1, F 2, F 3, F 4, F 5, F 6, F 7, obeys F n+1 = F n + F n-1 for all integers n 2. If F 6 = 37, and F 7 = 60, then what is…
  4. Question 4 (1 mark, Multiple choice) – A survey for a certain year found that 90% of pregnant women received medical care at least once before giving birth. Of these women, 60% received…
  5. Question 5 (1 mark, Multiple choice) – Looking at the surface of a smooth 3-dimensional object from the outside, which one of the following options is TRUE?
  6. Question 6 (2 marks, Multiple choice) – The country of Zombieland is in distress since more than 75% of its working population is suffering from serious health issues. Studies conducted by…
  7. Question 7 (2 marks, Multiple choice) – Consider two functions of time (t), f(t) = 0.01\,t2 and g(t) = 4\,t where 0 < t < . Now consider the following two statements: (i) For some t > 0,…
  8. Question 8 (2 marks, Multiple choice) – Which one of the following sentence sequences creates a coherent narrative? (i) Once on the terrace, on her way to her small room in the corner, she…
  9. Question 9 (2 marks, Multiple choice) – f(x) and g(y) are functions of x and y, respectively, and f(x) = g(y) for all real values of x and y. Which one of the following options is…
  10. Question 10 (2 marks, Multiple choice) – Which one of the options best describes the transformation of the 2-dimensional figure P to Q, and then to R, as shown?
  11. Question 11 (1 mark, Multiple choice) – Consider the following statements regarding the front-end and back-end of a compiler. S1: The front-end includes phases that are independent of the…
  12. Question 12 (1 mark, Multiple choice) – Which one of the following sequences when stored in an array at locations A[1],...,A[10] forms a max-heap?
  13. Question 13 (1 mark, Multiple choice) – Let SLLdel be a function that deletes a node in a singly-linked list given a pointer to the node and a pointer to the head of the list. Similarly, let…
  14. Question 14 (1 mark, Multiple choice) – Consider the Deterministic Finite-state Automaton (DFA) A shown below. The DFA runs on the alphabet 0, 1, and has the set of states s, p, q, r, with s…
  15. Question 15 (1 mark, Multiple choice) – The Lucas sequence L n is defined by the recurrence relation: L n = L n-1 + L n-2, for n 3, with L 1 = 1 and L 2 = 3. Which one of the options given…
  16. Question 16 (1 mark, Multiple choice) – Which one of the options given below refers to the degree (or arity) of a relation in relational database systems?
  17. Question 17 (1 mark, Multiple choice) – Suppose two hosts are connected by a point-to-point link and they are configured to use Stop-and-Wait protocol for reliable data transfer. Identify in…
  18. Question 18 (1 mark, Multiple choice) – Let A=bmatrix1&2&3&4\\4&1&2&3\\3&4&1&2\\2&3&4&1bmatrix and B=bmatrix3&4&1&2\\4&1&2&3\\1&2&3&4\\2&3&4&1bmatrix. Let det(A) and det(B) denote the…
  19. Question 19 (1 mark, Multiple choice) – Consider the following definition of a lexical token id for an identifier in a programming language, using extended regular expressions: letter →…
  20. Question 20 (1 mark, Multiple choice) – An algorithm has to store several keys generated by an adversary in a hash table. The adversary is malicious who tries to maximize the number of…
  21. Question 21 (1 mark, Multiple choice) – The output of a 2-input multiplexer is connected back to one of its inputs as shown in the figure. Match the functional equivalence of this circuit to…
  22. Question 22 (1 mark, Multiple select) – Which one or more of the following need to be saved on a context switch from one thread (T1) of a process to another thread (T2) of the same process?
  23. Question 23 (1 mark, Multiple select) – Which one or more of the following options guarantee that a computer system will transition from user mode to kernel mode?
  24. Question 24 (1 mark, Multiple select) – Which of the following statements is/are CORRECT?
  25. Question 25 (1 mark, Multiple select) – Which of the following statements is/are INCORRECT about the OSPF (Open Shortest Path First) routing protocol used in the Internet?
  26. Question 26 (1 mark, Multiple select) – Geetha has a conjecture about integers, which is of the form x\,[P(x) y\, Q(x,y)], where P is a statement about integers, and Q is a statement about…
  27. Question 27 (1 mark, Multiple select) – Which one or more of the following CPU scheduling algorithms can potentially cause starvation?
  28. Question 28 (1 mark, Multiple select) – Let f(x) = x3 + 15x2 - 33x - 36 be a real-valued function. Which of the following statements is/are TRUE?
  29. Question 29 (1 mark, Multiple select) – Let f and g be functions of natural numbers given by f(n) = n and g(n) = n2. Which of the following statements is/are TRUE?
  30. Question 30 (1 mark, Numerical answer) – Let A be the adjacency matrix of the graph with vertices 1, 2, 3, 4, 5. Let 1, 2, 3, 4, 5 be the five eigenvalues of A. Note that these eigenvalues…
  31. Question 31 (1 mark, Numerical answer) – The value of the definite integral -33 -22 -11(4x2y - z3)dz\,dy\,dx is . (Rounded off to the nearest integer)
  32. Question 32 (1 mark, Numerical answer) – A particular number is written as 132 in radix-4 representation. The same number in radix-5 representation is .
  33. Question 33 (1 mark, Numerical answer) – Consider a 3-stage pipelined processor having a delay of 10 ns (nanoseconds), 20 ns, and 14 ns, for the first, second, and the third stages,…
  34. Question 34 (1 mark, Numerical answer) – A keyboard connected to a computer is used at a rate of 1 keystroke per second. The computer system polls the keyboard every 10 ms (milli seconds) to…
  35. Question 35 (1 mark, Numerical answer) – The integer value printed by the ANSI-C program given below is .
  36. Question 36 (2 marks, Multiple choice) – Consider the following program: Which one of the following options represents the activation tree corresponding to the main function?
  37. Question 37 (2 marks, Multiple choice) – Consider the control flow graph shown. Which one of the following choices correctly lists the set of live variables at the exit point of each basic…
  38. Question 38 (2 marks, Multiple choice) – Consider the two functions incr and decr shown below. There are 5 threads each invoking incr once, and 3 threads each invoking decr once, on the same…
  39. Question 39 (2 marks, Multiple choice) – Consider the context-free grammar G below: S → aSb X; X → aX Xb a b, where S and X are non-terminals, and a and b are terminal symbols. The starting…
  40. Question 40 (2 marks, Multiple choice) – Consider the pushdown automaton (PDA) P below, which runs on the input alphabet a, b, has stack alphabet ⊥, A, and has three states s, p, q, with s…
  41. Question 41 (2 marks, Multiple choice) – Consider the given C-code and its corresponding assembly code, with a few operands U1–U4 being unknown. The memory is byte-addressable. Which one of…
  42. Question 42 (2 marks, Multiple choice) – A 4 kilobyte (KB) byte-addressable memory is realized using four 1 KB memory blocks. Two input address lines (IA4 and IA3) are connected to the chip…
  43. Question 43 (2 marks, Multiple choice) – Consider a sequential digital circuit consisting of T flip-flops and D flip-flops as shown in the figure. CLKIN is the clock input to the circuit. At…
  44. Question 44 (2 marks, Multiple choice) – A Boolean digital circuit is composed using two 4-input multiplexers (M1 and M2) and one 2-input multiplexer (M3) as shown in the figure. X0–X7 are…
  45. Question 45 (2 marks, Multiple choice) – Consider the IEEE-754 single precision floating point numbers P=0xC1800000 and Q=0x3F5C2EF4. Which one of the following corresponds to the product of…
  46. Question 46 (2 marks, Multiple choice) – Let A be a priority queue for maintaining a set of elements. Suppose A is implemented using a max-heap data structure. The operation Extract-Max(A)…
  47. Question 47 (2 marks, Multiple choice) – Consider the C function foo and the binary tree shown. When foo is called with a pointer to the root node of the given binary tree, what will it…
  48. Question 48 (2 marks, Multiple choice) – Let U = \1, 2, , n\, where n is a large positive integer greater than 1000. Let k be a positive integer less than n. Let A, B be subsets of U with A =…
  49. Question 49 (2 marks, Multiple select) – Let f: A B be an onto (or surjective) function, where A and B are nonempty sets. Define an equivalence relation on the set A as a 1 a 2 if f(a 1) =…
  50. Question 50 (2 marks, Multiple select) – Suppose you are asked to design a new reliable byte-stream transport protocol like TCP. This protocol, named myTCP, runs over a 100 Mbps network with…
  51. Question 51 (2 marks, Multiple select) – Let X be a set and 2X denote the powerset of X. Define a binary operation on 2X as follows: A B = (A - B) (B - A). Let H = (2X, ). Which of the…
  52. Question 52 (2 marks, Multiple select) – Suppose in a web browser, you click on the www.gate-2023.in URL. The browser cache is empty. The IP address for this URL is not cached in your local…
  53. Question 53 (2 marks, Multiple select) – Consider a random experiment where two fair coins are tossed. Let A be the event that denotes HEAD on both the throws, B be the event that denotes…
  54. Question 54 (2 marks, Multiple select) – Consider functions Function 1 and Function 2 expressed in pseudocode as follows: Let f 1(n) and f 2(n) denote the number of times the statement "x = x…
  55. Question 55 (2 marks, Multiple select) – Let G be a simple, finite, undirected graph with vertex set \v 1,,v n\. Let (G) denote the maximum degree of G and let N = \1, 2, \ denote the set of…
  56. Question 56 (2 marks, Numerical answer) – Let U = \1, 2, 3\. Let 2U denote the powerset of U. Consider an undirected graph G whose vertex set is 2U. For any A, B 2U, (A, B) is an edge in G if…
  57. Question 57 (2 marks, Numerical answer) – Consider the following two-dimensional array D in the C programming language, which is stored in row-major order: int D[128][128]; Demand paging is…
  58. Question 58 (2 marks, Numerical answer) – Consider a computer system with 57-bit virtual addressing using multi-level tree-structured page tables with L levels for virtual to physical address…
  59. Question 59 (2 marks, Numerical answer) – Consider a sequence a of elements a 0 = 1, a 1 = 5, a 2 = 7, a 3 = 8, a 4 = 9, and a 5 = 2. The following operations are performed on a stack S and a…
  60. Question 60 (2 marks, Numerical answer) – Consider the syntax directed translation given by the following grammar and semantic rules. Here N, I, F and B are non-terminals. N is the starting…
  61. Question 61 (2 marks, Numerical answer) – Consider the following table named Student in a relational database. The primary key of this table is rollNum. Student(rollNum, name, gender, marks):…
  62. Question 62 (2 marks, Numerical answer) – Consider a database of fixed-length records, stored as an ordered file. The database has 25,000 records, with each record being 100 bytes, of which…
  63. Question 63 (2 marks, Numerical answer) – Consider the language L over the alphabet 0, 1, given below: L = \w \0,1\* w does not contain three or more consecutive 1's\. The minimum number of…
  64. Question 64 (2 marks, Numerical answer) – An 8-way set associative cache of size 64 KB (1 KB = 1024 bytes) is used in a system with 32-bit address. The address is sub-divided into TAG, INDEX,…
  65. Question 65 (2 marks, Numerical answer) – The forwarding table of a router is shown below. Subnet Number / Subnet Mask / Interface ID: 200.150.0.0 / 255.255.0.0 / 1 200.150.64.0 /…