Sei sulla pagina 1di 29

GATE Mock Test

Computer Science and Information Technology


Time Limit: 3 hrs

SECTION – I

GENERAL APTITUDE

Direction for questions 1 to 4: Select the correct alternative from the given choices.

The Question is of 1 mark. Wrong answer will result in deduction of 1/3 marks.

1. If (1.001)2518 = 12.39 and (1.001)4124 = 61.62, then (1.001)6642 =

(A) 130.23 (B) 74.01 (C) 129.28 (D) 763.47

The Question is of 1 mark. There are no negative marks for wrong answer.

2. If 4x  5  6x  15 , then the sum of the possible values of x is _______.

The Question is of 1 mark. Wrong answer will result in deduction of 1/3 marks.

3. “It is always better to put aside some money for a rainy day”, he said to his sons.

This is

(A) a command. (B) a suggestion.

(C) a counsel. (D) a request.


4. “It is the duty of every responsible citizen to abide by the laws of the land”. This is

(A) an instruction. (B) a suggestion.

(C) a piece of advice. (D) an enquiry.

Direction for question 5: Fill in the blanks with suitable adverbs.

5. He turned out to be a spoiled child as his parents brought him up very ______.

(A) assiduously (B) indulgently

(C) efficiently (D) effectually


The Question is of 2 marks. Wrong answer will result in deduction of 2/3 marks.

Directions for question 6: Identify the best restatement of the given sentence.

6. It is not unusual for intelligence agencies the world over to get embroiled from time to time
in controversies which draw screaming headlines.

(A) Intelligence agencies getting caught up in controversies is a common occurrence


and this is blown out of proportion by newspapers the world over.

(B) Intelligence agencies everywhere often get entangled in controversies and this
draws screaming headlines.

(C) Intelligence agencies universally are known for controversies and this is reported
aggressively.

(D) Intelligence agencies across the globe tend to get involved in controversies off
and on and this news is splashed with a vengeance.

Directions for questions 7 to 9: Select the correct alternative from the given choices.
7. The cost of producing u units of a product equals 6u 2 rupees. The selling price of the
product is 300 rupees per unit. In order to make a profit of at least 3600 rupees, the
number of units to be sold is

(A) at least 36 (B) at most 30


(C) at least 28 (D) at most 20

8. Lakshmi started walking towards north and after walking 40 m she took a left turn and
walked 30 m. She then took a left turn and walked 80 m. She again took a left turn and
walked 60 m and then stopped. How far and in which direction is she from the starting
point?

(A) 50 m, South-east

(B) 50 m, South-west

(C) 80 m, South-east

(D) 80 m, North-east

9. The cost of a precious stone varies as the cube of its weight. A certain precious
stone broke into three pieces whose weights are in the ratio 1 : 2 : 3, as a result of
which its cost reduces by `80280. What was the cost of the stone before breakage?

(A) `88840

(B) `96336

(C) `102400

