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

The official GATE 2017 Computer Science & Information Technology (Set 1) paper, organised by IIT Roorkee: 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 Roorkee for GATE 2017. Spotted a mistake? Email team@lemyte.com.

General Aptitude
10 · 15 marks
Computer Science & Information Technology
55 · 85 marks
MCQ / MSQ / NAT
45 / 0 / 20
Marks to all
None

Where the marks were

GATE 2017 CS (Set 1) topic-wise marks

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

TopicQuestionsMarks
Computer Organization and Architecture812
Programming and Data Structures711
Theory of Computation610
Databases58
Computer Networks58
Discrete Mathematics57
Algorithms46
Compiler Design46
Operating System46
Linear Algebra35
Digital Logic23
Calculus12
Probability and Statistics11

Free solved questions

5 solved questions from GATE 2017 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.

Q6 · General Aptitude · MCQ · 2 marks

The expression

x+y−∣x−y∣2\frac{x+y-|x-y|}{2}

is equal to:

  • (A)
    the maximum of xx and yy
  • (B)
    the minimum of xx and yy
  • (C)
    1
  • (D)
    none of the above

Answer (official key): B

Solution

If x≥yx \ge y, then:

∣x−y∣=x−y.|x-y|=x-y.

So,

x+y−∣x−y∣2=x+y−(x−y)2=2y2=y.\frac{x+y-|x-y|}{2} = \frac{x+y-(x-y)}{2} = \frac{2y}{2} = y.

Here, yy is the minimum.

If y≥xy \ge x, then:

∣x−y∣=y−x.|x-y|=y-x.

So,

x+y−∣x−y∣2=x+y−(y−x)2=2x2=x.\frac{x+y-|x-y|}{2} = \frac{x+y-(y-x)}{2} = \frac{2x}{2} = x.

Here, xx is the minimum.

Therefore, the expression is equal to the minimum of xx and yy.

The correct answer is Option B.

Q7 · General Aptitude · MCQ · 2 marks

Six people are seated around a circular table. There are at least two men and two women. There are at least three right-handed persons. Every woman has a left-handed person to her immediate right. None of the women are right-handed. The number of women at the table is:

  • (A)
    2
  • (B)
    3
  • (C)
    4
  • (D)
    Cannot be determined

Answer (official key): A

Solution

None of the women are right-handed, so all women are left-handed.

There are at least three right-handed persons among six people. Hence, there can be at most three left-handed persons.

So the number of women is at most 3.

Now suppose there are 3 women. Since every woman has a left-handed person immediately to her right, and all left-handed persons would then be women, each woman must have another woman immediately to her right. Around a circular table, this would force all six people to be women, contradicting the condition that there are at least two men.

Therefore, the number of women cannot be 3. Since there are at least two women, the number of women is exactly:

2.2.

Therefore, the correct answer is Option A.

Q18 · Digital Logic · Numerical · 1 mark

Consider the Karnaugh map given below, where x represents “don't care” and blank represents 0.

Karnaugh map for Q21

Assume for all inputs (a,b,c,d)(a,b,c,d), the respective complements (a‾,b‾,c‾,d‾)(\overline{a},\overline{b},\overline{c},\overline{d}) are also available. The above logic is implemented using 2-input NOR gates only.

The minimum number of gates required is __________.

Answer (official key): 1

Solution

Using the don't-care cells, the Karnaugh map can be grouped as one 4-cell group.

The simplified function is:

F=a‾c.F=\overline{a}c.

Since complements of inputs are also available, this can be implemented using a single 2-input NOR gate as:

F=a‾c=a+c‾‾.F = \overline{a}c = \overline{a+\overline{c}}.

So only one 2-input NOR gate is required.

Therefore, the answer is 1.

Q61 · Programming and Data Structures · Numerical · 2 marks

The output of executing the following C program is __________.

#include <stdio.h>

int total(int v) {
    static int count = 0;
    while (v) {
        count += v & 1;
        v >>= 1;
    }
    return count;
}

void main() {
    static int x = 0;
    int i = 5;
    for (; i > 0; i--) {
        x = x + total(i);
    }
    printf("%d\n", x);
}

Answer (official key): 23

Solution

The function total(v) counts the number of set bits in v, but count is declared as static, so it retains its value across calls.

