GATECS2016 (Set 1)
Question 1 
I will not leave the place until the minister does not meet me.  
I will not leave the place until the minister doesn’t meet me.  
I will not leave the place until the minister meet me.  
I will not leave the place until the minister meets me 
Discuss it
Question 2 
paraphrase  
paradox  
paradigm  
paraffin 
Discuss it
Question 3 
figurative  
collateral  
literal  
figurine 
Discuss it
Here, we are talking about figure of speech So, figurative is figure of speech meaning : Use of metamorphic meaning of words to explain your thoughts instead of literal use of them.
This solution is contributed by Mohit Gupta.
Question 4 
zentaga  
tagafer  
tagazen  
relffer 
Discuss it
Question 5 
56  
64  
72  
96 
Discuss it
Question 6 
Elegance  
Executive  
Smooth  
Soft 
Discuss it
Question 7 
India is a country of exactly seventeen languages.  
Linguistic pluralism is the only indicator of a nation’s diversity.  
Indian currency notes have sufficient space for all the Indian languages.  
Linguistic pluralism is strong evidence of India’s diversity. 
Discuss it
Question 8 
I P always beats Q II. R always beats S III. S loses to P only sometimes IV. R always loses to QWhich of the following can be logically inferred from the above statements?
(i) P is likely to beat all the three other players (ii) S is the absolute worst player in the set
(i) only  
(ii) only  
(i) and (ii)  
neither (i) nor (ii) 
Discuss it
Question 9 
(x^{3} + 8)  
(x  1)  
(2x  5)  
(x + 1) 
Discuss it
f(x) = 2x^{7} + 3x  5 = 2x^{7}  2x + 5x  5Putting x = 1, we get f(x) = 0. So, x1 is a factor of f(x). Thus, B is the correct choice.
Question 10 
40.00
 