(D) `112880

Directions for question 10: Which of the phrases (A), (B), (C) and (D) given below
should replace the phrase given in bold in the following sentences to make it meaningful
and grammatically correct.

10. You are coming to watch the programme, isn't it?


(A) isn't you? (B) don't you?

(C) are you? (D) aren't you?

SECTION – 

COMPUTER SCIENCE ENGINEERING

Directions for questions 1 to 55: Select the correct alternative from the given choices.

1. Which of the following statement formulae is NOT satisfiable?

(A) (P  Q)  (P  Q)

(B) (P  Q)  (P  Q)

(C) P  (P  P)

(D) P  (P  P)

2. Let G be a simple connected regular graph with 14 edges. If G is not a cycle graph
and  is a vertex of G, then the degree of  is ______.

3. Let S = {0, 1, 2, 3, 4 ….., 2015}. If a number is selected at random from the set S, the
probability that it is a prime factor of 2015 is ______

3 1 1 1
(A) (B) (C) (D)
2015 1008 226 672

4. In the process of finding a root of f(x) = 3x3 – 5x2 – 21x + 35 = 0 by Regula – Falsi
method, the formula for obtaining the initial approximate value x1 is

af(b)  bf(a)
x1 = . Which of the following pairs of values is NOT a correct choice of
f (b)  f (a)
values for a and b?

(A) a = –3 and b = –2 (B) a = 0 and b = 1

(C) a = 1 and b = 2 (D) a = 2 and b = 3


5. 15 different sized apples are to be distributed among three boys with ages 4 years, 5
years and 6 years. The number of ways in which the apples can be distributed, so
that every boy should get as many apples as his age is _____

6. Below circuit is functionally equivalent to

(A) NOR gate (B) XOR gate

(C) OR gate (D) XNOR gate

7. A Logical function F is expressed as AB C  A D  ABCD  AB D then essential prime


implicants of F are

(A) A D, AB D (B) AB C, A D

(C) D, AB (D) A D, ABCD

8. Which of the following tree has, IN ORDER = CDBA and POST ORDER = DCBA?

A
(A) (B) A
B
C B
D

D C
(C) A (D)

B A

B
C C

D
9. Consider the following program
D with source line of code given as 200:

class function

int sqrt (int a);

int add (int a, int b);

int incr (int a);

int mul (int a, int b);

int decr (int a);

What is the modularity?

(A) 0.025 (B) 0.25 (C) 0.125 (D) 0.05

10. What is returned when a request is made to connect to a TCP port at which no
server is listening?

(A) A TCP segment with the ACK and SYN bits set to 1

(B) A TCP segment with the ACK and RST bits set to 1

(C) A TCP segment with the ACK and MF bits set to 1

(D) A TCP segment with ACK and NSR bits set to 1

11. Consider Two packet switching networks, each contain ‘N’ nodes. The first is star
topology with a central Router, the second is a bidirectional ring. What are the best,
average and worst case transmission paths in hops for the above networks?

(A) 2, 2, 2, and 1, 1, 1,
(B) 1, 2, 2 and 1, 2, 2,

(C) 2, 2, 2, and 1, N/4, N/2

(D) 2, 2, 2, and 1, N/2, N/4

12. The following expression is related to,

class, country (bore  19(Classes))

(A) Class names and countries of classes that carried guns of at least 19-inch bore

(B) Class names of countries that carried guns of at least 19 - inch bore

(C) Class names and countries of classes that carried guns of at most 19-inch bore

(D) Class names of countries that carried guns of at most 19 - inch bore

13. Consider the given ER – Diagram:

Payment
age amount Payment
S name
date
Section

Student Pay Loan


amount

How many weak entities are present in given Diagram?

(A) 0 (B) 1 (C) 2 (D) 3

14. Which of the following is FLASE with respect to ‘polling’?

I. Polling process periodically checks the status bits of an I/O device.

II. Polling is the simplest way for an I/O device to communicate with the processor.

III. During polling, I/O overhead is unpredictable.

(A) II, III Only (B) I Only


(C) I, III Only (D) III Only

15. An application written in ‘C’ runs 10 seconds on a desktop processor. A new ‘C’
compiler is released that requires only 0.2 as many instructions as the old compiler.
Then the CPI is increased by 1.1. How fast can the application run using this new
compiler?

(A) 2.2sec (B) 1.81sec

(C) 55sec (D) 10sec

16. Consider the language,

L = {w/w contain the substring ab} over  = {a, b}. The number of states in L is ___.

17. Consider the language,

LP = {x/x is a binary number that is a multiple of P}

For which of the following value of ‘P’, does LP is regular?

(A) For every P  1

(B) Only For every P  2n, n is any even number

(C) Only for 0 < p < 100

(D) P  1000 only

18. Consider the following recursive program, which takes a binary tree node
pointer, ‘N’ as input and returns True(false) if ‘N’ represents a binary search tree (or
not).

boolean BST_check(treeptr N)

if(N = = NULL) || (N → left = = NULL && N → right = = NULL))

return true;

else if (BST_check(N → left)


&& BST_check(N → right)

&& (N → key > N → left → key)

&& (N → key < N → right →


key))

return true;

else

return false;

For which of the following elements of a Binary search tree, will the above
algorithm fail?

(i) 5, 2, 1, 8, 6, 9, 3

(ii) 15, 10, 25, 14, 22, 30, 12

(iii) 100, 50, 125, 25, 75, 100, 150

(A) (i), (ii), (iii) (B) (i), (ii) only

(C) (ii) only (D) (iii) only

19. Consider the following program:

void f( );

void main( )

int a = 1;

while (a < = 6)

printf(%d\t”, a);

if (a > 3)
goto here;

a++;

f( )

here:

printf(“%d”, a);

The output of the above program is

(A) Compilation error

(B) 1 2 3 4 5 6

(C) Garbage values

(D) 1 2 3

20. During the process of LL(1) table construction, which of the following indicates a
failure in LL(1) property?
(A) If none of the symbols has $ in their FOLLOW sets
(B) If there is an attempt to create a table entry that has already been created
(C) If all terminals appear in FIRST of a variable
(D) If ε and $ are present in FIRST and FOLLOW of same variable.

21. Which of the following statement is TRUE?

(A) There exists a grammar which is SLR(K + 1) but not SLR(K), K  0

(B) There exists a grammar which is LALR(K + 1) but not LALR(K), K  0

(C) There exists a grammar which is LR(K +1) but not LR(K), K  0
(D) All of the above

22. Which of the following correctly specifies the following task:

“Allocate an integer array of 15 elements using malloc, assign 20 to each element


and release the memory”.

(A) int i;

int  A = malloc (15  sizeof (int));

for (i = 0; i < 15; i++ )

A[i] = 20;

free(A);

(B) int i;
int A = malloc (sizeof (15  int));
for (i = 0; i < 15 ; i++)
{
A[i] = 20;
free(A[i]);
}
(C) int i;
int A;
for (i = 0; i < 15; i++)
{
A = malloc(sizeof (int));
A[i] = 20;
free(A[i]);
}
(D) int i;

int A = 15  malloc(sizeof (int));

for (i = 0; i < 15 ; i + +)

A[i] = 20;

free(A);
23. Consider the following program:

1. # include < studio. h>

2. void main ( ) {

3. int a = 1, b = 2;

4. const int p = &a;

5. printf(“%d\n”, p);

6. p = 3;

7. p = &j;

8. printf(“%d\n”, p);

9. }

Which of the above lines will lead to compilation error?

(A) line 4 (B) line 6

(C) line 7 (D) line 6 and line 7

24. In which of the following, system calls are similar to interrupts?

(A) Both are always invoked by a user-level process explicitly.

(B) For both mechanisms execution transfers to a pre-defined function inside the
Kernel’s code.

(C) Both are synonymous in every aspect with respect to operating system.

(D) None of the above

25. For the hexadecimal virtual address: 0X4E35, what will be the virtual page
number and offset respectively if the page size is 4KB?

(A) Data insufficient (B) 9, 589

(C) 5, 1251 (D) 4, 3637

26. Consider the following two statements about an idempotent matrix A


P: The determinant of A is either 0 or 1

Q: Any eigen value of A is either 0 or 1

Then

(A) P is TRUE, but Q is FALSE.

(B) P is FALSE, but Q is TRUE.

(C) Both P and Q are TRUE.

(D) Both P and Q are FALSE.

27. The slope of the tangent to the curve f(x) = logx(ln x) at the point (e, 0) is _____
1
(A) 0 (B) 1 (C) e (D)
e

28. Let p(x): x  0, q(x): x4  0, r (x): x2 + 6x + 5 = 0 and s(x): x2 – 9 = 0 and let the
universe of discourse be the set of all integers. Which of the following predicate
statements are TRUE?

I. (x) (p(x)  q(x)) II.  (x) (q(x)  s(x))

III. (x) (r(x) s(x)) IV. (x) (r(x)  p(x))

(A) I and II only

(B) II and III only

(C) III and IV only

(D) IV and I only

29. If G is a simple undirected graph with 9 vertices and 4 components, then


maximum possible number of edges in G can be

(A) 9 (B) 15 (C) 21 (D) 27

30. In a reputed xyz engineering college out of 220 outgoing students in the
academic year 2014 – 2015, 64 students got placed in INFOSYS, 94 got placed in
TCS and 58 got placed in WIPRO. 28 students got placed in both INFOSYS and
TCS, 26 got placed in INFOSYS and WIPRO, 22 got placed in both WIPRO and
TCS and 14 students got placed in all the three companies. The percentage of the
students who got placed in none of these three companies is ______

31. Consider the following two threads:

Thread A: Thread B:

while (x < y) while (b)

x = x + 1; {

y = y + 1;

b = (x! = y);

Thread A and B share the global variables x, y, b. Initially x = 0, y = 1 and b = true. If


threads A and B execute in parallel manner and if each statement is an atomic
operation, then which of the following is possible?

I. Both threads A and B terminate.

II. Thread A terminates and thread B does not terminate.

III. Thread B terminates and thread A does not terminate.

IV. Neither thread A, nor thread B terminates.

(A) I, II only (B) I, II, III only

(C) I, II, IV only (D) III, IV only

32. Consider a virtual memory of 1 GB associated with a physical memory,


which is organized as 256 page frames of 4 KB each. The smallest addressable unit
is 1 Byte. Then which of the following is TRUE?

I. The page table fits into the main memory.

II. The frame table fits into a single page.


(A) I only (B) II only

(C) Both I and II (D) Neither I nor II

33. Consider an array of ‘n’ keys. A program fragment is given below, to find
the maximum k, k ≤ n, such that the first k keys of the array form a minheap. (Array
index starts from ‘1’ and returns k).

int minheap(int A[ ], int n)

int j = 1;

while (j <= (1))

if (A[j] < = (2) && A[j] < = (3))

j++;

else

break;

if (j> (4) )

return n;

if ( (5) )

return (6) ;

else

return 2 * j;

}
To make above algorithm an efficient one, identify the missing parts from the
following:

(A) 1. n–1

2. A[2 * j]

3. A[2 * j + 1]

4. n

5. A[2  j] > A[2 * j + 1]

6. 2*j

(B) 1. n/2

2. A[j + 1]

3. A[j + 2]

4. n/2 – 1

5. A[j + 1]

6. A[j + 2]

(C) 1. n/2

2. A[2 * j]

3. A[2 * j + 1]

4. n/2

5. A[j] > A[2 * j]

6. 2*j–1

(D) 1. n–1

2. A[2 * j – 1]

3. A[2 * j]

4. n/2 – 1

5. A[2 * j – 1] > A[2 * j]


6. 2*j–1

34. A ‘Queue Automaton’ is like a PDA except that the stack is replaced by a queue.
A Queue is a tape allowing symbols to be read only at the left end and written only at
the right end. Each read operator (dequeue) reads and removes a symbol from the
left end of the tape and each write operator (enqueue) writes a symbol at the right
end. For example if the state of the tape is ‘xyzxyxy’ then dequeue operator results
‘yzxyxy’ and enqueue ‘z’ results ‘xyzxyxyz”. Then which of the following is a valid
statement?

I. Every Queue Automaton can be simulated on a Turing machine.

II. Every Turing machine can be simulated on a Queue Automaton.

(A) I only (B) II only

(C) Both I and II (D) Neither I nor II

35. Consider the following context - free grammar:

S  ( ) | a | (A)

A  S|A, S

Which of the following is true?

(A) The grammar is suitable for recursive descent parsing.

(B) The grammar is not suitable for recursive descent parsing and it can be re written
as

S  (S’|a

S’  ) | A)

A  S|A, S

(C) The grammar can be re-written as below, to make it suitable for recursive
descent parsing

S  (S’|a

S’ ) | A)
A  SA’

A’  S, A’| ε

(D) The grammar cannot be re - written in any way to make it suitable for recursive
descent parsing.

36. What is the time complexity of following program:

function (int n)

if (n = = 1)

return;

for (int i = 1; i < = n; i++)

for (int j = 1; j < = n; j++)

printf(“ ”);

break;

(A) O(n) (B) O(n log n)

(C) O(n2) (D) O(n2 log n)

37. In the continuous Knapsack problem we are given a set of ‘n’ items. Each item
has weight W i and value Pi. We have a maximum budget of M. Our goal is to select
for each item a fraction 0  xi  1 such that
n n
 X i Wi  M and  X iPi is maximized, M = 20.
i1 i1

Consider the following table:

Item 1 2 3 4 5 6 7 8 9 10

Weight 4 6 3 2 13 11 10 10 5 2

Value 8 11 4 4 27 20 19 18 6 5

Which of the following gives maximum profit?

(A) Items 10, 5, 1


3
(B) Items 10, 5, 4 and 10 th of item 7

(C) (A) and (B) both give equal profit

(D) Items 10, 5, 6

38. Consider the given weighted undirected graph G. What is the total weight of second
minimum spanning tree that is, a minimum spanning tree which differs by exactly one
edge.

9 6
11
19 3 4 16
13 31

15
5
Which of the following27
is total weight of second minimum spanning tree?

(A) 47 (B) 49

(C) 53 (D) 55

39. Consider the given recurrence Relation :


3Tn  1  2 if n  1
T(n) =  if n  1
 1 M1

What is the time complexity of given recurrence relation?


M ?

(A) O(1) M2

(B) O(n)

(C) O(log n)

(D) O(n log n)

40. Consider the following decision tree and find the estimated value of build and
buy,

0.8
`20,000
Build
0.2 `34,000
System
0.6 `24,000
Buy
0.7
0.4 `12,000
0.3
`36,000

