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

The official GATE 2021 Computer Science & Information Technology (Set 1) 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

Not in 2027 1 question (Q 13) is on topics removed from the GATE 2027 syllabus. They are marked in the answer key below. What changed for CS

Where the marks were

GATE 2021 CS (Set 1) topic-wise marks

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

TopicQuestionsMarks
Algorithms710
Databases610
Discrete Mathematics69
Theory of Computation58
Compiler Design58
Computer Networks47
Digital Logic47
Programming and Data Structures46
Operating System56
Computer Organization and Architecture46
Probability and Statistics35
Linear Algebra12
Calculus11

Free solved questions

5 solved questions from GATE 2021 CS (Set 1)

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.

Q7 · General Aptitude · MCQ · 2 marks

We have 2 rectangular sheets of paper, M and N, of dimensions 6 cm × 1 cm each. Sheet M is rolled to form an open cylinder by bringing the short edges of the sheet together. Sheet N is cut into equal square patches and assembled to form the largest possible closed cube. Assuming the ends of the cylinder are closed, the ratio of the volume of the cylinder to that of the cube is __________

  • (A)
    π2\frac{\pi}{2}
  • (B)
    3π\frac{3}{\pi}
  • (C)
    9π\frac{9}{\pi}
  • (D)
    3π3\pi

Answer (official key): C

Solution

Bringing the short edges together means the cylinder has:

  • circumference = 6 cm
  • height = 1 cm

So

2πr=6⇒r=3π.2\pi r = 6 \Rightarrow r = \frac{3}{\pi}.

Hence cylinder volume is

Vc=πr2h=π(3π)2(1)=9π.V_c = \pi r^2 h = \pi\left(\frac{3}{\pi}\right)^2(1)=\frac{9}{\pi}.

For the cube, the largest possible square patches from a 6 cm × 1 cm strip have side 1 cm, giving 6 faces of a cube of side 1 cm. So cube volume is

Vcube=1.V_{cube}=1.

Therefore,

VcVcube=9π.\frac{V_c}{V_{cube}}=\frac{9}{\pi}.

So the correct answer is Option C.

Q8 · General Aptitude · MCQ · 2 marks

Some people suggest anti-obesity measures (AOM) such as displaying calorie information in restaurant menus. Such measures sidestep addressing the core problems that cause obesity: poverty and income inequality.

Which one of the following statements summarizes the passage?

  • (A)
    The proposed AOM addresses the core problems that cause obesity.
  • (B)
    If obesity reduces, poverty will naturally reduce, since obesity causes poverty.
  • (C)
    AOM are addressing the core problems and are likely to succeed.
  • (D)
    AOM are addressing the problem superficially.

Answer (official key): D

Solution

The passage says these anti-obesity measures do not address the core causes of obesity, and instead only sidestep them. So the best summary is that they are addressing the problem superficially.

Therefore, the correct answer is Option D.

Q21 · Operating System · MSQ · 1 mark

Which of the following standard C library functions will always invoke a system call when executed from a single-threaded process in a UNIX/Linux operating system?

  • (A)
    exit
  • (B)
    malloc
  • (C)
    sleep
  • (D)
    strlen

Answer (official key): A, C

Solution

exit ultimately terminates the process using a kernel service, so it invokes a system call. sleep also requires kernel involvement to suspend and later wake the process. malloc may or may not invoke a system call depending on allocator state, and strlen is purely a user-space memory scan.

Therefore, the correct answers are A and C.

Q26 · Algorithms · Numerical · 1 mark

Consider the following undirected graph with edge weights as shown:

Weighted graph for Q17

The number of minimum-weight spanning trees of the graph is __________.

Answer (official key): 3

Solution

To form a minimum-weight spanning tree, prefer edges of weight 0.1 first.

The 0.1-weight edges connect the vertices into two connected components:

  • the top-row component
  • the remaining six-vertex component

All 0.1-weight edges needed inside these components are forced for minimum weight. To obtain a spanning tree of the full graph, we must connect these two components using exactly one edge of weight 0.9.

There are exactly 3 possible 0.9-weight edges that can connect these two components without increasing the weight beyond the minimum.

Hence, the number of minimum-weight spanning trees is

