GATE 2021 CS (Set 2) question paper PDF and answer key

The official GATE 2021 Computer Science & Information Technology (Set 2) paper, organised by IIT Bombay: 65 questions for 100 marks in 3 hours. Download the official question paper and answer key as PDFs. Below is how the marks were split by topic, the complete official answer key and 5 questions solved step by step.

Source: the official paper and answer key published by IIT Bombay for GATE 2021 (official GATE site). Spotted a mistake? Email team@lemyte.com.

General Aptitude
10 · 15 marks
Computer Science & Information Technology
55 · 85 marks
MCQ / MSQ / NAT
34 / 13 / 18
Marks to all
None

Where the marks were

GATE 2021 CS (Set 2) topic-wise marks

Computer Science & Information Technology questions only; General Aptitude adds 15 marks on top. The top three topics carried 28 of the 85 subject marks.

TopicQuestionsMarks
Algorithms610
Theory of Computation69
Computer Organization and Architecture69
Programming and Data Structures68
Compiler Design58
Databases58
Computer Networks47
Operating System47
Digital Logic46
Probability and Statistics35
Discrete Mathematics34
Linear Algebra23
Calculus11

Free solved questions

5 solved questions from GATE 2021 CS (Set 2)

Question text and figures as in the official paper, the answer from the official key, and a worked solution. The other 60 solutions are in your report after you take the paper.

Q3 · General Aptitude · MCQ · 1 mark

If

(x−12)2−(x−32)2=x+2,\left(x-\frac{1}{2}\right)^2 - \left(x-\frac{3}{2}\right)^2 = x+2,

then the value of xx is:

  • (A)
    2
  • (B)
    4
  • (C)
    6
  • (D)
    8

Answer (official key): B

Solution

Use the identity a2−b2=(a−b)(a+b)a^2-b^2=(a-b)(a+b).

Here,

a=x−12,b=x−32.a=x-\frac12,\qquad b=x-\frac32.

So,

a−b=1a-b=1

and

a+b=2x−2.a+b=2x-2.

Therefore,

(x−12)2−(x−32)2=2x−2.\left(x-\frac12\right)^2-\left(x-\frac32\right)^2 = 2x-2.

Given

2x−2=x+2,2x-2=x+2,

we get

x=4.x=4.

Therefore, the correct answer is Option B.

Q4 · General Aptitude · MCQ · 1 mark

If θ\theta is the angle, in degrees, between the longest diagonal of the cube and any one of the edges of the cube, then cos⁡θ=\cos\theta =

  • (A)
    12\dfrac{1}{2}
  • (B)
    13\dfrac{1}{\sqrt{3}}
  • (C)
    12\dfrac{1}{\sqrt{2}}
  • (D)
    32\dfrac{\sqrt{3}}{2}

Answer (official key): B

Solution

Take a cube of side length aa. An edge vector can be represented as

(a,0,0)(a,0,0)

and the body diagonal vector as

(a,a,a).(a,a,a).

Then

cos⁡θ=(a,0,0)⋅(a,a,a)∥(a,0,0)∥∥(a,a,a)∥=a2a⋅a3=13.\cos\theta = \frac{(a,0,0)\cdot(a,a,a)} {\|(a,0,0)\|\|(a,a,a)\|} = \frac{a^2}{a\cdot a\sqrt{3}} = \frac{1}{\sqrt{3}}.

Therefore, the correct answer is Option B.

Q20 · Digital Logic · MCQ · 1 mark

Which one of the following circuits implements the Boolean function given below?

f(x,y,z)=m0+m1+m3+m4+m5+m6,f(x,y,z)=m_0+m_1+m_3+m_4+m_5+m_6,

where mim_i is the ithi^{\text{th}} minterm.

  • (A)
    GATE 2021 CS (Set 2) question 20 (Digital Logic), option A
  • (B)
    GATE 2021 CS (Set 2) question 20 (Digital Logic), option B
  • (C)
    GATE 2021 CS (Set 2) question 20 (Digital Logic), option C
  • (D)
    GATE 2021 CS (Set 2) question 20 (Digital Logic), option D

