GATE 2019 CS

All 65 questions of GATE 2019 CS

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

The expenditure on the project _____ as follows: equipment Rs. 20 lakhs, salaries Rs. 12 lakhs, and contingency Rs. 3 lakhs.

  • (A)
    break down
  • (B)
    break
  • (C)
    breaks down
  • (D)
    breaks

Answer (official key): C

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

Q2 · General Aptitude · MCQ · 1 mark

Ten friends planned to share equally the cost of buying a gift for their teacher. When two of them decided not to contribute, each of the other friends had to pay Rs. 150 more. The cost of the gift was Rs. ____.

  • (A)
    666
  • (B)
    3000
  • (C)
    6000
  • (D)
    12000

Answer (official key): C

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

Q3 · General Aptitude · MCQ · 1 mark

Two cars start at the same time from the same location and go in the same direction. The speed of the first car is 50 km/h and the speed of the second car is 60 km/h. The number of hours it takes for the distance between the two cars to be 20 km is ___.

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

Answer (official key): B

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

Q4 · General Aptitude · MCQ · 1 mark

A court is to a judge as _____________ is to a teacher.

  • (A)
    a student
  • (B)
    a punishment
  • (C)
    a syllabus
  • (D)
    a school

Answer (official key): D

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

Q5 · General Aptitude · MCQ · 1 mark

The search engine's business model ___________ around the fulcrum of trust.

  • (A)
    revolves
  • (B)
    plays
  • (C)
    sinks
  • (D)
    bursts

Answer (official key): A

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

Q6 · General Aptitude · MCQ · 2 marks

In the given diagram, teachers are represented in the triangle, researchers in the circle and administrators in the rectangle. Out of the total number of the people, the percentage of administrators shall be in the range of ___________.

Venn diagram for Q7

  • (A)
    0 to 15
  • (B)
    16 to 30
  • (C)
    31 to 45
  • (D)
    46 to 60

Answer (official key): C

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

Q7 · General Aptitude · MCQ · 2 marks

Three of the five students allocated to a hostel put in special requests to the warden. Given the floor plan of the vacant rooms, select the allocation plan that will accommodate all their requests.

Request by X: Due to pollen allergy, I want to avoid a wing next to the garden.
Request by Y: I want to live as far from the washrooms as possible, since I am very sensitive to smell.
Request by Z: I believe in Vaastu and so want to stay in the South-west wing.

The shaded rooms are already occupied. WR is washroom.

  • (A)
    GATE 2019 CS question 7 (Spatial Aptitude), option A
  • (B)
    GATE 2019 CS question 7 (Spatial Aptitude), option B
  • (C)
    GATE 2019 CS question 7 (Spatial Aptitude), option C
  • (D)
    GATE 2019 CS question 7 (Spatial Aptitude), option D

Answer (official key): D

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

Q8 · General Aptitude · MCQ · 2 marks

"A recent High Court judgement has sought to dispel the idea of begging as a disease — which leads to its stigmatization and criminalization — and to regard it as a symptom. The underlying disease is the failure of the state to protect citizens who fall through the social security net."

Which one of the following statements can be inferred from the given passage?

  • (A)
    Beggars are lazy people who beg because they are unwilling to work
  • (B)
    Beggars are created because of the lack of social welfare schemes
  • (C)
    Begging is an offence that has to be dealt with firmly
  • (D)
    Begging has to be banned because it adversely affects the welfare of the state

Answer (official key): B

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

Q9 · General Aptitude · MCQ · 2 marks

The police arrested four criminals — P, Q, R and S. The criminals knew each other. They made the following statements:

P says, "Q committed the crime."
Q says, "S committed the crime."
R says, "I did not do it."
S says, "What Q said about me is false."

Assume only one of the arrested four committed the crime and only one of the statements made above is true. Who committed the crime?

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

Answer (official key): B

Read the worked solution

Q10 · General Aptitude · MCQ · 2 marks

In a college, there are three student clubs. Sixty students are only in the Drama club, 80 students are only in the Dance club, 30 students are only in the Maths club, 40 students are in both Drama and Dance clubs, 12 students are in both Dance and Maths clubs, 7 students are in both Drama and Maths clubs, and 2 students are in all the clubs. If 75% of the students in the college are not in any of these clubs, then the total number of students in the college is _____.

  • (A)
    1000
  • (B)
    975
  • (C)
    900
  • (D)
    225

Answer (official key): C

Read the worked solution