(A) EvBuild = 26,800 and EvBuy = 22,400

(B) EvBuild = 22,400 and EvBuy = 26,800

(C) EvBuild = 22,080 and EvBuy = 22,800

(D) EvBuild = 22,800 and EvBuy = 22,080

41. The module of length L is split up into two sub modules, module 1 and module 2,
each of length L/2. How many links between the sub modules are allowed so that
we maintain the value of information flow metric at same level (Round it off to
nearest integer)?

(A) 2 (B) 3 (C) 4 (D) 5


42. Consider the below network; with 8 hosts and 7 Routers, All links are full duplex.

H1 2Mbps
R1 2Mbps H5
4Mbps
H2 2Mbps 4Mbps R6
2Mbps H6
R3 R4 R5
8Mbps 8Mbps 2Mbps H
7
4Mbps R
H3 2Mbps 4 Mbps 7

R2 2Mbps H8
H4 2Mbps

Case I: If the Hosts H2, H3, H4 want to send 2Mbps each to Host H1.

Case II: If the Hosts H2, H3, H1 want to send 2 Mbps each to Host H4.

Case III: If the Hosts H2, H3, H4, H5, H6, H7, H8 want to send 2 Mbps each to Host H1.

Case IV: If the Hosts H1, H2, H3, H4 want to


