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 PYQ2016Theory of ComputationContext-free Grammars and Push-down AutomataMCQ · 1 mark
Consider the transition diagram of a PDA given below with input alphabet Σ={a,b}\Sigma=\{a,b\} and stack alphabet Γ={X,Z}\Gamma = \{X,Z\}. ZZ is the initial stack symbol. Let LL denote the language accepted by the PDA Which one of the following is TRUE?
Official PYQ2016Programming and Data StructuresGraphsNAT · 1 mark
Consider the weighted undirected graph with 44 vertices, where the weight of edge {i,j}\{i,j\} is given by the entry WijW_{ij} in the matrix WW. W=[02852058850x58x0]\begin{bmatrix} 0&2 &8 &5 \\ 2&0 &5 &8 \\ 8&5 &0 &x \\ 5& 8 &x &0 \end{bmatrix} The largest possible integer value of xx, for which at least one …
Official PYQ2016AlgorithmsMinimum Spanning TreesMCQ · 1 mark
G=(V,E)G=(V, E) is an undirected simple graph in which each edge has a distinct weight, and ee is a particular edge of GG. Which of the following statements about the minimum spanning trees (MSTs)(MSTs) of GG is/are TRUE? If ee is the lightest edge of some cycle in GG, then every MST of GG includes ee. If ee is the heaviest edge of some …
Official PYQ2016Programming and Data StructuresProgramming in CMCQ · 1 mark
What will be the output of the following CC program? void count (int n) { static int d=1; printf ("%d",n); printf ("%d",d); d++; if (n>1) count (n-1); printf ("%d",d); } void main(){ count (3); }
Official PYQ2016AlgorithmsMinimum Spanning TreesNAT · 1 mark
Let GG be a complete undirected graph on 44 vertices, having 66 edges with weights being 1,2,3,4,5,1, 2, 3, 4, 5, and 66. The maximum possible weight that a minimum weight spanning tree of GG can have is __________
Official PYQ2016Digital LogicCombinational CircuitsMCQ · 1 mark
Consider the two cascade 22 to 11 multiplexers as shown in the figure . The minimal sum of products form of the output XX is
Official PYQ2016Computer NetworksTransport Layer: Flow Control, Congestion Control, UDP, TCP, SocketsNAT · 1 mark
For a host machine that uses the token bucket algorithm for congestion control, the token bucket has a capacity of 11 megabyte\text{megabyte} and the maximum output rate is 2020 megabytes\text{megabytes} per second\text{second}. Tokens arrive at a rate to sustain output at a rate of 1010 megabytes\text{megabytes} per second\text{second}. The token bucket is currently …
Official PYQ2016Theory of ComputationUndecidabilityMCQ · 1 mark
Let XX be a recursive language and YY be a recursively enumerable but not recursive language. Let WW and ZZ be two languages such that Y‾\overline{Y} reduces to WW, and ZZ reduces to X‾\overline{X} (reduction means the standard many-one reduction). Which one of the following statements is TRUE?
Official PYQ2016Operating SystemConcurrency and SynchronizationMCQ · 1 mark
Consider the following proposed solution for the critical section problem. There are nn processes : P0....Pn−1P_0....P_{n-1}. In the code, function pmax\text{pmax} returns an integer not smaller than any of its arguments .For all i,t[i]i,t[i] is initialized to zero. Code for PiP_i; do { c[i]=1; t[i]= pmax (t[0],....,t[n-1])+1; c[i]=0; for every j != i in …
Official PYQ2016Engineering MathematicsSets, Relations and FunctionsNAT · 1 mark
A function f:N+→N+f: \Bbb{N^+} \rightarrow \Bbb{N^+} , defined on the set of positive integers N+\Bbb{N^+}, satisfies the following properties: f(n)=f(n/2)f(n)=f(n/2) if nn is even f(n)=f(n+5)f(n)=f(n+5) if nn is odd Let R={i∣∃j:f(j)=i}R=\{ i \mid \exists{j} : f(j)=i \} be the set of distinct values that ff takes. The maximum possible size of RR is ___________.
Official PYQ2016Operating SystemI/O SchedulingNAT · 1 mark
Cylinder a disk queue with requests for I/OI/O to blocks on cylinders 47,38,121,191,87,11,92,10.47, 38, 121, 191, 87, 11, 92, 10. The C-LOOK scheduling algorithm is used. The head is initially at cylinder number 6363, moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered from 00 to 199199. The total head movement (in number of cylinders) …
Official PYQ2016Engineering MathematicsCombinatorics: Counting, Recurrence Relations, Generating FunctionsNAT · 1 mark
Consider the recurrence relation a1=8,an=6n2+2n+an−1a_1 =8 , a_n =6n^2 +2n+a_{n-1}. Let a99=K×104a_{99}=K\times 10^4. The value of KK is __________.
Official PYQ2016Computer NetworksFragmentation and IP Addressing, IPv4, CIDRNAT · 1 mark
An IP datagram of size 10001000 bytes \text{bytes }arrives at a router. The router has to forward this packet on a link whose MTU (maximum transmission unit) is 100100 bytes \text{bytes }. Assume that the size of the IP header is 2020 bytes .\text{bytes }. The number of fragments that the IP datagram will be divided into for transmission is________.
Official PYQ2016Operating SystemMemory Management and Virtual MemoryNAT · 1 mark
Consider a computer system with ten physical page frames. The system is provided with an access sequence (a1,a2,....,a20,a1,a2,...a20)(a_{1}, a_{2},....,a_{20}, a_{1}, a_{2},...a_{20}), where each aia_{i} is a distinct virtual page number. The difference in the number of page faults between the last-in-first-out page replacement policy and the optimal page replacement policy …
Official PYQ2016Engineering MathematicsProbability: Random Variables and DistributionsNAT · 1 mark
Consider the following experiment. Step 1. Flip a fair coin twice. Step 2. If the outcomes are (TAILS, HEADS) then output YY and stop. Step 3. If the outcomes are either (HEADS, HEADS) or (HEADS, TAILS), then output NN and stop. Step 4. If the outcomes are (TAILS, TAILS), then go to Step 1.1. The probability that the output of the experiment is YY …
Official PYQ2016Programming and Data StructuresBinary HeapsMCQ · 1 mark
An operator delete(i)(i) for a binary heap data structure is to be designed to delete the item in the ii-th node. Assume that the heap is implemented in an array and ii refers to the ii-th index of the array. If the heap tree has depth dd (number of edges on the path from the root to the farthest leaf ), then what is the time complexity to …
Official PYQ2016Theory of ComputationContext-free Grammars and Push-down AutomataMCQ · 1 mark
Consider the following context-free grammars; G1:S→aS∣B,B→b∣bBG_1 : S \to aS \mid B, B \to b \mid bB G2:S→aA∣bB,A→aA∣B∣ε,B→bB∣εG_2 : S \to aA \mid bB, A \to aA \mid B \mid \varepsilon,B \to bB \mid \varepsilon Which one of the following pairs of languages is generated by G1G_1 and G2G_2 ,respectively?
Official PYQ2016Programming and Data StructuresProgramming in CMCQ · 1 mark
The following function computes the maximum value contained in an integer array P[ ]P[ \ ] of size nn (n>=1)(n>=1). int max (int *p,int n) { int a = 0, b=n-1; while (__________) { if (p[a]<= p[b]) {a = a+1;} else {b = b-1;} } return p[a]; } The missing loop condition is:
Official PYQ2016DatabasesTransactions and Concurrency ControlMCQ · 1 mark
Consider the following two phase locking protocol. Suppose a transaction TT accesses (for read or write operations), a certain set of objects {O1,…,Ok}\{O_1,\ldots,O_k \}. This is done in the following manner: Step 1\text{Step 1}. TT acquires exclusive locks to O1,…,OkO_1,\ldots,O_k in increasing order of their addresses. Step 2\text{Step 2}. The required …
Official PYQ2016Compiler DesignRuntime EnvironmentsMCQ · 1 mark
What will be the output of the following pseudo-code when parameters are passed by reference and dynamic scoping is assumed? a = 3; void n(x) { x = x * a; print (x); } void m(y) { a = 1 ; a = y - a; n(a); print (a); } void main () { m(a); }