Skip to content

GATE CS question library

Practise GATE CS Computer Science previous year questions free. Browse by subject, syllabus topic, year and question type, with answers and available solutions.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

20 on this page
Official PYQ2021Operating SystemCPU SchedulingNAT · 1 mark
Three processes arrive at time zero with CPU\text{CPU} bursts of 16,  2016,\;20 and 1010 milliseconds. If the scheduler has prior knowledge about the length of the CPU\text{CPU} bursts, the minimum achievable average waiting time for these three processes in a non-preemptive scheduler (rounded to nearest integer) is _____________ milliseconds.
Official PYQ2021Compiler DesignSyntax-directed TranslationMCQ · 2 marks
​​​Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation (SDT)\text{(SDT)} actions, given as pseudo-code …
Official PYQ2021DatabasesRelational Model: Relational AlgebraMCQ · 2 marks
The following relation records the age of 500500 employees of a company, where empNoempNo (indicating the employee number) is the key: empAge(empNo‾,age)empAge(\underline{empNo},age) Consider the following relational algebra expression: ΠempNo(empAge⋈(age>age1)ρempNo1,age1(empAge))\Pi_{empNo}(empAge \Join_{(age>age1)} \rho_{empNo1,age1}(empAge)) What does the above expression generate?
Official PYQ2021Digital LogicSequential CircuitsMCQ · 2 marks
Consider a 33-bit counter, designed using TT flip-flops, as shown below: Assuming the initial state of the counter given by PQR\text{PQR} as 000000, what are the next three states?
Official PYQ2021Computer NetworksData Link Layer: Framing, Error Detection, MAC, Ethernet BridgingMCQ · 2 marks
Assume that a 1212-bit Hamming codeword consisting of 88-bit data and 44 check bits is d8d7d6d5c8d4d4d3d2c4d1c2c1d_8d_7d_6d_5c_8d_4d_ 4d_3d_2c_4d_1c_2c_1, where the data bits and the check bits are given in the following tables: …
Official PYQ2021Compiler DesignParsing (LL, LR)MCQ · 2 marks
Consider the following context-free grammar where the set of terminals is {a,b,c,d,f}\{a,b,c,d,f\}. …
Official PYQ2021AlgorithmsAsymptotic Worst Case Time and Space ComplexityMCQ · 2 marks
Consider the following recurrence relation. T(n)={T(n∕2)+T(2n∕5)+7nif  n>01if  n=0T\left ( n \right )=\left\{\begin{array} {lcl} T(n ∕ 2)+T(2n∕5)+7n & \text{if} \; n>0\\1 & \text{if}\; n=0 \end{array}\right. Which one of the following options is correct?
Official PYQ2021DatabasesTransactions and Concurrency ControlMCQ · 2 marks
Let ri(z)r_i(z) and wi(z)w_i(z) denote read and write operations respectively on a data item zz by a transaction TiT_i. Consider the following two schedules. S1:r1(x)r1(y)r2(x)r2(y)w2(y)w1(x)S_1: r_1(x)r_1(y)r_2(x)r_2(y)w_2(y)w_1(x) S2:r1(x)r2(x)r2(y)w2(y)r1(y)w1(x)S_2: r_1(x)r_2(x)r_2(y)w_2(y)r_1(y)w_1(x) Which one of the following options is correct?
Official PYQ2021Engineering MathematicsMonoids and GroupsMCQ · 2 marks
Let GG be a group of order 66, and HH be a subgroup of GG such that 1<∣H∣<61<|H|<6. Which one of the following options is correct?
Official PYQ2021DatabasesNormal FormsMCQ · 2 marks
Consider the relation R(P,Q,S,T,X,Y,Z,W)R(P,Q,S,T,X,Y,Z,W) with the following functional dependencies. PQ→X;P→YX;Q→Y;Y→ZWPQ\rightarrow X;\quad P\rightarrow YX;\quad Q\rightarrow Y; \quad Y\rightarrow ZW Consider the decomposition of the relation RR into the constituent relations according to the following two decomposition schemes. …
Official PYQ2021Engineering MathematicsProbability: Random Variables and DistributionsMCQ · 2 marks
Consider the two statements. S1:S_1:\quad There exist random variables XX and YY such that (E[(X−E(X))(Y−E(Y))])2>Var[X]Var[Y]\left(\mathbb E[(X-\mathbb E(X))(Y-\mathbb E(Y))]\right)^2>\textsf{Var}[X]\textsf{Var}[Y] S2:S_2:\quad For all random variables XX and Y,Cov[X,Y]=E[∣X−E[X]∣  ∣Y−E[Y]∣]Y, \textsf{Cov}[X,Y]=\mathbb E \left[|X-\mathbb E[X]|\;|Y-\mathbb E[Y]|\right ] Which one of the following …
Official PYQ2021Engineering MathematicsGraphs: Connectivity, Matching, ColouringMCQ · 2 marks
Let G=(V,E)G=(V, E) be an undirected unweighted connected graph. The diameter of GG is defined as: diam(G)=max⁡u,v∈V{the length of shortest path between u and v}\text{diam}(G)=\displaystyle \max_{u,v\in V} \{\text{the length of shortest path between $u$ and $v$}\} Let MM be the adjacency matrix of GG. Define graph G2G_2 on the same set of vertices with adjacency matrix NN, where …
Official PYQ2021Programming and Data StructuresProgramming in CMCQ · 2 marks
​​​​​Consider the following ANSI C\text{ ANSI C} program. #include <stdio.h> int main() { int i, j, count; count=0; i=0; for (j=-3; j<=3; j++) { if (( j >= 0) && (i++)) count = count + j; } count = count +i; printf("%d", count); return 0; } Which one of the following options is correct?
Official PYQ2021Theory of ComputationRegular Expressions and Finite AutomataMCQ · 2 marks
Consider the following language: L={w∈{0,1}∗∣w ends with the substring 011}L= \{ w \in \{0,1\}^* \mid w \text{ ends with the substring } 011 \} Which one of the following deterministic finite automata accepts L?L?
Official PYQ2021Theory of ComputationUndecidabilityMCQ · 2 marks
For a Turing machine MM, ⟨M⟩\langle M \rangle denotes an encoding of MM. Consider the following two languages. L1={⟨M⟩∣M takes more than 2021 steps on all inputs}L2={⟨M⟩∣M takes more than 2021 steps on some input}\begin{array}{ll} L_1 = \{ \langle M \rangle \mid M \text{ takes more than } 2021 \text{ steps on all inputs} \} \\ L_2 = \{ \langle M \rangle \mid M\text{ takes more than } 2021 \text{ steps on some input} \} \end{array} Which one of the …
Official PYQ2021AlgorithmsAlgorithm Design: Greedy TechniquesMSQ · 2 marks
Define RnR_n to be the maximum amount earned by cutting a rod of length nn meters into one or more pieces of integer length and selling them. For i>0i>0, let p[i]p[i] denote the selling price of a rod whose length is ii meters. Consider the array of prices: …
Official PYQ2021Programming and Data StructuresTreesMCQ · 2 marks
An articulationarticulation pointpoint in a connected graph is a vertex such that removing the vertex and its incident edges disconnects the graph into two or more connected components. Let TT be a DFS\text{DFS} tree obtained by doing DFS\text{DFS} in a connected undirected graph GG. Which of the following options is/are correct?
Official PYQ2021Digital LogicBoolean AlgebraMSQ · 2 marks
Consider the following Boolean expression. F=(X+Y+Z)(X‾+Y)(Y‾+Z)F=(X+Y+Z)(\overline X +Y)(\overline Y +Z) Which of the following Boolean expressions is/are equivalent to F‾\overline F (complement of FF)?
Official PYQ2021Engineering MathematicsSets, Relations and FunctionsMCQ · 2 marks
A relation RR is said to be circular if aRba\text{R}b and bRcb\text{R}c together imply cRac\text{R}a. Which of the following options is/are correct?
Official PYQ2021Computer NetworksTransport Layer: Flow Control, Congestion Control, UDP, TCP, SocketsMSQ · 2 marks
A TCP\text{TCP} server application is programmed to listen on port number PP on host SS. A TCP\text{TCP} client is connected to the TCP\text{TCP} server over the network. Consider that while the TCP\text{TCP} connection was active, the server machine SS crashed and rebooted. Assume that the client does not use the TCP\text{TCP} keepalive timer. …