send 2 Mbps each to Host 5.

In the above cases, there is a scope for congestion at which Routers respectively?

(A) R2, R1, (R3 and R2), R5

(B) R2, R1, (R4 and R3) , R6

(C) R1, R2, (R1 and R3), R6

(D) R1, R2 , R3, R6

43. A Router has the following CIDR entries in its Routing table:

Address/mask Next Hop

136.46.56.0/22 Router 7

136.46.60.0/22 Router 9
136.53.40.0/23 Interface 1

Default Interface 0

For the following IP address, what does the Router do if a packet with the following
address arrives, 136.46.57.14?

(A) Packet will be forwarded to Router 9

(B) Packet will be forwarded to Router 7

(C) Packet will be forwarded to interface 1

(D) Packet will be forwarded to Interface 0

44. Consider a LAN with a maximum distance of 2km. At what bandwidth would
propagation delay (at a speed of 2  108m/s) have equal transmit delay for 1000 byte
packets?

(A) 400 M bits/sec

(B) 600 M bits/sec

(C) 640 M bits/sec

(D) 800 M bits/sec

45. The order of an internal node in a B+-tree is the maximum number of children it
can have. Suppose that a child pointer takes
7 bytes, the data pointer takes 10 bytes, the search field value takes 15 bytes and
the block size is 1024 bytes, what is the order of the internal node?