Answer (official key): A

Solution

Use y,zy,z as the select lines of the 4×1 multiplexer.

For each yzyz combination:

  • yz=00yz=00: minterms m0,m4m_0,m_4 are both included, so I0=1I_0=1.
  • yz=01yz=01: minterms m1,m5m_1,m_5 are both included, so I1=1I_1=1.
  • yz=10yz=10: minterm m6m_6 is included but m2m_2 is not, so I2=xI_2=x.
  • yz=11yz=11: minterm m3m_3 is included but m7m_7 is not, so I3=x‾I_3=\overline{x}.

The circuit matching this assignment is Option A.

Therefore, the correct answer is Option A.

Q21 · Theory of Computation · MSQ · 1 mark

Let L1L_1 be a regular language and L2L_2 be a context-free language. Which of the following languages is/are context-free?

  • (A)
    L1∩L2‾L_1 \cap \overline{L_2}
  • (B)
    L1‾∪L2‾‾\overline{\overline{L_1} \cup \overline{L_2}}
  • (C)
    L1∪(L2∪L2‾)L_1 \cup (L_2 \cup \overline{L_2})
  • (D)
    (L1∩L2)∪(L1‾∩L2)(L_1 \cap L_2) \cup (\overline{L_1} \cap L_2)

Answer (official key): B, C, D

Solution

Since L1L_1 is regular, L1‾\overline{L_1} is also regular.

For option B:

L1‾∪L2‾‾=L1∩L2\overline{\overline{L_1} \cup \overline{L_2}} = L_1 \cap L_2

by De Morgan's law. The intersection of a regular language and a context-free language is context-free. So B is context-free.

For option C:

L2∪L2‾=Σ∗L_2 \cup \overline{L_2} = \Sigma^*

so the expression becomes

L1∪Σ∗=Σ∗,L_1 \cup \Sigma^* = \Sigma^*,

which is regular, hence context-free. So C is context-free.

For option D:

(L1∩L2)∪(L1‾∩L2)=(L1∪L1‾)∩L2=Σ∗∩L2=L2.(L_1 \cap L_2) \cup (\overline{L_1} \cap L_2) = (L_1 \cup \overline{L_1}) \cap L_2 = \Sigma^* \cap L_2 = L_2.

So D is context-free.

Option A is not necessarily context-free because context-free languages are not closed under complement in general.

Therefore, the correct answers are B, C, and D.

Q26 · Computer Organization and Architecture · Numerical · 1 mark

Consider a computer system with DMA support. The DMA module is transferring one 8-bit character in one CPU cycle from a device to memory through cycle stealing at regular intervals. Consider a 2 MHz processor.

If 0.5% processor cycles are used for DMA, the data transfer rate of the device is __________ bits per second.

Answer (official key): 80000

Solution

The processor frequency is

2 MHz=2×1062\text{ MHz}=2\times 10^6

cycles per second.

DMA uses 0.5% of processor cycles:

0.005×2×106=100000.005 \times 2\times 10^6 = 10000

cycles per second.

Each DMA cycle transfers one 8-bit character, so the data transfer rate is

10000×8=8000010000 \times 8 = 80000

bits per second.

Therefore, the answer is 80000.

The other 60 questions are solved in your report when you take GATE 2021 CS (Set 2) as a 3-hour test.

Take GATE 2021 CS (Set 2) as a test

Official answer key

GATE 2021 CS (Set 2) answer key

All 65 answers from the official key. Numerical answers are ranges; “or” means the key accepts either answer.

