GATE 2020 CS question paper PDF and answer key

The official GATE 2020 Computer Science & Information Technology paper, organised by IIT Delhi: 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 Delhi for GATE 2020 (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
42 / 0 / 23
Marks to all
None

Where the marks were

GATE 2020 CS topic-wise marks

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

TopicQuestionsMarks
Computer Organization and Architecture812
Programming and Data Structures812
Operating System610
Theory of Computation69
Databases58
Discrete Mathematics58
Algorithms58
Computer Networks46
Compiler Design34
Digital Logic23
Probability and Statistics12
Linear Algebra12
Calculus11

Free solved questions

5 solved questions from GATE 2020 CS

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.

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

Solution

Compare total travel cost including edge costs and toll booth costs.

For route 1-f-b-2:

  • edge costs: 1→f=1001 \to f = 100, f→b=0f \to b = 0, b→2=200b \to 2 = 200
  • tolls: f=100f = 100, b=100b = 100

Total cost:

100+0+200+100+100=500.100+0+200+100+100 = 500.

The other listed routes have higher total cost.

Therefore, the cheapest route is 1-f-b-2, i.e. Option B.

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

Solution

The letters follow alternating positions:

P=31=3P = 3^1 = 3 R=33=27R = 3^3 = 27 T=35=243T = 3^5 = 243

So,

Q=32=9Q = 3^2 = 9

and

S=34=81.S = 3^4 = 81.

Therefore,

Q+S=9+81=90.Q+S = 9+81 = 90.

So the correct answer is Option C.

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

Solution

The instruction must first be fetched:

  1. PCout,MARin,MEMreadPC_{out}, MAR_{in}, MEM_{read}
  2. MDRout,IRinMDR_{out}, IR_{in}

Then operand R1R1 is loaded into TEMP1TEMP1:

  1. R1out,TEMP1inR1_{out}, TEMP1_{in}

Then R2R2 is sent through the ALU with TEMP1TEMP1 to compute the sum into TEMP2TEMP2:

  1. R2out,TEMP1in,ALUadd,TEMP2inR2_{out}, TEMP1_{in}, ALU_{add}, TEMP2_{in}

Finally, the result is written to R0R0:

  1. TEMP2out,R0inTEMP2_{out}, R0_{in}

So the correct order is 3, 5, 2, 1, 4.

Therefore, the correct answer is Option C.

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

Solution

Each internal node can store pp pointers and p−1p-1 keys:

8p+12(p−1)≤40968p + 12(p-1) \le 4096 20p≤410820p \le 4108

so

p=205.p=205.

Each leaf entry contains a search key and a record pointer:

12+8=20 bytes.12+8=20\text{ bytes}.

So leaf capacity is:

⌊409620⌋=204.\left\lfloor \frac{4096}{20} \right\rfloor = 204.

For one million records, the number of leaf blocks is approximately:

⌈1000000204⌉=4902.\left\lceil \frac{1000000}{204} \right\rceil = 4902.

The next internal level needs:

⌈4902205⌉=24\left\lceil \frac{4902}{205} \right\rceil = 24

nodes.

A root node can point to these 24 nodes. Therefore, the path is:

root→internal node→leaf node→record block.\text{root} \to \text{internal node} \to \text{leaf node} \to \text{record block}.

Since no B+ tree node or record is initially in memory, this requires 4 disk accesses.

Therefore, the answer is 4.

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

Solution

The function tob(b, arr) stores the binary representation of bb in reverse order.

For b=4b=4:

4=1002.4 = 100_2.

So the array bits processed correspond to exponent 4.

The function pp(a,b) performs binary exponentiation and computes:

ab.a^b.

Therefore:

pp(3,4)=34=81.pp(3,4)=3^4=81.

So the answer is 81.

The other 60 questions are solved in your report when you take GATE 2020 CS as a 3-hour test.

Take GATE 2020 CS as a test

Official answer key

GATE 2020 CS answer key

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

Download the official GATE 2020 CS answer key (PDF)
QTopicTypeMarksAnswer
1Verbal AptitudeMCQ1A
2Analytical AptitudeMCQ1B
3Verbal AptitudeMCQ1D
4Verbal AptitudeMCQ1A
5Verbal AptitudeMCQ1D
6Quantitative AptitudeMCQ2B
7Quantitative AptitudeMCQ2A
8Verbal AptitudeMCQ2D
9Quantitative AptitudeMCQ2C
10Quantitative AptitudeMCQ2C
11Computer Organization and ArchitectureNumerical15
12Programming and Data StructuresMCQ1C
13Computer NetworksNumerical16
14Computer NetworksMCQ1D
15Digital LogicNumerical11034
16Compiler DesignNumerical17
17DatabasesMCQ1A
18Theory of ComputationMCQ1C
19Discrete MathematicsNumerical17
20DatabasesMCQ1A
21AlgorithmsMCQ1A
22Computer Organization and ArchitectureMCQ1C
23Programming and Data StructuresMCQ1B
24Programming and Data StructuresMCQ1C
25Operating SystemMCQ1C
26AlgorithmsNumerical113
27Computer Organization and ArchitectureMCQ1C
28Operating SystemMCQ1C
29Programming and Data StructuresNumerical119
30Theory of ComputationMCQ1D
31CalculusMCQ1A
32Discrete MathematicsNumerical10.125
33Compiler DesignMCQ1D
34Computer Organization and ArchitectureNumerical113.3 to 13.5
35Theory of ComputationMCQ1A
36Theory of ComputationMCQ2A
37AlgorithmsNumerical299
38Compiler DesignMCQ2B
39AlgorithmsMCQ2D
40Computer Organization and ArchitectureMCQ2B
41Probability and StatisticsNumerical20.5
42Discrete MathematicsMCQ2C
43Computer NetworksNumerical244
44Computer NetworksMCQ2B
45Programming and Data StructuresMCQ2B
46Computer Organization and ArchitectureNumerical214
47Discrete MathematicsNumerical212
48AlgorithmsMCQ2A
49Programming and Data StructuresNumerical2511
50Operating SystemNumerical25.25
51Operating SystemMCQ2A
52Digital LogicMCQ2B
53Theory of ComputationMCQ2A
54Linear AlgebraMCQ2C
55Programming and Data StructuresNumerical255
56Discrete MathematicsNumerical27
57Operating SystemNumerical2154.5 to 155.5
58Theory of ComputationNumerical26
59DatabasesMCQ2A
60DatabasesMCQ2A
61Computer Organization and ArchitectureNumerical22.15 to 2.18
62Computer Organization and ArchitectureMCQ2B
63DatabasesNumerical24
64Programming and Data StructuresNumerical281
65Operating SystemMCQ2B

Questions about GATE 2020 CS

How many questions are in the GATE 2020 CS 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 42 MCQs, 23 numerical answer (NAT) questions. The paper lasted 3 hours.

Is there negative marking in GATE 2020 CS?

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 2020 CS?

Outside General Aptitude, the biggest topics were Computer Organization and Architecture (12 marks), Programming and Data Structures (12 marks), Operating System (10 marks). The full topic-wise split is in the table on this page.

Were any GATE 2020 CS questions awarded marks to all?

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

Where does this GATE 2020 CS answer key come from?

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

More GATE papers