46.02  
60.01  
92.02 
Discuss it
For exponential dependence we must have functions of form f(x) = a.(k power x) : a,k are constants and f(0)=a Let us assume: C = cycles for failure ; L = Load; a, k = constants according to question C is an exponential function of L Hence we can say, 1) C = a x (k^L)  > in case C is increasing exponentially 2) C = a / (k^L)  > in case C is decreasing exponentially we take 2nd equation and apply log to both side we get: log C + L x (log k) = log a ...... by logarithmic property given (C=100 for L=80) and (C=10000 for L=40) apply these to values to above equation, this gives us 2 equations and 2 variables: log a = log 100 + (80 x log k)...............(1) log a = log 10000 + (40 x log k)...........(2) we have 2 variables and 2 equations hence we find log a = 6 log k= 1/20 now find, [ L = (log a  log C) / (log k) ] for C=5000 cycles => L = (6  log 5000)*20 = 46.0206 ~ 46.02 => [ANS]
Question 11 
p: {8, 9, 10, 11, 12} q: x is a composite number r: x is a perfect square s: x is a prime numberNote : This question was asked as Numerical Answer Type.
8  
9  
11  
12 
Discuss it
Question 12 
A  
B  
C  
D 
Discuss it
Question 13 
0  
1  
2  
3 
Discuss it
Question 14 
1  
0  
1  
0.5 
Discuss it
Question 15 
0  
1  
15  
1 
Discuss it
Question 16 
x'y + xy'  
xy' + (xy)  
x'y + xy  
xy + (xy)' 
Discuss it
Question 17 
10  
11  
10  
11 
Discuss it
Question 18 
1  
2  
4  
5 
Discuss it
Question 19 
16  
31  
32  
None 
Discuss it
Question 20 
Both operations can be performed in O(1) time  
At most one operation can be performed in O(1) time but the worst case time for the other operation will be Ω(n)  
The worst case time complexity for both operations will be Ω(n)  
Worst case time complexity for both operations will be Ω(log n) 
Discuss it
Question 21 
1  
2  
4  
6 
Discuss it
abcdef adebcf abdcef adbcef abdecf adbecf
Question 22 
void f(int, short); void main() { int i = 100; short s = 12; short *p = &s; __________ ; // call to f() }Which one of the following expressions, when placed in the blank above, will NOT result in a type checking error?
f(s, *s)
 
i = f(i,s)  
f(i,*s)  
f(i,*p) 
Discuss it
Question 23 
Θ(n log n), Θ(n log n) and Θ(n^{2})
 
Θ(n^{2}), Θ(n^{2}) and Θ(n Log n)
 
Θ(n^{2}), Θ(n log n) and Θ(n log n)
 
Θ(n^{2}), Θ(n log n) and Θ(n^{2}) 
Discuss it
 Insertion Sort takes Θ(n^{2}) in worst case as we need to run two loops. The outer loop is needed to one by one pick an element to be inserted at right position. Inner loop is used for two things, to find position of the element to be inserted and moving all sorted greater elements one position ahead. Therefore the worst case recursive formula is T(n) = T(n1) + Θ(n).
 Merge Sort takes Θ(n Log n) time in all cases. We always divide array in two halves, sort the two halves and merge them. The recursive formula is T(n) = 2T(n/2) + Θ(n).
 QuickSort takes Θ(n^{2}) in worst case. In QuickSort, we take an element as pivot and partition the array around it. In worst case, the picked element is always a corner element and recursive formula becomes T(n) = T(n1) + Θ(n). An example scenario when worst case happens is, arrays is sorted and our code always picks a corner element as pivot.
Question 24 
P: Minimum spanning tree of G does not change Q: Shortest path between any pair of vertices does not change
P only
 
Q only  
Neither P nor Q  
Both P and Q 
Discuss it
Question 25 
#include<stdio.h> void mystery(int *ptra, int *ptrb) { int *temp; temp = ptrb; ptrb = ptra; ptra = temp; } int main() { int a=2016, b=0, c=4, d=42; mystery(&a, &b); if (a < c) mystery(&c, &a); mystery(&a, &d); printf("%d\n", a); }The output of the program _____________ Note : This question was asked as Numerical Answer Type.
2016  
0  
4  
8 
Discuss it
Question 26 
A  
B  
C  
D 
Discuss it
Question 27 
I and IV only  
II and III only
 
III and IV only  
II and IV only 
Discuss it
Question 28 
A  
B  
C  
D 
Discuss it
Question 29 
x = u  t; y = x * v; x = y + w; y = t  z; y = x * y;The minimum number of total variables required to convert the above code segment to static single assignment form is Note : This question was asked as Numerical Answer Type.
6  
8  
9  
10 
Discuss it
x = u  t; x = y + w;and three assignments of the variable y.
y = x * v; y = t  z; y = x * ySo we use two variables x1, x2 for specifying distinct assignments of x and y1, y2 and y3 each assignment of y. So, total number of variables is 10 (x1, x2, y1, y2, y3, t, u, v, w, z). Static Single Assignment form(SSA) of the given code segment is:
x1 = u  t; y1 = x1 * v; x2 = y1 + w; y2 = t  z; y3 = x2 * y2;Please refer below link for details https://www.cs.cmu.edu/~fp/courses/15411f08/lectures/09ssa.pdf
Question 30 
Shortest remaining time first  
Roundrobin with time quantum less than the shortest CPU burst  
Uniform random  
Highest priority first with priority proportional to CPU burst length 
Discuss it
Question 31 
V X Y Z  
V W X Z  
V W X Y  
V W X Y Z 
Discuss it
Question 32 
Atomicity
 
Consistency  
Isolation  
Deadlockfreedom 
Discuss it
Question 33 
(VOLUME, NUMBER, STARTPGE, ENDPAGE, TITLE, YEAR, PRICE)The primary key is (VOLUME, NUMBER, STARTPAGE, ENDPAGE) and the following functional dependencies exist in the schema.
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) > TITLE (VOLUME, NUMBER) > YEAR (VOLUME, NUMBER, STARTPAGE, ENDPAGE) > PRICEThe database is redesigned to use the following schemas.
(VOLUME, NUMBER, STARTPAGE, ENDPAGE, TITLE, PRICE) (VOLUME, NUMBER, YEAR)Which is the weakest normal form that the new database satisfies, but the old one does not?
1NF  
2NF  
3NF  
BCNF 
Discuss it
Question 34 
DNS
 