Q11 · Linear Algebra · MCQ · 1 mark

Let XX be a square matrix. Consider the following two statements on XX.

I. XX is invertible.

II. Determinant of XX is non-zero.

Which one of the following is TRUE?

  • (A)
    I implies II; II does not imply I.
  • (B)
    II implies I; I does not imply II.
  • (C)
    I does not imply II; II does not imply I.
  • (D)
    I and II are equivalent statements.

Answer (official key): D

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

Q12 · Compiler Design · MCQ · 1 mark

Which one of the following kinds of derivation is used by LR parsers?

  • (A)
    Leftmost
  • (B)
    Leftmost in reverse
  • (C)
    Rightmost
  • (D)
    Rightmost in reverse

Answer (official key): D

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

Q13 · Databases · MCQ · 1 mark

Consider the following two statements about database transaction schedules:

I. Strict two-phase locking protocol generates conflict serializable schedules that are also recoverable.

II. Timestamp-ordering concurrency control protocol with Thomas' Write Rule can generate view serializable schedules that are not conflict serializable.

Which of the above statements is/are TRUE?

  • (A)
    I only
  • (B)
    II only
  • (C)
    Both I and II
  • (D)
    Neither I nor II

Answer (official key): C

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

Q14 · Computer Organization and Architecture · MCQ · 1 mark

In 16-bit 2's complement representation, the decimal number −28-28 is:

  • (A)
    1111 1111 0001 1100
  • (B)
    0000 0000 1110 0100
  • (C)
    1111 1111 1110 0100
  • (D)
    1000 0000 1110 0100

Answer (official key): C

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

Q15 · Discrete Mathematics · MCQ · 1 mark

Let GG be an undirected complete graph on nn vertices, where n>2n>2. Then, the number of different Hamiltonian cycles in GG is equal to:

  • (A)
    n!n!
  • (B)
    (n−1)!(n-1)!
  • (C)
    11
  • (D)
    (n−1)!2\dfrac{(n-1)!}{2}

Answer (official key): C, D

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

Q16 · Discrete Mathematics · Numerical · 1 mark

The value of

351 mod 53^{51}\bmod 5

is __________.

Answer (official key): 2

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

Q17 · Operating System · Numerical · 1 mark

The following C program is executed on a Unix/Linux system:

#include <unistd.h>

int main()
{
    int i;
    for (i = 0; i < 10; i++)
        if (i % 2 == 0)
            fork();
    return 0;
}

The total number of child processes created is __________.

Answer (official key): 31

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

Q18 · Theory of Computation · MCQ · 1 mark

For Σ={a,b}\Sigma=\{a,b\}, consider the regular language

L={x∣x=a2+3k or x=b10+12k, k≥0}.L=\{x\mid x=a^{2+3k}\ \text{or}\ x=b^{10+12k},\ k\ge0\}.

Which one of the following can be a pumping length, the constant guaranteed by the pumping lemma, for LL?

  • (A)
    3
  • (B)
    5
  • (C)
    9
  • (D)
    24

Answer (official key): D

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

Q19 · Algorithms · Numerical · 1 mark

An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot element is chosen uniformly at random.

The probability that the pivot element gets placed in the worst possible location in the first round of partitioning, rounded off to 2 decimal places, is __________.

Answer (official key): 0.08

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

Q20 · Programming and Data Structures · Numerical · 1 mark

Consider the following C program:

#include <stdio.h>

int main() {
    int arr[] = {1,2,3,4,5,6,7,8,9,0,1,2,5};
    int *ip = arr + 4;
    printf("%d\n", ip[1]);
    return 0;
}

The number that will be displayed on execution of the program is __________.

Answer (official key): 6

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

Q21 · Digital Logic · MCQ · 1 mark

The chip select logic for a certain DRAM chip in a memory system design is shown below. Assume that the memory system has 16 address lines denoted by A15A_{15} to A0A_0.

Chip select logic for Q2

What is the range of addresses, in hexadecimal, of the memory system that can get enabled by the chip select (CS) signal?

  • (A)
    C800 to CFFF
  • (B)
    CA00 to CAFF
  • (C)
    C800 to C8FF
  • (D)
    DA00 to DFFF

Answer (official key): A

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

Q22 · Computer Networks · MCQ · 1 mark

Not in GATE 2027 syllabus: SMTP, FTP and e-mail protocols