(A) 46 (B) 47 (C) 49 (D) 51

46. Find the clause that will give the same result as:

SELECT *

FROM cds

WHERE cd-id NOTIN(101, 104, 115);


(A) SELECT *

FROM cds

WHERE cd-id ≤ 101 AND cd–id ≥ 115;

(B) SELECT *

FROM cds

WHERE cd-id NOT LIKE (101, 104, 115);

(C) SELECT *

FROM cds

WHERE cd-id < > 101 AND cd-id < > 104
AND cd-id < > 115

(D) SELECT *

FROM cds

WHERE cd-id < > 101 OR cd-id < >


104 OR cd-id < > 115

47. Consider the following specifications:

Number of Subnets needed: 14

Number of Hosts needed: 14

Network Address: 192.20.20.0

What is the 4th subnet range?

(A) 192.20.20.0 to 192.20.20.31

(B) 192.20.20.32 to 192.20.20.47

(C) 192.20.20.48 to 192.20.20.63

(D) 192.20.20.64 to 192.20.20.79


48. A Token bucket has a capacity (C) of 250 KB. It has a maximum
outputting capacity (M) of 15 MB/sec. Token is released at a rate (r) of 2 MB/sec.
What is the maximum duration of time(s) we can see a burst to sustain?

(A) 17 msec (B) 18.7 msec

