Computer Science Gate 2017 Set 2 Questions



Ques 1Aptitude

In a file allocation system, which of the following allocation scheme(s) can be used if no external fragmentation is allowed?

I. Contiguous
II. Linked
III. Indexed

a) I and III only
b) II only
c) III only
d) II and III only


Aptitude is the correct answer.




Ques 2Aptitude

Let p, q, r denote the statement "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))


Aptitude is the correct answer.




Ques 3Aptitude

"We lived in culture and denied any merit to literally works, Considering them important only when they were handmaidens to something seemingly more urgent - namely ideology. This was a country where all gestures even the most private , interpreted as political terms." The author^^s believes that ideology is not as important as literature is revealed by the word

a) culture
b) seemingly
c) urgent
d) political


Aptitude is the correct answer.




Ques 4Aptitude

X is 30 digit number starting with 4 followed 7. Then number X3 will have

a) 90 digits
b) 91 digits
c) 92 digits
d) 93 digits


Aptitude is the correct answer.




Ques 5Aptitude

There are three boxes, one contains apples, another contains oranges and last one contains both apples and oranges. All three are known to be incorrectly labelled. 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 both apples and oranges
c) The box labelled oranges
d) can't be determined


Aptitude is the correct answer.




Ques 6Aptitude

The numbers of the roots of ex + 0.5x2 -2 = 0 in the range [-5, 5] are

a) 1
b) 0
c) 2
d) 3


Aptitude is the correct answer.




Ques 7Aptitude

Choose the option with words that are not synonyms.

a) aversion, dislike
b) luminous, radiant
c) plunder, loot
d) yielding, resistant


Aptitude is the correct answer.




Ques 8Aptitude

There are 3 red socks, 5 green socks and 3 blue socks. You choose 2 socks. The probability that they are of the same color is

a) 1/5

b) 7/30

c) 1/4

d) 16/55


Aptitude is the correct answer.




Ques 9Aptitude

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


Aptitude is the correct answer.




Ques 10Aptitude

There are 5 buildings called V, W, X, Y, Z in a row (not necessarily in order). V is to the West of W, Z is to the East of X and the West of V. W is to West of Y. Which building is in the middle?

a) V
b) W
c) X
d) Y


Aptitude is the correct answer.




Ques 11Aptitude

A test has questions worth 100 marks totals. There are two types of questions, multiple choice questions are worth 3 marks each and essay questions are worth 11 marks each. How many multiple choice questions does the exam have?

a) 12
b) 15
c) 18
d) 19


Aptitude is the correct answer.




Ques 12Automata

The minimum possible number of states of a deterministic finite automaton that accepts a regular language L = {w1aw2 | w1, w2 ∈{a,b}* , |w1| = 2, w2>=3} is_______


a is the correct answer.




Ques 13Automata

Identity the language generated by following grammar where S is the start variable.

S --> XY
X --> aX | a
Y --> aYb | ∈

a) {am bn| m>=n, n>0 }
b) {am bn| m>=n, n>=0 }
c) {am bn | m>n, n>=0 }
d) {am bn| m>n, n>0 }


Grammar is the correct answer.




Ques 14Automata

Let L1 and L2 be any context-free language and R be any regular language. Then, which of the following is correct ?

I. L1 ∪ L2 is context-free.
II. L1' is context-free.
III. L1-R is context-free.
IV. L1 ∩ L2 context-free.

a) I only
b) I and III only
c) II and IV only
d) I, II and IV only


Regular Language is the correct answer.




Ques 15C

Consider the C program fragment below which is meant to divide x by y using repeated subtractions. The variable 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 terminates 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 )


C code is the correct answer.




Ques 16C

Consider the following function implemented in C:

void printxy(int x, int y)
{
    int *ptr;
    x = 0;
    ptr = &x;
    y = *ptr;
    *ptr = 1;
    printf("%d,%d", x, y);
}


The output of the printxy(1,1) is

a) 0,0
b) 0,1
c) 1,0
d) 1,1


Functions is the correct answer.




