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 →
- Question 1 – Expedite, hasten, hurry, . Fill the blank by choosing a word with a meaning similar to that of the words given above.
- Question 2 – 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?
- Question 3 – 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…
- Question 4 – 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…
- Question 5 – 'When it is raining, peacocks dance.' Based only on this sentence, which one of the following options is necessarily true?
- Question 6 – Water : P :: Food : Q. Choose the P and Q combination from the options below to form a meaningful analogy.
- Question 7 – Two tiles are missing in Panel I. Which one of the options in Panel II is the appropriate choice for the missing tiles?
- Question 8 – Figures (i) and (ii) represent intercity highway systems. The black dots represent cities and the line segments between them represent intercity…
- Question 9 – 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…
- Question 10 – 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…
- Question 11 – 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…
- Question 12 – 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:…
- Question 13 – Which one of the following statements is equivalent to the assertion: Turing machine M decides the language L \0,1\*?
- Question 14 – 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…
- Question 15 – 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…
- Question 16 – Which one of the following options is not a property of Boolean algebra? Note: + is OR, is AND, and ' is NOT.
- Question 17 – In the C runtime environment, which one of the following is stored in the heap?
- Question 18 – Consider the following two statements about interrupt handling mechanisms in a CPU. S1: In a non-vectored interrupt mechanism, it usually takes more…
- Question 19 – Consider the following three ANSI C programs, P1, P2, and P3. Which one of the following statements is true?
- Question 20 – 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…
- Question 21 – 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…
- Question 22 – Which one of the following protocols may need to broadcast some of its messages?
- Question 23 – Which one of the following CPU scheduling algorithms cannot be preemptive?
- Question 24 – 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…
- Question 25 – Which of the following can be recurrence relation(s) corresponding to an algorithm with time complexity (n)?
- Question 26 – 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…
- Question 27 – For a real number a, let I(a)= -11(3x2-ax+1)\,dx. Which of the following statements is/are true?
- Question 28 – 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…
- Question 29 – Which of the following grammars is/are ambiguous?
- Question 30 – 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.…
- Question 31 – 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.…
- Question 32 – 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…
- Question 33 – 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…
- Question 34 – The 32-bit IEEE 754 single-precision representation of a number is `0xC2710000`. The number in decimal representation is . (rounded off to two decimal…
- Question 35 – A lexical analyzer uses the following token definitions: - letter [A-Za-z] - digit [0-9] - id letter(letter digit)* - number digit+ - ws (blank tab…
- Question 36 – 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…
- Question 37 – 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…
- Question 38 – 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…
- Question 39 – 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…
- Question 40 – 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…
- Question 41 – 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…
- Question 42 – In the context of schema normalization in relational DBMS, consider a set F of functional dependencies. The set of all functional dependencies implied…
- Question 43 – Consider the transmission of data bits `110001011000` over a link that uses Cyclic Redundancy Check (CRC) code for error detection. If the generator…
- Question 44 – Consider a processor that has 16 general-purpose registers and uses a 2-byte instruction format for all instructions. Variable-sized opcodes are…
- Question 45 – 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?
- Question 46 – 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…
- Question 47 – Consider the following two finite automata D 1 and D 2. Which of the following statements is/are true?
- Question 48 – 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?
- Question 49 – 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…
- Question 50 – 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…
- Question 51 – 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…
- Question 52 – 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,…
- Question 53 – 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…
- Question 54 – 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…
- Question 55 – 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…
- Question 56 – 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…
- Question 57 – 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…
- Question 58 – 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…
- Question 59 – 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…
- Question 60 – Consider the following ANSI C program. The output of this program is . (answer in integer) Note: Assume that the program compiles and runs…
- Question 61 – Consider the following ANSI C function. The maximum possible value that can be returned from this function is . (answer in integer) Note: Ignore…
- Question 62 – The determinant of a 44 matrix A is 3. The value of the determinant of 2A is . (answer in integer)
- Question 63 – 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…
- Question 64 – 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…
- Question 65 – 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…