Official Paper

GATE CS 2016 Official Paper: Shift 1 (Previous Year Paper)

65 questions · 180 minutes · with answers · free

General Aptitude (10 questions)

1

Out of the following four sentences, select the most suitable sentence with respect to grammar and usage.

  1. ((a))

    I will not leave the place until the minister does not meet me.

  2. ((b))

    I will not leave the place until the minister doesn’t meet me.

  3. ((c))

    I will not leave the place until the minister meet me.

  4. ((d))

    I will not leave the place until the minister meets me**.**

Show Answer
Answer: ((d))

I will not leave the place until the minister meets me**.**

Here the subject is ‘minister’ and a singular, so the verb too has to be singular to agree with it, the verb ‘meet’ in A,B and C is plural so it will be incorrect here; ‘meets’ is plural hence D is the right answer.

A and B have another incorrect usage in it, i.e. the two negatives in the same sentence ‘will not leave’ and ‘does not meet’.

2

A rewording of something written or spoken is a _________

  1. ((a))

    Paraphrase

  2. ((b))

    Paradox

  3. ((c))

    Paradigm

  4. ((d))

    Paraffin

Show Answer
Answer: ((a))

Paraphrase

Paraphrase is to rewrite something in a more concise manner, in order to make the meaning clear. Hence this is the right answer.

Paradox is a contradiction

Paradigm is a new view point on something

Paraffin is a flammable oily liquid used in medicine / or wax

3

Archimedes said, “Give me a lever long enough and a fulcrum on which to place it, and I will move the world.”

The sentence above is an example of a _______ statement.

  1. ((a))

    Figurative

  2. ((b))

    Collateral

  3. ((c))

    Literal

  4. ((d))

    Figurine

Show Answer
Answer: ((a))

Figurative

Explanation:

‘Figurative’ is a poetic/metaphorical/symbolic way of speech, just like the given sentence the lever and fulcrum are symbols, hence it is the right answer here.

‘Collateral’ is to pledge something as a surety/guarantee for gaining a favor/ thing required

‘Literal’ is the exact meaning of each word, which is not applicable here as no one can ‘move the earth with a fulcrum and a long stick’.

‘Figurine’ is a small statue of a human being usually made with bone china as a decorative piece

4

If ‘relftaga’ means carefree, ‘otaga’ means careful and ‘fertaga’ means careless, which of the following could mean ‘aftercare’?

  1. ((a))

    zentaga

  2. ((b))

    tagafer

  3. ((c))

    tagazen

  4. ((d))

    relffer

Show Answer
Answer: ((c))

tagazen

Given that the part of the word ‘taga’ is repeated in all, and ‘care’ is repeated in all solutions, we can conclude that taga means care.

Further, ‘fer’ is part of the word careless, so we can conclude that it means ‘less’.

Also, the part ‘taga’ comes in the second half of the word when ‘care’ comes in the first part. Therefore, for ‘care’ to come in the second half, as in ‘aftercare’, taga will have to come in the first half.

Therefore, tagazen could mean aftercare.

5

A cube is built using 64 cubic blocks of side one unit. After it is built, one cubic block is removed from every corner of the cube. The resulting surface area of the body (in square units) after the removal is __________

  1. ((a))

    56

  2. ((b))

    64

  3. ((c))

    72

  4. ((d))

    96

Show Answer
Answer: ((d))

96

Volume of a cube = side3

Surface area of the cube = 6 × side2

Given, cube is built using 64 cubic blocks of side one unit.

∴ side3 = 64

⇒ side = 4 unit

Now, one cubic block is removed from every corner of the cube. This won’t change the surface area of the cube as the number of visible faces remain the same.

Resulting surface area of the body = 6 × 42 = 96 sq. unit

6

A shaving set company sells 4 different types of razors, Elegance, Smooth, Soft and Executive. Elegance sells at Rs. 48, Smooth at Rs. 63, Soft at Rs. 78 and Executive at Rs. 173 per piece. The table below shows the numbers of each razor sold in each quarter of a year.

Quarter/ProductEleganceSmoothSoftExecutive
Q12730020009176029999
Q22522219392184458942
Q328976224291954410234
Q421012182291659510109
<br>

Which product contributes the greatest fraction to the revenue of the company in that year?

  1. ((a))

    Elegance

  2. ((b))

    Executive

  3. ((c))

    Smooth

  4. ((d))

    Soft

Show Answer
Answer: ((b))

Executive

Elegance sells at Rs. 48, Smooth at Rs. 63, Soft at Rs. 78 and Executive at Rs. 173 per piece.

From the table,

Number of Elegance razor sold in a year = 27300 + 25222 + 28976 + 21012 = 102510

Number of Smooth razor sold in a year = 20009 + 19392 + 22429 + 18229 = 80059

Number of Soft razor sold in a year = 17602 + 18445 + 19544 + 16595 = 72186

Number of Executive razor sold in a year = 9999 + 8942 + 10234 + 10109 = 39284

Revenue earned by selling Elegance razor = 102510 × 48 = Rs. 4920480

Revenue earned by selling Smooth razor = 80059 × 63 = Rs. 5043717

Revenue earned by selling Soft razor = 72186 × 78 = Rs. 5630508

Revenue earned by selling Executive razor = Rs. 6796132

Thus, Executive razor contributes the greatest fraction to the revenue of the company in that year.

7

Indian currency notes show the denomination indicated in at least seventeen languages. If this is not an indication of the nation’s diversity, nothing else is.

Which of the following can be logically inferred from the above sentences?

  1. ((a))

    India is a country of exactly seventeen languages.

  2. ((b))

    Linguistic pluralism is the only indicator of a nation’s diversity.

  3. ((c))

    Indian currency notes have sufficient space for all the Indian languages.

  4. ((d))

    Linguistic pluralism is strong evidence of India’s diversity.

Show Answer
Answer: ((d))

Linguistic pluralism is strong evidence of India’s diversity.

‘A’ cannot be true as ‘currency notes’ are a minimalistic representation, meaning they just show a fraction of something, hence it is not a complete picture and there definitelty can be more languages

‘B’ Diversity is not based on only languages, as it has to take into account various factors like clothes,cuisines,climates,mountains, people, etc, so though language is a part of the diversity it cannot be the only indicator.

‘C’ The currency notes come in various sizes and denominations, here it is not specified and so it is ambiguous as to which currency note is referred to here, also no currency note can have ‘sufficient space’ on it to fit in the 22 official or the1652 in totality that are spoken here.

‘D’ Linguistic pluralism is strong evidence of India’s diversity is definitely correct as a country which speaks in so many languages is a country which has a diverse set of people, traditions, cultures etc. hence this can clearly be ‘one’ of the indications of the nation’s diversity.

