GATE 2020 CS

All 65 questions of GATE 2020 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

Select the word that fits the analogy:

Cook : Cook :: Fly : ______

  • (A)
    Flyer
  • (B)
    Flying
  • (C)
    Flew
  • (D)
    Flighter

Answer (official key): A

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

Q2 · General Aptitude · MCQ · 1 mark

There are multiple routes to reach from node 1 to node 2, as shown in the network.

Route network for Q5

The cost of travel on an edge between two nodes is given in rupees. Nodes a, b, c, d, e, and f are toll booths. The toll price at toll booths marked a and e is Rs. 200, and is Rs. 100 for the other toll booths. Which is the cheapest route from node 1 to node 2?

  • (A)
    1-a-c-2
  • (B)
    1-f-b-2
  • (C)
    1-b-2
  • (D)
    1-f-e-2

Answer (official key): B

Read the worked solution

Q3 · General Aptitude · MCQ · 1 mark

The dawn of the 21st century witnessed the melting glaciers oscillating between giving too much and too little to billions of people who depend on them for fresh water. The UN climate report estimates that without deep cuts to man-made emissions, at least 30% of the northern hemisphere's surface permafrost could melt by the end of the century. Given this situation of imminent global exodus of billions of people displaced by rising seas, nation-states need to rethink their carbon footprint for political concerns, if not for environmental ones.

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

  • (A)
    Nation-states do not have environmental concerns.
  • (B)
    Nation-states are responsible for providing fresh water to billions of people.
  • (C)
    Billions of people are responsible for man-made emissions.
  • (D)
    Billions of people are affected by melting glaciers.

Answer (official key): D

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

Q4 · General Aptitude · MCQ · 1 mark

His knowledge of the subject was excellent but his classroom performance was ______.

  • (A)
    extremely poor
  • (B)
    good
  • (C)
    desirable
  • (D)
    praiseworthy

Answer (official key): A

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

Q5 · General Aptitude · MCQ · 1 mark

Raman is confident of speaking English ______ six months as he has been practising regularly ______ the last three weeks.

  • (A)
    during, for
  • (B)
    for, since
  • (C)
    for, in
  • (D)
    within, for

Answer (official key): D

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

Q6 · General Aptitude · MCQ · 2 marks

Two straight lines are drawn perpendicular to each other in the X-Y plane. If α\alpha and β\beta are the acute angles the straight lines make with the X-axis, then α+β\alpha+\beta is ______.

  • (A)
    60∘60^\circ
  • (B)
    90∘90^\circ
  • (C)
    120∘120^\circ
  • (D)
    180∘180^\circ

Answer (official key): B

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

Q7 · General Aptitude · MCQ · 2 marks

The figure below shows an annular ring with outer and inner radii as bb and aa, respectively. The annular space has been painted in the form of blue colour circles touching the outer and inner periphery of annular space. If maximum nn number of circles can be painted, then the unpainted area available in annular space is ______.

Annular ring for Q8

  • (A)
    π[(b2−a2)−n4(b−a)2]\pi\left[(b^2-a^2)-\frac{n}{4}(b-a)^2\right]
  • (B)
    π[(b2−a2)−n(b−a)2]\pi\left[(b^2-a^2)-n(b-a)^2\right]
  • (C)
    π[(b2−a2)+n4(b−a)2]\pi\left[(b^2-a^2)+\frac{n}{4}(b-a)^2\right]
  • (D)
    π[(b2−a2)+n(b−a)2]\pi\left[(b^2-a^2)+n(b-a)^2\right]

Answer (official key): A

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

Q8 · General Aptitude · MCQ · 2 marks

Goods and Services Tax (GST) is an indirect tax introduced in India in 2017 that is imposed on the supply of goods and services, and it subsumes all indirect taxes except few. It is a destination-based tax imposed on goods and services used, and it is not imposed at the point of origin from where goods come. GST also has a few components specific to state governments, central government and Union Territories (UTs).

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

  • (A)
    GST is imposed on the production of goods and services.
  • (B)
    GST includes all indirect taxes.
  • (C)
    GST does not have a component specific to UT.
  • (D)
    GST is imposed at the point of usage of goods and services.

Answer (official key): D

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

Q9 · General Aptitude · MCQ · 2 marks

The total revenue of a company during 2014–2018 is shown in the bar graph. If the total expenditure of the company in each year is 500 million rupees, then the aggregate profit or loss (in percentage) on the total expenditure of the company during 2014–2018 is ______.

Revenue bar chart for Q10

  • (A)
    16.67% profit
  • (B)
    16.67% loss
  • (C)
    20% profit
  • (D)
    20% loss

