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

The official GATE 2025 Computer Science & Information Technology (Set 2) 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 2025 (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
32 / 18 / 15
Marks to all
None

Not in 2027 1 question (Q 19) 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 2025 CS (Set 2) 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
Programming and Data Structures812
Computer Organization and Architecture712
Databases59
Algorithms58
Theory of Computation57
Operating System47
Digital Logic46
Computer Networks56
Compiler Design46
Linear Algebra34
Probability and Statistics24
Discrete Mathematics23
Calculus11

Free solved questions

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

Q5 · General Aptitude · MCQ · 1 mark

Bird : Nest :: Bee : _______

Select the correct option to complete the analogy.

  • (A)
    Kennel
  • (B)
    Hammock
  • (C)
    Hive
  • (D)
    Lair

Answer (official key): C

Solution

The analogy maps an animal to its dwelling. A bird lives in a nest; a bee lives in a hive. Kennel is for dogs, lair is for wild animals like bears, and hammock is not an animal dwelling. Therefore, the correct answer is (C) Hive.

Q6 · General Aptitude · MCQ · 2 marks

Based only on the conversation below, identify the logically correct inference:

"Even if I had known that you were in the hospital, I would not have gone there to see you", Ramya told Josephine.

  • (A)
    Ramya knew that Josephine was in the hospital.
  • (B)
    Ramya did not know that Josephine was in the hospital.
  • (C)
    Ramya and Josephine were once close friends; but now, they are not.
  • (D)
    Josephine was in the hospital due to an injury to her leg.

Answer (official key): B

Solution

The phrase "Even if I had known" is a counterfactual conditional. It implies that in reality Ramya did not know Josephine was in the hospital. Options (C) and (D) introduce facts not present in the statement. Therefore, the correct answer is (B).

Q35 · Computer Organization and Architecture · Numerical · 1 mark

The following two signed 2's complement numbers (multiplicand M and multiplier Q) are being multiplied using Booth''s algorithm:

M: 1100 1101 1110 1101 and Q: 1010 0100 1010 1010

The total number of addition and subtraction operations to be performed is ___________. (Answer in integer)

Answer (official key): 13

Solution

In Booth's algorithm, examine consecutive bit pairs of Q (with an appended 0 at the right). The 16-bit multiplier Q = 1010 0100 1010 1010, extended with a 0: bits (from LSB, pairs): 10,01,01,00,10,00,01,00,01,00,10,10,00,10,01,11 — wait, let us re-examine by scanning transitions. Q = 1010 0100 1010 1010. Appending 0: Q Q_{-1} pairs from LSB: (0,0)→no op, (1,0)→sub, (0,1)→add, (1,0)→sub, (0,1)→add, (0,0)→no op, (1,0)→sub, (0,1)→add, (0,0)→no op, (0,0)→no op, (1,0)→sub, (0,1)→add, (0,0)→no op, (1,0)→sub, (0,1)→add, (1,1)→no op. Counting operations: sub+add+sub+add+sub+add+add+sub+add+sub+add = 13 operations. The correct answer is 13.

Q38 · Digital Logic · MSQ · 2 marks

Given the following Karnaugh Map for a Boolean function F(w,x,y,z)F(w, x, y, z):

wx \backslash yz & 00 & 01 & 11 & 10 \\\hline 00 & 1 & 0 & 0 & 1 \\ 01 & 0 & 1 & 1 & 0 \\ 11 & 0 & 1 & 1 & 0 \\ 10 & 1 & 0 & 0 & 1 \end{array}$$ Which one or more of the following Boolean expression(s) represent(s) $F$?
  • (A)
    wˉxˉyˉzˉ+wxˉyˉzˉ+wˉxˉyzˉ+wxˉyzˉ+xz\bar{w}\bar{x}\bar{y}\bar{z} + w\bar{x}\bar{y}\bar{z} + \bar{w}\bar{x}y\bar{z} + w\bar{x}y\bar{z} + xz
  • (B)
    wˉxˉyˉzˉ+wˉxˉyzˉ+wxˉyz+xz\bar{w}\bar{x}\bar{y}\bar{z} + \bar{w}\bar{x}y\bar{z} + w\bar{x}yz + xz
  • (C)
    wˉxˉyˉzˉ+wxˉyˉzˉ+wxˉyˉz+xz\bar{w}\bar{x}\bar{y}\bar{z} + w\bar{x}\bar{y}\bar{z} + w\bar{x}\bar{y}z + xz
  • (D)
    xˉzˉ+xz\bar{x}\bar{z} + xz

Answer (official key): A, D

Solution

The K-map shows F=1 at minterms: 0(0000),2(0010),5(0101),7(0111),9(1001),11(1011),13(1101),15(1111). The simplified form is F=xˉzˉ+xzF = \bar{x}\bar{z} + xz: when x=0,z=0x=0,z=0 or x=1,z=1x=1,z=1. Verifying: (D) xˉzˉ+xz\bar{x}\bar{z}+xz covers exactly those minterms. Option (A) expands to the same function (the xˉzˉ\bar{x}\bar{z} minterms broken into four terms plus xzxz). Options (B) and (C) include minterms not in FF. The correct answers are (A) and (D).

Q59 · Algorithms · Numerical · 2 marks

Consider the following algorithm someAlgo that takes an undirected graph GG as input.

someAlgo(G)
  1. Let v be any vertex in G. Run BFS on G starting at v.
     Let u be a vertex in G at maximum distance from v as given by the BFS.
  2. Run BFS on G again with u as the starting vertex.
     Let z be the vertex at maximum distance from u as given by the BFS.
  3. Output the distance between u and z in G.

The output of someAlgo(T) for the tree shown in the given figure is ___________. (Answer in integer)

Tree for Q59

Answer (official key): 6

Solution

The algorithm someAlgo computes the diameter of a tree (the length of the longest path). This is a well-known two-BFS diameter algorithm for trees. Based on the official answer key and the tree figure, the diameter is 6.

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

Take GATE 2025 CS (Set 2) as a test

Official answer key

GATE 2025 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 2025 CS (Set 2) answer key (PDF)
QTopicTypeMarksAnswer
1Quantitative AptitudeMCQ1B
2Verbal AptitudeMCQ1C
3Spatial AptitudeMCQ1A
4Quantitative AptitudeMCQ1A
5Verbal AptitudeMCQ1C
6Verbal AptitudeMCQ2B
7Quantitative AptitudeMCQ2A
8Quantitative AptitudeMCQ2D
9Verbal AptitudeMCQ2B
10Quantitative AptitudeMCQ2C
11Digital LogicMSQ1A, B, C
12CalculusMCQ1A
13Theory of ComputationMCQ1D
14Programming and Data StructuresMCQ1D
15Computer NetworksMCQ1D
16Computer NetworksMCQ1D
17Programming and Data StructuresNumerical121
18DatabasesMSQ1B, C
19Computer NetworksNot in GATE 2027 syllabus: ARP, DHCP and ICMPMCQ1B
20Digital LogicNumerical1250
21Programming and Data StructuresNumerical14
22Compiler DesignMCQ1C
23Computer NetworksMCQ1A
24Theory of ComputationMSQ1B, C
25AlgorithmsMSQ1B, C, D
26Computer Organization and ArchitectureMSQ1D
27Operating SystemMCQ1D
28Theory of ComputationMCQ1A
29Linear AlgebraMCQ1A
30Linear AlgebraMCQ1C
31Compiler DesignMCQ1C
32Discrete MathematicsMCQ1A
33Programming and Data StructuresMCQ1B
34AlgorithmsMCQ1A
35Computer Organization and ArchitectureNumerical113
36Probability and StatisticsNumerical20.5
37Computer Organization and ArchitectureMCQ2A
38Digital LogicMSQ2A, D
39Computer Organization and ArchitectureNumerical2260.2 to 261.2
40Computer Organization and ArchitectureNumerical23
41Programming and Data StructuresNumerical246
42Computer NetworksMCQ2A
43Compiler DesignMCQ2C
44Discrete MathematicsMSQ2B, C
45Operating SystemMSQ2C, D
46Probability and StatisticsNumerical20.7 to 0.8
47Theory of ComputationNumerical26
48Operating SystemMSQ2D
49Operating SystemNumerical211
50Theory of ComputationMSQ2A, C
51DatabasesMSQ2B
52Programming and Data StructuresNumerical2111
53DatabasesNumerical233
54Digital LogicMSQ2B, C, D
55DatabasesMSQ2A, C, D
56AlgorithmsMCQ2C
57AlgorithmsMCQ2D
58Programming and Data StructuresMCQ2A
59AlgorithmsNumerical26
60Programming and Data StructuresMSQ2A
61Linear AlgebraMSQ2A, B, C
62Computer Organization and ArchitectureMSQ2A, B, C
63Compiler DesignMSQ2C, D
64Computer Organization and ArchitectureNumerical24
65DatabasesMSQ2C, D

Questions about GATE 2025 CS (Set 2)

How many questions are in the GATE 2025 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 32 MCQs, 18 MSQs, 15 numerical answer (NAT) questions. The paper lasted 3 hours.

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

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

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

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

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

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

More GATE papers