8

Consider the following statements relating to the level of poker play of four players P, Q, R and S.

I. P always beats Q

II. R always beats S

III. S loses to P only sometimes

IV. R always loses to Q

Which 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

  1. ((a))

    (i) only

  2. ((b))

    (ii) only

  3. ((c))

    (i) and (ii)

  4. ((d))

    neither (i) nor (ii)

Show Answer
Answer: ((d))

neither (i) nor (ii)

Using the ‘>’ to imply the winner in encounters between the two, we can conclude the following from the given statements:

I. P > Q

II. R > S

III. S > P (only sometimes = more likely to win).

IV. Q > R

Based on this, we can analyse the given statements:

i) P is likely to defeat the other players is not true, as P tends to lose to S, and we cannot determine the performance against R.

ii) S is the worst player amongst the lot is always untrue as S tends to defeat P in most encounters.

Hence neither statement (i) nor (ii) can be logically inferred from the given statement.

9

If f(x) = 2x7 + 3x – 5, which of the following is a factor of f(x)?

  1. ((a))

    (x+ 8)

  2. ((b))

    (x - 1)

  3. ((c))

    (2x - 5)

  4. ((d))

    (x + 1)

Show Answer
Answer: ((b))

(x - 1)

Given, f(x) = 2x7 + 3x – 5

We have to check each option and find the factor.

A) x3 + 8 = (x + 2)(x2 – 2x + 4)

∴ For x3 + 8 to be a factor, (x + 2) should be a factor too.

Thus, for x = -2, f(x) = 0

⇒ 2 × -27 + 3 × -2 – 5 ≠ 0

Thus x3 + 8 is not a factor.

B) x – 1

∴ For (x – 1) to be a factor, f(1) = 0

= 2 × 17 + 3 × 1 – 5

= 0

Thus (x – 1) is a factor

C) 2x - 5

For (2x – 5) to be a factor, f(5/2) = 0

= 2 × (5/2)7 + 3 × (5/2) – 5

≠ 0

Thus (2x – 5) is not a factor.

D) x + 1

For (x + 1) to be a factor, f(-1) = 0

= 2 × (-1)7 + 3 × -1 – 5

= -10

Thus, (x + 1) is not a factor.

∴ (x – 1) is a factor of f(x) = 2x7 + 3x – 5

10

In a process, the number of cycles to failure decreases exponentially with an increase in load. At a load of 80 units, it takes 100 cycles for failure. When the load is halved, it takes 10000 cycles for failure. The load for which the failure will happen in 5000 cycles is ________.

  1. ((a))

    40.00

  2. ((b))

    46.02

  3. ((c))

    60.01

  4. ((d))

    92.02

Show Answer
Answer: ((b))

46.02

Given, in a process, the number of cycles to failure decreases exponentially with an increase in load.

Let the relation be : c = a × bl,

Where, c is number of cycles and l is load units while a and b are constants.

Given, at a load of 80 units, it takes 100 cycles for failure. When the load is halved, it takes 10000 cycles for failure.

∴ 100 = a × b80 --------- (1) and 10000 = a × b40 -------- (2)

Dividing (1) by (2)

⇒ 1/100 = b40

Taking log both sides

∴ log(1/100) = 40 logb

140log(1100)=logb;\Rightarrow \frac{1}{{40}}\log \left( {\frac{1}{{100}}} \right) = \log b; 

Substituting value of b40 in eq2,

⇒ 10000 = a × 1/100

⇒ a = 106

Given, failure happened in 5000 cycles.

∴ 5000 = 106 × bl

⇒ 5 × 10-3 = bl

Taking log both sides.

log(5 × 10-3) = l × logb

log(5×103)140log(1100)=l\Rightarrow \frac{{\log \left( {5 \times {{10}^{ - 3}}} \right)}}{{\frac{1}{{40}}\log \left( {\frac{1}{{100}}} \right)}} = l 

⇒ l = 46.021

Computer Science and Information Technology (55 questions)

11

Let p, q, r, s represents the following propositions.

p: x ∈ {8, 9, 10, 11, 12}

q: x is a composite number

r: x is a perfect square

s: x is a prime number

The integer x ≥ 2 which satisfies ¬ ((p ⇒ q) ∧ (¬ r ∨ ¬ s)) is __________

12

Let an be the number of n-bit strings that do NOT contain two consecutive 1s. Which one of the following is the recurrence relation for an?

  1. ((a))

    an = an – 1 + 2an - 2

  2. ((b))

    an = an – 1 + an - 2

  3. ((c))

    an = 2an – 1 + an - 2

  4. ((d))

    an = 2an – 1 + 2an - 2

Show Answer
Answer: ((b))

an = an – 1 + an - 2

We have to take n-bit strings that do not contain two consecutive 1’s

For n = 1, i.e. 1 bit string , number of strings with 1 bit = { 0, 1 } = 2

For n = 2 i.e. 2 bit string, number of strings with 2 bit = {00, 01, 10} = 3

For n = 3, i.e. 3 bit string, number of strings with 3 bit = {000, 001, 010, 100, 101} = 5

For n = 4 i.e. 4 bit string, number of strings with 4 bit = {0000, 0001, 0010, 0100, 1000, 0101, 1010, 1001} = 8

Here, these values are making a Fibonacci series. Because we are getting the next value by adding the previous two values like in Fibonacci sequence (0, 1, 1, 2, 3, 5, 8 ……..)

Recurrence relation for Fibonacci sequence is : T(n) = T (n -1 ) + T(n - 2)

So, here recurrence relation for an = an-1 + an-2

13

\(\mathop {\lim }\limits_{x \to 4} \frac{{\sin \left( {x - 4} \right)}}{{x - 4}} = __________.\)

14

A probability density function on the interval [a, 1] is given by 1/x2 and outside this interval the value of the function is zero. The value of a is _________.

15

Two eigenvalues of a 3 × 3 real matrix P are (2 + √-1) and 3. The determinant of P is ______.

16

Consider the Boolean operator # with the following properties:

x # 0 = x, x # 1 = x̅, x # x = 0 and x # x̅ = 1. Then x # y is equivalent to

  1. ((a))

    xy̅ + x̅y

  2. ((b))

    xy̅ + x̅ y̅

  3. ((c))

    x̅y + xy

  4. ((d))

    xy + x̅ y̅ 

Show Answer
Answer: ((a))

xy̅ + x̅y

Find out the value of # function with the help of truth table;

Given:

x # 0 = x,

x # 1 = x̅,

x # x = 0 and

x # x̅ = 1

