GATE 2017 CS (Set 2)

All 65 questions of GATE 2017 CS (Set 2)

Question text and figures as in the official paper, with the answer from the official key. Worked solutions for every question are in your report after you take the paper as a 3-hour test.

Q1 · General Aptitude · MCQ · 1 mark

Choose the option with words that are not synonyms.

  • (A)
    aversion, dislike
  • (B)
    luminous, radiant
  • (C)
    plunder, loot
  • (D)
    yielding, resistant

Answer (official key): D

Worked solution: in your report after you take this paper.

Q2 · General Aptitude · MCQ · 1 mark

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

  • (A)
    15\frac{1}{5}
  • (B)
    730\frac{7}{30}
  • (C)
    14\frac{1}{4}
  • (D)
    415\frac{4}{15}

Answer (official key): D

Worked solution: in your report after you take this paper.

Q3 · General Aptitude · MCQ · 1 mark

There are five buildings called V, W, X, Y and Z in a row, not necessarily in that order.

  • V is to the West of W.
  • Z is to the East of X and the West of V.
  • W is to the West of Y.

Which is the building in the middle?

  • (A)
    V
  • (B)
    W
  • (C)
    X
  • (D)
    Y

Answer (official key): A

Worked solution: in your report after you take this paper.

Q4 · General Aptitude · MCQ · 1 mark

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

Answer (official key): B

Worked solution: in your report after you take this paper.

Q5 · General Aptitude · MCQ · 1 mark

A test has twenty questions worth 100 marks in total. 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

Answer (official key): B

Worked solution: in your report after you take this paper.

Q6 · General Aptitude · MCQ · 2 marks

An air pressure contour line joins locations in a region having the same atmospheric pressure. The following is an air pressure contour plot of a geographical region. Contour lines are shown at 0.05 bar intervals in this plot.

Air pressure contour plot for Q65

If the possibility of a thunderstorm is given by how fast air pressure rises or drops over a region, which of the following regions is most likely to have a thunderstorm?

  • (A)
    P
  • (B)
    Q
  • (C)
    R
  • (D)
    S

Answer (official key): C

Worked solution: in your report after you take this paper.

Q7 · General Aptitude · MCQ · 2 marks

X is a 30 digit number starting with the digit 4 followed by the digit 7. Then the number X3X^3 will have:

  • (A)
    90 digits
  • (B)
    91 digits
  • (C)
    92 digits
  • (D)
    93 digits

Answer (official key): A

Read the worked solution

Q8 · General Aptitude · MCQ · 2 marks

“We lived in a culture that denied any merit to literary 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, were interpreted in political terms.”

The author’s belief that ideology is not as important as literature is revealed by the word:

  • (A)
    culture
  • (B)
    seemingly
  • (C)
    urgent
  • (D)
    political

Answer (official key): B

Read the worked solution

Q9 · General Aptitude · MCQ · 2 marks

There are three boxes. One contains apples, another contains oranges and the last one contains both apples and oranges. All three are known to be incorrectly 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

Answer (official key): B

Worked solution: in your report after you take this paper.

Q10 · General Aptitude · MCQ · 2 marks

The number of roots of

ex+0.5x2−2=0e^x + 0.5x^2 - 2 = 0

in the range [−5,5][-5,5] is:

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

Answer (official key): C

Worked solution: in your report after you take this paper.

Q11 · Compiler Design · MCQ · 1 mark

Match the following according to input from the left column to the compiler phase in the right column that processes it.

InputCompiler phase
(P) Syntax tree(i) Code generator
(Q) Character stream(ii) Syntax analyzer
(R) Intermediate representation(iii) Semantic analyzer
(S) Token stream(iv) Lexical analyzer
  • (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)

Answer (official key): C

Worked solution: in your report after you take this paper.

Q12 · Theory of Computation · Numerical · 1 mark

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}L=\{w_1aw_2\mid w_1,w_2\in\{a,b\}^*,\ |w_1|=2,\ |w_2|\ge3\}