Download the official GATE 2021 CS (Set 2) answer key (PDF)
QTopicTypeMarksAnswer
1Verbal AptitudeMCQ1A
2Spatial AptitudeMCQ1B
3Quantitative AptitudeMCQ1B
4Spatial AptitudeMCQ1B
5Verbal AptitudeMCQ1C
6Spatial AptitudeMCQ2A
7Quantitative AptitudeMCQ2A
8Analytical AptitudeMCQ2C
9Quantitative AptitudeMCQ2C
10Verbal AptitudeMCQ2C
11Computer NetworksMCQ1C
12Programming and Data StructuresMCQ1C
13Programming and Data StructuresMCQ1C
14AlgorithmsMCQ1C
15Theory of ComputationMCQ1C
16AlgorithmsMCQ1B
17Compiler DesignMCQ1C
18DatabasesMCQ1D
19Computer Organization and ArchitectureMCQ1C
20Digital LogicMCQ1A
21Theory of ComputationMSQ1B, C, D
22Compiler DesignMSQ1D
23Operating SystemMSQ1A, C, D
24Discrete MathematicsMSQ1B, D
25Discrete MathematicsMSQ1B, C
26Computer Organization and ArchitectureNumerical180000
27CalculusNumerical119
28Programming and Data StructuresNumerical115
29Theory of ComputationNumerical1256
30Probability and StatisticsNumerical115 to 16
31Programming and Data StructuresNumerical11
32DatabasesNumerical1698
33Digital LogicNumerical13
34Computer Organization and ArchitectureNumerical12
35Linear AlgebraNumerical14
36AlgorithmsMCQ2C
37Probability and StatisticsMCQ2D
38Compiler DesignMCQ2D
39Compiler DesignMCQ2A
40AlgorithmsMCQ2B
41DatabasesMCQ2B
42Computer Organization and ArchitectureMCQ2A
43Programming and Data StructuresMCQ2D
44Theory of ComputationMCQ2C
45DatabasesMCQ2B
46Digital LogicMCQ2B
47Computer NetworksMCQ2C
48Probability and StatisticsMCQ2A
49Linear AlgebraMCQ2B
50Operating SystemMSQ2A, D
51DatabasesMSQ2A, C, D
52AlgorithmsMSQ2A, B
53Theory of ComputationMSQ2B, C, D
54Theory of ComputationMSQ2A, B, C
55Operating SystemMSQ2A, B, C
56Computer Organization and ArchitectureMSQ2A, D
57Computer NetworksMSQ2B, C
58AlgorithmsNumerical2929
59Programming and Data StructuresNumerical260
60Compiler DesignNumerical28
61Operating SystemNumerical24108
62Discrete MathematicsNumerical259049
63Computer NetworksNumerical2130 to 140
64Computer Organization and ArchitectureNumerical21.87 to 1.88
65Digital LogicNumerical26

Questions about GATE 2021 CS (Set 2)

How many questions are in the GATE 2021 CS (Set 2) paper?

65 questions for 100 marks: 10 General Aptitude questions worth 15 marks and 55 Computer Science & Information Technology questions worth 85 marks. By type, there were 34 MCQs, 13 MSQs, 18 numerical answer (NAT) questions. The paper lasted 3 hours.

Is there negative marking in GATE 2021 CS (Set 2)?

Yes, for MCQs only. A wrong MCQ answer costs one-third of its marks (−⅓ for a 1-mark question, −⅔ for a 2-mark question). MSQ and numerical (NAT) questions have no negative marking, and an MSQ earns marks only when every correct option is chosen.

Which topics carried the most marks in GATE 2021 CS (Set 2)?

Outside General Aptitude, the biggest topics were Algorithms (10 marks), Theory of Computation (9 marks), Computer Organization and Architecture (9 marks). The full topic-wise split is in the table on this page.

Were any GATE 2021 CS (Set 2) questions awarded marks to all?

No. Every question was graded with the answer in the official key.

Where does this GATE 2021 CS (Set 2) answer key come from?

From the official answer key published by IIT Bombay, which organised GATE 2021. Range answers for numerical questions and questions with more than one accepted answer are kept exactly as the key gives them.

More GATE papers