GATECS2009
Question 1 
Commutativity  
Associativity  
Existence of inverse for every element  
Existence of identity 
Discuss it
Question 2 
2  
3  
n1  
n 
Discuss it
Question 3 
No two vertices have the same degree.  
At least two vertices have the same degree.  
At least three vertices have the same degree.  
All vertices have the same degree. 
Discuss it
Question 4 
R is symmetric but NOT antisymmetric  
R is NOT symmetric but antisymmetric  
R is both symmetric and antisymmetric  
R is neither symmetric nor antisymmetric 
Discuss it
Question 5 
(1217)_{16}  
(028F)_{16}  
(2297)_{10}  
(0B17)_{16} 
Discuss it
Question 6 
2  
3  
4  
5 
Discuss it
Question 7 
As soon as an interrupt is raised  
By checking the interrupt register at the end of fetch cycle.  
By checking the interrupt register after finishing the execution of the current instruction.  
By checking the interrupt register at fixed time intervals. 
Discuss it
Question 8 
FIFO  
Optimal  
LRU  
MRU 
Discuss it
Question 9 
Virtual page number  
Page frame number  
Both virtual page number and page frame number  
Access right information 
Discuss it
A page table entry must contain Page frame number. Virtual page number is typically used as index in page table to get the corresponding page frame number. See this for details.
Question 10 
Theta(n)  
Theta(nLogn)  
Theta(n*n)  
Theta(n*nLogn) 
Discuss it
1. Find the minimum value in the list 2. Swap it with the value in the first position 3. Repeat the steps above for the remainder of the list (starting at the second position and advancing each time)As we can see from the algorithm, selection sort performs swap only after finding the appropriate position of the current picked element. So there are O(n) swaps performed in selection sort. Because swaps require writing to the array, selection sort is preferable if writing to memory is significantly more expensive than reading. This is generally the case if the items are huge but the keys are small. Another example where writing times are crucial is an array stored in EEPROM or Flash. There is no other algorithm with less data movement. References: http://en.wikipedia.org/wiki/Selection_sort
Question 11 
All palindromes  
All odd length palindromes.  
Strings that begin and end with the same symbol  
All even length palindromes 
Discuss it
Question 12 
P: Always finds a negative weighted cycle, if one exist s. Q: Finds whether any negative weighted cycle is reachable from the source.
P Only  
Q Only  
Both P and Q  
Neither P nor Q 
Discuss it
Question 13 
There is no polynomial time algorithm for pA  
If pA can be solved deterministically in polynomial time,then P = NP  
If pA is NPhard, then it is NPcomplete.  
pA may be undecidable. 
Discuss it
If a problem is both NP hard and NP, then it is NP Complete. See http://www.geeksforgeeks.org/npcompletenessset1/ for details.
Question 14 
The set of all strings containing the substring 00.  
The set of all strings containing at most two 0’s.  
The set of all strings containing at least two 0’s.  
The set of all strings that begin and end with either 0 or 1. 
Discuss it
Question 15 
There is unique minimal DFA for every regular language  
Every NFA can be converted to an equivalent PDA.  
Complement of every contextfree language is recursive.  
Every nondeterministic PDA can be converted to an equivalent deterministic PDA. 
Discuss it
Question 16 
8  
32  
64  
128 
Discuss it
Question 17 
Group 1 Group 2 P. Regular expression 1. Syntax analysis Q. Pushdown automata 2. Code generation R. Dataflow analysis 3. Lexical analysis S. Register allocation 4. Code optimization
P4. Q1, R2, S3  
P3, Q1, R4, S2  
P3, Q4, R1, S2  
P2, Q1, R4, S3 
Discuss it
Question 18 
#include <stdio.h> int fun(int n, int *f_p) { int t, f; if (n <= 1) { *f_p = 1; return 1; } t = fun(n 1,f_p); f = t+ * f_p; *f_p = t; return f; } int main() { int x = 15; printf (" %d \n", fun(5, &x)); return 0; }
6  
8  
14  
15 
Discuss it
Let x is stored at location 2468 i.e. &x = 2468 (dots are use just to ensure alignment) x = 15 fun(5, 2468) ...{t = fun(4, 2468) .......{t = fun(3, 2468) ...........{t = fun(2,2468) ...............{t = fun(1, 2468) ...................{// x=1 ........................return 1} ................t = 1 ................f = 2 //1+1 //since *f_p is x ................x = t = 1 ................return 2} ...........t = 2 ...........f = 2+1 ...........x = t = 2 ...........return 3} ........t = 3 ........f = 3+2 ........x = t = 3 ........return 5} ....t = 5 ....f = 5+3 ....x = t = 5 ....return 8} which implies fun (5,2468) is 8.
Question 19 
I. Content coupling II. Common coupling III. Control coupling IV. Stamp coupling V. Data couplingCoupling between modules can be ranked in the order of strongest (least desirable) to weakest (most desirable) as follows:
IIIIIIIVV  
VIVIIIIII  
IIIIV IIIV  
IVIIVIIII 
Discuss it
Question 20 
< table border=1> <tr> <td rowspan=2> ab </td> <td colspan=2> cd </td> </tr> <tr> <td> ef </td> <td rowspan=2> gh </td> </tr> <tr> <td colspan=2> ik </td> </tr> </table> 
(2, 2, 3) and (2, 3, 2)  
(2, 2, 3) and (2, 2, 3)  
(2, 3, 2) and (2, 3, 2)  
(2, 3, 2) and (2, 2, 3) 
Discuss it
Question 21 
0.453  
0.468  
0.485  
0.492 
Discuss it
Let Xi be the probability that the face value is i. We can say that X1 + X2 + X3 + X4 + X5 + X6 = 1 It is given that (X1 + X3 + X5) = 0.9*(X2 + X4 + X6) It is also given that X2 = X4 = X6 Also given that (X4 + X6)/(X4 + X5 + X6) = 0.75 Solving the above equations, we can get X3 as 0.468
Question 22 
* 
a 
b 
c 
d 
a 
a 
b 
c 
d 
b 
b 
a 
d 
c 
c 
c 
d 
b 
a 
d 
d 
c 
a 
b 
a, b are generators  
b, c are generators  
c, d are generators  
d, a are generators 
Discuss it
Check for all: a^{1} = a , a^{2} = a * a = a a^{3} = a^{2} * a = a * a = a a is not the generator since we are not able to express other members of the group in powers of a Check for c  c^{1} = c c^{2} = c * c = b c^{3} = c^{2} * c = b * c = d c^{4} = c^{2} * c^{2} = b * b = a We are able to generate all the members of the group from c , Hence c is the generator Similarly check for d
Question 23 
∀x(P(x)→(G(x)∧S(x)))  
∀x((G(x)∧S(x))→P(x))  
∃x((G(x)∧S(x))→P(x)  
∀x((G(x)∨S(x))→P(x)) 
Discuss it
=> This statement can be expressed as => For all X, x can be either gold or silver then the ornament X is precious => For all X, (G(X) v S(x)) => P(X).
This solution is contributed by Anil Saikrishna Devarasetty .
Question 24 
P 
Q 
PcQ 
T 
T 
T 
T 
F 
T 
F 
T 
F 
F 
F 
T 
A) B) C) D)
A  
B  
C  
D 
Discuss it
Question 25 
0  
1  
ln 2  
1/2 ln 2 
Discuss it
Question 26 
I and III  
I and IV  
II and III  
II and IV 
Discuss it
According to negation property of universal qualifier and existential quantifier
Question 27 
Present
State A 
Present
State B 
Input 
Next
State A 
Next
State B 
Output 
0 
0 
0 
0 
0 
1 
0 
1 
0 
1 
0 
0 
1 
0 
0 
0 
1 
0 
1 
1 
0 
1 
0 
0 
0 
0 
1 
0 
1 
0 
0 
1 
1 
0 
0 
1 
1 
0 
1 
0 
1 
1 
1 
1 
1 
0 
0 
1 
3  
4  
5  
6 
Discuss it
Question 28 
S1 
S2 
S3 
S4 

I1 
2 
1 
1 
1 
I2 
1 
3 
2 
2 
I3 
1 
1 
1 
3 
I4 
1 
2 
2 
2 
16  
23  
28  
30 
Discuss it
Question 29 
3  
8  
129  
216 
Discuss it
Set 0  0  48  0  mod4=0  *  
4  32  255  mod4=3  *  
8  8  1  mod4=1  *  
216  92  4  mod4=0  *  
Set 1  1  1  3  mod4=3  *  
133  133  8  mod4=0  *  
129  129  133  mod4=1  *  
73  73  159  mod4=3  *  
Set 2  216  mod4=0  *  
129  mod4=1  *  
63  mod4=3  *  
8  mod4=0  *  
Set 3  255  155  98  mod4=0  *  
3  3  32  mod4=0  *  
159  159  73  mod4=1  *  
63  63  92  mod4=0  *  
155  Mod4=3  * 
Question 30 
Process P1: t=0: requests 2 units of R2 t=1: requests 1 unit of R3 t=3: requests 2 units of R1 t=5: releases 1 unit of R2 and 1 unit of R1. t=7: releases 1 unit of R3 t=8: requests 2 units of R4 t=10: Finishes Process P2: t=0: requests 2 units of R3 t=2: requests 1 unit of R4 t=4: requests 1 unit of R1 t=6: releases 1 unit of R3 t=8: Finishes Process P3: t=0: requests 1 unit of R4 t=2: requests 2 units of R1 t=5: releases 2 units of R1 t=7: requests 1 unit of R2 t=8: requests 1 unit of R3 t=9: FinishesWhich one of the following statements is TRUE if all three processes run concurrently starting at time t=0?
All processes will finish without any deadlock  
Only P1 and P2 will be in deadlock.  
Only P1 and P3 will be in a deadlock.  
All three processes will be in deadlock 
Discuss it
We can apply the following Deadlock Detection algorithm and see that there is no process waiting indefinitely for a resource. See this for deadlock detection algorithm.
Question 31 
95 ms  
119 ms  
233 ms  
276 ms 
Discuss it
Question 32 
I. If a process makes a transition D, it would result in another process making transition A immediately. II. A process P2 in blocked state can make transition E while another process P1 is in running state. III. The OS uses preemptive scheduling. IV. The OS uses nonpreemptive scheduling.Which of the above statements are TRUE?
I and II  
I and III  
II and III  
II and IV 
Discuss it
Question 33 
void enter_CS(X) { while testandset(X) ; } void leave_CS(X) { X = 0; }In the above solution, X is a memory location associated with the CS and is initialized to 0. Now consider the following statements: I. The above solution to CS problem is deadlockfree II. The solution is starvation free. III. The processes enter CS in FIFO order. IV More than one process can enter CS at the same time. Which of the above statements is TRUE?
I only  
I and II  
II and III  
IV only 
Discuss it
Question 34 
It reduces the memory access time to read or write a memory location.  
It helps to reduce the size of page table needed to implement the virtual address space of a process.  
It is required by the translation lookaside buffer.  
It helps to reduce the number of page faults in page replacement algorithms. 
Discuss it
Question 35 
if n <= 3 then T(n) = n else T(n) = T(n/3) + cnWhich one of the following represents the time complexity of the algorithm? <pre> (A) (n) (B) (n log n) (C) (n^2) (D) (n^2log n) </pre>
A  
B  
C  
D 
Discuss it
Answer(A)
T(n) = cn + T(n/3) = cn + cn/3 + T(n/9) = cn + cn/3 + cn/9 + T(n/27) Taking the sum of infinite GP series. The value of T(n) will be less than this sum. T(n) <= cn(1/(11/3)) <= 3cn/2 or we can say cn <= T(n) <= 3cn/2 Therefore T(n) = (n)
This can also be solved using Master Theorem for solving recurrences. The given expression lies in Case 3 of the theorem.
Question 36 
A  
B  
C  
D 
Discuss it
To get the idea of open addressing concept, you can go through below lines from Wikipedia.
Open addressing, or closed hashing, is a method of collision resolution in hash tables. With this method a hash collision is resolved by probing, or searching through alternate locations in the array (the probe sequence) until either the target record is found, or an unused array slot is found, which indicates that there is no such key in the table. Well known probe sequences include:
linear probing in which the interval between probes is fixed–often at 1.
quadratic probing in which the interval between probes increases linearly (hence, the indices are described by a quadratic function).
double hashing in which the interval between probes is fixed for each record but is computed by another hash function.
Question 37 
2  
3  
4  
5 
Discuss it
a / \ / \ b c / \ / / \ / d e g / / hReferences: http://en.wikipedia.org/wiki/AVL_tree
Question 38 
(b,e)(e,f)(a,c)(b,c)(f,g)(c,d)  
(b,e)(e,f)(a,c)(f,g)(b,c)(c,d)  
(b,e)(a,c)(e,f)(b,c)(f,g)(c,d)  
(b,e)(e,f)(b,c)(a,c)(f,g)(c,d) 
Discuss it
Question 39 
A  
B  
C  
D 
Discuss it
Question 40 
L1 = {  m, n >= 0 } L2 = {  i, j, k >= 0 }Then L is
Not recursive  
Regular  
Context free but not regular  
Recursively enumerable but not context free. 
Discuss it
Question 41 
begin either with 0 or 1  
end with 0  
end with 00  
contain the substring 00. 
Discuss it
Question 42 
I. There exist parsing algorithms for some programming languages whose complexities are less than O(n^{3}). II. A programming language which allows recursion can be implemented with static storage allocation. III. No Lattributed definition can be evaluated in The framework of bottomup parsing. IV. Code improving transformations can be performed at both source language and intermediate code level.
I and II  
I and IV  
III and IV  
I, III and IV 
Discuss it
Question 43 
T1 = R1[X] W1[X] W1[Y] T2 = R2[X] R2[Y] W2[Y] S1 = R1[X] R2[X] R2[Y] W1[X] W1[Y] W2[Y] S2 = R1[X] R2[X] R2[Y] W1[X] W2[Y] W1[Y] S3 = R1[X] W1[X] R2[X] W1[Y] R2[Y] W2[Y] S1 = R1[X] R2[Y]R2[X]W1[X] W1[Y] W2[Y]Which of the above schedules are conflictserializable?
S1 and S2  
S2 and S3  
S3 only  
S4 only 
Discuss it
Question 44 
2  
3  
4  
5 
Discuss it
Question 45 
IV) SELECT R.a, R.b FROM R,S WHERE R.c=S.cWhich of the above queries are equivalent?
I and II  
I and III  
II and IV  
III and IV 
Discuss it
Question 46 
I. M’= M^{e} mod n M = (M’)^{d} mod n II. ed ≡ 1 mod n III. ed ≡ 1 mod f(n) IV. M’= M^{e} mod f(n) M = (M’)^{d} mod f(n)Which of the above equations correctly represent RSA cryptosystem?
I and II  
I and III  
II and IV  
III and IV 
Discuss it
EncryptedText = (PlainText)^{e} mod n PlainText = (EncryptedText)^{d} mod nIII is true because below is true
d^{1} = e mod ϕ(n) OR ed = 1 mod ϕ(n)
Question 47 
0.015/s  
0.064/s  
0.135/s  
0.327/s 
Discuss it
So, minimum permissible rate = 1 / 64 = 0.015 per second
Thus, option (A) is the answer.
Please comment below if you find anything wrong in the above post.
Question 48 
G(x) contains more than two terms  
G(x) does not divide 1+x^k, for any k not exceeding the frame length  
1+x is a factor of G(x)  
G(x) has an odd number of terms. 
Discuss it
Question 49 
I. The context diagram should depict The system as a single bubble. II. External entities should be identified clearly at all levels of DFDs. III. Control information should not be represented in a DFD. IV. A data store can be connected either to another data store or to an external entity.
II and III  
II and III  
I and III  
I, II and III 
Discuss it
Question 50 
I. The cyclomatic complexity of a module is equal to the maximum number of linearly independent circuits in the graph. II. The cyclomatic complexity of a module is the number of decisions in the module plus one,where a decision is effectively any conditional statement in the module. III.The cyclomatic complexity can also be used as a number of linearly independent paths that should be tested during path coverage testing.
I and II  
II and III  
I and III  
I, II and III 
Discuss it
TRUE: The cyclomatic complexity of a module is the number of decisions in the module plus one,where a decision is effectively any conditional statement in the module. TRUE: The cyclomatic complexity can also be used as a number of linearly independent paths that should be tested during path coverage testing.
Question 51 
505035  
505036  
505037  
505038 
Discuss it
Question 52 
(0, 15, 31)  
(0, 16, 30)  
(0, 16, 31)  
(0, 17, 31) 
Discuss it
Question 53 
l(i,j) = 0, if either i=0 or j=0 = expr1, if i,j > 0 and X[i1] = Y[j1] = expr2, if i,j > 0 and X[i1] != Y[j1]
expr1 ≡ l(i1, j) + 1  
expr1 ≡ l(i, j1)  
expr2 ≡ max(l(i1, j), l(i, j1))  
expr2 ≡ max(l(i1,j1),l(i,j)) 
Discuss it
1) The last characters of two strings match. The length of lcs is length of lcs of X[0..i1] and Y[0..j1] 2) The last characters don't match. The length of lcs is max of following two lcs values a) LCS of X[0..i1] and Y[0..j] b) LCS of X[0..i] and Y[0..j1]
Question 54 
All elements L should be initialized to 0 for the values of l(i,j) to be properly computed  
The values of l(i,j) may be computed in a row major order or column major order of L(M,N)  
The values of l(i,j) cannot be computed in either row major order or column major order of L(M,N)  
L[p,q] needs to be computed before L[r,s] if either p < r or q < s. 
Discuss it
Question 55 
Suppliers(sid:integer, sname:string, city:string, street:string) Parts(pid:integer, pname:string, color:string) Catalog(sid:integer, pid:integer, cost:real)Consider the following relational query on the above database:
SELECT S.sname FROM Suppliers S WHERE S.sid NOT IN (SELECT C.sid FROM Catalog C WHERE C.pid NOT IN (SELECT P.pid FROM Parts P WHERE P.color<> 'blue'))Assume that relations corresponding to the above schema are not empty. Which one of the following is the correct interpretation of the above query?
Find the names of all suppliers who have supplied a nonblue part.  
Find the names of all suppliers who have not supplied a nonblue part.  
Find the names of all suppliers who have supplied only blue parts.  
Find the names of all suppliers who have not supplied only blue parts. 
Discuss it
The subquery “SELECT P.pid FROM Parts P WHERE P.color<> ‘blue’” gives pids of parts which are not blue. The bigger subquery “SELECT C.sid FROM Catalog C WHERE C.pid NOT IN (SELECT P.pid FROM Parts P WHERE P.color<> ‘blue’)” gives sids of all those suppliers who have supplied blue parts. The complete query gives the names of all suppliers who have supplied a nonblue part
Question 56 
Suppliers(sid:integer, sname:string, city:string, street:string) Parts(pid:integer, pname:string, color:string) Catalog(sid:integer, pid:integer, cost:real)Assume that, in the suppliers relation above, each supplier and each street within a city has a unique name, and (sname, city) forms a candidate key. No other functional dependencies are implied other than those implied by primary and candidate keys. Which one of the following is TRUE about the above schema?
The schema is in BCNF  
The schema is in 3NF but not in BCNF  
The schema is in 2NF but not in 3NF  
The schema is not in 2NF 
Discuss it
X → Y is a trivial functional dependency (Y ⊆ X) X is a superkey for schema RSince (sname, city) forms a candidate key, there is no nontirvial dependency X → Y where X is not a superkey
Question 57 
i = 2  
i = 3  
i = 4  
i = 5 
Discuss it
Question 58 
16ms  
18ms  
20ms  
22ms 
Discuss it
Question 59 
25,12,16,13,10,8,14  
25,14,13,16,10,8,12  
25,14,16,13,10,8,12  
25,14,12,13,10,8,16 
Discuss it
25 / \ / \ 14 16 / \ / \ / \ / \ 13 10 8 12
Question 60 
14,13,12,10,8  
14,12,13,8,10  
14,13,8,12,10  
14,13,12,8,10 
Discuss it
Let us delete the two nodes one by one: 1) Deletion of 25: Replace 25 with 12 12 / \ / \ 14 16 / \ / / \ / 13 10 8 Since heap property is violated for root (16 is greater than 12), make 16 as root of the tree. 16 / \ / \ 14 12 / \ / / \ / 13 10 8 2) Deletion of 16: Replace 16 with 8 8 / \ / \ 14 12 / \ / \ 13 10 Heapify from root to bottom. 14 / \ / \ 8 12 / \ / \ 13 10 14 / \ / \ 13 12 / \ / \ 8 10