Which of the following protocol pairs can be used to send and retrieve e-mails, in that order?

  • (A)
    IMAP, POP3
  • (B)
    SMTP, POP3
  • (C)
    SMTP, MIME
  • (D)
    IMAP, SMTP

Answer (official key): B

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

Q23 · Compiler Design · Numerical · 1 mark

Consider the grammar given below:

S→AaS \to Aa A→BDA \to BD B→b∣ϵB \to b \mid \epsilon D→d∣ϵD \to d \mid \epsilon

Let aa, bb, dd, and $$$ be indexed as follows:

Symbolabd$
Index3210

Compute the FOLLOW set of the non-terminal BB and write the index values for the symbols in the FOLLOW set in descending order.

For example, if the FOLLOW set is \{a,b,d,\}$, then the answer should be 3210.

Answer: __________.

Answer (official key): 31

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

Q24 · Operating System · Numerical · 1 mark

Consider three concurrent processes P1P_1, P2P_2 and P3P_3 as shown below, which access a shared variable DD that has been initialized to 100.

Concurrent process operations for Q23

The three operations are:

  • P1P_1: D=D+20D = D + 20
  • P2P_2: D=D−50D = D - 50
  • P3P_3: D=D+10D = D + 10

The processes are executed on a uniprocessor system running a time-shared operating system.

If the minimum and maximum possible values of DD after the three processes have completed execution are XX and YY respectively, then the value of Y−XY-X is __________.

Answer (official key): 80

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

Q25 · Discrete Mathematics · MCQ · 1 mark

Let GG be an arbitrary group. Consider the following relations on GG:

R1R_1: for all a,b∈Ga,b\in G, aR1baR_1b if and only if there exists g∈Gg\in G such that

a=g−1bg.a=g^{-1}bg.

R2R_2: for all a,b∈Ga,b\in G, aR2baR_2b if and only if

a=b−1.a=b^{-1}.

Which of the above is/are equivalence relation/relations?

  • (A)
    R1R_1 and R2R_2
  • (B)
    R1R_1 only
  • (C)
    R2R_2 only
  • (D)
    Neither R1R_1 nor R2R_2

Answer (official key): B

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

Q26 · Calculus · MCQ · 1 mark

Compute

lim⁡x→3x4−812x2−5x−3.\lim_{x\to 3}\frac{x^4-81}{2x^2-5x-3}.
  • (A)
    1
  • (B)
    5312\dfrac{53}{12}
  • (C)
    1087\dfrac{108}{7}
  • (D)
    Limit does not exist

Answer (official key): C

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

Q27 · Computer Organization and Architecture · MCQ · 1 mark

A certain processor uses a fully associative cache of size 16 kB. The cache block size is 16 bytes. Assume that the main memory is byte addressable and uses a 32-bit address.

How many bits are required for the Tag and the Index fields respectively in the addresses generated by the processor?

  • (A)
    24 bits and 0 bits
  • (B)
    28 bits and 4 bits
  • (C)
    24 bits and 4 bits
  • (D)
    28 bits and 0 bits

Answer (official key): D

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

Q28 · Programming and Data Structures · Numerical · 1 mark

Consider the following C program:

#include <stdio.h>

int jumble(int x, int y) {
    x = 2*x + y;
    return x;
}

int main() {
    int x = 2, y = 5;
    y = jumble(y, x);
    x = jumble(y, x);
    printf("%d\n", x);
    return 0;
}

The value printed by the program is __________.

Answer (official key): 26

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

Q29 · Computer Organization and Architecture · MCQ · 1 mark

Consider Z=X−YZ=X-Y, where XX, YY and ZZ are all in sign-magnitude form. XX and YY are each represented in nn bits.

To avoid overflow, the representation of ZZ would require a minimum of:

  • (A)
    nn bits
  • (B)
    n−1n-1 bits
  • (C)
    n+1n+1 bits
  • (D)
    n+2n+2 bits

Answer (official key): C

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

Q30 · Probability and Statistics · Numerical · 1 mark

Two numbers are chosen independently and uniformly at random from the set

{1,2,…,13}.\{1,2,\ldots,13\}.

The probability, rounded off to 3 decimal places, that their 4-bit unsigned binary representations have the same most significant bit is __________.

Answer (official key): 0.502 to 0.504

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

Q31 · Databases · MCQ · 1 mark

Which one of the following statements is NOT correct about the B+ tree data structure used for creating an index of a relational database table?

  • (A)
    B+ Tree is a height-balanced tree
  • (B)
    Non-leaf nodes have pointers to data records
  • (C)
    Key values in each node are kept in sorted order
  • (D)
    Each leaf node has a pointer to the next leaf node