xy#
000
011
101
110

 

So, according to this # function results in XOR operation on x and y.

x # y equivalent to x.y̅ + x̅.y

Alternate method:

Rules of XOR function are:

1)  XOR of a with 0 = a

  1. XOR of a with 1 = a’

  2. XOR of a with a = 0

  3. XOR of a with a’ = 1

So, here also given properties follow the rules of XOR operation so, this # function here represents the XOR function.

x # y is equivalent to xy̅ + x̅ y.

17

The 16-bit 2’s complement representation of an integer is 1111 1111 1111 0101; its decimal representation is________.

18

We want to design a synchronous counter that counts the sequence 0-1-0-2-0-3 and then repeats. The minimum number of J-K flip-flops required to implement this counter is _______.

19

A processor can support a maximum memory of 4 GB, where the memory is word-addressable (a word consists of two bytes). The size of the address bus of the processor is at least_______ bits. 

20

A queue is implemented using an array such that ENQUEUE and DEQUEUE operations are performed efficiently. Which one of the following statements is CORRECT (n refers to the number of items in the queue)?

  1. ((a))

    Both operations can be performed in O(1) time

  2. ((b))

    At most one operation can be performed in O(1) time but the worst case time for the other operation will be Ω(n) 

  3. ((c))

    The worst-case time complexity for both operations will be Ω(n)

  4. ((d))

    Worst case time complexity for both operations will be Ω (log n)

Show Answer
Answer: ((a))

Both operations can be performed in O(1) time

When we consider a normal implementation of the queue using an array, in that case for enqueue and dequeue operation, we have to shift every other element.  In this, every time we remove the item from the start of the queue, all of the rest of the items in the queue move down by one to fill the space made by the removal of other items.

But if we consider the circular array implementation of a queue, in this case, both enqueue and dequeue can be performed in O(1) time.

Diagram

21

Consider the following directed graph:

The number of different topological orderings of the vertices of the graph is _______.

22

Consider the following C program. 

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?

  1. ((a))

    f(s,*s)

  2. ((b))

    i = f(i, s)

  3. ((c))

    f(i,*s)

  4. ((d))

    f(i,*p)

Show Answer
Answer: ((d))

f(i,*p)

Consider all the options one by one.

  1. f(s,*s)

In this function call, second argument is a pointer variable but, in the question, 2nd argument is given as short not a pointer variable. So, it is incorrect.

  1. i = f(i, s)

Here in this value of this function f(i, s) will  store into variable i. But in case of actual function there is no return type. So, it is incorrect.

  1. f(i,*s)

Same as in 1st option. So, it is incorrect.

  1. f(i,*p)

Here, both the arguments and return type matches. As p is a pointer to short and *p is value of short. So, it is correct.

23

The worst-case running times of Insertion sort, Merge sort and Quick sort, respectively, are:

  1. ((a))

    Θ (n log n), Θ (n log n), and Θ (n2)

  2. ((b))

    Θ (n2), Θ (n2), and Θ (n log n)

  3. ((c))

    Θ (n2), Θ (n log n), and Θ (n log n)

  4. ((d))

    Θ (n2), Θ (n log n), and Θ (n2)

Show Answer
Answer: ((d))

Θ (n2), Θ (n log n), and Θ (n2)

Insertion sort:

In Insertion sort, the worst-case takes Θ (n2) time, the worst case of insertion sort is when elements are sorted in reverse order. In that case the number of comparisons will be like:

\(\mathop \sum \limits_{{\rm{p}} = 1}^{{\rm{N}} - 1} {\rm{p}} = 1 + 2 + 3 + \ldots . + {\rm{N}} - 1 = {\rm{;}}\frac{{{\rm{N}}\left( {{\rm{N}} - 1} \right)}}{2} - 1\)

This will give Θ (n2) time complexity.

Merge sort:

In Merge sort, the worst-case takes Θ (n log n) time. Merge sort is based on the divide and conquer approach. Recurrence relation for merge sort will become:

T(n) = 2T (n/2) + Θ (n)

T(n) = n + Θ (n)

T (n) = n × logn

Quicksort:

In Quicksort, the worst-case takes Θ (n2) time. The worst case of quicksort is when the first or the last element is chosen as the pivot element.

Diagram

\(\mathop \sum \limits_{{\rm{p}} = 1}^{{\rm{N}} - 1} {\rm{p}} = 1 + 2 + 3 + \ldots . + {\rm{N}} - 1 = {\rm{;}}\frac{{{\rm{N}}\left( {{\rm{N}} - 1} \right)}}{2} - 1\)

This will give Θ (n2) time complexity.

Recurrence relation for quick sort algorithm will be,

T (n) = T (n-1) + Θ (n)

This will give the worst-case time complexity as Θ (n2).

24

Let G be a weighted connected undirected graph with distinct positive edge weights. If every edge weight is increased by the same value, then which of the following statements is/are TRUE?

P: Minimum spanning tree of G does not change

Q: Shortest path between any pair of vertices does not change

  1. ((a))

    P only

  2. ((b))

    Q only

  3. ((c))

    Neither P nor Q

  4. ((d))

    Both P and Q

Show Answer
Answer: ((a))

P only

Concept:

A minimum spanning tree (MST) or minimum weight spanning tree is a subset of the edges(V – 1 ) of a connected, edge-weighted undirected graph G(V, E) that connects all the vertices together, without any cycles and with the minimum possible total edge weight.

Example:

Graph G(V, E)

Shortest path between A and C = A → B and B → C, that is,1 + 2 = 3

G(V, V – 1) → minimum spanning tree

Increase the weight of G(V, E) by 10

Graph G'(V, E)

Shortest path between A and C = A → C = 20 (different path)

G'(V, V – 1) → minimum spanning tree

 

Statement P: TRUE

Minimum spanning the tree of G does not change

Statement Q: False

Shortest path between any pair of vertices may change

25

Consider the following C program.

#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) ;

                print ("%d\n", a);

}

The output of the program is __________.

26

Which of the following languages is generated by the given grammar?

S → aS | bS | ϵ

  1. ((a))

    {anbm | n, m ≥ 0}

  2. ((b))

    {w ∈ {a, b} * | w has equal number of a’s and b’s}

  3. ((c))

    {an | n ≥ 0} ∪ { bn | n ≥ 0} ∪ {abn | n ≥ 0}

  4. ((d))

    (a + b}*

Show Answer
Answer: ((d))

(a + b}*

S → aS | bS | ϵ 

This grammar results in (a + b)*

DFA for this grammar is:

Diagram

Now, consider the options one by one:

Option 1:

{anbm | n, m ≥ 0}