3.3.

Therefore, the answer is 3.

Q27 · Operating System · Numerical · 1 mark

Three processes arrive at time zero with CPU bursts of 16, 20 and 10 milliseconds. If the scheduler has prior knowledge about the length of the CPU bursts, the minimum achievable average waiting time for these three processes in a non-preemptive scheduler (rounded to nearest integer) is __________ milliseconds.

Answer (official key): 12

Solution

To minimize average waiting time in a non-preemptive scheduler with known burst times, use Shortest Job First (SJF).

Execution order:

  • 10 ms
  • 16 ms
  • 20 ms

Waiting times:

  • first process: 0
  • second process: 10
  • third process: 10 + 16 = 26

Average waiting time:

0+10+263=363=12.\frac{0 + 10 + 26}{3} = \frac{36}{3} = 12.

Therefore, the answer is 12 milliseconds.

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

Take GATE 2021 CS (Set 1) as a test

Official answer key

GATE 2021 CS (Set 1) 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 1) answer key (PDF)
QTopicTypeMarksAnswer
1Quantitative AptitudeMCQ1C
2Verbal AptitudeMCQ1C
3Spatial AptitudeMCQ1A
4Verbal AptitudeMCQ1C
5Spatial AptitudeMCQ1A
6Quantitative AptitudeMCQ2C
7Quantitative AptitudeMCQ2C
8Verbal AptitudeMCQ2D
9Quantitative AptitudeMCQ2C
10Analytical AptitudeMCQ2C
11Programming and Data StructuresMCQ1D
12AlgorithmsMCQ1C
13Computer NetworksNot in GATE 2027 syllabus: ARP, DHCP and ICMPMCQ1C
14Discrete MathematicsMCQ1B
15AlgorithmsMCQ1D
16Theory of ComputationMCQ1C
17Digital LogicMCQ1A
18Compiler DesignMCQ1C
19AlgorithmsMCQ1C
20Compiler DesignMCQ1C
21Operating SystemMSQ1A, C
22Theory of ComputationMSQ1D
23Operating SystemMSQ1A, C
24Operating SystemMSQ1A, C
25DatabasesMSQ1A
26AlgorithmsNumerical13
27Operating SystemNumerical112
28Probability and StatisticsNumerical10.35 to 0.39
29Discrete MathematicsNumerical165
30Programming and Data StructuresNumerical186
31Discrete MathematicsNumerical111
32Computer Organization and ArchitectureNumerical1-7.75
33Computer Organization and ArchitectureNumerical117
34CalculusNumerical10.25
35DatabasesNumerical1205
36Compiler DesignMCQ2A
37DatabasesMCQ2C
38AlgorithmsMCQ2C
39Compiler DesignMCQ2B
40Theory of ComputationMCQ2A
41DatabasesMCQ2A
42Programming and Data StructuresMCQ2B
43Discrete MathematicsMCQ2B
44Theory of ComputationMCQ2D
45Probability and StatisticsMCQ2D
46Discrete MathematicsMCQ2A
47DatabasesMCQ2B
48Digital LogicMCQ2A
49Digital LogicMCQ2A
50AlgorithmsMSQ2B
51Digital LogicMSQ2B, C, D
52Computer NetworksMSQ2A, B, C
53Computer NetworksMSQ2A, C
54DatabasesMSQ2C
55Discrete MathematicsMSQ2C
56Operating SystemMSQ2A, B, D
57AlgorithmsMSQ2A, C
58Computer NetworksNumerical250 to 52
59Computer Organization and ArchitectureNumerical217160
60Probability and StatisticsNumerical20.04
61Linear AlgebraNumerical23
62Programming and Data StructuresNumerical21023
63Compiler DesignNumerical26
64Theory of ComputationNumerical250
65Computer Organization and ArchitectureNumerical250

Questions about GATE 2021 CS (Set 1)

How many questions are in the GATE 2021 CS (Set 1) 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 1)?

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

Outside General Aptitude, the biggest topics were Algorithms (10 marks), Databases (10 marks), Discrete Mathematics (9 marks). The full topic-wise split is in the table on this page.

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

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

Where does this GATE 2021 CS (Set 1) 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