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 PYQ2018Operating SystemConcurrency and SynchronizationMCQ · 2 marks
Consider the following solution to the producer-consumer synchronization problem. The shared buffer size is NN. Three semaphores emptyempty, fullfull and mutexmutex are defined with respective initial values of 0,N0, N and 11. Semaphore emptyempty denotes the number of available slots in the buffer, for the consumer to read from. Semaphore fullfull …
Official PYQ2018Digital LogicNumber Representations (Fixed and Floating Point)MCQ · 2 marks
Consider the unsigned 8-bit fixed point binary number representation, below, b7  b6  b5  b4  b3  ⋅b2  b1  b0b_7 \: \: b_6 \: \: b_5 \: \: b_4 \: \: b_3 \: \: \cdot b_2 \: \: b_1 \: \: b_0 where the position of the primary point is between b3b_3 and b2b_2 . Assume b7b_7 is the most significant bit. Some of the decimal numbers listed below cannot be represented exactly in the …
Official PYQ2018Programming and Data StructuresProgramming in CMCQ · 2 marks
Consider the following C code. Assume that unsigned long int type length is 6464 bits. unsigned long int fun(unsigned long int n) { unsigned long int i, j=0, sum = 0; for( i=n; i>1; i=i/2) j++; for( ; j>1; j=j/2) sum++; return sum; } The value returned when we call fun with the input 2402^{40} is:
Official PYQ2018AlgorithmsGraph Traversals (BFS, DFS)MCQ · 2 marks
Let GG be a simple undirected graph. Let TDT_D be a depth first search tree of GG. Let TBT_B be a breadth first search tree of GG. Consider the following statements. No edge of GG is a cross edge with respect to TDT_D. (A cross edge in GG is between two nodes neither of which is an ancestor of the other in TDT_D). For every edge …
Official PYQ2018Programming and Data StructuresProgramming in CMCQ · 2 marks
#include<stdio.h> void fun1(char* s1, char* s2){ char* temp; temp = s1; s1 = s2; s2 = temp; } void fun2(char** s1, char** s2){ char* temp; temp = *s1; *s1 = *s2; *s2 = temp; } int main(){ char *str1="Hi", *str2 = "Bye"; fun1(str1, str2); printf("%s %s", str1, str2); fun2(&str1, &str2); printf("%s %s", str1, str2); return 0; } The output of the …
Official PYQ2018AlgorithmsAlgorithm Design: Dynamic ProgrammingMCQ · 2 marks
Assume that multiplying a matrix G1G_1 of dimension p×qp \times q with another matrix G2G_2 of dimension q×rq \times r requires pqrpqr scalar multiplications. Computing the product of nn matrices G1G2G3…GnG_1G_2G_3 \dots G_n can be done by parenthesizing in different ways. Define GiGi+1G_i G_{i+1} as an explicitly computed pair for a given …
Official PYQ2018Computer NetworksTransport Layer: Flow Control, Congestion Control, UDP, TCP, SocketsNAT · 1 mark
Consider a long-lived TCP\text{TCP} session with an end-to-end bandwidth of 1  Gbps  (=1091\; \text{Gbps}\; (=10^9 bits-per-second).). The session starts with a sequence number of 12341234. The minimum time (in seconds, rounded to the closet integer) before this sequence number can be used again is _________.
Official PYQ2018Engineering MathematicsPropositional and First Order LogicMCQ · 2 marks
Consider the first-order logic sentence φ≡∃ s ∃ t ∃ u ∀ v ∀ w∀ x ∀ y ψ(s,t,u,v,w,x,y)\varphi \equiv \exists \: s \: \exists \: t \: \exists \: u \: \forall \: v \: \forall \: w \forall \: x \: \forall \: y \: \psi(s, t, u, v, w, x, y) where ψ(s,t,u,v,w,x,y,)\psi(s, t, u, v, w, x, y, ) is a quantifier-free first-order logic formula using only predicate symbols, and possibly equality, but no function symbols. …
Official PYQ2018Engineering MathematicsSets, Relations and FunctionsMCQ · 2 marks
Let NN be the set of natural numbers. Consider the following sets, P:P: Set of Rational numbers (positive and negative) Q:Q: Set of functions from {0,1}\{0,1\} to NN R:R: Set of functions from NN to {0,1}\{0, 1\} S:S: Set of finite subsets of NN Which of the above sets are countable?
Official PYQ2018Operating SystemDeadlockNAT · 1 mark
Consider a system with 33 processes that share 44 instances of the same resource type. Each process can request a maximum of KK instances. Resources can be requested and releases only one at a time. The largest value of KK that will always avoid deadlock is ___
Official PYQ2018Engineering MathematicsEigenvalues and Eigenvectors, LU DecompositionMCQ · 2 marks
Consider a matrix P whose only eigenvectors are the multiples of [14]\begin{bmatrix} 1 \\ 4 \end{bmatrix}. Consider the following statements. P does not have an inverse P has a repeated eigenvalue P cannot be diagonalized Which one of the following options is correct?
Official PYQ2018Digital LogicSequential CircuitsNAT · 1 mark
Consider the sequential circuit shown in the figure, where both flip-flops used are positive edge-triggered D\text{D} flip-flops. The number of states in the state transition diagram of this circuit that have a transition back to the same state on some value of "in" is ____
Official PYQ2018Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageNAT · 1 mark
A 32-bit32\text{-bit} wide main memory unit with a capacity of 1  GB1\;\textsf{GB} is built using 256M×4-bit256\textsf{M} \times 4\text{-bit} DRAM chips. The number of rows of memory cells in the DRAM chip is 2142^{14}. The time taken to perform one refresh operation is 50  nanoseconds50\;\text{nanoseconds}. The refresh period is 2  milliseconds.2\;\text{milliseconds.} The percentage …
Official PYQ2018Programming and Data StructuresTreesNAT · 1 mark
The postorder traversal of a binary tree is 8, 9, 6, 7, 4, 5, 2, 3, 1\text{8, 9, 6, 7, 4, 5, 2, 3, 1}. The inorder traversal of the same tree is 8,6,9,4,7,2,5,1,3{8, 6, 9, 4, 7, 2, 5, 1, 3}. The height of a tree is the length of the longest path from the root to any leaf. The height of the binary tree above is _____
Official PYQ2018Engineering MathematicsMonoids and GroupsNAT · 1 mark
Let GG be a finite group on 8484 elements. The size of a largest possible proper subgroup of GG is _____
Official PYQ2018Engineering MathematicsGraphs: Connectivity, Matching, ColouringNAT · 1 mark
The chromatic number of the following graph is _____
Official PYQ2018Programming and Data StructuresRecursionNAT · 1 mark
Consider the following C\text{C} program: #include<stdio.h> int counter=0; int calc (int a, int b) { int c; counter++; if(b==3) return (a*a*a); else { c = calc(a, b/3); return (c*c*c); } } int main() { calc(4, 81); printf("%d", counter); } The output of this program is ______.
Official PYQ2018Engineering MathematicsEigenvalues and Eigenvectors, LU DecompositionNAT · 1 mark
Consider a matrix A=uvTA= uv^T where u=(12),v=(11)u=\begin{pmatrix}1 \\ 2 \end{pmatrix} , v = \begin{pmatrix}1 \\1 \end{pmatrix}. Note that vTv^T denotes the transpose of vv. The largest eigenvalue of AA is ____
Official PYQ2018Engineering MathematicsMaxima and Minima, Mean Value Theorem, IntegrationNAT · 1 mark
The value of ∫0π/4xcos⁡(x2)dx\int^{\pi/4} _0 x \cos(x^2) dx correct to three decimal places (assuming that π=3.14\pi = 3.14) is ____
Official PYQ2018Engineering MathematicsProbability: Random Variables and DistributionsNAT · 1 mark
Two people, PP and QQ, decide to independently roll two identical dice, each with 66 faces, numbered 11 to 66. The person with the lower number wins. In case of a tie, they roll the dice repeatedly until there is no tie. Define a trial as a throw of the dice by PP and Q.Q. Assume that all 66 numbers on each dice are equi-probable and …