Here order is fixed, means first any number of a will come then any number of b. It is incorrect.

Option 2: 

{w ϵ {a, b} * | w has an equal number of a’s and b’s}

As given grammar is not generating the expression which generates only equal number of a and b. So,

not correct.

Option 3:

{an | n ≥ 0} {bn | n ≥ 0} {anbn | n ≥ 0}

Here, also order is fixed. So, it is incorrect.

Option 4:

{a, b}*

This is equivalent to (a + b)*. So, it is correct.

27

Which of the following decision problems are undecidable?

I. Given NFAs N1 and N2, is L(N1) ∩ L(N2) = ϕ?

II. Given a CFG G = (N, ∑, P, S) and a string x ∈ ∑*, does x ∈ L(G)?

III. Given CFGs G1 and G2, is L(G1) = L(G2)?

IV. Given a TM M, is L(M) = ϕ?

  1. ((a))

    I and IV only

  2. ((b))

    II and III only

  3. ((c))

    III and IV only

  4. ((d))

    II and IV only

Show Answer
Answer: ((c))

III and IV only

I. Given NFAs N1 and N2, is L(N1) ∩ L(N2) = ϕ?

This is decidable, when we convert the NFA into DFA, if no common final state in it. Then this will become true.

II. Given a CFG G = (N, ∑, P, S) and a string x ∈ ∑*, does x ∈ L(G)?

Membership property of a context free grammar is decidable.

III. Given CFGs G1 and G2, is L(G1) = L(G2)?

Equivalence of two context free grammar is undecidable.

IV. Given a TM M, is L(M) = ϕ?   

Emptiness problem of Turing machine is undecidable.

28

Which one of the following regular expressions represents the language: the set of all binary strings having two consecutive 0s and two consecutive 1s? 

  1. ((a))

    (0 + 1) 0011 (0 + 1) + (0 + 1) 1100 (0 + 1)

  2. ((b))

    (0 + 1) *(00(0 + 1)*11 + 11 (0 + 1)00) (0 + 1)

  3. ((c))

    (0 + 1) 00 (0 + 1) + (0 + 1) 11 (0 + 1)

  4. ((d))

    00 (0 + 1) *11 + 11 (0 + 1) *00

Show Answer
Answer: ((b))

(0 + 1) *(00(0 + 1)*11 + 11 (0 + 1)00) (0 + 1)

Consider all the options one by one:

  1. (0 + 1) 0011 (0 + 1) + (0 + 1) 1100 (0 + 1)

It consider only those string which have either 0011 or 1100 as a substring. So, it is wrong.

  1. (0 + 1) *(00(0 + 1)*11 + 11 (0 + 1)00) (0 + 1)

It contains set of all the binary strings that contain two consecutive 0’s and 1’s.

  1. (0 + 1) 00 (0 + 1) + (0 + 1) 11 (0 + 1)

This set contains only those string which have either 00 or 11 as substring but not does not contain all the strings that contain two consecutive 0’s and 1’s.

  1. 00 (0 + 1) *11 + 11 (0 + 1) *00

It represents those strings which start with 00 or 11 and end with 11 or 00 respectively. So, it is wrong.

29

Consider the following code segment.

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 _______.

30

Consider an arbitrary set of CPU-bound processes with unequal CPU burst lengths submitted at the same time to a computer system. Which one of the following process scheduling algorithms would minimize the average waiting time in the ready queue?

  1. ((a))

    Shortest remaining time first

  2. ((b))

    Round robin with time quantum less than the shortest CPU burst

  3. ((c))

    Uniform random

  4. ((d))

    Highest priority first with priority proportional to CPU burst length

Show Answer
Answer: ((a))

Shortest remaining time first

Concept:

Waiting time:

It is the total time spent by the process in the ready state waiting for CPU.

Shortest remaining time first:

This algorithm is the pre-emptive shortest job first algorithm and optimal. In this process having small running time remaining until completion are selected to execute first, this can also cause starvation. But in shortest remaining time first algorithm, turnaround time, waiting time is minimum and CPU utilization is high.

Example:

ProcessArrival timeBurst time
P105
P217
P323

 

For shortest remaining time first,

Gantt chart:

P1P2P3P3P1P2

0            1               2              3              5              9            15

Average waiting time in SRTF = 3.67 ms (Burst time are in ms)

For round robin scheduling with TQ = 1

Gantt chart:

P1P2P1P3P2P1P3P2P1P3P2P1P2

0     1      2      3      4      5      6      7      8      9     10    11    12   15

Average waiting time in RR = 6.33 ms

For uniform random (say FCFS)

Gantt chart:

P1P2P3

0               5               12             15

Average waiting using FCFS = 4.67 ms

Priority scheduling algorithm:

In this example, average waiting time for this = 4.67 ms

Therefore, Shortest remaining time first algorithm has minimum average waiting time.

31

Which of the following is NOT a superkey in a relational schema with attributes V, W, X, Y, Z and primary key V Y?

  1. ((a))

    VXYZ

  2. ((b))

    VWXZ

  3. ((c))

    VWXY

  4. ((d))

    VWXYZ

Show Answer
Answer: ((b))

VWXZ

Concept:

Superkey is a set of attributes within a table whose values can be used to uniquely identify a tuple. A candidate key is a minimal superkey.

Superkey is superset of candidate key or primary key.

Explanation:

Primary key is VY. (given)

All superkeys must contain this primary key VY. From the given keys, key, which doesn’t contain

the VY.

Here, option 2: VWXZ

“VWXZ” doesn’t contain the primary key VY. So, it is not a superkey.

32

Which one of the following is NOT a part of the ACID properties of database transactions?

  1. ((a))

    Atomicity

  2. ((b))

    Consistency

  3. ((c))

    Isolation

  4. ((d))

    Deadlock-freedom

Show Answer
Answer: ((d))

Deadlock-freedom

ACID properties of database transaction:

Atomicity: The entire transaction takes place at once or doesn’t happen at all.

Consistency: The database must be consistent before and after the transaction.

Isolation: Multiple transactions occur independently without interference.

Durability: The changes of a successful transaction occurs even if the system failure occurs.

So, deadlock freedom is not the ACID property of database transaction.

33

A database of research articles in a journal uses the following schema.

(VOLUME, NUMBER, STARTPAGE, 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) → PRICE

The 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?

  1. ((a))

    1NF

  2. ((b))

    2NF

  3. ((c))

    3NF

  4. ((d))

    BCNF

Show Answer
Answer: ((b))

2NF

First relational schema:

(VOLUME, NUMBER, STARTPAGE, ENDPAGE, TITLE, YEAR, PRICE)