Compute each call:

CallBinarySet bits addedReturned cumulative count
total(5)10122
total(4)10013
total(3)01125
total(2)01016
total(1)00117

Now x accumulates these returned values:

x=2+3+5+6+7=23.x=2+3+5+6+7=23.

Therefore, the output is 23.

Q62 · Computer Organization and Architecture · Numerical · 2 marks

A cache memory unit with capacity of NN words and block size of BB words is to be designed.

If it is designed as a direct-mapped cache, the length of the TAG field is 10 bits.

If the cache unit is now designed as a 16-way set-associative cache, the length of the TAG field is __________ bits.

Answer (official key): 14

Solution

For the same cache capacity and block size, changing from direct-mapped to 16-way set-associative reduces the number of index bits by:

log⁡216=4.\log_2 16 = 4.

Those 4 bits move from the index field into the tag field.

Given direct-mapped tag length:

10 bits.10\text{ bits}.

Therefore, 16-way set-associative tag length is:

10+4=14 bits.10+4=14\text{ bits}.

Therefore, the answer is 14.

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

Take GATE 2017 CS (Set 1) as a test

Official answer key

GATE 2017 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 2017 CS (Set 1) answer key (PDF)
QTopicTypeMarksAnswer
1Verbal AptitudeMCQ1D
2Quantitative AptitudeMCQ1D
3Analytical AptitudeMCQ1C
4Verbal AptitudeMCQ1C
5Quantitative AptitudeMCQ1C
6Quantitative AptitudeMCQ2B
7Analytical AptitudeMCQ2A
8Verbal AptitudeMCQ2B
9Quantitative AptitudeMCQ2D
10Spatial AptitudeMCQ2C
11DatabasesMCQ1A
12Theory of ComputationMCQ1B
13Computer Organization and ArchitectureMCQ1D
14AlgorithmsMCQ1B
15AlgorithmsMCQ1C
16Probability and StatisticsNumerical10
17Compiler DesignMCQ1B
18Digital LogicNumerical11
19DatabasesNumerical12.6
20Discrete MathematicsNumerical118
21Discrete MathematicsMCQ1D
22Computer NetworksMCQ1B
23Operating SystemMCQ1D
24Theory of ComputationNumerical14
25Computer Organization and ArchitectureMCQ1D
26Computer Organization and ArchitectureMCQ1C
27Linear AlgebraMCQ1C
28Programming and Data StructuresMCQ1B
29Programming and Data StructuresMCQ1D
30Discrete MathematicsMCQ1B
31Operating SystemNumerical13
32Compiler DesignMCQ1C
33Programming and Data StructuresMCQ1B
34Computer Organization and ArchitectureNumerical10.05
35Computer NetworksMCQ1D
36Theory of ComputationMCQ2B
37CalculusMCQ2C
38Computer NetworksMCQ2C
39Linear AlgebraMCQ2A
40Programming and Data StructuresMCQ2C
41DatabasesMCQ2D
42Operating SystemMCQ2D
43Discrete MathematicsMCQ2D
44Theory of ComputationMCQ2D
45DatabasesMCQ2A
46Programming and Data StructuresMCQ2A
47Digital LogicMCQ2B
48Operating SystemMCQ2B
49Theory of ComputationMCQ2A
50Linear AlgebraMCQ2B
51Theory of ComputationMCQ2A
52AlgorithmsMCQ2A
53DatabasesNumerical24
54Compiler DesignNumerical21024
55Computer NetworksNumerical211
56Programming and Data StructuresNumerical23
57Computer Organization and ArchitectureNumerical21.49 to 1.52
58Computer Organization and ArchitectureNumerical2-16
59Computer NetworksNumerical286.5 to 89.5
60Discrete MathematicsNumerical2271
61Programming and Data StructuresNumerical223
62Computer Organization and ArchitectureNumerical214
63AlgorithmsNumerical25
64Compiler DesignNumerical22
65Computer Organization and ArchitectureNumerical276

Questions about GATE 2017 CS (Set 1)

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

Is there negative marking in GATE 2017 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 2017 CS (Set 1)?

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

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

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

Where does this GATE 2017 CS (Set 1) answer key come from?

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

More GATE papers