ARP  
DHCP  
RARP 
Discuss it
Question 35 
(i) HTTP (ii) FTP (iii) TCP (iv) POP3
(i) and (ii) only
 
(ii) and (iii) only  
(ii) and (iv) only  
(iv) only 
Discuss it
Question 36 
1  
2  
4  
10 
Discuss it
Question 37 
190  
296  
198  
200 
Discuss it
Question 38 
1  
2  
3  
4 
Discuss it
Let us assume: f(1) = x. Then, f(2) = f(2/2) = f(1) = x f(3) = f(3+5) = f(8) = f(8/2) = f(4/2) = f(2/1) = f(1) = x Similarly, f(4) = x f(5) = f(5+5) = f(10/2) = f(5) = y.So it will have two values. All multiples of 5 will have value y and others will have value x. It will have 2 different values.
Question 39 
Step 1. Flip a fair coin twice. Step 2. If the outcomes are (TAILS, HEADS) then output Y and stop. Step 3. If the outcomes are either (HEADS, HEAD) or (HEADS, TAILS), then output N and stop. Step 4. If the outcomes are (TAILS, TAILS), then go to Step 1.The probability that the output of the experiment is Y is (up to two decimal places). [This Question was originally a FillintheBlanks question]
0.33  
0.25  
0.5  
0.27 
Discuss it
Question 40 
A  
B  
C  
D 
Discuss it
Question 41 
3644  
3645  
456  
1823 
Discuss it
Question 42 
33 or 34  
30 or 31  
38 or 39  
100 
Discuss it
Throughput of 1st case T1: 1/max delay =1/800 Throughput of 2nd case T2: 1/max delay= 1/600 %age increase in throughput: (T2T1)/T2 = ( (1/600)  (1/800) ) / (1/800) = 33.33%
Question 43 
Θ(1)  
Θ(Log (n))  
Θ(√ n)  
Θ(n) 
Discuss it
It will take O(1) to calculate c4 = g3 + p3g2 + p3p2g1 + p3p2p1g0 + p3p2p1p0c0c4 = g3 + p3g2 + p3p2g1 + p3p2p1g0 + p3p2p1p0c0, if OR gate with 5 inputs is present.And, if fanin != number of inputs then we will have delay in each level, as given below. If we have 8 inputs, and OR gate with 2 inputs, to build an OR gate with 8 inputs, we will need 4 gates in level1, 2 in level2 and 1 in level3. Hence 3 gate delays, for each level. Similarly an ninput gate constructed with 2input gates, total delay will be O(log n). // This Explanation has been provided by Saksham Raj Seth.
Question 44 
int max(int *p, int n) { int a=0, b=n1; while (__________) { if (p[a] <= p[b]) { a = a+1; } else { b = b1; } } return p[a]; }The missing loop condition is
a != n  
b != 0  
b > (a + 1)  
b != a 
Discuss it
#include<iostream> int max(int *p, int n) { int a=0, b=n1; while (a!=b) { if (p[a] <= p[b]) { a = a+1; } else { b = b1; } } return p[a]; } int main() { int arr[] = {10, 5, 1, 40, 30}; int n = sizeof(arr)/sizeof(arr[0]); std::cout << max(arr, 5); }
Question 45 
void count(int n) { static int d = 1; printf("%d ", n); printf("%d ", d); d++; if(n > 1) count(n1); printf("%d ", d); } int main() { count(3); }
3 1 2 2 1 3 4 4 4  
3 1 2 1 1 1 2 2 2  
3 1 2 2 1 3 4  
3 1 2 1 1 1 2 
Discuss it
count(3) will print value of n and d. So 3 1 will be printed and d will become 2. Then count(2) will be called. It will print value of n and d. So 2 2 will be printed and d will become 3. Then count(1) will be called. It will print value of n and d. So 1 3 will be printed and d will become 4. Now count(1) will print value of d which is 4. count(1) will finish its execution. Then count(2) will print value of d which is 4. Similarly, count(3) will print value of d which is 4. So series will be A.
Question 46 
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);}
6, 2  
6, 6  
4, 2  
4, 4 
Discuss it
a = 3; void main() { // Calls m with 'a' being passed by reference // Since there is no local 'a', global 'a' is passed. m(a); } // y refers to global 'a' as main calls "m(a)" void m(y) { // A local 'a' is created with value 1. a = 1; // a = 3  1 = 2 a = y  a; // Local 'a' with value 2 is passed by // reference to n() n(a); // Modified local 'a' is printed print(a); } // Local 'a' of m is passed here void n(x) { // x = 2 * 2 [Note : again local 'a' is referred // because of dynamic scoping] x = x * a; // 4 is printed and local 'a' of m() is also // changed to 4. print(x); }
Question 47 
O(1)  
O(d) but not O(1)  
O(2^{d}) but not O(d)  
O(d2^{d}) but not O(2^{d})

Discuss it
Question 48 
8  
12  
10  
11 
Discuss it
Question 49 
6  
7  
8  
9 
Discuss it
Question 50 
I. If e is the lightest edge of some cycle in G, then every MST of G includes e II. If e is the heaviest edge of some cycle in G, then every MST of G excludes e
I only  
II only  
both I and II  
neither I nor II 
Discuss it
Question 51 
16  
32  
256  
64 
Discuss it
Queue: 4 3 2 1 Stack: Empty 3 2 1 4 3 2 1 4 Empty 2 1 4 3 2 1 4 3 Empty 1 4 3 2 1 4 3 2 Empty 4 3 2 1 3 2 1 4 3 2 4 1 2 4 1 3 2 4 3 1 4 3 1 2 3 1 2 4 3 4 1 2 4 1 2 3 Empty 1 2 3 4
Question 52 
A  
B  
C  
D 
Discuss it
Question 53 
A  
B  
C  
D 
Discuss it
In the given PDA we can number the states as q1, q2 and q3 from left to right.
The transitions of the PDA are as follows:

(q1, a, Z) >(q1, XZ )

(q1, a, X) >(q1, XX )

(q1, b, X) >(q2, € )

(q2, b, X) >(q2, € )

(q2, €, Z) >(q3, Z)
As initial state is the final state hence null string is always accepted by the PDA. The first two transitions show that state remains q1 (final state) on ‘a’ input alphabet and with every ‘a’ we push X onto the stack. Hence a^{n} is always accepted for n≥0. Transitions 3 and 4 shows that for input alphabet ‘b’ and stack symbol X (i.e. ‘a’ occurred in the string) we can pop X from the stack. Transition 5 shows that we can move to the final state (q3) only when the string is empty and stack symbol is Z. This is possible when we have popped all X from the stack i.e. ‘b’ occurred exactly the same times as ‘a’. Hence a^{n}b^{n } is always accepted for n≥0. The language accepted by the PDA is { a^{n}  n≥0 } U { a^{n}b^{n }  n≥0 } and is a Deterministic CFL. (a^{n}b^{n }  n≥0 is not regular but is accepted by a PDA). Hence option (D).
This solution is contributed by Yashika Arora.Question 54 
W can be recursively enumerable and Z is recursive.  
W an be recursive and Z is recursively enumerable.  
W is not recursively enumerable and Z is recursive.  
W is not recursively enumerable and Z is not recursive 
Discuss it
Question 55 
Operator Precedence Associativity Arity + High Left Binary  Medium Right Binary * Low Left BinaryThe value of the expression 2  5 + 1  7 * 3 in this language is __________ ? Note : This question was asked as Numerical Answer Type.
1  
2  
3  
9 
Discuss it
Question 56 
1 3 2  
2 2 3  
2 3 1  
Syntax Error 
Discuss it
Question 57 
384  
48  
192  
96 
Discuss it
Question 58 
346  
165  
154  
173 
Discuss it
63 => 87 24 movements 87 => 92 5 movements 92 => 121 29 movements 121 => 191 70 movements 191 > 10 0 movement 10 => 11 1 movement 11 => 38 27 movements 38 => 47 9 movementsTotal head movements = 165
Question 59 
0  
1  
2  
3 
Discuss it
Question 60 
At most one process can be in the critical section at any time  
The bounded wait condition is satisfied  
The progress condition is satisfied  
It cannot cause a deadlock 
Discuss it
Mutual exclusion is satisfied: All other processes j started before i must have value (i.e. t[j]) less than the value of process i (i.e. t[i]) as function pMax() return a integer not smaller than any of its arguments. So if anyone out of the processes j have positive value will be executing in its critical section as long as the condition t[j] > 0 && t[j] <= t[i] within while will persist. And when this j process comes out of its critical section, it sets t[j] = 0; and next process will be selected in for loop. So when i process reaches to its critical section none of the processes j which started earlier before process i is in its critical section. This ensure that only one process is executing its critical section at a time.
Deadlock and progress are not satisfied: while (t[j] != 0 && t[j] <=t[i]); because of this condition deadlock is possible when value of j process becomes equals to the value of process i (i.e t[j] == t[i]). because of the deadlock progess is also not possible (i.e. Progess == no deadlock) as no one process is able to make progress by stoping other process.
Bounded waiting is also not satisfied: In this case both deadlock and bounded waiting to be arising from the same reason as if t[j] == t[i] is possible then starvation is possible means infinite waiting.This explanation has been contributed by Dheerendra Singh.
Question 61 
guarantee serializability and deadlockfreedom  
guarantee neither serializability nor deadlockfreedom  
guarantee serializability but not deadlockfreedom  
guarantee deadlockfreedom but not serializability 
Discuss it
 No possibility of deadlock.
 Ensure serializability.
 Less throughput and resource utilisation because it holds the resources before the transaction begins execution.
 Starvation is possible since no restriction on unlock operation.
 2pl is a deadlock free protocol but it is difficult to use in practice.
Question 62 
A  
B  
C  
D 
Discuss it
Question 63 
10  
50  
12  
13 
Discuss it
Question 64 
1.1  
0.1  
2.1  
2.0 
Discuss it
According to the token bucket algorithm, the minimum time required to send 1 MB of data or the maximum rate of data transmission is given by: S = C / (M  P) Where, M = Maximum burst rate, P = Rate of arrival of a token, C = capacity of the bucketUsing the above formula for the given question we can say that:
M = 20 MB P = 10 MB C = 1 MB S = 1 / (20 10) = 0.1 secSince, the bucket is initially full, it already has 1 MB to transmit so it will be transmitted instantly. So, we are left with only (12  1), i.e. 11 MB of data to be transmitted. Time required to send the 11 MB will be 11 * 0.1 = 1.1 sec The above image is adopted from here. This explanation is contributed by Namita Singh.
Question 65 
2500  
2000  
1500  
500 
Discuss it
Total time = TransmissionTime + 2* PropagationDelay + AckTime. Trans. time = (1000*8)/80*1000 = 0.1 sec 2*PropDelay = 2*100ms = 0.2 sec Ack time = 100*8/8*1000 = 0.1 sec. Total Time = 0.1 + 0.2 + 0.1 = 0.4 sec. Throughput = ((L/B)/Total time) * B, L = data packet to be sent and B = BW of sender. Throughput = L/Total Time = 1000/0.4 = 2500 bytes/sec.