Primary key: (VOLUME, NUMBER, STARTPAGE, ENDPAGE)

Functional dependencies are:

(VOLUME, NUMBER, STARTPAGE, ENDPAGE) → TITLE   

(This dependency is in BCNF, satisfy form X → A, where X is the candidate key)

(VOLUME, NUMBER) → YEAR

(This dependency is not in 2NF, as there is partial dependency in this)

(VOLUME, NUMBER, STARTPAGE, ENDPAGE) → PRICE       (BCNF form).

First relational schema is in 1NF.

Second relational schema:

(VOLUME, NUMBER, STARTPAGE, ENDPAGE, TITLE, PRICE)      - 1st

(VOLUME, NUMBER, YEAR)   - 2nd

1st satisfy

(VOLUME, NUMBER, STARTPAGE, ENDPAGE) → TITLE     //BCNF form

(VOLUME, NUMBER, STARTPAGE, ENDPAGE) → PRICE      // BCNF form

2nd satisfy

(VOLUME, NUMBER) → YEAR               // According to this, satisfy 2 NF form.

Weakest normal form that new database satisfies but old one doesn’t is 2NF.

34

Which one of the following protocols is NOT used to resolve one form of address to another one? 

  1. ((a))

    DNS

  2. ((b))

    ARP

  3. ((c))

    DHCP

  4. ((d))

    RARP

Show Answer
Answer: ((c))

DHCP

For, this we must know what each of these protocol does.

DNS:

DNS stands for domain name server. DNS converts domains to IP address. These are internet’s equivalent of a phone book.

ARP:

ARP stands for address resolution protocol.  This is a protocol uses to convert IP address into MAC address. This protocol operates below the network layer as part of interface between OSI network and link layer.

RARP:

RARP stands for reverse address resolution protocol. This is used to convert a particular MAC address into a corresponding IP address.

DHCP:

DHCP stands for dynamic host configuration protocol. It enables a server to automatically assign an IP address to a computer from a defined range of numbers. It is not used to resolve one address form to another.

35

Which of the following is/are example(s) of stateful application layer protocols?

(i) HTTP

(ii) FTP

(iii) TCP

(iv) POP3

  1. ((a))

    (i) and (ii) only

  2. ((b))

    (ii) and (iii) only

  3. ((c))

    (ii) and (iv) only

  4. ((d))

    (iv) only

Show Answer
Answer: ((c))

(ii) and (iv) only

Concept:

Stateless protocols: A stateless protocol does not require the server to retain session information or status about each communicating partner for the duration of multiple requests. Each request is treated as an independent transaction.

Stateful protocols: A protocol that requires keeping of the internal state on the server is known as stateful protocol.

Explanation:

HTTP: Hypertext transfer protocol is a stateless protocol. No information is maintained by server in this protocol.

FTP: File transfer protocol is a stateful protocol. It remembers all the log files corresponding to the client.

TCP: Transfer control protocol is not an application layer protocol. TCP works at transport layer.

POP3: It is a client/ server protocol in which e-mail is received and held by the internet server. It is a stateful application layer protocol.

Therefore, option 3 is correct

36

The coefficient of x12 in (x3 + x4 + x5 + x6 + …)3 is _______.

37

Consider the recurrence relation a1 = 8, an = 6n2 + 2n + an – 1. Let a99 = K × 104. The value of K is ________.

38

A function f: N+ → N+, defined on the set of positive integers N+, satisfies the following properties:

f(n) = f(n/2) if n is even

f(n) = f(n + 5) if n is odd

Let R = {i | ∃ j: f(j) = i} be the set of distinct values that f takes. The maximum possible size of R is _______.

39

Consider the following experiment.

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, HEADS) or (HEADS, TAILS), then output N and stop.

Step 4. If the outcomes are (TAILS, TAILS), then go to Step1.

The probability that the output of the experiment is Y is (up to two decimal places) ______.

40

Consider the two cascaded 2-to-1 multiplexers as shown in the figure.

The minimal sum of products form of the output X is

  1. ((a))

    P̅ Q̅ + PQR

  2. ((b))

    P̅ Q + QR

  3. ((c))

    PQ + P̅ Q̅ R

  4. ((d))

    Q̅ R̅ + PQR

Show Answer
Answer: ((d))

Q̅ R̅ + PQR

input given at 0 is R̅ in MUX 2

Concept:

For a 2: 1 multiplexer, if S is enabled and I0, I1 are the input, output = S̅ I0 + SI1

Explanation:

                          MUX 1                       MUX 2

Here, output of MUX 1 is input to MUX 2.

Here, output of MUX1 = P̅.0 + P.R = P R

Output of MUX 2 = X = Q̅.R̅  + Q.P.R

The minimal sum of products form of the output X is Q̅.R̅ + PQR

41

The size of the data count register of a DMA controller is 16 bits. The processor needs to transfer a file of 29,154 kilobytes from disk to main memory. The memory is byte addressable. The minimum number of times the DMA controller needs to get the control of the system bus from the processor to transfer the file from the disk to main memory is ________.

42

The stage delays in a 4-stage pipeline are 800, 500, 400 and 300 picoseconds. The first stage (with delay 800 picoseconds) is replaced with a functionally equivalent design involving two stages with respective delays 600 and 350 picoseconds. The throughput increase of the pipeline is percent.

43

Consider a carry lookahead adder for adding two n-bit integers, built using gates of fan-in at most two. The time to perform addition using this adder is

  1. ((a))

    Θ (1)

  2. ((b))

    Θ (log(n))

  3. ((c))

    Θ (√n)

  4. ((d))

    Θ (n)

Show Answer
Answer: ((b))

Θ (log(n))

Concept:

A carry look- ahead adder reduces the propagation delay by introducing more complex hardware. In this, ripple carry design is suitably transformed such that the carry logic cover fixed groups of bits of the adder is reduced to two – level logic.

Explanation:

In case of look – ahead adder,

Gi = carry generator, Pi = carry propagator (Pi = Ai XOR Bi) and (Gi = AiBi)

C1 = G0 + P0C0

C2 = G1 + P1G0 + P1P0C0

C3 = G2 + P2G1 + P2 P1G0 + P2 P1 P0C0

From above Boolean equations, C4 does not have to wait for C3 and C2 to propagate. It propagates at the same time. Boolean expression for each carry output is the sum of products so these are implemented with AND gates followed by an OR gate.

Here, for generation of nth carry bit, we perform AND between (n+1) inputs.  If we have AND gates with a fan-in of k then we find the AND of all the bits in logk(n + 1) time.

Here we have to find for fan-in with atmost 2 bits.

So, time to perform this addition =   Θ (log(n))

44