Answer (official key): C

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

Q10 · General Aptitude · MCQ · 2 marks

If P=3P = 3, R=27R = 27, T=243T = 243, then $Q + S = ______.

  • (A)
    40
  • (B)
    80
  • (C)
    90
  • (D)
    110

Answer (official key): C

Read the worked solution

Q11 · Computer Organization and Architecture · Numerical · 1 mark

A multiplexer is placed between a group of 32 registers and an accumulator to regulate data movement such that at any given point in time the content of only one register will move to the accumulator.

The minimum number of select lines needed for the multiplexer is __________.

Answer (official key): 5

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

Q12 · Programming and Data Structures · MCQ · 1 mark

What is the worst-case time complexity of inserting n2n^2 elements into an AVL tree with nn elements initially?

  • (A)
    Θ(n4)\Theta(n^4)
  • (B)
    Θ(n2)\Theta(n^2)
  • (C)
    Θ(n2log⁡n)\Theta(n^2\log n)
  • (D)
    Θ(n3)\Theta(n^3)

Answer (official key): C

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

Q13 · Computer Networks · Numerical · 1 mark

Assume that you have made a request for a web page through your web browser to a web server. Initially, the browser cache is empty. Further, the browser is configured to send HTTP requests in non-persistent mode. The web page contains text and five very small images.

The minimum number of TCP connections required to display the web page completely in your browser is __________.

Answer (official key): 6

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

Q14 · Computer Networks · MCQ · 1 mark

Consider the following statements about the functionality of an IP-based router.

I. A router does not modify the IP packets during forwarding.

II. It is not necessary for a router to implement any routing protocol.

III. A router should reassemble IP fragments if the MTU of the outgoing link is larger than the size of the incoming IP packet.

Which of the above statements is/are TRUE?

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

Answer (official key): D

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

Q15 · Digital Logic · Numerical · 1 mark

If there are mm input lines and nn output lines for a decoder that is used to uniquely address a byte-addressable 1 KB RAM, then the minimum value of m+nm+n is __________.

Answer (official key): 1034

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

Q16 · Compiler Design · Numerical · 1 mark

Consider the following grammar.

S→aSB∣dS \to aSB \mid d B→bB \to b

The number of reduction steps taken by a bottom-up parser while accepting the string aaadbbb is __________.

Answer (official key): 7

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

Q17 · Databases · MCQ · 1 mark

Which one of the following is used to represent the supporting many-one relationships of a weak entity set in an entity-relationship diagram?

  • (A)
    Diamonds with double/bold border
  • (B)
    Rectangles with double/bold border
  • (C)
    Ovals with double/bold border
  • (D)
    Ovals that contain underlined identifiers

Answer (official key): A

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

Q18 · Theory of Computation · MCQ · 1 mark

Consider the language

L={an∣n≥0}∪{anbn∣n≥0}L = \{a^n \mid n \ge 0\} \cup \{a^n b^n \mid n \ge 0\}

and the following statements.

I. LL is deterministic context-free.

II. LL is context-free but not deterministic context-free.

III. LL is not LL(kk) for any kk.

Which of the above statements is/are TRUE?

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

Answer (official key): C

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

Q19 · Discrete Mathematics · Numerical · 1 mark

Let GG be a group of 35 elements. Then the largest possible size of a subgroup of GG other than GG itself is __________.

Answer (official key): 7

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

Q20 · Databases · MCQ · 1 mark

Consider a relational database containing the following schemas.

Catalogue

snopnocost
S1P1150
S1P250
S1P3100
S2P4200
S2P5250
S3P1250
S3P2150
S3P5300
S3P4250

Suppliers

snosnamelocation
S1M/s Royal furnitureDelhi
S2M/s Balaji furnitureBangalore
S3M/s Premium furnitureChennai

Parts

pnopnamepart_type
P1TableWood
P2ChairWood
P3TableSteel
P4AlmirahSteel
P5AlmirahWood

The primary key of each table is indicated by the underlined constituent fields.

SELECT s.sno, s.sname
FROM Suppliers s, Catalogue c
WHERE s.sno = c.sno AND
      cost > (SELECT AVG(cost)
              FROM Catalogue
              WHERE pno = 'P4'
              GROUP BY pno);

The number of rows returned by the above SQL query is:

  • (A)
    4
  • (B)
    5
  • (C)
    0
  • (D)
    2

Answer (official key): A

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

Q21 · Algorithms · MCQ · 1 mark

For parameters aa and bb, both of which are ω(1)\omega(1),

T(n)=T(n1/a)+1T(n)=T(n^{1/a})+1

and