Answer (official key): B

Read the worked solution

Q32 · Algorithms · Numerical · 1 mark

Consider a sequence of 14 elements:

A=[−5,−10,6,3,−1,−2,13,4,−9,−1,4,12,−3,0].A=[-5,-10,6,3,-1,-2,13,4,-9,-1,4,12,-3,0].

The subsequence sum is defined as:

S(i,j)=∑k=ijA[k].S(i,j)=\sum_{k=i}^{j}A[k].

Determine the maximum of S(i,j)S(i,j), where 0≤i≤j<140\le i\le j<14.

Answer: __________.

Answer (official key): 29

Read the worked solution

Q33 · Theory of Computation · MCQ · 1 mark

If LL is a regular language over Σ={a,b}\Sigma=\{a,b\}, which one of the following languages is NOT regular?

  • (A)
    L⋅LR={xy∣x∈L, yR∈L}L\cdot L^R=\{xy\mid x\in L,\ y^R\in L\}
  • (B)
    {wwR∣w∈L}\{ww^R\mid w\in L\}
  • (C)
    Prefix⁡(L)={x∈Σ∗∣∃y∈Σ∗ such that xy∈L}\operatorname{Prefix}(L)=\{x\in\Sigma^*\mid \exists y\in\Sigma^* \text{ such that } xy\in L\}
  • (D)
    Suffix⁡(L)={y∈Σ∗∣∃x∈Σ∗ such that xy∈L}\operatorname{Suffix}(L)=\{y\in\Sigma^*\mid \exists x\in\Sigma^* \text{ such that } xy\in L\}

Answer (official key): B

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

Q34 · Digital Logic · MCQ · 1 mark

Which one of the following is NOT a valid identity?

  • (A)
    (x⊕y)⊕z=x⊕(y⊕z)(x\oplus y)\oplus z=x\oplus(y\oplus z)
  • (B)
    (x+y)⊕z=x⊕(y+z)(x+y)\oplus z=x\oplus(y+z)
  • (C)
    x⊕y=x+y, if xy=0x\oplus y=x+y,\ \text{if }xy=0
  • (D)
    x⊕y=(xy+x′y′)′x\oplus y=(xy+x'y')'

Answer (official key): B

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

Q35 · Discrete Mathematics · MCQ · 1 mark

Let U={1,2,…,n}U=\{1,2,\ldots,n\}. Let

A={(x,X)∣x∈X, X⊆U}.A=\{(x,X)\mid x\in X,\ X\subseteq U\}.

Consider the following two statements on ∣A∣|A|.

I. ∣A∣=n2n−1|A|=n2^{n-1}

II. ∣A∣=∑k=1nk(nk)|A|=\sum_{k=1}^{n} k\binom{n}{k}

Which of the above statements is/are TRUE?

  • (A)
    Only I
  • (B)
    Only II
  • (C)
    Both I and II
  • (D)
    Neither I nor II

Answer (official key): C

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

Q36 · Programming and Data Structures · MCQ · 2 marks

Consider the following C function.

void convert(int n) {
    if (n < 0)
        printf("%d", n);
    else {
        convert(n / 2);
        printf("%d", n % 2);
    }
}

Which one of the following will happen when the function convert is called with any positive integer n as argument?

  • (A)
    It will print the binary representation of n and terminate
  • (B)
    It will print the binary representation of n in the reverse order and terminate
  • (C)
    It will print the binary representation of n but will not terminate
  • (D)
    It will not print anything and will not terminate

Answer (official key): D

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

Q37 · Algorithms · MCQ · 2 marks

Let GG be any connected, weighted, undirected graph.

I. GG has a unique minimum spanning tree, if no two edges of GG have the same weight.

II. GG has a unique minimum spanning tree, if, for every cut of GG, there is a unique minimum-weight edge crossing the cut.

Which of the above two statements is/are TRUE?

  • (A)
    I only
  • (B)
    II only
  • (C)
    Both I and II
  • (D)
    Neither I nor II

Answer (official key): C

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

Q38 · Digital Logic · MCQ · 2 marks

Consider three 4-variable functions f1f_1, f2f_2, and f3f_3, which are expressed in sum-of-minterms as:

f1=∑(0,2,5,8,14)f_1 = \sum(0,2,5,8,14) f2=∑(2,3,6,8,14,15)f_2 = \sum(2,3,6,8,14,15) f3=∑(2,7,11,14)f_3 = \sum(2,7,11,14)