The following function computes the maximum value contained in an integer array p[] of size n (n>= 1).

int max (int *p, int n)  {

             int a = 0, b = n – 1;

             while(__________) {

  if(p[a] <= p[b])  { a = a+1;  }

  else                      { b = b-1;   } 

             }

            return p[a];

       }

The missing loop condition is

  1. ((a))

    a ! = n

  2. ((b))

    b ! = 0

  3. ((c))

    b > (a + 1)

  4. ((d))

    b ! = a

Show Answer
Answer: ((d))

b ! = a

Consider size of array; n= 5

23716

  p[0]          p[1]       p[2]        p[3]        p[4]

In this array, we have to find the maximum element.

CASE 1 :  while (a ! = n)

int max (int *p, int n)  {                  // p points to array and n= 5

                        int a = 0, b = n – 1;                       // a = 0 , b= 4

                        while( a ! = n ) {                          

          if(p[a] <= p[b])  { a = a+1;  }

          else                      { b = b-1;   } 

                        }

                       return p[a];

                } 

In this case, at the end value of  a becomes 5, p[5] doesn’t result in any value.

CASE 2: while (b ! = 0)

With this condition, it will not print the maximum value.

CASE 3: while (b > (a + 1 ))

This will give the required output which gives the maximum element of the array but this condition doesn’t hold true for n = 2.

CASE 4: while ( b ! = a )

It will give the maximum element of the array.

45

What will be the output of the following C program?

void count (int n) {

static int d=1;

printf("%d ", n);

printf("%d ", d);

d++;

if(n>1)   count (n-1);

printf("%d ", d);

   }

void main() {

count(3);

  }

  1. ((a))

    3 1 2 2 1 3 4 4 4

  2. ((b))

    3 1 2 1 1 1 2 2 2

  3. ((c))

    3 1 2 2 1 3 4

  4. ((d))

    3 1 2 1 1 1 2

Show Answer
Answer: ((a))

3 1 2 2 1 3 4 4 4

A static local variable is initialized only once no matter how many times the function in which it resides is called.

  1. Here, count (3) calls the function

void count (int n) {

             static int d=1;             // d= 1(only once)

             printf("%d ", n);         // print 3

             printf("%d ", d);            // print 1

             d++;                                   // d = 2

             if(n>1)   count (n-1);                // (3 > 1) condition true, count (2), again call goes to function.

             printf("%d ", d);

}

  1. Now, count (2) is called,

It will print value of n and d  i.e. 2 2 will be printed and d will become 3

  1. Now, condition become true again (2 > 1). Count (1) will be called.

  2. Count (1) will print the valued of n and d i.e. 1 3 will be printed and d will become  4.

  3. Now if condition becomes false as 1 is not greater than 1 . So, it will print the value of d which is 4.

  4. control will go back to count (2). It will also print final value of d i.e. 4. Count (2) execution finished.

And control will go to count (3).

  1. count (3) finally prints the value of d i.e. 4.

8 ) So, final output is 3 1 2 2 1 3 4 4 4

46

What will be the output of the following pseudo-code when parameters are passed by reference and dynamic scoping is assumed?

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); }

  1. ((a))

    6, 2

  2. ((b))

    6, 6

  3. ((c))

    4, 2

  4. ((d))

    4, 4

Show Answer
Answer: ((c))

4, 2

The correct answer is option 3.

Concept:

Static Scope:

Referencing the environment of a statement in a static scope language is the collection of all local variables and all other ancestor variables that are visible in the statement.

Dynamic Scope:

Referencing the environment of a statement in a dynamical scope language is the collection of all local variables and all other active subprogram variables which are visible in the statement.

Explanation:

Step 1:

Here 'a' is a global variable it can be accessed throughout the program.

Step 2:

In m(y) here a is not a local variable so it updates the value in the global section. Then control moves to n(x) function.

Step 3:

In n(x), the local variable x is updated by x = x*a. So print x value as 4. Then n(x) function is removed from stack moves back to m(y) function call.

Step 4:

In m(y), The value 'a' prints by checking the local variable and other active sub-programs. Hence the main function has the variable 'a'. Hence it prints the 'a' as 2 as output.

Hence the correct answer is 4,2.

47

An operator delete(i) for a binary heap data structure is to be designed to delete the item in the i-th node. Assume that the heap is implemented in an array and i refers to the i-th index of the array. If the heap tree has depth d (number of edges on the path from the root to the farthest leaf), then what is the time complexity to re-fix the heap efficiently after the removal of the element? 

  1. ((a))

    O(1)

  2. ((b))

    O(d) but not O(1)

  3. ((c))

    O(2d) but not O(d)

  4. ((d))

    O(d2d) but not O(2d)

Show Answer
Answer: ((b))

O(d) but not O(1)

STEPS:

1)  delete (i) will delete the element at ith index in the binary heap in O (1) time.

  1. But, we have to fill the empty position with the last node of the heap.

  2. Last node of the heap can be easily found in O (1) time and replace empty position with this node.

  3. After this, there is need to heapify the binary heap which will take  O (depth of heap tree).

  4. Depth of heap tree is log n if n is number of elements in the heap.

  5. But, in question it is given that depth is d. So, this delete (i) will take O (d) time not O(1)

48

Consider the weighted undirected graph with 4 vertices, where the weight of edge {i, j}g is given by the entry Wij in the matrix W.

\(W = \left[ {\begin{array}{*{20}{c}} 0&2&8&5\ 2&0&5&8\ 8&5&0&x\ 5&8&x&0 \end{array}} \right]\)

The largest possible integer value of x, for which at least one shortest path between some pair of vertices will contain the edge with weight x is______.

49

Let G be a complete undirected graph on 4 vertices, having 6 edges with weights being 1, 2, 3, 4, 5, and 6. The maximum possible weight that a minimum weight spanning tree of G can have is________

50

G = (V, E) is an undirected simple graph in which each edge has a distinct weight, and e is a particular edge of G. Which of the following statements about the minimum spanning trees (MSTs) of G is/are TRUE?

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

  1. ((a))

    I only

  2. ((b))

    II only

  3. ((c))

    both I and II

  4. ((d))

    neither I nor II

Show Answer
Answer: ((b))

II only

I. If e is the lightest edge of some cycle in G, then every MST of G includes e          (INCORRECT)

Let G = (V, E) is a graph with 4 vertices and 5 edges. 

Here, cycle contains the edge weights (3, 4, 5) but edge weight 3 is not included in the MST.

So, according to the cut-property of MST if is the lightest edge of some cycle in G, then every MST of G may or may not include e.

II. If e is the heaviest edge of some cycle in G, then every MST of G excludes e          (CORRECT)