T(b)=1.T(b)=1.

Then T(n)T(n) is:

  • (A)
    Θ(log⁡alog⁡bn)\Theta(\log_a \log_b n)
  • (B)
    Θ(log⁡an)\Theta(\log_a n)
  • (C)
    Θ(log⁡blog⁡an)\Theta(\log_b \log_a n)
  • (D)
    Θ(log⁡2log⁡2n)\Theta(\log_2 \log_2 n)

Answer (official key): A

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

Q22 · Computer Organization and Architecture · MCQ · 1 mark

Consider the following statements.

I. Daisy chaining is used to assign priorities in attending interrupts.

II. When a device raises a vectored interrupt, the CPU does polling to identify the source of interrupt.

III. In polling, the CPU periodically checks the status bits to know if any device needs its attention.

IV. During DMA, both the CPU and DMA controller can be bus masters at the same time.

Which of the above statements is/are TRUE?

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

Answer (official key): C

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

Q23 · Programming and Data Structures · MCQ · 1 mark

The preorder traversal of a binary search tree is:

15, 10, 12, 11, 20, 18, 16, 1915,\ 10,\ 12,\ 11,\ 20,\ 18,\ 16,\ 19

Which one of the following is the postorder traversal of the tree?

  • (A)
    10, 11, 12, 15, 16, 18, 19, 20
  • (B)
    11, 12, 10, 16, 19, 18, 20, 15
  • (C)
    20, 19, 18, 16, 15, 12, 11, 10
  • (D)
    19, 16, 18, 20, 11, 12, 10, 15

Answer (official key): B

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

Q24 · Programming and Data Structures · MCQ · 1 mark

What is the worst-case time complexity of inserting nn elements into an empty linked list, if the linked list needs to be maintained in sorted order?

  • (A)
    Θ(n)\Theta(n)
  • (B)
    Θ(nlog⁡n)\Theta(n\log n)
  • (C)
    Θ(n2)\Theta(n^2)
  • (D)
    Θ(1)\Theta(1)

Answer (official key): C

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

Q25 · Operating System · MCQ · 1 mark

Consider allocation of memory to a new process. Assume that none of the existing holes in the memory will exactly fit the process's memory requirement. Hence, a new hole of smaller size will be created if allocation is made in any of the existing holes.

Which one of the following statements is TRUE?

  • (A)
    The hole created by first fit is always larger than the hole created by next fit.
  • (B)
    The hole created by worst fit is always larger than the hole created by first fit.
  • (C)
    The hole created by best fit is never larger than the hole created by first fit.
  • (D)
    The hole created by next fit is never larger than the hole created by best fit.

Answer (official key): C

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

Q26 · Algorithms · Numerical · 1 mark

Consider a double hashing scheme in which the primary hash function is

h1(k)=k mod 23h_1(k)=k \bmod 23

and the secondary hash function is

h2(k)=1+(k mod 19).h_2(k)=1+(k \bmod 19).

Assume that the table size is 23. Then the address returned by probe 1 in the probe sequence, where the probe sequence begins at probe 0, for key value k=90k=90 is __________.

Answer (official key): 13

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

Q27 · Computer Organization and Architecture · MCQ · 1 mark

Consider the following data path diagram.

Data path diagram for Q4

Consider an instruction R0←R1+R2R0 \leftarrow R1 + R2. The following steps are used to execute it over the given data path. Assume that PC is incremented appropriately. The subscripts out and in indicate read and write operations, respectively.

  1. R2out, TEMP1in, ALUadd, TEMP2inR2_{out},\ TEMP1_{in},\ ALU_{add},\ TEMP2_{in}
  2. R1out, TEMP1inR1_{out},\ TEMP1_{in}
  3. PCout, MARin, MEMreadPC_{out},\ MAR_{in},\ MEM_{read}
  4. TEMP2out, R0inTEMP2_{out},\ R0_{in}
  5. MDRout, IRinMDR_{out},\ IR_{in}

Which one of the following is the correct order of execution of the above steps?

  • (A)
    2, 1, 4, 5, 3
  • (B)
    1, 2, 4, 3, 5
  • (C)
    3, 5, 2, 1, 4
  • (D)
    3, 5, 1, 2, 4

Answer (official key): C

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

Q28 · Operating System · MCQ · 1 mark

Consider the following statements about process state transitions for a system using preemptive scheduling.

I. A running process can move to ready state.

II. A ready process can move to running state.

III. A blocked process can move to running state.

IV. A blocked process can move to ready state.

Which of the above statements are TRUE?

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

Answer (official key): C

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

Q29 · Programming and Data Structures · Numerical · 1 mark