(C) 21 msec (D) 24.2 msec

49. Consider a Relation: Class, with attributes Class-Id, Duration, Subject,


Teacher-name (unique), Address, Class-Id (unique), which of the following
combination of attributes breaks the second Normal form?

(A) Teacher-name, Class-Id

(B) class-Id, Teacher-name, Duration

(C) Duration, Subject, Address

(D) Class-Id, Subject

50. Hosts A and B are each connected to a switch via 10 Mbps links. The
propagation delay on each link is 30 µs. ‘S’ is a store-and-forward device, it begins
retransmitting a received packet 10 µs after it has finished receiving it. Calculate the
total time required to transmit 10000 bits from A to B, as two 5000 bit packets sent
one right after the other?

(A) 1700 µsec (B) 1610 µsec

(C) 1600 µsec (D) 1570 µsec

51. Consider the following Recurrence Relation:

n log 4
T(n) = 4T    n 3
3

What is the time complexity of given Relation?

 log 4 
(A) θ  n 3 . log n 
 (B) θ(n2)
 

(C) θ(n4) (D) θ(n log n)


52. Radix sort functions by sorting the input numbers on each digit, for each of the
digits in the number. The numbers are sorted on the least significant digit first,
followed by the second least significant digit and so on till the most significant digit.

Sort the following:

ed, ca, xa, cd, xd, bd, ad, ea

What is the sequence after First Iteration?

(A) ca, xa, ea, ed, cd, xd, ad, bd

(B) ca, xa, ea, ed, cd, xd, bd, ad

(C) ca, xa, ea, ed, xd, cd, bd, ad

(D) ca, ea, xa, ed, cd, xd, bd, ad

53. Consider the given message:

ABCCBDEBECCDEBBACD
ACDACDEEBBCCDDEFD

Which of the following shows correct Huffman codes for A, B, C D, E, F


respectively?

(A) 1100, 10, 00, 01, 111, 1101

(B) 1100, 00, 10, 01, 111, 1101

(C) 1101, 00, 10, 01, 111, 1100

(D) 1101, 10, 00, 01, 111, 1100

54. What is the Boolean function ‘f’ implemented as shown in the figure using two
input multiplexers?

A I0

I1 2×1 f
C B
I1
2×1
I0 S0
C S1
Y

B
(A) (B  C) A + BC (B) A(B ☉ C) + B C

(C) AB + C A  B (D) B(A ☉ C)

55. Consider the circuit given below:

1 1 1
T Q0 T Q1 T Q2
>1 2
>
0
Q0 Q1 Q2
> Pr Pr Pr
CLK

If the clock frequency is 1MHz, then the type of

counter would be

(A) MOD-3 UP COUNTER

(B) MOD-4 UP COUNTER

(C) MOD-3 DOMN COUNTER

(D) MOD-4 DOWN COUNTER

Answer Key

Section – I

1. D

2. –11
3. C

4. A

5. B

6. B

7. B

8. A

9. B

10. D

Section – I

1. 0

2. 0.24 to 0.26

3. C

4. C

5. B

6. B

7. A

8. D

9. D

10. A

11. A

12. B

13. C

14. C

15. C
16. C

17. C

18. B

19. D

20. 051530

21. 3

22. A

23. C

24. D

25. D

25. D

26. C

27. D

28. D

29. B

30. 29 to 31

31. C

32. C

33. C

34. C

35. C

36. A

37. B

38. B

39. A
40. D

41. C

42. C

43. B

44. D

45. B

46. C

47. C

48. B

49. D

50. D

51. A

52. B

53. C

54. A

55. D

Potrebbero piacerti anche