GATE 2021 CS – Previous Year Questions with Solutions
All 65 questions of GATE 2021 CS 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 – The ratio of boys to girls in a class is 7 to 3. Among the options below, an acceptable value for the total number of students in the class is:
- Question 2 – A polygon is convex if, for every pair of points, P and Q belonging to the polygon, the line segment PQ lies completely inside or on the polygon.…
- Question 3 – Consider the following sentences: (i) Everybody in the class is prepared for the exam. (ii) Babu invited Danish to his home because he enjoys playing…
- Question 4 – A circular sheet of paper is folded along the lines in the directions shown (first fold along the vertical diameter, then along the horizontal…
- Question 5 – is to surgery as writer is to . Which one of the following options maintains a similar logical relation in the above sentence?
- Question 6 – We have 2 rectangular sheets of paper, M and N, of dimensions 6 cm x 1 cm each. Sheet M is rolled to form an open cylinder by bringing the short edges…
- Question 7 – Details of prices of two items P and Q are presented in the table: P has cost ₹5,400, marked price ₹5,860; Q has profit 25%, marked price ₹10,000…
- Question 8 – There are five bags each containing identical sets of ten distinct chocolates. One chocolate is picked from each bag. The probability that at least…
- Question 9 – Given below are two statements 1 and 2, and two conclusions I and II. Statement 1: All bacteria are microorganisms. Statement 2: All pathogens are…
- Question 10 – Some people suggest anti-obesity measures (AOM) such as displaying calorie information in restaurant menus. Such measures sidestep addressing the core…
- Question 11 – Suppose that L 1 is a regular language and L 2 is a context-free language. Which one of the following languages is NOT necessarily context-free?
- Question 12 – Let P be an array containing n integers. Let t be the lowest upper bound on the number of comparisons of the array elements, required to find the…
- Question 13 – Consider the following three functions. f 1 = 10n, f 2 = n n, f 3 = nn Which one of the following options arranges the functions in the increasing…
- Question 14 – Consider the following statements. S 1: The sequence of procedure calls corresponds to a preorder traversal of the activation tree. S 2: The sequence…
- Question 15 – Consider the following statements. S 1: Every SLR(1) grammar is unambiguous but there are certain unambiguous grammars that are not SLR(1). S 2: For…
- Question 16 – Let the representation of a number in base 3 be 210. What is the hexadecimal representation of the number?
- Question 17 – Let p and q be two propositions. Consider the following two formulae in propositional logic. S 1: ( p (p q)) q S 2: q ( p (p q)) Which one of the…
- Question 18 – Consider the following two statements. S 1: Destination MAC address of an ARP reply is a broadcast address. S 2: Destination MAC address of an ARP…
- Question 19 – Consider the following array: [23, 32, 45, 69, 72, 73, 89, 97]. Which algorithm out of the following options uses the least number of comparisons…
- Question 20 – A binary search tree T contains n distinct elements. What is the time complexity of picking an element in T that is smaller than the maximum element…
- Question 21 – In the context of operating systems, which of the following statements is/are correct with respect to paging?
- Question 22 – Let M denote an encoding of an automaton M. Suppose that = \0,1\. Which of the following languages is/are NOT recursive?
- Question 23 – Suppose a database system crashes again while recovering from a previous crash. Assume checkpointing is not done by the database either during the…
- Question 24 – Which of the following standard C library functions will always invoke a system call when executed from a single-threaded process in a UNIX/Linux…
- Question 25 – Consider a linear list based directory implementation in a file system. Each directory is a list of nodes, where each node contains the file name…
- Question 26 – In an undirected connected planar graph G, there are eight vertices and five faces. The number of edges in G is .
- Question 27 – Consider the following undirected graph (a 3x3 grid of vertices, 12 edges) with edge weights: top row horizontal edges 0.1, 0.1; second row horizontal…
- Question 28 – The lifetime of a component of a certain type is a random variable whose probability density function is exponentially distributed with parameter 2.…
- Question 29 – There are 6 jobs with distinct difficulty levels, and 3 computers with distinct processing speeds. Each job is assigned to a computer such that: - The…
- Question 30 – Consider the following expression. x -3 2x+22-4x+3 The value of the above expression (rounded to 2 decimal places) is .
- Question 31 – Consider the following sequence of operations on an empty stack. push(54); push(52); pop(); push(55); push(62); s = pop(); Consider the following…
- Question 32 – Consider a computer system with a byte-addressable primary memory of size 232 bytes. Assume the computer system has a direct-mapped cache of size 32…
- Question 33 – A relation r(A, B) in a relational database has 1200 tuples. The attribute A has integer values ranging from 6 to 20, and the attribute B has integer…
- Question 34 – Consider the following representation of a number in IEEE 754 single-precision floating point format with a bias of 127. S: 1 E: 10000001 F:…
- Question 35 – Three processes arrive at time zero with CPU bursts of 16, 20 and 10 milliseconds. If the scheduler has prior knowledge about the length of the CPU…
- Question 36 – Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation (SDT)…
- Question 37 – The following relation records the age of 500 employees of a company, where empNo (indicating the employee number) is the key: empAge(empNo, age).…
- Question 38 – Consider a 3-bit counter, designed using T flip-flops, with the clock going to T P; T P = R', T Q = P' (Q clocked by P' path), T R = Q' path as shown…
- Question 39 – Assume that a 12-bit Hamming codeword consisting of 8-bit data and 4 check bits is d 8d 7d 6d 5c 8d 4d 3d 2c 4d 1c 2c 1, where the data bits and the…
- Question 40 – Consider the following recurrence relation. T(n) = T(n/2) + T(2n/5) + 7n if n>0; T(n)=1 if n=0. Which one of the following options is correct?
- Question 41 – Consider the following context-free grammar where the set of terminals is a, b, c, d, f. S -> d a T R f T -> a S b a T epsilon R -> c a T R epsilon…
- Question 42 – Let r i(z) and w i(z) denote read and write operations respectively on a data item z by a transaction T i. Consider the following two schedules. S 1:…
- Question 43 – Consider the relation R(P,Q,S,T,X,Y,Z,W) with the following functional dependencies. PQ X;\ P YX;\ Q Y;\ Y ZW Consider the decomposition of the…
- Question 44 – Let G be a group of order 6, and H be a subgroup of G such that 1 < H < 6. Which one of the following options is correct?
- Question 45 – Consider the two statements. S 1: There exist random variables X and Y such that (E[(X-E(X))(Y-E(Y))])2 > Var[X]Var[Y] S 2: For all random variables X…
- Question 46 – Let G=(V,E) be an undirected unweighted connected graph. The diameter of G is defined as diam(G)= u,v V\length of shortest path between u and v\. Let…
- Question 47 – Consider the following ANSI C program. Which one of the following options is correct?
- Question 48 – Consider the following language. L = \w \0,1\* w ends with the substring 011\ Which one of the following deterministic finite automata accepts L?
- Question 49 – For a Turing machine M, M denotes an encoding of M. Consider the following two languages. L 1 = \ M M takes more than 2021 steps on all inputs\ L 2 =…
- Question 50 – Define R n to be the maximum amount earned by cutting a rod of length n meters into one or more pieces of integer length and selling them. For i>0,…
- Question 51 – An articulation point in a connected graph is a vertex such that removing the vertex and its incident edges disconnects the graph into two or more…
- Question 52 – Consider the following Boolean expression. F = (X+Y+Z)(X+Y)(Y+Z) Which of the following Boolean expressions is/are equivalent to F (complement of F)?
- Question 53 – A relation R is said to be circular if aRb and bRc together imply cRa. Which of the following options is/are correct?
- Question 54 – A TCP server application is programmed to listen on port number P on host S. A TCP client is connected to the TCP server over the network. Consider…
- Question 55 – Consider two hosts P and Q connected through a router R. The maximum transfer unit (MTU) value of the link between P and R is 1500 bytes, and between…
- Question 56 – Consider the following pseudocode, where S is a semaphore initialized to 5 in line#2 and counter is a shared variable initialized to 0 in line#1.…
- Question 57 – Consider a dynamic hashing approach for 4-bit integer keys: (1) There is a main hash table of size 4. (2) The 2 least significant bits of a key are…
- Question 58 – Consider the following ANSI C function: Let Z be an array of 10 elements with Z[i]=1, for all i such that 0 i 9. The value returned by…
- Question 59 – Consider the sliding window flow-control protocol operating between a sender and a receiver over a full-duplex error-free link. Assume the following:…
- Question 60 – Consider the following C code segment: In a compiler, this code segment is represented internally as a directed acyclic graph (DAG). The number of…
- Question 61 – In a pushdown automaton P=(Q,,,,q 0,F), a transition of the form p a, X Y q represents (q,Y)(p,a,X). Consider the following pushdown automaton over…
- Question 62 – Consider the following matrix. pmatrix 0&1&1&1\\ 1&0&1&1\\ 1&1&0&1\\ 1&1&1&0 pmatrix The largest eigenvalue of the above matrix is .
- Question 63 – A five-stage pipeline has stage delays of 150, 120, 150, 160 and 140 nanoseconds. The registers that are used between the pipeline stages have a delay…
- Question 64 – A sender (S) transmits a signal, which can be one of the two kinds: H and L with probabilities 0.1 and 0.9 respectively, to a receiver (R). In the…
- Question 65 – Consider the following instruction sequence where registers R1, R2 and R3 are general purpose and MEMORY[X] denotes the content at the memory location…