Consider the following C program.

#include <stdio.h>
int main()
{
    int a[4][5] = {
        {1, 2, 3, 4, 5},
        {6, 7, 8, 9, 10},
        {11, 12, 13, 14, 15},
        {16, 17, 18, 19, 20}
    };

    printf("%d\n", *(*(a + **a + 2) + 3));
    return 0;
}

The output of the program is __________.

Answer (official key): 19

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

Q30 · Theory of Computation · MCQ · 1 mark

Consider the following statements.

I. If L1∪L2L_1 \cup L_2 is regular, then both L1L_1 and L2L_2 must be regular.

II. The class of regular languages is closed under infinite union.

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

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

Q31 · Calculus · MCQ · 1 mark

Consider the functions:

I. e−xe^{-x}

II. x2−sin⁡xx^2-\sin x

III. x3+1\sqrt{x^3+1}

Which of the above functions is/are increasing everywhere in [0,1][0,1]?

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

Answer (official key): A

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

Q32 · Discrete Mathematics · Numerical · 1 mark

Let XX be the set of all binary relations on the set {1,2,3}\{1,2,3\}. Suppose a relation is chosen from XX at random. The probability that the chosen relation is reflexive, rounded off to 3 decimal places, is __________.

Answer (official key): 0.125

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

Q33 · Compiler Design · MCQ · 1 mark

Consider the following statements.

I. Symbol table is accessed only during lexical analysis and syntax analysis.

II. Compilers for programming languages that support recursion necessarily need heap storage for memory allocation in the run-time environment.

III. Errors violating the condition "any variable must be declared before its use" are detected during syntax analysis.

Which of the above statements is/are TRUE?

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

Answer (official key): D

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

Q34 · Computer Organization and Architecture · Numerical · 1 mark

A direct mapped cache memory of 1 MB has a block size of 256 bytes. The cache has an access time of 3 ns and a hit rate of 94%.

During a cache miss, it takes 20 ns to bring the first word of a block from the main memory, while each subsequent word takes 5 ns. The word size is 64 bits.

The average memory access time in ns, rounded off to 1 decimal place, is __________.

Answer (official key): 13.3 to 13.5

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

Q35 · Theory of Computation · MCQ · 1 mark

Which one of the following regular expressions represents the set of all binary strings with an odd number of 1's?

  • (A)
    ((0+1)*1(0+1)*1)*10*
  • (B)
    (0*10*10*)*0*1
  • (C)
    10*(0*10*10*)*
  • (D)
    (0*10*10*)*10*

Answer (official key): Marks to all

Everyone who took this paper got the marks for this question. Marks to all in GATE

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

Q36 · Theory of Computation · MCQ · 2 marks

Which of the following languages are undecidable? Note that ⟨M⟩\langle M\rangle indicates encoding of the Turing machine MM.

L1={⟨M⟩∣L(M)=∅}L_1 = \{\langle M\rangle \mid L(M)=\varnothing\} L2={⟨M,w,q⟩∣M on input w reaches state q in exactly 100 steps}L_2 = \{\langle M,w,q\rangle \mid M \text{ on input } w \text{ reaches state } q \text{ in exactly 100 steps}\} L3={⟨M⟩∣L(M) is not recursive}L_3 = \{\langle M\rangle \mid L(M) \text{ is not recursive}\} L4={⟨M⟩∣L(M) contains at least 21 members}L_4 = \{\langle M\rangle \mid L(M) \text{ contains at least 21 members}\}
  • (A)
    L1,L3,L_1, L_3, and L4L_4 only
  • (B)
    L3L_3 and L4L_4 only
  • (C)
    L1L_1 and L3L_3 only
  • (D)
    L2,L3,L_2, L_3, and L4L_4 only

Answer (official key): A

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

Q37 · Algorithms · Numerical · 2 marks

Consider a graph G=(V,E)G=(V,E), where

V={v1,v2,…,v100}V=\{v_1,v_2,\ldots,v_{100}\}

and

E={(vi,vj)∣1≤i<j≤100}.E=\{(v_i,v_j)\mid 1\le i<j\le 100\}.

The weight of the edge (vi,vj)(v_i,v_j) is ∣i−j∣|i-j|. The weight of a minimum spanning tree of GG is __________.

Answer (official key): 99

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

Q38 · Compiler Design · MCQ · 2 marks

Consider the productions

A→PQA \to PQ

and

A→XY.A \to XY.

Each of the five non-terminals A,P,Q,X,YA,P,Q,X,Y has two attributes: ss is a synthesized attribute, and ii is an inherited attribute.

Consider the following attribute rules.

Rule 1:

P.i=A.i+2,Q.i=P.i+A.s,A.s=P.s+Q.sP.i=A.i+2,\quad Q.i=P.i+A.s,\quad A.s=P.s+Q.s

Rule 2:

X.i=A.i+Y.s,Y.i=X.s+A.sX.i=A.i+Y.s,\quad Y.i=X.s+A.s

Which one of the following is TRUE?

  • (A)
    Both Rule 1 and Rule 2 are L-attributed.
  • (B)
    Only Rule 1 is L-attributed.
  • (C)
    Only Rule 2 is L-attributed.
  • (D)
    Neither Rule 1 nor Rule 2 is L-attributed.

Answer (official key): B

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

Q39 · Algorithms · MCQ · 2 marks

Let G=(V,E)G=(V,E) be a weighted, connected graph and let TT be a minimum spanning tree (MST) of GG maintained using adjacency lists. Suppose a new weighted edge (u,v)(u,v) is added to GG. The worst-case time complexity of determining whether TT is still an MST of the resultant graph is:

  • (A)
    Θ(∣E∣+∣V∣)\Theta(|E|+|V|)
  • (B)
    Θ(∣E∣∣V∣)\Theta(|E||V|)
  • (C)
    Θ(∣E∣log⁡∣V∣)\Theta(|E|\log|V|)
  • (D)
    Θ(∣V∣)\Theta(|V|)

Answer (official key): D

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

Q40 · Computer Organization and Architecture · MCQ · 2 marks

Consider three registers R1R1, R2R2, and R3R3 that store numbers in IEEE-754 single precision floating point format. Assume that R1R1 and R2R2 contain the values, in hexadecimal notation, 0x42200000 and 0xC1200000, respectively.

If R3=R1/R2R3 = R1/R2, what is the value stored in R3R3?

  • (A)
    0x40800000
  • (B)
    0xC0800000
  • (C)
    0x83400000
  • (D)
    0xC8500000

Answer (official key): B

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

Q41 · Probability and Statistics · Numerical · 2 marks

For n>2n>2, let a∈{0,1}na\in\{0,1\}^n be a non-zero vector. Suppose that xx is chosen uniformly at random from {0,1}n\{0,1\}^n. Then, the probability that

∑i=1naixi\sum_{i=1}^{n} a_i x_i

is an odd number is __________.

Answer (official key): 0.5

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

Q42 · Discrete Mathematics · MCQ · 2 marks

Which one of the following predicate formulas is NOT logically valid?

Note that WW is a predicate formula without any free occurrence of xx.

  • (A)
    ∀x(P(x)∨W)≡∀xP(x)∨W\forall x(P(x)\vee W)\equiv \forall xP(x)\vee W
  • (B)
    ∃x(P(x)∧W)≡∃xP(x)∧W\exists x(P(x)\wedge W)\equiv \exists xP(x)\wedge W
  • (C)
    ∀x(P(x)→W)≡∀xP(x)→W\forall x(P(x)\to W)\equiv \forall xP(x)\to W
  • (D)
    ∃x(P(x)→W)≡∀xP(x)→W\exists x(P(x)\to W)\equiv \forall xP(x)\to W

Answer (official key): C

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

Q43 · Computer Networks · Numerical · 2 marks

Consider a TCP connection between a client and a server with the following specifications:

  • round trip time is 6 ms
  • receiver advertised window is 50 KB
  • slow-start threshold at the client is 32 KB
  • maximum segment size is 2 KB

The connection is established at time t=0t=0. Assume that there are no timeouts and errors during transmission.

Then the size of the congestion window, in KB, at time t+60t+60 ms after all acknowledgements are processed is __________.

Answer (official key): 44

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

Q44 · Computer Networks · MCQ · 2 marks

An organization requires a range of IP addresses to assign one to each of its 1500 computers. The organization has approached an Internet Service Provider (ISP) for this task. The ISP uses CIDR and serves the requests from the available IP address space 202.61.0.0/17.

The ISP wants to assign an address space to the organization which will minimize the number of routing entries in the ISP's router using route aggregation. Which of the following address spaces are potential candidates from which the ISP can allot any one to the organization?

I. 202.61.84.0/21
II. 202.61.104.0/21
III. 202.61.64.0/21
IV. 202.61.144.0/21

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

Answer (official key): B

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

Q45 · Programming and Data Structures · MCQ · 2 marks

In a balanced binary search tree with nn elements, what is the worst-case time complexity of reporting all elements in the range [a,b][a,b]? Assume that the number of reported elements is kk.

  • (A)
    Θ(log⁡n)\Theta(\log n)
  • (B)
    Θ(log⁡n+k)\Theta(\log n+k)
  • (C)
    Θ(klog⁡n)\Theta(k\log n)
  • (D)
    Θ(nlog⁡k)\Theta(n\log k)