Ques 17Compiler

Which of the following statements about the 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


Parsing is the correct answer.




Ques 18Compiler

Match the following according to input(from the left column) to the compiler phase(in the right column) that process it:

(P)Syntax Tree (i)Code generator
(Q)Character Stream (ii)Syntax analyser
(R)Intermediate representation (iii)Semantic analyser
(S)Token stream (iv)Lexical analyser

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)


Compiler Design is the correct answer.




Ques 19Computer Network

The maximum number of IPv4 router address addresses that can be listed in the record route (RR) option field of an IPv4 header is ____.


a is the correct answer.




Ques 20Computer Network

Consider a socket API on Linux machine that supports UDP socket. 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 only
d) Neither I nor II


Computer Network is the correct answer.




Ques 21Computer Network

Consider a socket API on Linux machine that supports UDP socket. 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


Computer Network is the correct answer.




Ques 22Computer Network

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 following above 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


Routing protocols is the correct answer.




Ques 23Data Structure

G is undirected graph with n vertices and 25 edges such that each vertex has degree at least 3. Then the maximum possible value of n is ________


a is the correct answer.




Ques 24Data Structure

A Circular queue has been implemented using singly linked list where each node consists of a value and a pointer to next node. We maintain exactly two pointers FRONT and REAR pointing to the front node and rear node of queue. Which of the following statements is/are correct for circular queue so that insertion and deletion operations can be performed in O(1) i.e. constant 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


Circular Queue is the correct answer.




Ques 25Data Structure

Match the following:

(P)static char var; (i)Sequence of memory locations to store addresses
(Q)m=malloc(10);
m=NULL;
(ii)A variable in data section of memory
(R)char *ptr[10]; (iii)Request to allocate a CPU register to store data
(S)register int var1; (iv)A lost memory which cannot be freed

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)


Storage Class is the correct answer.




Ques 26Data Structure

Match the algorithms with their time complexities:

Algorithm Time Complexity
(P)Tower of Hanoi with n disks (i)θ(n2)
(Q)Binary Search given n sorted numbers (ii)θ(nlogn)
(R)Heap sort of n numbers at the worst case (iii)θ(2n)
(S)Addition of two n*n matrices (iv)θ(logn)

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)


Complexity is the correct answer.




Ques 27DBMS

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 of the following conditions, can the relational table for R be merged with that of A?

(A) Relation R is one-to-many and the participation of A in R is total.
(B) Relation R is one-to-many and the participation of A in R is partial.
(C) Relation R is many-to-one and the participation of A in R is total.
(D) Relation R is many-to-one and the participation of A in R is partial.

a) A
b) B
c) C
d) D


ER model is the correct answer.




Ques 28Digital Logic

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 X 101

b) 1.45 X 10-1

c) 2.27 X 10-1

d) 2.27 X 101


Number Representation is the correct answer.




Ques 29Mathematics

Consider a quadratic equation x2 - 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 = ______.


a is the correct answer.




Ques 30Mathematics

The representation of the value of a 16-bit unsigned integer X in a 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


Number Representation is the correct answer.




Ques 31OS

The read access times and the hit ratios for different caches in a memory hierarchy are as given below:

Cache Read Access Time
(In Nanosecond)
Hit Ratio
I-Cache 2 0.8
D-Cache 2 0.9
L2-Cache 8 0.9

The read access time of main memory in 90 nanoseconds. Assume that the caches use the referred-word-first read policy and the writeback 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% od 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 _________


a is the correct answer.




Ques 32OS

A system shares 9 tape drives. The current allocation and maximum requirement of tape drives for 3 processes are shown below:

Process Allocation Time Maximum Requirement
P1 3 7
P2 1 6
P3 3 5

Which of the following best describes the current state of the system?

a) Safe, Deadlocked
b) Safe, Not Deadlocked
c) Not Safe, Deadlocked
d) Not Safe, Not Deadlocked


Deadlock is the correct answer.




Ques 33OS

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) III only
b) IV only
c) I and II only
d) III and IV only


Threads is the correct answer.