is __________.

Answer (official key): 8

Worked solution: in your report after you take this paper.

Q13 · Theory of Computation · MCQ · 1 mark

Identify the language generated by the following grammar, where SS is the start variable.

S→XYS \to XY X→aX∣aX \to aX \mid a Y→aYb∣ϵY \to aYb \mid \epsilon
  • (A)
    {ambn∣m≥n, n>0}\{a^m b^n \mid m \ge n,\ n > 0\}
  • (B)
    {ambn∣m≥n, n≥0}\{a^m b^n \mid m \ge n,\ n \ge 0\}
  • (C)
    {ambn∣m>n, n≥0}\{a^m b^n \mid m > n,\ n \ge 0\}
  • (D)
    {ambn∣m>n, n>0}\{a^m b^n \mid m > n,\ n > 0\}

Answer (official key): C

Worked solution: in your report after you take this paper.

Q14 · Linear Algebra · Numerical · 1 mark

Let

P=[11−12−343−23]P= \begin{bmatrix} 1 & 1 & -1\\ 2 & -3 & 4\\ 3 & -2 & 3 \end{bmatrix}

and

Q=[−1−2−161265105]Q= \begin{bmatrix} -1 & -2 & -1\\ 6 & 12 & 6\\ 5 & 10 & 5 \end{bmatrix}

be two matrices.

Then the rank of P+QP+Q is __________.

Answer (official key): 2

Worked solution: in your report after you take this paper.

Q15 · Theory of Computation · MCQ · 1 mark

Let L1,L2L_1, L_2 be any two context-free languages and RR be any regular language. Which of the following is/are CORRECT?

I. L1∪L2L_1 \cup L_2 is context-free.
II. L1‾\overline{L_1} is context-free.
III. L1−RL_1 - R is context-free.
IV. L1∩L2L_1 \cap L_2 is context-free.

  • (A)
    I, II and IV only
  • (B)
    I and III only
  • (C)
    II and IV only
  • (D)
    I only

Answer (official key): B

Worked solution: in your report after you take this paper.

Q16 · Operating System · MCQ · 1 mark

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

Answer (official key): D

Worked solution: in your report after you take this paper.

Q17 · Discrete Mathematics · MCQ · 1 mark

Let pp, qq, rr 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))(\neg p \wedge r) \wedge (\neg r \Rightarrow (p \wedge q))
  • (B)
    (¬p∧r)∧((p∧q)⇒¬r)(\neg p \wedge r) \wedge ((p \wedge q) \Rightarrow \neg r)
  • (C)
    (¬p∧r)∨((p∧q)⇒¬r)(\neg p \wedge r) \vee ((p \wedge q) \Rightarrow \neg r)
  • (D)
    (¬p∧r)∨(¬r⇒(p∧q))(\neg p \wedge r) \vee (\neg r \Rightarrow (p \wedge q))

Answer (official key): A

Worked solution: in your report after you take this paper.

Q18 · Algorithms · MCQ · 1 mark

Match the algorithms with their time complexities:

AlgorithmTime complexity
(P) Towers of Hanoi with nn disks(i) Θ(n2)\Theta(n^2)
(Q) Binary search given nn sorted numbers(ii) Θ(nlog⁡n)\Theta(n\log n)
(R) Heap sort given nn numbers at the worst case(iii) Θ(2n)\Theta(2^n)
(S) Addition of two n×nn \times n matrices(iv) Θ(log⁡n)\Theta(\log n)
  • (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)

Answer (official key): C

Worked solution: in your report after you take this paper.

Q19 · Calculus · MCQ · 1 mark

If

f(x)=Rsin⁡(πx2)+S,f(x)=R\sin\left(\frac{\pi x}{2}\right)+S, f′(12)=2f'\left(\frac{1}{2}\right)=\sqrt{2}

and

∫01f(x) dx=2Rπ,\int_0^1 f(x)\,dx=\frac{2R}{\pi},