For the following circuit with one AND gate and one XOR gate, the output function ff can be expressed as:

Digital logic circuit for Q30

  • (A)
    ∑(7,8,11)\sum(7,8,11)
  • (B)
    ∑(2,7,8,11,14)\sum(2,7,8,11,14)
  • (C)
    ∑(2,14)\sum(2,14)
  • (D)
    ∑(0,2,3,5,6,7,8,11,14,15)\sum(0,2,3,5,6,7,8,11,14,15)

Answer (official key): A

Read the worked solution

Q39 · Programming and Data Structures · MCQ · 2 marks

Consider the following statements:

I. The smallest element in a max-heap is always at a leaf node.

II. The second largest element in a max-heap is always a child of the root node.

III. A max-heap can be constructed from a binary search tree in Θ(n)\Theta(n) time.

IV. A binary search tree can be constructed from a max-heap in Θ(n)\Theta(n) time.

Which of the above statements are TRUE?

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

Answer (official key): A

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

Q40 · Databases · MCQ · 2 marks

Let the set of functional dependencies

F={QR→S, R→P, S→Q}F=\{QR\to S,\ R\to P,\ S\to Q\}

hold on a relation schema

X=(P,Q,R,S).X=(P,Q,R,S).

XX is not in BCNF. Suppose XX is decomposed into two schemas YY and ZZ, where

Y=(P,R)Y=(P,R)

and

Z=(Q,R,S).Z=(Q,R,S).

Consider the two statements given below.

I. Both YY and ZZ are in BCNF.

II. Decomposition of XX into YY and ZZ is dependency preserving and lossless.

Which of the above statements is/are correct?

  • (A)
    Both I and II
  • (B)
    I only
  • (C)
    II only
  • (D)
    Neither I nor II

Answer (official key): C

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

Q41 · Computer Networks · MCQ · 2 marks

Not in GATE 2027 syllabus: ARP, DHCP and ICMP

Suppose that in an IP-over-Ethernet network, a machine X wishes to find the MAC address of another machine Y in its subnet.

Which one of the following techniques can be used for this?

  • (A)
    X sends an ARP request packet to the local gateway's IP address which then finds the MAC address of Y and sends to X
  • (B)
    X sends an ARP request packet to the local gateway's MAC address which then finds the MAC address of Y and sends to X
  • (C)
    X sends an ARP request packet with broadcast MAC address in its local subnet
  • (D)
    X sends an ARP request packet with broadcast IP address in its local subnet

Answer (official key): C

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

Q42 · Operating System · MCQ · 2 marks

Consider the following snapshot of a system running nn concurrent processes. Process ii is holding XiX_i instances of a resource RR, 1≤i≤n1\le i\le n. Assume that all instances of RR are currently in use.

Further, for all ii, process ii can place a request for at most YiY_i additional instances of RR while holding the XiX_i instances it already has.

Of the nn processes, there are exactly two processes pp and qq such that:

Yp=Yq=0.Y_p=Y_q=0.

Which one of the following conditions guarantees that no other process apart from pp and qq can complete execution?

  • (A)
    Xp+Xq<min⁡{Yk∣1≤k≤n, k≠p, k≠q}X_p+X_q < \min\{Y_k\mid 1\le k\le n,\ k\ne p,\ k\ne q\}
  • (B)
    Xp+Xq<max⁡{Yk∣1≤k≤n, k≠p, k≠q}X_p+X_q < \max\{Y_k\mid 1\le k\le n,\ k\ne p,\ k\ne q\}
  • (C)
    min⁡(Xp,Xq)≥min⁡{Yk∣1≤k≤n, k≠p, k≠q}\min(X_p,X_q)\ge \min\{Y_k\mid 1\le k\le n,\ k\ne p,\ k\ne q\}
  • (D)
    min⁡(Xp,Xq)≤max⁡{Yk∣1≤k≤n, k≠p, k≠q}\min(X_p,X_q)\le \max\{Y_k\mid 1\le k\le n,\ k\ne p,\ k\ne q\}

Answer (official key): A

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

Q43 · Algorithms · MCQ · 2 marks

There are nn unsorted arrays: A1,A2,…,AnA_1,A_2,\ldots,A_n. Assume that nn is odd. Each of A1,A2,…,AnA_1,A_2,\ldots,A_n contains nn distinct elements. There are no common elements between any two arrays.

