GATE 2017 Computer Science and Information Technology Session 2
Q. 1 The representation of the value of a 16−bit unsigned integer X in hexadecimal number system is BCA9. The representation of the value of X in octal number system is
A. 571244
B. 736251
C. 571247
D. 136251
Q. 2 Match the following:
A. P-ii; Q-iv; R-i; S-iii
B. P-ii; Q-i; R-iv; S-iii
C. P-ii; Q-iv; R-iii; S-i
D. P-iii; Q-iv; R-i; S-ii
Q. 3 Match the algorithms with their time complexities:
A. P→ (iii) Q → (iv) r →(i) S →(ii)
B. P→ (iv) Q →(iii) r →(i) S→(ii)
C. P→ (iii) Q →(iv) r →(ii) S→(i)
D. P→ (iv) Q →(iii) r →(ii) S→(i)
Q. 4 Let L₁, L₂ be any two context-free languages and R be any regular language. Then which of the following is/are correct.
1- L₁, L₂ is context-free
2- L₁ is context-free
3- L₁-R is context-free
4- L₁ ∩ L₂ is context-free
A. 1, 2 and 4 only
B. 1 and 3 only
C. 2 and 4 only
D. 1 only
Q. 5 Match the following according to input (from the left column) to the compiler phase (in the right column) that processes it:
A. P-ii; Q-iii; R-iv; S-i
B. P-ii; Q-i; R-iii; S-iv
C. P-iii; Q-iv; R-i; S-ii
D. P-i; Q-iv; R-ii; S-iii
Q. 6 Which of the following statements about parser is/are CORRECT?
I.Canonical LR is more powerful than SLR
II.SLR is more powerful than LALR
III.SLR is more powerful than Canonical LR
A. I only
B. II only
C. III only
D. II and III only
Q. 7 Which of the following is/are shared by all the threads in a process?
I.Program counter
II.Stack
III.Address space
IV.Registers
A. I and II only
B. III only
C. IV only
D. III and IV only
Q. 8 In a file allocation system, which of the following allocation scheme(s) can be used if no external fragmentation is allowed ?
1.Contiguous
2.Linked
3.Indexed
A. 1 and 3 only
B. 2 only
C. 3 only
D. 2 and 3 only 8
Q. 9 Consider the following statements about the routing protocols. Routing Information Protocol (RIP) and Open Shortest Path First (OSPF) in an IPv4 network.
I.RIP uses distance vector routing
II.RIP packets are sent using UDP
III.OSPF packets are sent using TCP
IV.OSPF operation is based on link-state routing
Which of the above statements are CORRECT?
A. I and IV only
B. I, II and III only
C. I, II and IV only
D. II, III and IV only
Q. 10 If, then the constants R and S are
A. 2/π and 16/π
B. 2/π and 0
C. 4/π and 0
D. 4/π and 16/π
Q. 11 Let p,q,r denote the statements ”It is raining”, “It is cold”, and “It is pleasant”, respectively. Then the statement “It is not raining and it is pleasant, and it is not pleasant only if it is raining and it is cold” is represented by
A. (¬p∧r)∧(¬r→(p∧q))
B. (¬p∧r)∧((p∧q)→¬r)
C. (¬p∧r)∨((p∧q)→¬r)
D. (¬p∧r)∨(r→(p∧q))
Q. 12 Given the following binary number in 32-bit (single precision) IEEE−754 format : 00111110011011010000000000000000
The decimal value closest to this floating-point number is :
A. 1.45∗10¹
B. 1.45∗10⁻¹
C. 2.27∗10⁻¹
D. 2.27∗10¹
Q. 13 A circular queue has been implemented using a singly linked list where each node consists of a value and a single pointer pointing to the next node. We maintain exactly two external pointers FRONT and REAR pointing to the front node and the rear node of the queue, respectively. Which of the following statements is/are CORRECT for such a circular queue, so that insertion and deletion operations can be performed in O(1) time?
I.Next pointer of front node points to the rear node.
II.Next pointer of rear node points to the front node
A. (I) only.
B. (II) only.
C. Both (I) and (II).
D. Neither (I) nor (II).
Q. 14 Consider the following function implemented in C:
void print xy(int x, int y) {
int *ptr;
x=0;
ptr=&x;
y=*ptr;
*ptr=1;
printf(“%d, %d”, x, y);
}
The output of invoking printxy(1,1) is
A. 0,0
B. 0,1
C. 1,0
D. 1,1
Q. 15 The Breadth First Search (BFS) algorithm has been implemented using the queue data structure. Which one of the following is a possible order of visiting the nodes in the graph below?
A. MNOPQR
B. NQMPOR
C. QMNROP
D. POQNMR
Q. 16 Identify the language generated by the following grammar, where S is the start variable.
S→XY
X→aX∣a
Y→aYb∣ϵ
A. A
B. B
C. C
D. D
Q. 17 An ER model of a database consists of entity types A and B. These are connected by a relationship R which does not have its own attribute. Under which one of the following conditions, can the relational table for R be merged with that of A?
A. Relationship R is one-to-many and the participation of A in R is total
B. Relationship R is one-to-many and the participation of A in R is partial
C. Relationship R is many-to-one and the participation of A in R is total
D. Relationship R is many-to-one and the participation of A in Ris partial
Q. 18 Consider socket API on a Linux machine that supports connected UDP sockets. A connected UDP socket is a UDP socket on which connect function has already been called. Which of the following statements is/are CORRECT?
I.A connected UDP socket can be used to communicate with multiple peers simultaneously.
II.A process can successfully call connect function again for an already connected UDP socket
A. I only
B. II only
C. Both I and II
D. Neither I nor II
Q. 19 Consider the following tables T1 and T2.
In table T1. P is the primary key and Q is the foreign key referencing R in table T2 with on delete cascade and on-update cascade. In table T2, R is the primary key and S is the foreign key referencing P in table T1 with on-delete set NULL and on-update cascade. In order to delete record ⟨3,8⟩ from the table T1, the number of additional records that need to be deleted from table T1 is _______
Q. 20 The maximum number of IPv4 router addresses that can be listed in the record route (RR) option field of an IPv4 header is______
Q. 21 Consider the set X={a,b,c,d,e}
under partial ordering R={(a,a),(a,b),(a,c),(a,d),(a,e),(b,b),(b,c),(b,e),(c,c),(c,e),(d,d),(d,e),(e,e)}
The Hasse diagram of the partial order (X,R) is shown below.
The minimum number of ordered pairs that need to be added to R to make (X,R) a lattice is ______
Q. 22 Then the rank of P+Q is ___________ . for the given matrices
Q. 23 G is an undirected graph with n vertices and 25 edges such that each vertex of G has degree at least 3. Then the maximum possible value of n is _________ .
Q. 24 Consider the quadratic equation x²−13x+36=0 with coefficients in a base b. The solutions of this equation in the same base b are x=5 and x=6. Then b= _____
Q. 25 The minimum possible number of states of a deterministic finite automaton that accepts the regular language L = {w1aw2 | w1,w2 ∈ {a,b}∗ , |w1|=2,|w2|≥3} is ______________ .
Q. 26 P and Q are considering to apply for a job. The probability that P applies for the job is 1/4, the probability that P applies for the job given that Q applies for the job is 1/2, and the probability that Q applies for the job given that P applies for the job is 1/3. Then the probability that P does not apply for the job given that Q does not apply for this job is
A. 4/5
B. 5/6
C. 7/8
D. 11/12
Q. 27 If w, x, y and z are boolean variables, then which of the following are incorrect.
A. (A)
B. (B)
C. (C)
D. (D)
Q. 28 Given f(w,x,y,z)=Σm(0,1,2,3,7,8,10)+Σd(5,6,11,15); where d represents the ‘don’t-care’ condition in Karnaugh maps. Which of the following is a minimum product-of-sums (POS) form of f(w,x,y,z)?
A. f=(w¯+z¯)(x¯+z)
B. f=(w¯+z)(x+z)
C. f=(w+z)(x¯+z)
D. f=(w+z¯)(x¯+z)
Q. 29 In a two-level cache system, the access times of L1 and L2 caches are 1 and 8 clock cycles, respectively. The miss penalty from the L2 cache to main memory is 18 clock cycles. The miss rate of L1 cache is twice that of L2. The average memory access time (AMAT) of this cache system is 2 cycles. The miss rates of L1 and L2 respectively are
A. 0.111 and 0.056
B. 0.056 and 0.111
C. 0.0892 and 0.1784
D. 0.1784 and 0.0892
Q. 30 Consider the recurrence function
Then T(n) in terms of θ notation is
A. θ(loglogn)
B. θ(logn)
C. θ(√n)
D. θ(n)
Q. 31 For any discrete random variable X, with probability mass function
define the polynomial function
For a certain discrete random variable Y, there exists a scalar β∈[0,1] such that gy(z)=(1−β +βz)^N. The expectation of Y is
A. Nβ(1−β)
B. Nβ
C. N(1−β)
D. Not expressible in terms of N and β alone
Q. 32 Consider the following expression grammar G:
E→E−T∣T
T→T+F∣F
F→(E)∣id
Which of the following grammars is not left recursive, but is equivalent to G?
A. E→E−T∣T T→T+F∣FF→(E)∣id
B. E→TE′ E′→−TE′∣ϵ T→T+F∣F F→(E)∣id
C. E→TX X→−TX∣ϵ T→FY Y→+FY∣ϵ F→(E)∣id
D. E→TX∣(TX) X→−TX∣+TX∣ϵ T→id
Q. 33 A system shares 9 tape drives. The current allocation and maximum requirement of tape drives for that processes are shown below:
Which of the following best describes current state of the system?
A. Safe, Deadlocked
B. Safe, Not Deadlocked
C. Not Safe, Deadlocked
D. Not Safe, Not Deadlocked
Q. 34 Consider the binary code that consists of only four valid codewords as given below: 00000, 01011, 10101, 11110
Let the minimum Hamming distance of the code p and the maximum number of erroneous bits that can be corrected by the code be q. Then the values of p and q are
A. p=3 and q=1
B. p=3 and q=2
C. p=4 and q=1
D. p=4 and q=2
Q. 35 Consider two hosts X and Y, connected by a single direct link of rate 10⁶ bits/sec. The distance between the two hosts is 10,000 km and the propagation speed along the link is 2×10⁸ m/sec. Host X sends a file of 50,000 bytes as one large message to host Y continuously. Let the transmission and propagation delays be p milliseconds and q milliseconds respectively. Then the value of p and q are
A. p =50 and q=100
B. p =50 and q=400
C. p=100 and q=50
D. p =400 and q=50
Q. 36 The pre-order traversal of a binary search tree is given by 12,8,6,2,7,9,10,16,15,19,17,20. Then the post-order traversal of this tree is
A. 2,6,7,8,9,10,12,15,16,17,19,20
B. 2,7,6,10,9,8,15,17,20,19,16,12
C. 7,2,6,8,9,10,20,17,19,15,16,12
D. 7,6,2,10,9,8,15,16,17,20,19,12
Q. 37 Consider the C program fragment below which is meant to divide x by y using repeated subtractions. The variables x, y, q and r are all unsigned int.
while (r >= y) {
r=r-y;
q=q+1;
}
Which of the following conditions on the variables x,y,q and r before the execution of the fragment will ensure that the loop terminated in a state satisfying the condition x==(y∗q+r)?
A. (q==r) && (r==0)
B. (x>0) && (r==x) && (y>0)
C. (q==0) && (r==x) && (y>0)
D. (q==0) && (y>0)
Q. 38 Consider the following C function
int fun(int n) {
int I, j;
for(i=1; i<=n; i++) {
for (j=1; j printf(“%d %d”, I, j);
}
}
}
Time complexity of fun in terms of Θ notation is
A. Θ(n√n)
B. Θ(n²)
C. Θ(nlogn)
D. Θ(n²logn)
Q. 39 Let δ denote the transition function and δˆ denote the extended transition function of the ϵ-NFA whose transition table is given below:
Then δˆ(q2,aba) is
A. ∅
B. {q0,q1,q3}
C. {q0,q1,q2}
D. {q0,q2,q3}
Q. 40 Consider the following languages.
Which of the following are CORRECT?
I.L₁ is context free but not regular
II.L₂ is not context free
III.L₃is not context free but recursive
Iv.L₄ is deterministic context free
A. I, II and IV only
B. II and III only
C. I and IV only
D. III and IV only
Q. 41 Let L(R) be the language represented by regular expression R. Let L(G) be the language generated by a context free grammar G. Let L(M) be the language accepted by a Turing machine M. Which of the following decision problems are undecidable?
I.Given a regular expression R and a string w, is w∈L(R)?
II.Given a context-free grammar G, is L(G)=∅
III.Given a context-free grammar G, is L(G)=Σ∗ for some alphabet Σ?
IV.Given a Turing machine M and a string w, is w∈L(M)?
A. I and IV only
B. II and III only
C. II, III and IV only
D. III and IV only
Q. 42 The next state table of a 2-bit saturating up-counter is given below.
The counter is built as a synchronous sequential circuit using T flip-flops. The expressions for T1 and T0 are
A. A
B. B
C. C
D. D
Q. 43 Consider the following snippet of a C program. Assume that swap (&x,&y) exchanges the content of x and y:
int main () {
int array[] = {3, 5, 1, 4, 6, 2};
int done =0;
int i;
while (done==0) {
done =1;
for (i=0; i<=4; i++) {
if (array[i] < array[i+1]) {
swap(&array[i], &array[i+1]);
done=0;
}
}
for (i=5; i>=1; i–) {
if (array[i] > array[i-1]) {
swap(&array[i], array[i-1]);
done =0;
}
}
}
printf(“%d”, array[3]);
}
The output of the program is _______
Q. 44 Two transactions T1 and T2 are given as
T1:r1(X)w1(X)r1(Y)w1(Y)
T2:r2(Y)w2(Y)r2(Z)w2(Z)
where ri(V) denotes a read operation by transaction Ti on a variable V and wi(V) denotes a write operation by transaction Ti on a variable V. The total number of conflict serializable schedules that can be formed by T1 and T2 is ______
Q. 45 The read access times and the hit ratios for different caches in a memory hierarchy are as given below:
The read access time of main memory in 90 nanoseconds. Assume that the caches use the referred-word-first read policy and the write-back policy. Assume that all the caches are direct mapped caches. Assume that the dirty bit is always 0 for all the blocks in the caches. In execution of a program, 60% of memory reads are for instruction fetch and 40% are for memory operand fetch. The average read access time in nanoseconds (up to 2 decimal places) is _________
Q. 46 Consider the following database table named top_scorer.
Consider the following SQL query:
SELECT ta.player FROM top_scorer AS ta
WHERE ta.goals >ALL (SELECT tb.goals
FROM top_scorer AS tb
WHERE tb.country = ‘Spain’)
AND ta.goals > ANY (SELECT tc.goals
FROM top_scorer AS tc
WHERE tc.country=’Germany’)
The number of tuples returned by the above SQL query is ______
Q. 47 If the ordinary generating function of a sequence ….
then then a₃−a₀ is equal to ___________ .
Q. 48 If a random variable X has a Poisson distribution with mean 5, then the expectation E[(x+2)²] equals ___.
Q. 49 In a B+ Tree , if the search-key value is 8 bytes long , the block size is 512 bytes and the pointer size is 2 B , then the maximum order of the B+ Tree is ____
Q. 50 A message is made up entirely of characters from the set X={P,Q,R,S,T}. The table of probabilities for each of the characters is shown below:
If a message of 100 characters over X is encoded using Huffman coding, then the expected length of the encoded message in bits is ______.
Q. 51 Consider the set of process with arrival time ( in milliseconds ) , CPU burst time ( in milliseconds) and priority ( 0 is the highest priority ) shown below . None of the process have I/O burst time The average waiting time (in milliseconds) of all the process using preemptive priority scheduling algorithm is ______
Q. 52 If the characteristic polynomial of a 3 × 3 matrix M over R (the set of real numbers) is λ³–4λ² +aλ+30,a∈R , and one eigenvalue of M is 2, then the largest among the absolute values of the eigenvalues of M is _______
Q. 53 Consider a machine with a byte addressable main memory of 2³² bytes divided into blocks of size 32 bytes. Assume that a direct mapped cache having 512 cache lines is used with this machine. The size of the tag field in bits is _______
Q. 54 Consider the following C program.
#include
int main () {
int m=10;
int n, n1;
n=++m;
n1=m++;
n–;
–n1;
n-=n1;
printf(“%d”, n);
return 0;
}
The output of the program is ______
Q. 55 Consider the following C program.
#include
#include
int main() {
char* c=”GATECSIT2017”;
char* p=c;
printf(“%d”, (int)strlen(c+2[p]-6[p]-1));
return 0;
}
The output of the program is _______
Q. 56 Choose the options with the words that are not synonyms
A. aversion , dislike
B. luminious , radiant
C. plunder,loot
D. yeinding ,resistant
Q. 57 Saturn is ________ to be seen on a clear night with the naked eye .
A. enough bright
B. bright enough
C. as enough bright
D. bright as enough
Q. 58 There are 5 building V,W,X,Y and Z in a row .V is the west of W.Z is east of X and west of V.W is the west of Y .Which is the building in the middle .?
A. V
B. W
C. X
D. Y
Q. 59 A test has 20 questions with 100 marks in total.There are 2 types of questions.Multiple choice questions are 3 marks each and essay questions are 11 marks each .How many multiple choice questions does the paper have ?
A. 12
B. 15
C. 18
D. 19
Q. 60 There are 3 red socks, 4 green socks,and 3 blue socks.You choose 2 socks.The probability that they are same color ?
A. 1/5
B. 7/30
C. 1/4
D. 4/15
Q. 61 We lived in a culture that that denied any merit to literary works , considering that
considering them important only when they were handmaidens to something seemingly more urgent -namely ideology .This was a country where all gestures even most private were interrupted in the political terms. The authors belief that ideology is not as important as literature is revealed by the word
A. Culture
B. seemingly
C. urgent
D. political
Q. 62 There are 3 boxes one contains apples another contains oranges and the last one contains both apples and oranges .All three are known to be perfectly labelled .If you are permitted to open just one box and then pull out and inspect only one fruit .Which box would you open to determine the contents of all three boxes.
A. The box labelled “Apples “
B. The box labelled “Apples and oranges “
C. The box labelled ” oranges “
D. cannot be determined
Q. 63 X is a 30 digit number starting with the digit 4 following by the digit 7 .The number x³ will have
A. 90 digits
B. 91 digits
C. 92 digits
D. 93 digits
Q. 64 The number of roots of e^x+0.5x²-2 =0 in the range [-5,5] is
A. 0
B. 1
C. 2
D. 3
Q. 65 An air pressure contour line joins locations in the region having the same atmospheric pressure .The following is an air pressure contour plot of a geographical region .Contour lines are shown in 0.05 bar intervals in this plot.
If the possibility of a thunderstorm is given by how fast air pressure rises drops over a
region .Which of the following is most likely to have a thunderstorm ?
A. P
B. Q
C. R
D. S
Answer Sheet | ||||||||||
Question | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
Answer | D | A | C | B | C | A | B | D | C | C |
Question | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
Answer | A | C | B | C | D | C | C | B | 0 | 9 |
Question | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
Answer | -0.01 To 0.01 | 2 | 16 | 8 | 8 | A | C | A | A | B |
Question | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
Answer | B | C | B | A | D | B | C | C | C | D |
Question | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |
Answer | D | B | 3 | 54 | 4.72 | 7 | 15 | 54 | 52 | 225 |
Question | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 |
Answer | 29 | 5 | 18 | 0 | 2 | D | B | A | D | B |
Question | 61 | 62 | 63 | 64 | 65 | |||||
Answer | B | B | A | C | C |