then the constants RR and SS are respectively:

  • (A)
    2π\frac{2}{\pi} and 16π\frac{16}{\pi}
  • (B)
    2π\frac{2}{\pi} and 00
  • (C)
    4π\frac{4}{\pi} and 00
  • (D)
    4π\frac{4}{\pi} and 16π\frac{16}{\pi}

Answer (official key): C

Worked solution: in your report after you take this paper.

Q20 · Computer Networks · MCQ · 1 mark

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

Answer (official key): B

Worked solution: in your report after you take this paper.

Q21 · Operating System · MCQ · 1 mark

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

Answer (official key): B

Worked solution: in your report after you take this paper.

Q22 · Programming and Data Structures · MCQ · 1 mark

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 invoking printxy(1,1) is:

  • (A)
    0,0
  • (B)
    0,1
  • (C)
    1,0
  • (D)
    1,1

Answer (official key): C

Worked solution: in your report after you take this paper.

Q23 · Discrete Mathematics · Numerical · 1 mark

GG is an undirected graph with nn vertices and 25 edges such that each vertex of GG has degree at least 3.

Then the maximum possible value of nn is __________.

Answer (official key): 16

Worked solution: in your report after you take this paper.

Q24 · Compiler Design · MCQ · 1 mark

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

Answer (official key): A

Worked solution: in your report after you take this paper.

Q25 · Computer Organization and Architecture · MCQ · 1 mark

Given the following binary number in 32-bit single precision IEEE-754 format:

00111110011001100110011000000000

The decimal value closest to this floating-point number is:

  • (A)
    1.45×1011.45 \times 10^1
  • (B)
    1.45×10−11.45 \times 10^{-1}
  • (C)
    2.27×10−12.27 \times 10^{-1}
  • (D)
    2.27×1012.27 \times 10^1

Answer (official key): C

Worked solution: in your report after you take this paper.

Q26 · Databases · Numerical · 1 mark

Consider the following tables T1 and T2.

T1

PQ
22
38
73
58
69
85
98

T2

RS
22
83
32
97
57
72

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)(3,8) from table T1, the number of additional records that need to be deleted from table T1 is __________.

Answer (official key): 0

Worked solution: in your report after you take this paper.

Q27 · Discrete Mathematics · Numerical · 1 mark

Consider the set X={a,b,c,d,e}X=\{a,b,c,d,e\} under the 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)}.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)(X,R) is shown below.

Hasse diagram for Q21

The minimum number of ordered pairs that need to be added to RR to make (X,R)(X,R) a lattice is __________.

Answer (official key): -0.01 to 0.01

Read the worked solution

Q28 · Algorithms · MCQ · 1 mark

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?

Graph for Q15

  • (A)
    MNOPQR
  • (B)
    NQMPOR
  • (C)
    QMNPOR
  • (D)
    POQNMR

Answer (official key): D

Worked solution: in your report after you take this paper.

Q29 · Databases · MCQ · 1 mark

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 R is partial.

Answer (official key): C

Worked solution: in your report after you take this paper.

Q30 · Programming and Data Structures · MCQ · 1 mark

Match the following:

Left columnRight column
(P) static char var;(i) Sequence of memory locations to store addresses
(Q) m = malloc(10); m = NULL;(ii) A variable located in data section of memory
(R) char *ptr[10];(iii) Request to allocate a CPU register to store data
(S) register int var;(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-(iii), Q-(iv), R-(ii), S-(i)
  • (D)
    P-(iii), Q-(iv), R-(i), S-(ii)

Answer (official key): A

Worked solution: in your report after you take this paper.

Q31 · Programming and Data Structures · MCQ · 1 mark

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

Answer (official key): B

Worked solution: in your report after you take this paper.

Q32 · Computer Networks · Numerical · 1 mark

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

Answer (official key): 9

Worked solution: in your report after you take this paper.

Q33 · Computer Organization and Architecture · MCQ · 1 mark

The representation of the value of a 16-bit unsigned integer XX in hexadecimal number system is BCA9. The representation of the value of XX in octal number system is:

  • (A)
    571244
  • (B)
    736251
  • (C)
    571247
  • (D)
    136251

Answer (official key): D

Worked solution: in your report after you take this paper.

Q34 · Computer Networks · MCQ · 1 mark

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 statements 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

Answer (official key): C

Worked solution: in your report after you take this paper.

Q35 · Discrete Mathematics · Numerical · 1 mark

Consider a quadratic equation

x2−13x+36=0x^2 - 13x + 36 = 0

with coefficients in a base bb.

The solutions of this equation in the same base bb are x=5x=5 and x=6x=6.

Then bb is __________.

Answer (official key): 8

Worked solution: in your report after you take this paper.

Q36 · Compiler Design · MCQ · 2 marks

Consider the following expression grammar GG:

E→E−T∣TE \to E-T \mid T T→T+F∣FT \to T+F \mid F F→(E)∣idF \to (E) \mid id

Which one of the following grammars is not left recursive, but is equivalent to GG?

  • (A)
    E→E−T∣TE \to E-T \mid T; T→FYT \to FY; Y→+FY∣ϵY \to +FY \mid \epsilon; F→(E)∣idF \to (E) \mid id
  • (B)
    E→TXE \to TX; X→−TX∣ϵX \to -TX \mid \epsilon; T→T+F∣FT \to T+F \mid F; F→(E)∣idF \to (E) \mid id
  • (C)
    E→TXE \to TX; X→−TX∣ϵX \to -TX \mid \epsilon; T→FYT \to FY; Y→+FY∣ϵY \to +FY \mid \epsilon; F→(E)∣idF \to (E) \mid id
  • (D)
    E→XTE \to XT; X→X−T∣ϵX \to X-T \mid \epsilon; T→YFT \to YF; Y→Y+F∣ϵY \to Y+F \mid \epsilon; F→(E)∣idF \to (E) \mid id

Answer (official key): C

Worked solution: in your report after you take this paper.

Q37 · Probability and Statistics · MCQ · 2 marks

For any discrete random variable XX, with probability mass function

P(X=j)=pj,pj≥0,j∈{0,…,N},P(X=j)=p_j,\quad p_j\ge0,\quad j\in\{0,\ldots,N\},

and

∑j=0Npj=1,\sum_{j=0}^{N}p_j=1,

define the polynomial function

gX(z)=∑j=0Npjzj.g_X(z)=\sum_{j=0}^{N}p_jz^j.

For a certain discrete random variable YY, there exists a scalar β∈[0,1]\beta\in[0,1] such that

gY(z)=(1−β+βz)N.g_Y(z)=(1-\beta+\beta z)^N.

The expectation of YY is:

  • (A)
    Nβ(1−β)N\beta(1-\beta)
  • (B)
    NβN\beta
  • (C)
    N(1−β)N(1-\beta)
  • (D)
    Not expressible in terms of NN and β\beta alone

Answer (official key): B

Worked solution: in your report after you take this paper.

Q38 · Theory of Computation · MCQ · 2 marks

Consider the following languages.

L1={ap∣p is a prime number}L_1=\{a^p\mid p\text{ is a prime number}\} L2={anbmc2m∣n≥0, m≥0}L_2=\{a^n b^m c^{2m}\mid n\ge0,\ m\ge0\} L3={anbnc2n∣n≥0}L_3=\{a^n b^n c^{2n}\mid n\ge0\} L4={anbn∣n≥1}L_4=\{a^n b^n\mid n\ge1\}

Which of the following are CORRECT?

I. L1L_1 is context-free but not regular.
II. L2L_2 is not context-free.
III. L3L_3 is not context-free but recursive.
IV. L4L_4 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

Answer (official key): D

Worked solution: in your report after you take this paper.

Q39 · Digital Logic · MCQ · 2 marks

Given

f(w,x,y,z)=∑m(0,1,2,3,7,8,10)+∑d(5,6,11,15),f(w,x,y,z)=\sum m(0,1,2,3,7,8,10)+\sum d(5,6,11,15),

where dd represents the don't-care condition in Karnaugh maps.

Which one of the following is a minimum product-of-sums (POS) form of f(w,x,y,z)f(w,x,y,z)?

  • (A)
    f=(w‾+z‾)(x‾+z)f=(\overline{w}+\overline{z})(\overline{x}+z)
  • (B)
    f=(w‾+z)(x+z)f=(\overline{w}+z)(x+z)
  • (C)
    f=(w+z)(x‾+z)f=(w+z)(\overline{x}+z)
  • (D)
    f=(w+z‾)(x‾+z)f=(w+\overline{z})(\overline{x}+z)

Answer (official key): A

Worked solution: in your report after you take this paper.

Q40 · Programming and Data Structures · MCQ · 2 marks

Consider the C program fragment below which is meant to divide xx by yy using repeated subtractions. The variables x,y,qx,y,q and rr are all unsigned integers.

while (r >= y) {
    r = r - y;
    q = q + 1;
}

Which of the following conditions on the variables x,y,qx,y,q and rr before the execution of the fragment will ensure that the loop terminates in a state satisfying the condition

x=yq+r?x = yq + r?
  • (A)
    (q=0) && (y>0)(q=0)\ \&\&\ (y>0)
  • (B)
    (x>0) && (r=x) && (y>0)(x>0)\ \&\&\ (r=x)\ \&\&\ (y>0)
  • (C)
    (q=0) && (r=x) && (y>0)(q=0)\ \&\&\ (r=x)\ \&\&\ (y>0)
  • (D)
    (q=r) && (r=0)(q=r)\ \&\&\ (r=0)

Answer (official key): C

Worked solution: in your report after you take this paper.

Q41 · Theory of Computation · MCQ · 2 marks

Let L(R)L(R) be the language represented by regular expression RR. Let L(G)L(G) be the language generated by context-free grammar GG. Let L(M)L(M) be the language accepted by Turing machine MM.

Which of the following decision problems are undecidable?

I. Given a regular expression RR and a string ww, is w∈L(R)w\in L(R)?

II. Given a context-free grammar GG, is L(G)=∅L(G)=\emptyset?

III. Given a context-free grammar GG, is L(G)=Σ∗L(G)=\Sigma^* for some alphabet Σ\Sigma?

IV. Given a Turing machine MM and a string ww, is w∈L(M)w\in L(M)?

  • (A)
    I and IV only
  • (B)
    II and III only
  • (C)
    II, III and IV only
  • (D)
    III and IV only

Answer (official key): D

Worked solution: in your report after you take this paper.

Q42 · Algorithms · MCQ · 2 marks

Consider the following C function.

int fun(int n) {
    int i, j;
    for (i = 1; i <= n; i++) {
        for (j = 1; j < n; j += i) {
            printf("%d %d", i, j);
        }
    }
}

The time complexity of fun in terms of Θ\Theta notation is:

  • (A)
    Θ(nn)\Theta(n\sqrt{n})
  • (B)
    Θ(n2)\Theta(n^2)
  • (C)
    Θ(nlog⁡n)\Theta(n\log n)
  • (D)
    Θ(n2log⁡n)\Theta(n^2\log n)

Answer (official key): C

Worked solution: in your report after you take this paper.

Q43 · Computer Networks · MCQ · 2 marks

Consider two hosts XX and YY, connected by a single direct link of rate 10610^6 bits/sec.

The distance between the two hosts is 10,000 km and the propagation speed along the link is 2×1082\times10^8 m/sec.

Host XX sends a file of 50,000 bytes as one large message to host YY continuously.

Let the transmission and propagation delays be pp milliseconds and qq milliseconds, respectively. Then the values of pp and qq are:

  • (A)
    p=50p=50 and q=100q=100
  • (B)
    p=50p=50 and q=400q=400
  • (C)
    p=100p=100 and q=50q=50
  • (D)
    p=400p=400 and q=50q=50

Answer (official key): D

Worked solution: in your report after you take this paper.

Q44 · Operating System · MCQ · 2 marks

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

ProcessCurrent allocationMaximum requirement
P1P_137
P2P_216
P3P_335

Which one 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

Answer (official key): B

Worked solution: in your report after you take this paper.

Q45 · Digital Logic · MCQ · 2 marks

The next-state table of a 2-bit saturating up-counter is given below.

Q1Q_1Q0Q_0Q1+Q_1^+Q0+Q_0^+
0001
0110
1011
1111

The counter is built as a synchronous sequential circuit using T flip-flops.

The expressions for T1T_1 and T0T_0 are:

  • (A)
    T1=Q1Q0,T0=Q1‾Q0‾T_1=Q_1Q_0,\quad T_0=\overline{Q_1}\overline{Q_0}
  • (B)
    T1=Q1‾Q0,T0=Q1‾+Q0‾T_1=\overline{Q_1}Q_0,\quad T_0=\overline{Q_1}+\overline{Q_0}
  • (C)
    T1=Q1+Q0,T0=Q1‾+Q0‾T_1=Q_1+Q_0,\quad T_0=\overline{Q_1}+\overline{Q_0}
  • (D)
    T1=Q1‾Q0,T0=Q1+Q0T_1=\overline{Q_1}Q_0,\quad T_0=Q_1+Q_0

Answer (official key): B

Worked solution: in your report after you take this paper.

Q46 · Probability and Statistics · MCQ · 2 marks

PP and QQ are considering applying for a job.

The probability that PP applies for the job is 14\frac{1}{4}.

The probability that PP applies for the job given that QQ applies for the job is 12\frac{1}{2}.

The probability that QQ applies for the job given that PP applies for the job is 13\frac{1}{3}.

The probability that PP does not apply for the job given that QQ does not apply for the job is:

  • (A)
    45\frac{4}{5}
  • (B)
    56\frac{5}{6}
  • (C)
    78\frac{7}{8}
  • (D)
    1112\frac{11}{12}

Answer (official key): A

Worked solution: in your report after you take this paper.

Q47 · Algorithms · MCQ · 2 marks

Consider the recurrence function

T(n)={2T(n)+1,n>22,0<n≤2T(n)= \begin{cases} 2T(\sqrt{n})+1, & n>2 \\ 2, & 0<n\le 2 \end{cases}

Then T(n)T(n) in terms of Θ\Theta notation is:

  • (A)
    Θ(log⁡log⁡n)\Theta(\log\log n)
  • (B)
    Θ(log⁡n)\Theta(\log n)
  • (C)
    Θ(n)\Theta(\sqrt{n})
  • (D)
    Θ(n)\Theta(n)

Answer (official key): B

Worked solution: in your report after you take this paper.

Q48 · Theory of Computation · MCQ · 2 marks

Let δ\delta denote the transition function and δ^\widehat{\delta} denote the extended transition function of the ϵ\epsilon-NFA whose transition table is given below.

Epsilon-NFA transition table for Q39

Then δ^(q2,aba)\widehat{\delta}(q_2, aba) is:

  • (A)
    {q0,q2,q3}\{q_0,q_2,q_3\}
  • (B)
    {q0,q1,q3}\{q_0,q_1,q_3\}
  • (C)
    {q0,q1,q2}\{q_0,q_1,q_2\}
  • (D)
    ∅\emptyset

Answer (official key): C

Worked solution: in your report after you take this paper.

Q49 · Digital Logic · MCQ · 2 marks

If w,x,y,zw,x,y,z are Boolean variables, then which one of the following is INCORRECT?

  • (A)
    wx+w(x+y)+x(x+y)=x+wywx+w(x+y)+x(x+y)=x+wy
  • (B)
    w+x‾=w‾ x‾\overline{w+x}=\overline{w}\,\overline{x}
  • (C)
    (w‾x(y‾+xz‾)+w‾x)y=xy(\overline{w}x(\overline{y}+x\overline{z})+\overline{w}x)y=xy
  • (D)
    (w+y)(wxy+wyz)=wxy+wyz(w+y)(wxy+wyz)=wxy+wyz

Answer (official key): C

Worked solution: in your report after you take this paper.

Q50 · Computer Organization and Architecture · MCQ · 2 marks

In a two-level cache system, the access times of L1L_1 and L2L_2 caches are 1 and 8 clock cycles, respectively. The miss penalty from the L2L_2 cache to main memory is 18 clock cycles.

The miss rate of L1L_1 cache is twice that of L2L_2. The average memory access time (AMAT) of this cache system is 2 cycles.

The miss rates of L1L_1 and L2L_2, respectively, are:

  • (A)
    0.1110.111 and 0.0560.056
  • (B)
    0.0560.056 and 0.1110.111
  • (C)
    0.08920.0892 and 0.17840.1784
  • (D)
    0.17840.1784 and 0.08920.0892

Answer (official key): A

Worked solution: in your report after you take this paper.

Q51 · Computer Networks · MCQ · 2 marks

Consider a binary code that consists of only four valid codewords as given below:

00000,01011,10101,11110.00000,\quad 01011,\quad 10101,\quad 11110.

Let the minimum Hamming distance of the code be pp and the maximum number of erroneous bits that can be corrected by the code be qq.

Then the values of pp and qq are:

  • (A)
    p=3p=3 and q=1q=1
  • (B)
    p=3p=3 and q=2q=2
  • (C)
    p=4p=4 and q=1q=1
  • (D)
    p=4p=4 and q=2q=2

Answer (official key): A

Worked solution: in your report after you take this paper.

Q52 · Programming and Data Structures · MCQ · 2 marks

The pre-order traversal of a binary search tree is given by:

12, 8, 6, 2, 7, 9, 10, 16, 15, 19, 17, 20.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, 202,\ 6,\ 7,\ 8,\ 9,\ 10,\ 12,\ 15,\ 16,\ 17,\ 19,\ 20
  • (B)
    2, 7, 6, 10, 9, 8, 15, 17, 20, 19, 16, 122,\ 7,\ 6,\ 10,\ 9,\ 8,\ 15,\ 17,\ 20,\ 19,\ 16,\ 12
  • (C)
    7, 2, 6, 8, 9, 10, 20, 17, 19, 15, 16, 127,\ 2,\ 6,\ 8,\ 9,\ 10,\ 20,\ 17,\ 19,\ 15,\ 16,\ 12
  • (D)
    7, 6, 2, 10, 9, 8, 15, 16, 17, 20, 19, 127,\ 6,\ 2,\ 10,\ 9,\ 8,\ 15,\ 16,\ 17,\ 20,\ 19,\ 12

Answer (official key): B

Worked solution: in your report after you take this paper.

Q53 · Databases · Numerical · 2 marks

Consider the following database table named top_scorer.

playercountrygoals
KloseGermany16
RonaldoBrazil15
G MüllerGermany14
FontaineFrance13
PeléBrazil12
KlinsmannGermany11
KocsisHungary11
BatistutaArgentina10
CubillasPeru10
LatoPoland10
LinekerEngland10
T MüllerGermany10
RahnGermany10

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

Answer (official key): 7

Worked solution: in your report after you take this paper.

Q54 · Programming and Data Structures · Numerical · 2 marks

Consider the following C program.

#include <stdio.h>
#include <string.h>

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

Answer (official key): 2

Worked solution: in your report after you take this paper.

Q55 · Linear Algebra · Numerical · 2 marks

If the characteristic polynomial of a 3×33\times3 matrix MM over R\mathbb{R} is

λ3−4λ2+aλ+30,a∈R,\lambda^3 - 4\lambda^2 + a\lambda + 30,\quad a\in\mathbb{R},

and one eigenvalue of MM is 2, then the largest among the absolute values of the eigenvalues of MM is __________.

Answer (official key): 5

Worked solution: in your report after you take this paper.

Q56 · Discrete Mathematics · Numerical · 2 marks

If the ordinary generating function of a sequence {an}n=0∞\{a_n\}_{n=0}^{\infty} is

1+z(1−z)3,\frac{1+z}{(1-z)^3},

then a3−a0a_3-a_0 is equal to __________.

Answer (official key): 15

Worked solution: in your report after you take this paper.

Q57 · Databases · Numerical · 2 marks

Two transactions T1T_1 and T2T_2 are given as:

T1:r1(X) w1(X) r1(Y) w1(Y)T_1: r_1(X)\ w_1(X)\ r_1(Y)\ w_1(Y) T2:r2(Y) w2(Y) r2(Z) w2(Z)T_2: r_2(Y)\ w_2(Y)\ r_2(Z)\ w_2(Z)

where ri(V)r_i(V) denotes a read operation by transaction TiT_i on a variable VV, and wi(V)w_i(V) denotes a write operation by transaction TiT_i on a variable VV.

The total number of conflict serializable schedules that can be formed by T1T_1 and T2T_2 is __________.

Answer (official key): 54

Worked solution: in your report after you take this paper.

Q58 · Algorithms · Numerical · 2 marks

A message is made up entirely of characters from the set

X={P,Q,R,S,T}.X=\{P,Q,R,S,T\}.

The table of probabilities for each of the characters is shown below.

CharacterProbability
P0.22
Q0.34
R0.17
S0.19
T0.08
Total1.00

If a message of 100 characters over XX is encoded using Huffman coding, then the expected length of the encoded message in bits is __________.

Answer (official key): 225

Worked solution: in your report after you take this paper.

Q59 · Computer Organization and Architecture · Numerical · 2 marks

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

CacheRead access time (nanoseconds)Hit ratio
I-cache20.8
D-cache20.9
L2-cache80.9

The read access time of main memory is 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 __________.

Answer (official key): 4.72

Worked solution: in your report after you take this paper.

Q60 · Programming and Data Structures · Numerical · 2 marks

Consider the following C program.

#include <stdio.h>

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

Answer (official key): 0

Worked solution: in your report after you take this paper.

Q61 · Operating System · Numerical · 2 marks

Consider the set of processes with arrival time in milliseconds, CPU burst time in milliseconds, and priority shown below. Priority 0 is the highest priority. None of the processes have I/O burst time.

ProcessArrival timeBurst timePriority
P1P_10112
P2P_25280
P3P_31223
P4P_42101
P5P_59164

The average waiting time in milliseconds of all the processes using preemptive priority scheduling algorithm is __________.

Answer (official key): 29

Worked solution: in your report after you take this paper.

Q62 · Computer Organization and Architecture · Numerical · 2 marks

Consider a machine with a byte-addressable main memory of 2322^{32} 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 __________.

Answer (official key): 18

Read the worked solution

Q63 · Databases · Numerical · 2 marks

In a B+ tree, if the search-key value is 8 bytes long, the block size is 512 bytes and the block pointer size is 2 bytes, then the maximum order of the B+ tree is __________.

Answer (official key): 52

Read the worked solution

Q64 · Programming and Data Structures · Numerical · 2 marks

Consider the following snippet of a C program. Assume that swap(&x, &y) exchanges the contents 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 __________.

Answer (official key): 3

Worked solution: in your report after you take this paper.

Q65 · Probability and Statistics · Numerical · 2 marks

If a random variable XX has a Poisson distribution with mean 5, then the expectation

E[(X+2)2]E[(X+2)^2]

equals __________.

Answer (official key): 54

Worked solution: in your report after you take this paper.