The worst-case time complexity of computing the median of the medians of A1,A2,…,AnA_1,A_2,\ldots,A_n is:

  • (A)
    O(n)O(n)
  • (B)
    O(nlog⁡n)O(n\log n)
  • (C)
    O(n2)O(n^2)
  • (D)
    Ω(n2log⁡n)\Omega(n^2\log n)

Answer (official key): C

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

Q44 · Programming and Data Structures · MCQ · 2 marks

Consider the following C program.

#include <stdio.h>

int r() {
    static int num = 7;
    return num--;
}

int main() {
    for (r(); r(); r())
        printf("%d", r());

    return 0;
}

Which one of the following values will be displayed on execution of the program?

  • (A)
    41
  • (B)
    52
  • (C)
    63
  • (D)
    630

Answer (official key): B

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

Q45 · Theory of Computation · MCQ · 2 marks

Which one of the following languages over Σ={a,b}\Sigma=\{a,b\} is NOT context-free?

  • (A)
    {wwR∣w∈{a,b}∗}\{ww^R \mid w\in\{a,b\}^*\}
  • (B)
    {wanbnwR∣w∈{a,b}∗, n≥0}\{wa^nb^nw^R \mid w\in\{a,b\}^*,\ n\ge 0\}
  • (C)
    {wanwRbn∣w∈{a,b}∗, n≥0}\{wa^nw^Rb^n \mid w\in\{a,b\}^*,\ n\ge 0\}
  • (D)
    {anbi∣i∈{n,3n,5n}, n≥0}\{a^nb^i \mid i\in\{n,3n,5n\},\ n\ge 0\}

Answer (official key): C

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

Q46 · Discrete Mathematics · MCQ · 2 marks

Consider the first order predicate formula φ\varphi:

∀x[(∀z (z∣x)⇒((z=x)∨(z=1)))⇒∃w((w>x)∧(∀z (z∣w)⇒((w=z)∨(z=1))))]\forall x\left[ \left(\forall z\ (z\mid x)\Rightarrow((z=x)\vee(z=1))\right) \Rightarrow \exists w\left((w>x)\wedge\left(\forall z\ (z\mid w)\Rightarrow((w=z)\vee(z=1))\right)\right) \right]

Here a∣ba\mid b denotes that aa divides bb, where aa and bb are integers.

Consider the following sets:

S1S_1: {1,2,3,…,100}\{1,2,3,\ldots,100\}

S2S_2: Set of all positive integers

S3S_3: Set of all integers

Which of the above sets satisfy φ\varphi?

  • (A)
    S1S_1 and S2S_2
  • (B)
    S1S_1 and S3S_3
  • (C)
    S2S_2 and S3S_3
  • (D)
    S1S_1, S2S_2 and S3S_3

Answer (official key): C

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

Q47 · Compiler Design · MCQ · 2 marks

Consider the following grammar and the semantic actions to support the inherited type declaration attributes. Let X1X_1, X2X_2, X3X_3, X4X_4, X5X_5, and X6X_6 be the placeholders for the non-terminals DD, TT, LL or L1L_1 in the following table:

Production ruleSemantic action
D→TLD \to T LX1.type=X2.typeX_1.type = X_2.type
T→intT \to intT.type=intT.type = int
T→floatT \to floatT.type=floatT.type = float
L→L1,idL \to L_1, idX3.type=X4.typeX_3.type = X_4.type<br>addType(id.entry, X5.type)
L→idL \to idaddType(id.entry, X6.type)

Which one of the following are the appropriate choices for X1X_1, X2X_2, X3X_3 and X4X_4?

  • (A)
    X1=L, X2=T, X3=L1, X4=LX_1=L,\ X_2=T,\ X_3=L_1,\ X_4=L
  • (B)
    X1=T, X2=L, X3=L1, X4=TX_1=T,\ X_2=L,\ X_3=L_1,\ X_4=T
  • (C)
    X1=L, X2=L, X3=L1, X4=TX_1=L,\ X_2=L,\ X_3=L_1,\ X_4=T
  • (D)
    X1=T, X2=L, X3=T, X4=L1X_1=T,\ X_2=L,\ X_3=T,\ X_4=L_1

Answer (official key): A

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

Q48 · Theory of Computation · MCQ · 2 marks

Consider the following sets:

S1S_1: Set of all recursively enumerable languages over the alphabet {0,1}\{0,1\}

S2S_2: Set of all syntactically valid C programs

