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

The official GATE 2026 Computer Science & Information Technology (Set 1) paper, organised by IIT Guwahati: 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 Guwahati for GATE 2026 (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
28 / 24 / 13
Marks to all
None

Not in 2027 1 question (Q 51) 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 2026 CS (Set 1) topic-wise marks

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

TopicQuestionsMarks
Programming and Data Structures711
Algorithms610
Computer Organization and Architecture69
Computer Networks58
Digital Logic58
Operating System58
Theory of Computation46
Compiler Design46
Databases46
Discrete Mathematics35
Probability and Statistics23
Calculus23
Linear Algebra22

Free solved questions

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

Q5 · General Aptitude · MCQ · 1 mark

The antonym of the word protagonist is ________.

  • (A)
    agnostic
  • (B)
    antagonist
  • (C)
    arsonist
  • (D)
    anarchist

Answer (official key): B

Solution

A protagonist is the main or leading character in a story. Its opposite is the antagonist, the character who opposes the protagonist.

So the correct answer is Option B.

Q6 · General Aptitude · MCQ · 2 marks

For positive real numbers SS and KK, the function HK(S)H_K(S) is defined as:

HK(S)=max⁡(S−K,0)H_K(S) = \max(S-K, 0)

The graph below shows the plot of a function N(S)N(S) versus SS.

Graph of N(S) versus S

N(S)N(S) can be expressed as ________.

  • (A)
    H10(S)−H20(S)H_{10}(S) - H_{20}(S)
  • (B)
    H10(S)−2H20(S)H_{10}(S) - 2H_{20}(S)
  • (C)
    −H10(S)+H20(S)-H_{10}(S) + H_{20}(S)
  • (D)
    H15(S)−H20(S)H_{15}(S) - H_{20}(S)

Answer (official key): A

Solution

From the graph:

  • For S≤10S \le 10, the value is 0
  • For 10<S<2010 < S < 20, the graph rises linearly from 0 to 10, so N(S)=S−10N(S)=S-10
  • For S≥20S \ge 20, the graph stays constant at 10

Now examine:

H10(S)−H20(S)H_{10}(S)-H_{20}(S)

Piecewise:

  • If S≤10S \le 10: H10(S)=0,H20(S)=0⇒N(S)=0H_{10}(S)=0,\quad H_{20}(S)=0 \Rightarrow N(S)=0
  • If 10<S≤2010 < S \le 20: H10(S)=S−10,H20(S)=0⇒N(S)=S−10H_{10}(S)=S-10,\quad H_{20}(S)=0 \Rightarrow N(S)=S-10
  • If S>20S > 20: H10(S)=S−10,H20(S)=S−20H_{10}(S)=S-10,\quad H_{20}(S)=S-20 so N(S)=(S−10)−(S−20)=10N(S)=(S-10)-(S-20)=10

This matches the graph exactly.

Therefore, the correct answer is Option A.

Q46 · Compiler Design · MCQ · 2 marks

Consider the control flow graph shown in the figure.

Control Flow Graph

Which one of the following options correctly lists the set of redundant expressions (common subexpressions) in the basic blocks B4 and B5?

Note: All the variables are integers.

  • (A)
    B4: {b+i}\{b+i\}, B5: {c+m}\{c+m\}
  • (B)
    B4: {g∗k}\{g*k\}, B5: {c+m}\{c+m\}
  • (C)
    B4: {g∗k, b+i}\{g*k,\ b+i\}, B5: {}\{\}
  • (D)
    B4: {g∗k}\{g*k\}, B5: {}\{\}

Answer (official key): D

Solution

From the control flow graph:

  • B1 computes a=b+ia=b+i
  • B2 computes a=g∗ka=g*k, then other assignments
  • B3 computes t=g∗kt=g*k and then assigns b=c+mb=c+m
  • B4 computes x=g∗kx=g*k and y=b+iy=b+i
  • B5 computes z=c+mz=c+m

At the entry of B4, an expression is redundant only if it is available along all incoming paths.

  • The expression g∗kg*k is computed in both B2 and B3, and neither gg nor kk is modified before reaching B4. So g∗kg*k is redundant in B4.
  • The expression b+ib+i is available from B1 along the B2 path, but along the B3 path the variable bb is redefined by b=c+mb=c+m. So b+ib+i is not available on all paths to B4.

At B5, the expression c+mc+m is not available along all paths from the entry because it is computed in B3 but not in B2, and B4 does not compute it.

So:

  • B4: {g∗k}\{g*k\}
  • B5: {}\{\}

Therefore, the correct answer is Option D.

Q54 · Computer Networks · MSQ · 2 marks

An ISP having an address block 202.16.0.0/15 assigns a block of 6000 IP addresses to a client, using the classless internet domain routing (CIDR) super-netting approach.

Which of the following address blocks can be assigned by the ISP?

  • (A)
    202.16.0.0/19
  • (B)
    202.17.64.0/19
  • (C)
    202.16.32.0/19
  • (D)
    202.17.24.0/19

Answer (official key): A, B, C

Solution

The client needs at least 6000 addresses. The smallest CIDR block that can provide this is:

213=81922^{13} = 8192

addresses, which corresponds to a /19 block.

A /19 block advances in steps of 32 in the third octet.

The ISP block 202.16.0.0/15 covers:

  • 202.16.0.0 to 202.16.255.255
  • 202.17.0.0 to 202.17.255.255

Now check alignment:

  • 202.16.0.0/19 → valid
  • 202.17.64.0/19 → valid
  • 202.16.32.0/19 → valid
  • 202.17.24.0/19 → invalid, because 24 is not a multiple of 32

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

Q56 · Programming and Data Structures · Numerical · 2 marks

Consider the recursive functions represented by the following code segment:

int bar(int n){
    if (n == 1) return 0;
    else return 1 + bar(n/2);
}

int foo(int n){
    if (n == 1) return 1;
    else return 1 + foo(bar(n));
}

The smallest positive integer nn for which foo(n) returns 5 is ________.
(answer in integer)

Note: Ignore syntax errors (if any) in the function.

Answer (official key): 65536

Solution

The function bar(n) computes:

⌊log⁡2n⌋\lfloor \log_2 n \rfloor

for positive integers nn.

Now define the smallest positive integer aka_k such that

foo(ak)=k.foo(a_k)=k.

From the definition of foo:

  • foo(1)=1foo(1)=1, so a1=1a_1 = 1
  • to get foo(n)=k+1foo(n)=k+1, we need foo(bar(n))=kfoo(bar(n)) = k so the smallest such nn is the smallest integer for which ⌊log⁡2n⌋=ak,\lfloor \log_2 n \rfloor = a_k, namely n=2ak.n = 2^{a_k}.

Therefore:

a2=2a1=2a_2 = 2^{a_1} = 2 a3=2a2=4a_3 = 2^{a_2} = 4 a4=2a3=16a_4 = 2^{a_3} = 16 a5=2a4=65536a_5 = 2^{a_4} = 65536

Therefore, the answer is 65536.

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

Take GATE 2026 CS (Set 1) as a test

Official answer key

GATE 2026 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 2026 CS (Set 1) answer key (PDF)
QTopicTypeMarksAnswer
1Quantitative AptitudeMCQ1D
2Spatial AptitudeMCQ1C
3Quantitative AptitudeMCQ1C
4Analytical AptitudeMCQ1C
5Verbal AptitudeMCQ1B
6Quantitative AptitudeMCQ2A
7Spatial AptitudeMCQ2D
8Quantitative AptitudeMCQ2C
9Verbal AptitudeMCQ2B
10Analytical AptitudeMCQ2A
11Discrete MathematicsMCQ1A
12Computer Organization and ArchitectureMCQ1B
13Computer NetworksMSQ1A, C, D
14Linear AlgebraMCQ1A
15AlgorithmsMCQ1A
16Computer NetworksMCQ1D
17Computer Organization and ArchitectureMCQ1B
18Computer Organization and ArchitectureMCQ1D
19Probability and StatisticsMCQ1B
20Linear AlgebraMSQ1B, D
21Theory of ComputationMSQ1B, D
22AlgorithmsMSQ1C
23Compiler DesignMSQ1C
24Digital LogicMSQ1A, C
25DatabasesMSQ1C, D
26Operating SystemMSQ1A, C
27Compiler DesignMSQ1C
28Digital LogicMSQ1B, C
29Theory of ComputationMSQ1A, B, C
30Programming and Data StructuresMSQ1B, C
31Programming and Data StructuresNumerical19
32DatabasesMSQ1A, B, C
33Programming and Data StructuresNumerical111
34Operating SystemNumerical16
35CalculusNumerical13
36Digital LogicMCQ2B
37Programming and Data StructuresMCQ2D
38Programming and Data StructuresMCQ2B
39Computer Organization and ArchitectureMCQ2A
40Digital LogicMCQ2C
41CalculusMSQ2A, C, D
42AlgorithmsMSQ2A
43Digital LogicMSQ2B, D
44AlgorithmsMCQ2A
45AlgorithmsMSQ2B, D
46Compiler DesignMCQ2D
47Computer NetworksMCQ2B
48Computer NetworksMCQ2B
49AlgorithmsMSQ2A, D
50DatabasesMCQ2B
51Computer Organization and ArchitectureNot in GATE 2027 syllabus: Secondary storage (magnetic disk)Numerical277.3
52Discrete MathematicsNumerical234
53Programming and Data StructuresNumerical27
54Computer NetworksMSQ2A, B, C
55Discrete MathematicsMSQ2B, C
56Programming and Data StructuresNumerical265536
57Compiler DesignMSQ2A, B, D
58Probability and StatisticsNumerical24.24 to 4.26
59Theory of ComputationMSQ2B, D
60Operating SystemMSQ2B, C
61Theory of ComputationMSQ2C
62Computer Organization and ArchitectureNumerical295
63Operating SystemNumerical24
64DatabasesNumerical26
65Operating SystemNumerical29.5

Questions about GATE 2026 CS (Set 1)

How many questions are in the GATE 2026 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 28 MCQs, 24 MSQs, 13 numerical answer (NAT) questions. The paper lasted 3 hours.

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

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

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

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

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

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

More GATE papers