Answer (official key): B

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

Q46 · Computer Organization and Architecture · Numerical · 2 marks

A processor has 64 registers and uses 16-bit instruction format. It has two types of instructions: I-type and R-type. Each I-type instruction contains an opcode, a register name, and a 4-bit immediate value. Each R-type instruction contains an opcode and two register names.

If there are 8 distinct I-type opcodes, then the maximum number of distinct R-type opcodes is __________.

Answer (official key): 14

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

Q47 · Discrete Mathematics · Numerical · 2 marks

The number of permutations of the characters in IILACC such that no character appears in its original position, if the two I's are indistinguishable, is __________.

Answer (official key): 12

Read the worked solution

Q48 · Algorithms · MCQ · 2 marks

Let G=(V,E)G=(V,E) be a directed weighted graph with weight function w:E→Rw:E\to \mathbb{R}. For some function f:V→Rf:V\to \mathbb{R}, for each edge (u,v)∈E(u,v)\in E, define

w′(u,v)=w(u,v)+f(u)−f(v).w'(u,v)=w(u,v)+f(u)-f(v).

Which one of the options completes the following sentence so that it is TRUE?

The shortest paths in GG under ww are shortest paths under w′w' also, ________.

  • (A)
    for every f:V→Rf:V\to \mathbb{R}
  • (B)
    if and only if w′(u,v)w'(u,v) is positive for every edge (u,v)(u,v)
  • (C)
    if and only if f(v)f(v) is negative for every vertex vv
  • (D)
    if and only if f(v)f(v) is the distance from source ss to vv in the graph obtained by adding a new vertex ss to GG and edges of zero weight from ss to every vertex of GG

Answer (official key): A

Read the worked solution

Q49 · Programming and Data Structures · Numerical · 2 marks

Consider the array representation of a binary min-heap containing 1023 elements.

The minimum number of comparisons required to find the maximum in the heap is __________.

Answer (official key): 511

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

Q50 · Operating System · Numerical · 2 marks

Consider the following set of processes, assumed to have arrived at time 0. Consider the CPU scheduling algorithms Shortest Job First (SJF) and Round Robin (RR). For RR, assume that the processes are scheduled in the order P1,P2,P3,P4P_1,P_2,P_3,P_4.

ProcessP1P_1P2P_2P3P_3P4P_4
Burst time (ms)8724

If the time quantum for RR is 4 ms, then the absolute value of the difference between the average turnaround times, in ms, of SJF and RR, rounded off to 2 decimal places, is __________.

Answer (official key): 5.25

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

Q51 · Operating System · MCQ · 2 marks

Each of a set of nn processes executes the following code using two semaphores aa and bb initialized to 1 and 0, respectively. Assume that count is a shared variable initialized to 0 and not used in CODE SECTION P.

CODE SECTION P is executed first. Then the following synchronization code is executed:

wait(a);
count = count + 1;
if (count == n) signal(b);
signal(a);
wait(b);
signal(b);

Then CODE SECTION Q is executed.

What does the code achieve?

  • (A)
    It ensures that no process executes CODE SECTION Q before every process has finished CODE SECTION P.
  • (B)
    It ensures that at most two processes are in CODE SECTION Q at any time.
  • (C)
    It ensures that all processes execute CODE SECTION P mutually exclusively.
  • (D)
    It ensures that at most n−1n-1 processes are in CODE SECTION P at any time.

Answer (official key): A

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

Q52 · Digital Logic · MCQ · 2 marks

Consider the Boolean function z(a,b,c)z(a,b,c) represented by the circuit shown below.

Boolean circuit for Q28

Which one of the following minterm lists represents the circuit given above?

  • (A)
    z=∑(0,1,3,7)z=\sum(0,1,3,7)
  • (B)
    z=∑(1,4,5,6,7)z=\sum(1,4,5,6,7)
  • (C)
    z=∑(2,4,5,6,7)z=\sum(2,4,5,6,7)
  • (D)
    z=∑(2,3,5)z=\sum(2,3,5)

Answer (official key): B

Read the worked solution

Q53 · Theory of Computation · MCQ · 2 marks

Consider the following languages.

L1={wxyxz∣w,x,y,z∈(0+1)∗}L_1=\{wxyxz \mid w,x,y,z\in(0+1)^*\} L2={xy∣x,y∈(a+b)∗, ∣x∣=∣y∣, x≠y}L_2=\{xy \mid x,y\in(a+b)^*,\ |x|=|y|,\ x\ne y\}