S3S_3: Set of all languages over the alphabet {0,1}\{0,1\}

S4S_4: Set of all non-regular languages over the alphabet {0,1}\{0,1\}

Which of the above sets are uncountable?

  • (A)
    S1S_1 and S2S_2
  • (B)
    S3S_3 and S4S_4
  • (C)
    S2S_2 and S3S_3
  • (D)
    S1S_1 and S4S_4

Answer (official key): B

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

Q49 · Operating System · MCQ · 2 marks

Assume that in a certain computer, the virtual addresses are 64 bits long and the physical addresses are 48 bits long. The memory is word addressable. The page size is 8 kB and the word size is 4 bytes. The Translation Look-aside Buffer (TLB) in the address translation path has 128 valid entries.

At most how many distinct virtual addresses can be translated without any TLB miss?

  • (A)
    16×21016\times 2^{10}
  • (B)
    256×210256\times 2^{10}
  • (C)
    4×2204\times 2^{20}
  • (D)
    8×2208\times 2^{20}

Answer (official key): B

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

Q50 · Computer Networks · MCQ · 2 marks

Consider three machines M, N, and P with IP addresses 100.10.5.2, 100.10.5.5, and 100.10.5.6 respectively. The subnet mask is set to 255.255.255.252 for all the three machines.

Which one of the following is true?

  • (A)
    M, N, and P all belong to the same subnet
  • (B)
    Only M and N belong to the same subnet
  • (C)
    Only N and P belong to the same subnet
  • (D)
    M, N, and P belong to three different subnets

Answer (official key): C

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

Q51 · Compiler Design · Numerical · 2 marks

Consider the augmented grammar given below:

S' -> S
S  -> ( L ) | id
L  -> L , S | S

Let