According to the cycle property of MST, same example as above. Here, cycle contains the edge weights (1, 2, 3)  and 3 is the heaviest so edge weight 3 is excluded in the MST.

If there is heaviest edge in cycle, then we will exclude it from the MST because there are other low-cost edges are available to include in MST (because edge weights are distinct here).

51

Let Q denote a queue containing sixteen numbers and S be an empty stack. Head(Q) returns the element at the head of the queue Q without removing it from Q. Similarly, Top(S) returns the elements at the top of S without removing it from S. Consider the algorithm given below.

The maximum possible number of iterations of the while loop in the algorithm is _______.

52

Consider the following context-free grammars:

G1 : S → aS|B, B → b|bB

G2 : S → aA|bB, A → aA|B|ϵ, B → bB|ϵ

Which one of the following pairs of languages is generated by G1 and G2, respectively?

  1. ((a))

    {ambn|m > 0 or n > 0} and {ambn|m > 0 and n > 0}

  2. ((b))

    {ambn|m > 0 and n > 0} and {ambn|m > 0 or n ≥ 0}

  3. ((c))

    {ambn|m ≥ 0 or n > 0} and {ambn|m > 0 and n > 0}

  4. ((d))

    {ambn|m ≥ 0 and n > 0} and {ambn|m > 0 or n > 0}

Show Answer
Answer: ((d))

{ambn|m ≥ 0 and n > 0} and {ambn|m > 0 or n > 0}

Given grammar is :

G1 : S → aS|B, B → b|bB

This grammar generates strings of type {b, ab, bb, aab, abb, bbb, aaab,……..}.

Here number of a’s can be 0 but number of b’s is always more than 0. From this option 1) and 2) are eliminated because these can’t generate number of a’s as 0.

Now, grammar G2 is:

G2 : S → aA|bB, A → aA|B|ϵ, B → bB|ϵ

This grammar generates string of type: {a, b, aa, ab, bb, aaa, aab, abb, bbb, ………..}.

This grammar doesn’t generate null string number of a’s and b’s are more than 0. So, only option 4) matches according to grammar G1 and G2.

G1 generates language of type: {am bn | m ≥ 0 and n > 0}

G2 generates language of type: {am bn | m > 0 or n > 0}

53

Consider the transition diagram of a PDA given below with input alphabet ∑ = {a, b} and stack alphabet Γ = {X, Z}. Z is the initial stack symbol. Let L denote the language accepted by the PDA.

Which one of the following is TRUE?

  1. ((a))

    L = { an bn |n ≥ 0} and is not accepted by any finite automata

  2. ((b))

    L = { an | n ≥ 0} ∪ { anbn | n ≥ 0} and is not accepted by any deterministic PDA

  3. ((c))

    L is not accepted by any Turing machine that halts on every input

  4. ((d))

    L = { an|n ≥ 0} ∪ {anbn|n ≥ 0} and is deterministic context-free

Show Answer
Answer: ((d))

L = { an|n ≥ 0} ∪ {anbn|n ≥ 0} and is deterministic context-free

Concept:

Acceptance of given string by a push down automata in two ways either by

  • Acceptance by final state: if machine at the end of the string enters to one of the final states then string is accepted.
  • Acceptance by Empty state: if at the end of the string, stack is empty then string is accepted.

Explanation:

In this PDA, initial state is also the final state it means null string is accepted by the given push down automata (PDA). Consider the states as q1, q2 and q3 where q1 is the final state.

Transition of given PDA are:

  1. (q1, a, Z) => (q1, XZ)

  2. (q1, a, X) => (q1, XX)

  3. (q1, b, X) => (q2, ϵ)

  4. (q2, b, X) => (q2, ϵ)

  5. (q2, ϵ, Z) => (q3, Z)

First two transition show that after giving input a at transition state remains same. With every input ‘a’ we push X into stack. It means an is always accepted for n>= 0. Transition 3 and 4 shows that for every b input a X is popped out of the stack until stack symbol is Z and string becomes empty. It means ‘b’ occurred same number of times as ‘a’. It represents language of the form {anbn for n>=0 }. It is a DCFL.

54

Let X be a recursive language and Y be a recursively enumerable but not recursive language.

Let W and Z be two languages such that Y̅ reduces to W, and Z reduces to X̅ (reduction means the standard many-one reduction). Which one of the following statements is TRUE?

  1. ((a))

    W can be recursively enumerable and Z is recursive.

  2. ((b))

    W can be recursive and Z is recursively enumerable.

  3. ((c))

    W is not recursively enumerable and Z is recursive.

  4. ((d))

    W is not recursively enumerable and Z is not recursive.

Show Answer
Answer: ((c))

W is not recursively enumerable and Z is recursive.

Concept:

Language A is reducible to language B (represented as A ≤ B) if there exists a function which will convert A to B.

Rule: If A ≤ B and B is recursive then; A is also recursive.

If A ≤ B and if A is not recursively enumerable, B is also not recursively enumerable.

Explanation;

Here X is a recursive language and X̅ is complement of X. As complement of a recursive language is also recursive, so, X̅ is also recursive.

But complement of recursive enumerable language is not recursive enumerable so, Y̅ is not recursive enumerable.

Now it is given that, Y̅ reduces to W and Z reduces to X̅.

According to the rule, X̅ is recursive. So, Z is also recursive.

But according to the property of recursive enumerable language W is not recursive enumerable language.

55

The attributes of three arithmetic operations in some programming language are given below.

OperatorPrecedenceAssociativityArity
+HighLeftBinary
-MediumRightBinary
*LowLeftBinary

 

The value of the expression 2 – 5 + 1 – 7 * 3 in this language is _______.

56

Consider the following Syntax Directed Translation Scheme (SDTS), with non-terminals {S, A} and terminals {a, b}.

S → aA {print 1}

S → a {print 2}

A → Sb {print 3}

Using the above SDTS, the output printed by a bottom-up parser, for the input aab is:

  1. ((a))

    1 3 2

  2. ((b))

    2 2 3

  3. ((c))

    2 3 1

  4. ((d))

    syntax error

Show Answer
Answer: ((c))

2 3 1

We have to find the output for input aab using the bottom – up parser

Given:

S → aA {print 1}

S → a {print 2}

A → Sb {print 3}

Using the parse tree:

We stopped the parse tree at ‘aab’ because it matches with the required string. Print the output string from bottom to top i.e. 2 3 1

57

Consider a computer system with 40-bit virtual addressing and page size of sixteen kilobytes. If the computer system has a one-level page table per process and each page table entry requires 48 bits, then the size of the per-process page table is_______ megabytes.