Which one of the following is TRUE?

  • (A)
    L1L_1 is regular and L2L_2 is context-free.
  • (B)
    L1L_1 is context-free but not regular and L2L_2 is context-free.
  • (C)
    Neither L1L_1 nor L2L_2 is context-free.
  • (D)
    L1L_1 is context-free but L2L_2 is not context-free.

Answer (official key): A

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

Q54 · Linear Algebra · MCQ · 2 marks

Let AA and BB be two n×nn \times n matrices over real numbers. Let rank⁡(M)\operatorname{rank}(M) and det⁡(M)\det(M) denote the rank and determinant of a matrix MM, respectively.

Consider the following statements.

I. rank⁡(AB)=rank⁡(A)rank⁡(B)\operatorname{rank}(AB)=\operatorname{rank}(A)\operatorname{rank}(B)

II. det⁡(AB)=det⁡(A)det⁡(B)\det(AB)=\det(A)\det(B)

III. rank⁡(A+B)≤rank⁡(A)+rank⁡(B)\operatorname{rank}(A+B)\le \operatorname{rank}(A)+\operatorname{rank}(B)

IV. det⁡(A+B)≤det⁡(A)+det⁡(B)\det(A+B)\le \det(A)+\det(B)

Which of the above statements are TRUE?

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

Answer (official key): C

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

Q55 · Programming and Data Structures · Numerical · 2 marks

Consider the following C functions.

int fun1(int n) {
    static int i = 0;
    if (n > 0) {
        ++i;
        fun1(n-1);
    }
    return(i);
}

int fun2(int n) {
    static int i = 0;
    if (n > 0) {
        i = i + fun1(n);
        fun2(n-1);
    }
    return(i);
}

The return value of fun2(5) is __________.

Answer (official key): 55

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

Q56 · Discrete Mathematics · Numerical · 2 marks

Graph GG is obtained by adding vertex xx to K3,4K_{3,4} and making xx adjacent to every vertex of K3,4K_{3,4}. The minimum number of colours required to edge-colour GG is __________.

Answer (official key): 7

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

Q57 · Operating System · Numerical · 2 marks

Consider a paging system that uses 1-level page table residing in main memory and a TLB for address translation. Each main memory access takes 100 ns and TLB lookup takes 20 ns. Each page transfer to/from the disk takes 5000 ns.

Assume that the TLB hit ratio is 95%, page fault rate is 10%. Assume that in 20% of the total page faults, a dirty page has to be written back to disk before the required page is read from disk. TLB update time is negligible.

The average memory access time in ns, rounded off to 1 decimal places, is __________.

Answer (official key): 154.5 to 155.5

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

Q58 · Theory of Computation · Numerical · 2 marks

Consider the following language.