I0=CLOSURE⁡({S′→∙S}).I_0 = \operatorname{CLOSURE}(\{S' \to \bullet S\}).

The number of items in the set

GOTO⁡(I0, ()\operatorname{GOTO}(I_0,\ ()

is __________.

Answer (official key): 5

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

Q52 · Theory of Computation · Numerical · 2 marks

Let Σ\Sigma be the set of all bijections from {1,…,5}\{1,\ldots,5\} to {1,…,5}\{1,\ldots,5\}, where idid denotes the identity function, i.e., id(j)=j, ∀jid(j)=j,\ \forall j.

Let ∘\circ denote composition on functions. For a string

x=x1x2⋯xn∈Σn,n≥0,x=x_1x_2\cdots x_n\in\Sigma^n,\quad n\ge0,

let

π(x)=x1∘x2∘⋯∘xn.\pi(x)=x_1\circ x_2\circ \cdots \circ x_n.

Consider the language

L={x∈Σ∗∣π(x)=id}.L=\{x\in\Sigma^*\mid \pi(x)=id\}.

The minimum number of states in any DFA accepting LL is __________.

Answer (official key): 120

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

Q53 · Digital Logic · Numerical · 2 marks

What is the minimum number of 2-input NOR gates required to implement a 4-variable function expressed in sum-of-minterms form as

f=∑(0,2,5,7,8,10,13,15)?f=\sum(0,2,5,7,8,10,13,15)?

Assume that all the inputs and their complements are available.

Answer: __________.

Answer (official key): 3

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

Q54 · Computer Organization and Architecture · Numerical · 2 marks

A certain processor deploys a single-level cache. The cache block size is 8 words and the word size is 4 bytes. The memory system uses a 60 MHz clock.

To service a cache miss, the memory controller first takes 1 cycle to accept the starting address of the block, it then takes 3 cycles to fetch all the eight words of the block, and finally transmits the words of the requested block at the rate of 1 word per cycle.

The maximum bandwidth for the memory system when the program running on the processor issues a series of read operations is __________ ×106\times 10^6 bytes/sec.

Answer (official key): 160

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

Q55 · Linear Algebra · Numerical · 2 marks

Consider the following matrix:

R=[1248139271416641525125]R= \begin{bmatrix} 1 & 2 & 4 & 8 \\ 1 & 3 & 9 & 27 \\ 1 & 4 & 16 & 64 \\ 1 & 5 & 25 & 125 \end{bmatrix}

The absolute value of the product of eigenvalues of RR is __________.

Answer (official key): 12

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

Q56 · Operating System · Numerical · 2 marks

The index node (inode) of a Unix-like file system has 12 direct, one single-indirect and one double-indirect pointers. The disk block size is 4 kB, and the disk block address is 32-bits long.

The maximum possible file size, rounded off to 1 decimal place, is __________ GB.

Answer (official key): 4 to 4.1

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

Q57 · Operating System · Numerical · 2 marks

Consider the following four processes with arrival times and CPU burst times as shown below.

ProcessP1P2P3P4
Arrival time0134
CPU burst time313Z

These processes are run on a single processor using the preemptive Shortest Remaining Time First scheduling algorithm.

If the average waiting time of the processes is 1 millisecond, then the value of ZZ is __________.

Answer (official key): 2

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

Q58 · Databases · Numerical · 2 marks

Consider the following relations P(X,Y,Z)P(X,Y,Z), Q(X,Y,T)Q(X,Y,T) and R(Y,V)R(Y,V).

P

XYZ
X1Y1Z1
X1Y1Z2
X2Y2Z2
X2Y4Z4

Q

XYT
X2Y12
X1Y25
X1Y16
X3Y31

R

YV
Y1V1
Y3V2
Y2V3
Y2V2

How many tuples will be returned by the following relational algebra query?

ΠX(σP.Y=R.Y ∧ R.V=V2(P×R))−ΠX(σQ.Y=R.Y ∧ Q.T>2(Q×R))\Pi_X\left(\sigma_{P.Y=R.Y\ \wedge\ R.V=V2}(P\times R)\right) - \Pi_X\left(\sigma_{Q.Y=R.Y\ \wedge\ Q.T>2}(Q\times R)\right)

Answer: __________.

Answer (official key): 1

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

Q59 · Programming and Data Structures · Numerical · 2 marks

Consider the following C program:

#include <stdio.h>

int main()
{
    int a[] = {2, 4, 6, 8, 10};
    int i, sum = 0, *b = a + 4;

    for (i = 0; i < 5; i++)
        sum = sum + (*b - i) - *(b - i);

    printf("%d\n", sum);
    return 0;
}

The output of the above C program is __________.

Answer (official key): 10

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

Q60 · Discrete Mathematics · Numerical · 2 marks

In an RSA cryptosystem, the value of the public modulus parameter nn is 3007. It is also known that

ϕ(n)=2880,\phi(n)=2880,

where ϕ()\phi() denotes Euler's Totient Function.

Then the prime factor of nn which is greater than 50 is __________.

Answer (official key): 97

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

Q61 · Databases · Numerical · 2 marks

A relational database contains two tables Student and Performance as shown below.

Student

Roll_noStudent_name
1Amit
2Priya
3Vinit
4Rohan
5Smita

Performance

Roll_noSubject_codeMarks
1A86
1B95
1C90
2A89
2C92
3C80

The primary key of the Student table is Roll_no. For the Performance table, the columns Roll_no and Subject_code together form the primary key.

Consider the SQL query given below:

SELECT S.Student_name, sum(P.Marks)
FROM Student S, Performance P
WHERE P.Marks > 84
GROUP BY S.Student_name;

The number of rows returned by the above SQL query is __________.

Answer (official key): 5

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

Q62 · Probability and Statistics · Numerical · 2 marks

Let TT be a full binary tree with 8 leaves. A full binary tree has every level full. Suppose two leaves aa and bb of TT are chosen uniformly and independently at random.

The expected value of the distance between aa and bb in TT, i.e., the number of edges in the unique path between aa and bb, rounded off to 2 decimal places, is __________.

Answer (official key): 4.25

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

Q63 · Probability and Statistics · Numerical · 2 marks

Suppose YY is distributed uniformly in the open interval (1,6)(1,6). The probability that the polynomial

3x2+6xY+3Y+63x^2+6xY+3Y+6

has only real roots, rounded off to 1 decimal place, is __________.

Answer (official key): 0.8

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

Q64 · Computer Networks · Numerical · 2 marks

Consider that 15 machines need to be connected in a LAN using 8-port Ethernet switches. Assume that these switches do not have any separate uplink ports.

The minimum number of switches needed is __________.

Answer (official key): 3

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

Q65 · Programming and Data Structures · Numerical · 2 marks

Consider the following C program:

#include <stdio.h>

int main()
{
    float sum = 0.0, j = 1.0, i = 2.0;

    while (i / j > 0.0625) {
        j = j + j;
        sum = sum + i / j;
        printf("%f\n", sum);
    }

    return 0;
}

The number of times the variable sum will be printed when the above program is executed is __________.

Answer (official key): 5

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