58

Consider a disk queue with requests for I/O to blocks on cylinders 47, 38, 121, 191, 87, 11, 92, 10. The C-LOOK scheduling algorithm is used. The head is initially at cylinder number 63, moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered from 0 to 199. The total head movement (in number of cylinders) incurred while servicing these requests is______.

59

Consider a computer system with ten physical page frames. The system is provided with an access sequence (a1, a2,…,a20, a1, a2,…,a20), where each ai is a distinct virtual page number. The difference in the number of page faults between the last-in-first-out page replacement policy and the optimal page replacement policy is ______.

60

Consider the following proposed solution for the critical section problem. There are n processes: P0…Pn – 1. In the code, function pmax returns an integer not smaller than any of its arguments. For all i, t[i] is initialized to zero.

Code for Pi:

do {

                c [i]=1; t[i] = pmax (t [0],…, t[n-1]) +1; c[i]=0;

                for every j ≠ I in {0,…,n-1} {

                                while (c[j]);

                                while (t[j] != 0 && t[j]<=t[i]) ;

                ]

                Critical section;

                t[i] =0;

                Remainder Section;

} While (true);

Which one of the following is TRUE about the above solution?

  1. ((a))

    At most one process can be in the critical section at any time

  2. ((b))

    The bounded wait condition is satisfied

  3. ((c))

    The progress condition is satisfied

  4. ((d))

    It cannot cause a deadlock

Show Answer
Answer: ((a))

At most one process can be in the critical section at any time

Given code is a N process synchronization solution (known as Lamport’s bakery algorithm)

; c[i]=0;

This helps in getting the token. Each process which wants to enter into critical section, gets a token number (as in a restaurant) and wait for his turn.

c[i]=1 //announce that process Pi is ready to take it’s token number

t[i] = pmax (t [0],…, t[n-1]) +1 //get token number

c[i]=0; // means process Pi has taken it’s token number

As more than one process can get same token value and then suppose P2 wants to enter the critical section. So, this line will be executed

while (t[j] != 0 && t[j]<=t[i]) ;

Now, j!=i, P2 scans for other processes and check if anyone of them have it’s token value less than or equal to it’s own token value. When P2 finds true then it starts looping at the condition. Similar for other processes. So, when P1 ­finds that all other processes have their token value as non zero and have value less than token of P1. It also waits. It becomes the situation of deadlock.

When deadlock in the system, progress will not be satisfied here.

Also, when a process reaches critical section, all other processes which started before it must have its token value as 0. This means that no two processes can be in critical section at the same time.

61

Consider the following two-phase locking protocol. Suppose a transaction T accesses (for read or write operations), a certain set of objects {O1,…,Ok}. This is done in the following manner:

Step 1. T acquires exclusive locks to O1,…,Ok in increasing order of their addresses.

Step 2. The required operations are performed.

Step 3. All locks are released.

This protocol will

  1. ((a))

    guarantee serializability and deadlock-freedom

  2. ((b))

    guarantee neither serializability nor deadlock-freedom

  3. ((c))

    guarantee serializability but not deadlock-freedom

  4. ((d))

    guarantee deadlock-freedom but not serializability

Show Answer
Answer: ((a))

guarantee serializability and deadlock-freedom

A transaction is said to follow 2- phase locking protocol if locking and unlocking can be done in 2 phases:

  1. Growing phase: New locks on data items may be acquired but none can be released.

  2. Shrinking phase: Existing locks may be released but no new locks can be acquired.

Properties of conservative 2PL:

A 2PL schedule is serializable, strict recoverable, deadlock free, starvation free.

Here, locks are acquired in order O1, O2, O3,……….Ok (increasing order). Locks are also not released until the transaction completes its operation. Here circular wait condition can never occur. Hence, there is no possibility of deadlock.

2PL is conflict serializable. So, it guarantees serializability. We can get a serializable schedule by ordering based on lock points.

62

Consider that B wants to send a message m that is digitally signed to A. Let the pair of private and public keys for A and B be denoted by KxK_{x}^{-} and Kx+K_{x}^{+} for x = A, B, respectively. Let Kx(m) represent the operation of encrypting m with a key Kx and H(m) represent the message digest. Which one of the following indicates the CORRECT way of sending the message m along with the digital signature to A?

  1. ((a))

    \(\left{ m,K_{B}^{+}\left( H\left( m \right) \right) \right}\)

  2. ((b))

    \(\left{ m,~K_{B}^{-}\left( H\left( m \right) \right) \right}\)

  3. ((c))

    \(\left{ m,~K_{A}^{-}\left( H\left( m \right) \right) \right}\)

  4. ((d))

    \(\left{ m,~K_{A}^{+}\left( m \right) \right}\)

Show Answer
Answer: ((b))

\(\left{ m,~K_{B}^{-}\left( H\left( m \right) \right) \right}\)

Concept:

Digital signature is attached to an electronically transmitted document to verify its contents and the sender’s identity. It ensures the integrity, non-repudiation and authenticity of the message. Message digest is a hash value which is generated by applying a function on it.

In digital signature:

  1. Private key of sender is used to encrypt the message

  2. Public key of sender is used to decrypt the message.

Diagram:

Here, B sends the message m to A.

Private key is denoted by KxK_{x}^{-} and public keys by Kx+K_{x}^{+}

So, according to the definition of digital signature, \(\left{ m,~K_{B}^{-}\left( H\left( m \right) \right) \right}\) is the correct way to send the message m along with the digital signature to A.

63

An IP datagram of size 1000 bytes arrives at a router. The router has to forward this packet on a link whose MTU (maximum transmission unit) is 100 bytes. Assume that the size of the IP header is 20 bytes.

The number of fragments that the IP datagram will be divided into for transmission is_____.

64

For a host machine that uses the token bucket algorithm for congestion control, the token bucket has a capacity of 1 megabyte and the maximum output rate is 20 megabytes per second. Tokens arrive at a rate to sustain output at a rate of 10 megabytes per second. The token bucket is currently full, and the machine needs to send 12 megabytes of data. The minimum time required to transmit the data is _______seconds.

65

A sender uses the Stop-and-Wait ARQ protocol for reliable transmission of frames. Frames are of size 1000 bytes and the transmission rate at the sender is 80 Kbps (1Kbps = 1000 bits/second). Size of an acknowledgement is 100 bytes and the transmission rate at the receiver is 8 Kbps. The one-way propagation delay is 100 milliseconds.

Assuming no frame is lost, the sender throughput is________ bytes/second.

Attempt this paper under real exam conditions

Timed interface, section switching, instant scoring, and question-by-question analytics — free.

Start Timed Attempt