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 PYQ2021Computer NetworksTransport Layer: Flow Control, Congestion Control, UDP, TCP, SocketsMSQ · 2 marks
Consider two hosts PP and QQ connected through a router RR. The maximum transfer unit (MTU)\text{(MTU)} value of the link between PP and RR is 15001500 bytes, and between RR and QQ is 820820 bytes. A TCP\text{TCP} segment of size 14001400 bytes was transferred from PP to QQ through RR, with IP\text{IP} identification value as …
Official PYQ2021Operating SystemConcurrency and SynchronizationMSQ · 2 marks
Consider the following pseudocode, where S\textsf{S} is a semaphore initialized to 55 in line #2\#2 and counter\textsf{counter} is a shared variable initialized to 00 in line #1\#1. Assume that the increment operation in line #7\#7 is not\textit{not} atomic. 1. int counter = 0; 2. Semaphore S = init(5); 3. void parop(void) 4. { 5. wait(S); 6. …
Official PYQ2021AlgorithmsSearching, Sorting, HashingMCQ · 2 marks
Consider a dynamic\textit{dynamic} hashing approach for 44-bit integer keys: There is a main hash table of size 44. The 22 least significant bits of a key is used to index into the main hash table. Initially, the main hash table entries are empty. Thereafter, when more keys are hashed into it, to resolve collisions, the set of all keys corresponding to …
Official PYQ2021AlgorithmsAsymptotic Worst Case Time and Space ComplexityNAT · 2 marks
Consider the following ANSI C\text{ANSI C} function: int SimpleFunction(int Y[], int n, int x) { int total = Y[0], loopIndex; for (loopIndex=1; loopIndex<=n-1; loopIndex++) total=x*total +Y[loopIndex]; return total; } Let Z\textsf{Z} be an array of 1010 elements with Z[i]=1\textsf{Z}[i]=1, for all ii such that 0≤i≤90 \leq i \leq 9. The value returned …
Official PYQ2021Computer NetworksTransport Layer: Flow Control, Congestion Control, UDP, TCP, SocketsNAT · 2 marks
Consider the sliding window flow-control protocol operating between a sender and a receiver over a full-duplex error-free link. Assume the following: The time taken for processing the data frame by the receiver is negligible. The time taken for processing the acknowledgement frame by the sender is negligible. The sender has infinite number of frames …
Official PYQ2021Theory of ComputationContext-free Grammars and Push-down AutomataNAT · 2 marks
In a pushdown automaton P=(Q,Σ,Γ,δ,q0,F)P=(Q, \Sigma, \Gamma, \delta, q_0, F), a transition of the form, where p,q∈Qp,q \in Q, a∈Σ∪{ϵ}a \in \Sigma \cup \{ \epsilon \}, and X,Y∈Γ∪{ϵ}X,Y \in \Gamma \cup \{ \epsilon \}, represents (q,Y)∈δ(p,a,X).(q,Y) \in \delta(p,a,X).Consider the following pushdown automaton over the input alphabet Σ={a,b}\Sigma = \{a,b\} and stack alphabet …
Official PYQ2021Compiler DesignLocal OptimizationNAT · 2 marks
Consider the following CC code segment: a = b + c; e = a + 1; d = b + c; f = d + 1; g = e + f; In a compiler, this code segment is represented internally as a directed acyclic graph (DAG)\text{(DAG)}. The number of nodes in the DAG\text{DAG} is _____________
Official PYQ2021Engineering MathematicsEigenvalues and Eigenvectors, LU DecompositionNAT · 2 marks
Consider the following matrix.(0111101111011110)\begin{pmatrix} 0 & 1 & 1 & 1\\ 1& 0& 1 & 1\\ 1& 1 & 0 & 1 \\1 & 1 & 1 & 0 \end{pmatrix}The largest eigenvalue of the above matrix is __________.
Official PYQ2021Computer Organization and ArchitectureInstruction PipeliningNAT · 2 marks
A five-stage pipeline has stage delays of 150,120,150,160150, 120, 150, 160 and 140140 nanoseconds. The registers that are used between the pipeline stages have a delay of 55 nanoseconds each. The total time to execute 100100 independent instructions on this pipeline, assuming there are no pipeline stalls, is _______ nanoseconds.
Official PYQ2021Computer Organization and ArchitectureMachine Instructions and Addressing ModesNAT · 2 marks
Consider the following instruction sequence where registers R1,R2\text{R1}, \text{R2} and R3\text{R3} are general purpose and MEMORY[X]\text{MEMORY[X]} denotes the content at the memory location X.\text{X}. …
Official PYQ2021Engineering MathematicsConditional Probability and Bayes TheoremNAT · 2 marks
A sender (S)(\textsf{S}) transmits a signal, which can be one of the two kinds: HH and LL with probabilities 0.10.1 and 0.90.9 respectively, to a receiver (R)(\textsf{R}). In the graph below, the weight of edge (u,v)(u,v) is the probability of receiving vv when uu is transmitted, where u,v∈{H,L}u,v \in \{H,L\}. For example, the probability that the …
Official PYQ2021General AptitudeMCQ · 1 mark
Gauri said that she can play the keyboard __________ her sister.
Official PYQ2021General AptitudeMCQ · 1 mark
A transparent square sheet shown above is folded along the dotted line. The folded sheet will look like ___________.
Official PYQ2021General AptitudeMCQ · 1 mark
If θ\theta is the angle, in degrees, between the longest diagonal of the cube and any one of the edges of the cube, then, cos⁡θ=\cos \theta =
Official PYQ2021General AptitudeMCQ · 1 mark
Pen : Write :: Knife :\text{Pen : Write :: Knife :} _______ Which one of the following options maintains a similar logical relation in the above?
Official PYQ2021General AptitudeMCQ · 2 marks
Listening to music during exercise improves performance and reduces discomfort. Scientists researched whether listening to music while studying can help students learn better and the results were inconclusive. Students who needed external stimulation for studying fared worse while students who did not need any external stimulation benefited from music. Which …
Official PYQ2021General AptitudeMCQ · 1 mark
​​​​​​If (x–12)2–(x−32)2=x+2\left( x – \dfrac{1}{2} \right)^2 – \left( x- \dfrac{3}{2} \right) ^2 = x+2, then the value of xx is:
Official PYQ2021General AptitudeMCQ · 2 marks
A jigsaw puzzle has 22 pieces. One of the pieces is shown above. Which one of the given options for the missing piece when assembled will form a rectangle? The piece can be moved, rotated or flipped to assemble with the above piece.
Official PYQ2021General AptitudeMCQ · 2 marks
The number of students in three classes is in the ratio 3:13:63:13:6. If 1818 students are added to each class, the ratio changes to 15:35:2115:35:21. The total number of students in all the three classes in the beginning was:
Official PYQ2021General AptitudeMCQ · 2 marks
The number of units of a product sold in three different years and the respective net profits are presented in the figure above. The cost/unit in Year 33 was ₹  1\;1, which was half the cost/unit in Year 22. The cost/unit in Year 33 was one-third of the cost/unit in Year 11. Taxes were paid on the selling price at 10%10 \%, 13%13 \%, and …