L={x∈{a,b}∗∣number of a’s in x is divisible by 2 but not divisible by 3}L=\{x\in\{a,b\}^* \mid \text{number of }a\text{'s in }x\text{ is divisible by 2 but not divisible by 3}\}

The minimum number of states in a DFA that accepts LL is __________.

Answer (official key): 6

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

Q59 · Databases · MCQ · 2 marks

Consider a relational table RR that is in 3NF, but not in BCNF. Which one of the following statements is TRUE?

  • (A)
    RR has a nontrivial functional dependency X→AX \to A, where XX is not a superkey and AA is a prime attribute.
  • (B)
    RR has a nontrivial functional dependency X→AX \to A, where XX is not a superkey and AA is a non-prime attribute.
  • (C)
    RR has a nontrivial functional dependency X→AX \to A, where XX is a superkey and AA is a non-prime attribute.
  • (D)
    A cell in RR holds a set instead of an atomic value.

Answer (official key): A

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

Q60 · Databases · MCQ · 2 marks

Consider a schedule of transactions T1T_1 and T2T_2:

12345678910
T1T_1RARCWDWBCommit
T2T_2RBWBRDWCCommit

Here, RX stands for "Read(X)" and WX stands for "Write(X)". Which one of the following schedules is conflict equivalent to the above schedule?

In the options, each schedule is written in time order; Ri(X)R_i(X) and Wi(X)W_i(X) are Read(X) and Write(X) by TiT_i.

  • (A)
    R2(B), W2(B), R2(D), R1(A), R1(C), W1(D), W1(B), W2(C), Commit1, Commit2R_2(B),\ W_2(B),\ R_2(D),\ R_1(A),\ R_1(C),\ W_1(D),\ W_1(B),\ W_2(C),\ \text{Commit}_1,\ \text{Commit}_2
  • (B)
    R1(A), R1(C), W1(D), W1(B), R2(B), W2(B), R2(D), W2(C), Commit1, Commit2R_1(A),\ R_1(C),\ W_1(D),\ W_1(B),\ R_2(B),\ W_2(B),\ R_2(D),\ W_2(C),\ \text{Commit}_1,\ \text{Commit}_2
  • (C)
    R1(A), R1(C), W1(D), R2(B), W2(B), R2(D), W1(B), W2(C), Commit1, Commit2R_1(A),\ R_1(C),\ W_1(D),\ R_2(B),\ W_2(B),\ R_2(D),\ W_1(B),\ W_2(C),\ \text{Commit}_1,\ \text{Commit}_2
  • (D)
    R2(B), W2(B), R2(D), W2(C), R1(A), R1(C), W1(D), W1(B), Commit1, Commit2R_2(B),\ W_2(B),\ R_2(D),\ W_2(C),\ R_1(A),\ R_1(C),\ W_1(D),\ W_1(B),\ \text{Commit}_1,\ \text{Commit}_2

Answer (official key): A

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

Q61 · Computer Organization and Architecture · Numerical · 2 marks

Consider a non-pipelined processor operating at 2.5 GHz. It takes 5 clock cycles to complete an instruction. You are going to make a 5-stage pipeline out of this processor. Overheads associated with pipelining force you to operate the pipelined processor at 2 GHz.

In a given program, assume that 30% are memory instructions, 60% are ALU instructions and the rest are branch instructions. 5% of the memory instructions cause stalls of 50 clock cycles each due to cache miss and 50% of the branch instructions cause stalls of 2 cycles each. Assume that there are no stalls associated with the execution of ALU instructions.

For this program, the speedup achieved by the pipelined processor over the non-pipelined processor, rounded off to 2 decimal places, is __________.

Answer (official key): 2.15 to 2.18

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

Q62 · Computer Organization and Architecture · MCQ · 2 marks

A computer system with a word length of 32 bits has a 16 MB byte-addressable main memory and a 64 KB, 4-way set associative cache memory with a block size of 256 bytes. Consider the following four physical addresses represented in hexadecimal notation.

A1=0x42C8A4,A2=0x546888,A3=0x6A289C,A4=0x5E4880A1 = \texttt{0x42C8A4},\quad A2 = \texttt{0x546888},\quad A3 = \texttt{0x6A289C},\quad A4 = \texttt{0x5E4880}

Which one of the following is TRUE?

  • (A)
    A1A1 and A4A4 are mapped to different cache sets.
  • (B)
    A2A2 and A3A3 are mapped to the same cache set.
  • (C)
    A3A3 and A4A4 are mapped to the same cache set.
  • (D)
    A1A1 and A3A3 are mapped to the same cache set.

Answer (official key): B

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

Q63 · Databases · Numerical · 2 marks

Consider a database implemented using B+ tree for file indexing and installed on a disk drive with block size of 4 KB. The size of search key is 12 bytes and the size of tree/disk pointer is 8 bytes. Assume that the database has one million records. Also assume that no node of the B+ tree and no records are present initially in main memory. Consider that each record fits into one disk block.

The minimum number of disk accesses required to retrieve any record in the database is __________.

Answer (official key): 4

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

Q64 · Programming and Data Structures · Numerical · 2 marks

Consider the following C functions.

int tob(int b, int* arr) {
    int i;
    for (i = 0; b > 0; i++) {
        if (b % 2) arr[i] = 1;
        else arr[i] = 0;
        b = b / 2;
    }
    return(i);
}

int pp(int a, int b) {
    int arr[20];
    int i, tot = 1, ex, len;
    ex = a;
    len = tob(b, arr);
    for (i = 0; i < len; i++) {
        if (arr[i] == 1)
            tot = tot * ex;
        ex = ex * ex;
    }
    return(tot);
}

The value returned by pp(3,4) is __________.

Answer (official key): 81

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

Q65 · Operating System · MCQ · 2 marks

Consider the following five disk access requests of the form (request id, cylinder number) that are present in the disk scheduler queue at a given time.

(P,155), (Q,85), (R,110), (S,30), (T,115)(P,155),\ (Q,85),\ (R,110),\ (S,30),\ (T,115)

Assume the head is positioned at cylinder 100. The scheduler follows Shortest Seek Time First scheduling to service the requests.

Which one of the following statements is FALSE?

  • (A)
    TT is serviced before PP.
  • (B)
    QQ is serviced after SS, but before TT.
  • (C)
    The head reverses its direction of movement between servicing of QQ and PP.
  • (D)
    RR is serviced before PP.

Answer (official key): B

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