GATE 2026 Computer Science (CS1) Question Paper with Solutions | All 65 Questions

 

GATE 2026 Computer Science (CS1) Question Paper with Solutions

Welcome to our GATE 2026 Computer Science and Information Technology (CS1) question paper solution series. In this post, you will find all 65 questions from the GATE 2026 CS1 examination along with their answers and detailed explanations. This resource is designed to help students understand important concepts, practise exam-level questions and improve their preparation for the GATE Computer Science examination.

The GATE Computer Science examination covers several important subjects, including Programming and Data Structures, Algorithms, Operating Systems, Computer Networks, Database Management Systems, Computer Organization and Architecture, Theory of Computation, Compiler Design, Digital Logic and Engineering Mathematics. Practising questions from these subjects can help students strengthen their fundamentals and develop better problem-solving skills.

What You Will Get in This Post

  • All 65 questions from the GATE 2026 CS1 question paper.
  • Multiple Choice Questions (MCQs) with answer checking.
  • Multiple Select Questions (MSQs) with correct options.
  • Numerical Answer Type (NAT) questions with answer checking.
  • Step-by-step explanations to understand the solutions.
  • Interactive practice so you can attempt questions before viewing solutions.

                 

Why Practise GATE 2026 Questions?

Solving the complete question paper is a useful way to test your knowledge and identify topics that need more attention. Instead of simply memorising answers, try to solve each question yourself first. After attempting it, check the correct answer and read the explanation carefully. This approach can help you understand concepts, improve accuracy and manage your time more effectively.

Start Your Practice

Whether you are preparing for GATE 2027 or revising for another Computer Science examination, these GATE 2026 CS1 questions can be useful for practice. Attempt the questions one by one, review your mistakes and keep revising the concepts regularly.

Best of Luck!
Keep practising, stay consistent and work towards your GATE preparation goals.

Question 1

The antonym of the word protagonist is ________.

A agnostic
B antagonist
C arsonist
D anarchist
Correct Answer: (B) antagonist

A protagonist is the main character or leading figure, while an antagonist opposes the protagonist. Therefore, “antagonist” is the correct antonym.

Question 2

The figure shows two 4-tile patterns. Either one or both of the patterns can be used any number of times and in any orientation to construct a new pattern. Which one of the options below cannot be constructed by using only these two 4-tile patterns assuming there are no overlaps among them?

Given 4-tile patterns
A
B
C
D
Correct Answer: (C)

Each available pattern contains 4 tiles. Therefore, any pattern constructed from these pieces must contain a total number of tiles divisible by 4.

Option C contains 15 tiles, and 15 is not divisible by 4. Hence, option C cannot be constructed using only the given 4-tile patterns.

Question 3

Consider a knock-out women’s badminton singles tournament where there are no ties. The loser in each game is eliminated from the tournament. Every player plays until she is defeated or remains the last undefeated player. The last undefeated player is declared the winner of the tournament. If there are 64 players in the beginning of the tournament, how many games should be played in total to declare the winner of the tournament?

A 127
B 64
C 63
D 32
Correct Answer: (C) 63

Initially, there are 64 players. Each game eliminates exactly one player. To declare one winner, 63 players must be eliminated.

Therefore,
Total games = 64 − 1
Answer = 63

Question 4

A student needs to enroll for a minimum of 60 credits. A student cannot enroll for more than 70 credits. The credits are divided amongst project and three distinct sets of courses namely, core courses, specialization courses, and elective courses. It is compulsory for a student to enroll for exactly 15 credits of core courses and exactly 20 credits of project. In addition, a student has to enroll for a minimum of 10 credits of specialization courses. The maximum credits of elective courses that a student can enroll for is ______

A10
B15
C20
D25
Correct Answer: (D) 25

Maximum total credits = 70

Required core credits = 15
Required project credits = 20
Minimum specialization credits = 10

Maximum elective credits = 70 − 15 − 20 − 10 = 25.

Therefore, the correct option is (D) 25.

Question 5

‘When the teacher is in the room, all students stand silently.’

If the above statement is true, which one of the following statements is not necessarily true?

A If any student is not standing silently, then the teacher is not in the room.
B When the teacher is in the room, all students are silent.
C If all students are standing, then the teacher is in the room.
D When the teacher is in the room, all students are standing.
Correct Answer: (C)

The given statement says that if the teacher is in the room, all students stand silently.

This does not mean that if all students are standing, the teacher must be in the room. Students could be standing even when the teacher is absent.

Therefore, option (C) is not necessarily true.

Question 6 · 2 Marks
Combinatorics deals with problems involving counting. For example, “How many distinct arrangements of N distinct objects in M spaces on a circle are possible?” is a typical problem in combinatorics. This kind of counting is sometimes used in the modeling of several physical phenomena. Often, in such models, the different combinatorial possibilities are assigned probability values. Assigning probabilities enables the computation of the average values of physical quantities.

Consider the following statements:
P: Combinatorics is always invoked in the modeling of physical phenomena.
Q: Modeling some physical phenomena involves assigning probabilities to combinatorial possibilities in order to compute average values of physical quantities.

Based on the passage above, what can be inferred about statements P and Q?

A P is False and Q is False
B P is False and Q is True
C P is True and Q is False
D P is True and Q is True
Correct Answer: (B) P is False and Q is True

Statement P is False: The passage says combinatorial counting is “sometimes” used in modeling physical phenomena, not that it is always used.

Statement Q is True: The passage explicitly states that some models assign probabilities to combinatorial possibilities to compute average physical quantities.

GATE 2026 · CS1 Question 7 · MCQ · 2 Marks

In Panel I of the figure below, the front view and top view of a structure are shown. Which one of the 3D structures shown in Panel II possesses the views shown in Panel I?



Question 8 · 2 Marks
For positive real numbers S and K, the function HK(S) is defined as:
HK(S) = max(S − K, 0)
max(a, b) = a, when a > b
max(a, b) = b, when a ≤ b

The graph below shows the plot of a function N(S) versus S. N(S) can be expressed as _____.



A H10(S) − H20(S)
B H10(S) − 2H20(S)
C −H10(S) + H20(S)
D H15(S) − H20(S)
Correct Answer: (A)

H10(S) = max(S − 10, 0) and H20(S) = max(S − 20, 0).

For S ≤ 10, both terms are zero, so N(S) = 0. Between S = 10 and S = 20, the function rises as S − 10. For S ≥ 20, the difference is (S − 10) − (S − 20) = 10.

This matches the given graph. Therefore, N(S) = H10(S) − H20(S).

Question 9 · 2 Marks

In the 2020 summer Olympics’ Javelin throw finals, Neeraj Chopra exhibited a spectacular performance to win the gold medal. The silver medal was won by Jakub Vadlejch and the bronze medal was won by Vitezlav Vesely. There were six rounds of throws with each athlete having one throw per round. The best of all the throws of each athlete is considered for the medal. Following were the observations about the throws:

i. The first and second rounds were dominated by Neeraj Chopra with a gold medal performance in his second throw, while the other two athletes did not have any medal winning throws in these rounds.

ii. The throws in the last round by both Jakub Vadlejch and Vitezlav Vesely were fouls and were not considered for scoring.

iii. After four rounds, Vitezlav Vesely was in the second position and could not improve upon his best throw in the succeeding rounds.

iv. In the fourth round, the throw by Jakub Vadlejch was the best in that round.

In which round did Vitezlav Vesely have his best throw?

A Third
B Fourth
C Fifth
D Sixth
Correct Answer: (A) Third

Step 1: From observation (i), Vesely's best throw was not in the first or second round.

Step 2: From observation (ii), his sixth-round throw was a foul, so it cannot be his best throw.

Step 3: From observation (iii), Vesely could not improve his best throw in rounds five and six. Therefore, his best throw occurred by the end of round four.

Step 4: Observation (iv) says Jakub had the best throw in round four. Since Vesely was in second position after four rounds, Vesely's best throw must have occurred before round four.

Rounds one, two, four, five and six are eliminated. Hence, Vesely's best throw was in the third round (Option A).

Question 10 · 1 Mark

An unbiased six-faced dice whose faces are marked with numbers 1, 2, 3, 4, 5, and 6 is rolled twice in succession and the number on the top face is recorded each time. The probability that the number appearing in the second roll is an integer multiple of the number appearing in the first roll is __________.

A 16
B 518
C 718
D 56
Correct Answer: (C) 7/18

Two dice rolls produce 6 × 6 = 36 equally likely ordered outcomes.

Count the valid second-roll values for each first-roll value:

First roll = 1: second roll can be 1, 2, 3, 4, 5, 6 → 6 outcomes.
First roll = 2: second roll can be 2, 4, 6 → 3 outcomes.
First roll = 3: second roll can be 3, 6 → 2 outcomes.
First roll = 4: second roll can be 4 → 1 outcome.
First roll = 5: second roll can be 5 → 1 outcome.
First roll = 6: second roll can be 6 → 1 outcome.

Total favourable outcomes = 6 + 3 + 2 + 1 + 1 + 1 = 14.

Probability = 14/36 = 7/18.

Question 11 · 1 Mark

An urn contains one red ball and one blue ball. At each step, a ball is picked uniformly at random from the urn, and this ball together with another ball of the same color is put back in the urn. The probability that there are equal number of red and blue balls after two steps is

A1/4
B1/3
C1/2
D2/3
Correct Answer: (B) 1/3

Initially, there is 1 red ball and 1 blue ball.

Step 1: After the first draw, either red or blue is added to the urn. The counts become either (2 red, 1 blue) or (1 red, 2 blue).

Step 2: To have equal numbers after two steps, the second draw must be the opposite color from the first draw.

If red was drawn first, the probability of drawing blue next is 1/3. If blue was drawn first, the probability of drawing red next is also 1/3.

Therefore, total probability = (1/2 × 1/3) + (1/2 × 1/3) = 1/3.

Question 12 · 1 Mark

Consider 4 × 4 matrices with their elements from {0, 1}. The number of such matrices with even number of 1s in every row and every column is

0110
1010
1100
0000
Illustrative binary matrix
A512
B1025
C1023
D255
Correct Answer: (A) 512

A 4 × 4 binary matrix has 16 entries. Choose the entries in the first 3 rows and first 3 columns freely. There are 9 such entries, each with 2 possible values.

Therefore, the number of choices is \(2^9 = 512\).

The even-parity condition for each of the first 3 rows determines the last entry in that row. Similarly, the condition for each of the first 3 columns determines the last entry in that column. The bottom-right entry is then fixed, and its row and column parity conditions are automatically satisfied.

Hence, the total number of matrices is 512.

Question 13 · 1 Mark

For n > 1, the maximum multiplicity of any eigenvalue of an n × n matrix with elements from ℝ is

A ∈ ℝn×n
An
Bn − 1
C1
Dn + 1
Correct Answer: (A) n

The maximum possible algebraic multiplicity of an eigenvalue of an n × n matrix is n.

For example, consider the identity matrix multiplied by a constant: A = λIn.

Its characteristic polynomial is det(xI − A) = (x − λ)n.

Therefore, the eigenvalue λ has algebraic multiplicity n, which is the maximum possible. Hence, the answer is (A) n.

Question 14 · 1 Mark

Match each addressing mode in List I with a data element or an element of a data structure (in a high-level language) in List II:

List I
P. Immediate
Q. Indirect
R. Base with index
S. Base with offset/displacement
List II
1. Element of an array
2. Pointer
3. Element of a record
4. Constant
AP–4, Q–3, R–1, S–2
BP–4, Q–2, R–1, S–3
CP–1, Q–4, R–3, S–2
DP–2, Q–3, R–1, S–4
Correct Answer: (B) P–4, Q–2, R–1, S–3

P. Immediate → 4. Constant
Immediate addressing uses the value itself as a constant operand.

Q. Indirect → 2. Pointer
Indirect addressing uses a pointer or address to locate the operand.

R. Base with index → 1. Element of an array
An array element can be accessed using a base address and an index.

S. Base with offset/displacement → 3. Element of a record
A record field can be located using a base address and its fixed offset.

Therefore, the correct matching is P–4, Q–2, R–1, S–3 (Option B).

Question 15 · 1 Mark

Consider a processor P whose instruction set architecture is the load-store architecture. The instruction format is such that the first operand of any instruction is the destination operand.

Which one of the following sequences of instructions corresponds to the high-level language statement Z = X + Y?

Note: X, Y, and Z are memory operands. R0, R1, and R2 are registers.
A ADD Z, X, Y
B LOAD R0, X ADD Z, R0, Y
C ADD R0, X, Y STORE Z, R0
D LOAD R0, X LOAD R1, Y ADD R2, R0, R1 STORE Z, R2
Correct Answer: (D)

Step 1: LOAD R0, X
Memory operand X ki value register R0 mein load hoti hai.

Step 2: LOAD R1, Y
Memory operand Y ki value register R1 mein load hoti hai.

Step 3: ADD R2, R0, R1
R0 aur R1 ki values add hoti hain aur result R2 mein store hota hai. Pehla operand destination hai.

Step 4: STORE Z, R2
Result ko register R2 se memory location Z mein store kiya jata hai.

Load-store architecture mein arithmetic operation registers par hota hai; memory operands ko pehle registers mein load karna padta hai. Isliye Option (D) sahi hai.

Question 16

Which one of the following dependencies among the register operands of different instructions can cause a data hazard in a pipelined processor?

Correct Answer: (B) Read-after-write

Explanation: Read-after-write (RAW) hazard occurs when a later instruction tries to read a register before an earlier instruction has finished writing its result to that register.

Example:

I1: R1 = R2 + R3

I2: R4 = R1 + R5

Instruction I2 needs the new value of R1 produced by I1. If that value is not ready when I2 reads it, a data hazard occurs.

Question 17

Consider the following recurrence relations:

For all n > 1,
T1(n) = 4T1(n/2) + T2(n)
T2(n) = 5T2(n/4) + Θ(log2 n)

Assume that for all n ≤ 1, T1(n) = 1 and T2(n) = 1.
Which one of the following options is correct?

Correct Answer: (A)

First, solve:

T2(n) = 5T2(n/4) + Θ(log n)

By the Master Theorem, T2(n) = Θ(nlog4 5).

Now substitute into the first recurrence:

T1(n) = 4T1(n/2) + Θ(nlog4 5)

Since log4 5 is less than 2, the additional term grows more slowly than n2.

Applying the Master Theorem again gives T1(n) = Θ(n2).

Question 18

With respect to a TCP connection between a client and a server, which one of the following statements is true?

Correct Answer: (D)

TCP supports simultaneous connection termination. Both the client and the server can independently initiate closing the connection at approximately the same time.

(A) is incorrect because TCP establishes a connection using a three-way handshake. (B) is incorrect because either side can initiate closing. (C) is incorrect because TCP is full-duplex, allowing data transmission in both directions.

Question 19

Which of the following statements is/are true with respect to the interaction of a web browser with a web server using HTTP 1.1?

Correct Answers: (A), (C) and (D)

(A) True: HTTP/1.1 supports persistent TCP connections, allowing multiple objects from the same server to use one connection.

(B) False: Objects hosted on different servers do not generally share the same TCP connection.

(C) True: HTTP/1.1 supports pipelining, which allows multiple requests to be sent without waiting for each earlier response to finish.

(D) True: A persistent connection can be reused to request multiple webpages from the same server.

Question 20

Let n > 1. Consider an n × n matrix M with its elements from ℝ. Let the vector (0, 1, 0, 0, …, 0) ∈ ℝⁿ be in the null space of M.

Which of the following options is/are always correct?

Correct Answers: (B) and (D)

(B) A non-zero vector is in the null space, so M is singular and det(M) = 0.

(D) If v = (0, 1, 0, …, 0) is in the null space, then 2v is also in the null space. Both are non-zero vectors.

(A) Incorrect because the determinant is zero.

(C) Incorrect because the rank is not necessarily 1.

Question 21

Consider the following Boolean expression of a function F:

F(P, Q) = (P̅ + Q) ⊕ (P̅Q)

Which of the following expressions is/are equivalent to F?

Correct Answers: (A) and (C)

Given:

F(P,Q) = (P̅ + Q) ⊕ (P̅Q)

Using the Boolean identity:

(X + Y) ⊕ (XY) = X ⊕ Y

Put X = P̅ and Y = Q:

F = P̅ ⊕ Q

This is also equivalent to the complement of P ⊕ Q.

Therefore, options A and C are correct.

Question 22

Consider the 8-bit signed integers X, Y and Z represented using the sign-magnitude form. The binary representations of X and Y are as follows:

X : 10110100
Y : 01001100

Which of the following operations to compute Z result(s) in an arithmetic overflow?

Correct Answers: (B) and (C)

Step 1: Convert X and Y into decimal.

X = 10110100 = −52 (sign bit 1 means negative).

Y = 01001100 = +76 (sign bit 0 means positive).

8-bit sign-magnitude range: −127 to +127.

(A) X + Y: −52 + 76 = 24. No overflow.

(B) X − Y: −52 − 76 = −128. Overflow.

(C) −X + Y: 52 + 76 = 128. Overflow.

(D) −X − Y: 52 − 76 = −24. No overflow.

Therefore, options B and C result in arithmetic overflow.

Question 23

Let n be an odd number greater than 100. Consider a binary minheap with n elements stored in an array P whose index starts from 1.

Which of the following indices of P do/does NOT correspond to any leaf node of the minheap?

Correct Answers: (B) and (C)

For a 1-indexed binary heap:

Internal nodes have indices from 1 to ⌊n/2⌋.

Leaf nodes have indices from ⌊n/2⌋ + 1 to n.

Since n is odd, let n = 2k + 1.

(A) (n + 1)/2 = k + 1 → Leaf node.

(B) (n − 1)/2 = k → Internal node, not a leaf.

(C) (n − 3)/2 = k − 1 → Internal node, not a leaf.

(D) n = last array index → Leaf node.

Therefore, options B and C do not correspond to leaf nodes.

Question 24
Consider a hash table P[0, 1, …, 10] that is initially empty. The hash table is maintained using open addressing with linear probing. The hash function used is:
h(x) = (x + 7) mod 11
Consider the following sequence of insertions performed on P:
1, 13, 22, 15, 11, 24
Which of the following positions in the hash table is/are empty after these insertions are performed?
Correct Answer: (C) 2

Using the hash function h(x) = (x + 7) mod 11:

  • 1 → 8
  • 13 → 9
  • 22 → 7
  • 15 → 0
  • 11 → 7 (collision), so linear probing places it at 10.
  • 24 → 9 (collision), then 10, 0 are occupied, so it is placed at 1.

Occupied positions: 0, 1, 7, 8, 9, 10.

Empty positions: 2, 3, 4, 5, 6.

Therefore, among the given options, only position 2 is empty.
Question 25
Consider the following grammar where S is the start symbol, and a and b are terminal symbols.
S → aSbS   |   bS   |   ε
Which of the following statements is/are true?
Correct Answers: (A), (B) and (C)

Option (A) – True: The grammar is ambiguous because the same string can have two different derivations.

Option (B) – True: The string abb has two distinct derivations:

Derivation 1:
S → aSbS → abS → abbS → abb

Derivation 2:
S → aSbS → abSbS → abbS → abb

Thus, the same string abb can be generated in two different ways.

Option (C) – True: The string abab has only one rightmost derivation. Its rightmost derivation is:

S → aSbS
→ aSbaSbS
→ aSbaSb
→ aSbab
→ abab

Option (D) – False: The grammar is context-free, and every context-free language is decidable.

Question 26
Let M be a nondeterministic finite automaton (NFA) with 6 states over a finite alphabet.

Which of the following options CANNOT be the number of states in the minimal deterministic finite automaton (DFA) that is equivalent to M?
Correct Answers: (B) 65 and (D) 128

Given that the NFA has 6 states.

Using subset construction, the maximum number of states in the equivalent DFA is:

2n = 26 = 64

Therefore, the equivalent DFA can have at most 64 states. The minimal DFA cannot have more than 64 states either.

  • (A) 32: Possible, because it is less than or equal to 64.
  • (B) 65: Not possible, because it exceeds 64.
  • (C) 1: Possible, because a DFA can have just one state.
  • (D) 128: Not possible, because it exceeds 64.

Hence, the correct answers are (B) and (D).

Question 27
Consider the following C statements:
char *str1 = "Hello;    /* Statement S1 */

char *str2 = "Hello;";   /* Statement S2 */

int *str3 = "Hello";     /* Statement S3 */
Which of the following options is/are correct?
Correct Answer: (C)

Statement S1 – Lexical Error:
The string literal starts with a double quotation mark but does not have a closing double quotation mark. Therefore, it has an unterminated string literal (lexical error).

Statement S2 – Correct:
The string literal "Hello;" is properly enclosed in double quotation marks. The semicolon is part of the string.

Statement S3 – Semantic Error:
The string literal is of character-array type, but the pointer str3 is declared as int *. These pointer types are incompatible, resulting in a semantic constraint violation in C.

Hence, option (C) is correct.

Question 28
Which of the following statements is/are true?
Correct Answer: (C)

(A) False: LL(1) parser is a predictive parser and does not use backtracking.

(B) False: An LL(1) grammar cannot be left-recursive. Left recursion must be eliminated.

(C) True: Left factoring helps make a grammar suitable for predictive parsing by removing common prefixes.

(D) False: SLR parsers are more powerful than LL(1) parsers in terms of the class of grammars they can handle.

Hence, option (C) is correct.

Question 29
With respect to deadlocks in an operating system, which of the following statements is/are FALSE?
Correct Answers: (A) and (C)

(A) False: Banker's algorithm is used for deadlock avoidance, not deadlock prevention.

(B) True: If the hold and wait condition is eliminated, deadlock can be prevented.

(C) False: An assignment edge in a resource allocation graph is directed from a resource to a process, not from a process to a resource.

(D) True: A safe state means there exists a safe sequence in which all processes can complete without deadlock.

Hence, the false statements are (A) and (C).

Question 30
Let P, Q, R and S be the attributes of a relation in a relational schema. Let X → Y indicate functional dependency in the context of a relational database, where X, Y ⊆ {P, Q, R, S}.
X → Y   (Functional Dependency)
Which of the following options is/are always true?
Correct Answers: (C) and (D)

(A) False: From P → R and PQ → R, we cannot conclude that Q → R. The dependency P → R already determines R using P alone.

(B) False: PQ → R does not imply that either P → R or Q → R individually. Both attributes together may be needed to determine R.

(C) True: Given P → R and Q → S, by the union rule: PQ → RS.

(D) True: By the augmentation rule, if P → R, then adding Q to both sides gives PQ → RQ. By the decomposition rule, PQ → R.

Hence, options (C) and (D) are always true.

Question 31
In the context of relational database normalization, which of the following statements is/are true?
Correct Answers: (A), (B) and (C)

(A) True: The 3NF synthesis algorithm can always produce a dependency-preserving 3NF decomposition.

(B) True: A relation in 1NF can be retained as it is; therefore, a dependency-preserving 1NF decomposition is possible.

(C) True: BCNF decomposition is possible, but it is not always possible to preserve all functional dependencies.

(D) False: A dependency-preserving 2NF decomposition can be obtained by decomposing relations to remove partial dependencies while retaining the relevant dependencies.

Hence, options (A), (B) and (C) are true.

Question 32
Consider the function f : ℝ → ℝ defined as follows:
f(x) = { c₁ex − c₂ loge(1/x),   if x > 0
     3,   otherwise
where c₁, c₂ ∈ ℝ. If f is continuous at x = 0, then c₁ + c₂ = _________.
(Answer in integer)

Correct Answer: 3

For continuity at x = 0:

limx→0⁺ f(x) = f(0) = 3

Therefore,

limx→0⁺ [c₁ex − c₂ ln(1/x)] = 3

As x → 0⁺:

  • ex → 1
  • ln(1/x) → ∞

For the limit to be finite, we must have:

c₂ = 0

Then:

c₁ × 1 = 3, so c₁ = 3

Hence,

c₁ + c₂ = 3 + 0 = 3

Question 32
GATE 2026 · CS1
The height of a binary tree is the number of edges in the longest path from the root to a leaf in the tree. The maximum possible height of a full binary tree with 23 nodes is _________. (answer in integer)
Question 34
GATE 2026 · CS1
Consider the following program in C:
#include <stdio.h>

void func(int i, int j) {
    if(i < j) {
        int i = 0;
        while (i < 10) {
            j += 2;
            i++;
        }
    }
    printf("%d", i);
}

int main() {
    int i = 9, j = 10;
    func(i, j);
    return 0;
}
The output of the program is _________. (answer in integer)
Question 35
GATE 2026 · CS1
Consider a system consisting of k instances of a resource R, being shared by 5 processes. Assume that each process requires a maximum of two instances of resource R and a process can request or release only one instance at a time. Further, a process can request the second instance of the resource only after acquiring the first instance.

The minimum value of k for the system to be deadlock-free is _________. (answer in integer)
Question 36
GATE 2026 · CS1
Consider the real valued variables X, Y and Z represented using the IEEE 754 single-precision floating-point format. The binary representations of X and Y in hexadecimal notation are as follows:
X : 35C00000
Y : 34A00000
Let Z = X + Y.
Which one of the following is the binary representation of Z, in hexadecimal notation?
Question 37
GATE 2026 · CS1
Consider a 2-bit saturating up/down counter that performs the saturating up count when the input P is 0, and the saturating down count when P is 1. The Next State table of the counter is as shown. The counter is built as a synchronous sequential circuit using D flip-flops.
input P current state Q₁ current state Q₀ next state Q₁⁺ next state Q₀⁺
00001
00110
01011
01111
10000
10100
11001
11110
Which one of the following options corresponds to the expressions for the inputs of the D flip-flops, D₁ and D₀?
Question 38
GATE 2026 · CS1
The size of the physical address space of a processor is 232 bytes. The capacity of a cache memory unit is 223 bytes. The cache block size is 128 bytes. The cache memory unit can be built as a direct mapped cache or as a K-way set-associative cache, where K = 2L and L ∈ {1, 2, 3}. Let the length of the TAG field be M bits for the direct mapped cache, and N bits for the set-associative cache.

Which one of the following options is true?
Question 39
GATE 2026 · CS1
Consider the following code snippet in C language that computes the number of nodes in a non-empty singly linked list pointed to by the pointer variable head.
struct node{
    int elt;
    struct node *next;
};

int getListSize (struct node *head)
{
    if( E1 ) return 1;
    return E2;
}
Which one of the following options gives the correct replacements for the expressions E1 and E2?
Question 40
GATE 2026 · CS1
Let P be the set of all integers from 1 to 15. Consider any order of insertion of the elements of P into a binary search tree that creates a complete binary tree.

Which one of the following elements can NEVER be the third element that is inserted?
Question 41
GATE 2026 · CS1
Let G(V, E) be an undirected, edge-weighted graph with integer weights. The weight of a path is the sum of the weights of the edges in that path. The length of a path is the number of edges in that path.

Let s ∈ V be a vertex in G. For every u ∈ V and for every k ≥ 0, let dk(u) denote the weight of a shortest path (in terms of weight) from s to u of length at most k. If there is no path from s to u of length at most k, then dk(u) = ∞.

Consider the statements:
S1: For every k ≥ 0 and u ∈ V, dk+1(u) ≤ dk(u).

S2: For every (u, v) ∈ E, if (u, v) is part of a shortest path (in terms of weight) from s to v, then for every k ≥ 0, dk(u) ≤ dk(v).
Which one of the following options is correct?
Question 42 
GATE 2026 · CS1




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.
GATE 2026 · CS1 Question 43

Consider a relational database schema with two relations R(P, Q) and S(X, Y).

Let
E = {⟨u⟩ | ∃v ∃w ⟨u, v⟩ ∈ R ∧ ⟨v, w⟩ ∈ S}
be a tuple relational calculus expression.

Which one of the following relational algebraic expressions is equivalent to E?

GATE 2026 · CS1 Question 44

A TCP sender successfully establishes a connection with a TCP receiver and starts the transmission of segments. The TCP congestion control mechanism’s slow-start threshold is set to 10000 segments. Assume that the round-trip time is fixed at 1 millisecond. Assume that the sender always has data to send, the segments are numbered from 1, and no segment is lost. Let t denote the time (in milliseconds) at which the transmission of segment number 2000 starts.

Which one of the following options is correct?

GATE 2026 · CS1 Question 45

Consider the implementation of sliding window protocol over a lossless link, with a window size of W frames, where each frame is of size 1000 bits (including header). The bandwidth of the link is 100 kbps (1k = 10³) and the one-way propagation delay is 100 milliseconds. Assume that processing times at the sender and receiver are zero and the transmission time of acknowledgements is also zero.

Which one of the following options gives the minimum size of W (in number of frames) required to achieve 100% link utilization?

GATE 2026 · CS1 Question 46 · MSQ

Let f : ℝ → ℝ be defined as follows:

f(x) = ( |x|/2 − x ) ( x − |x|/2 )

Which of the following statements is/are true?

GATE 2026 · CS1 Question 47

Let G(V, E) be a simple, undirected graph. A vertex cover of G is a subset V′ ⊆ V such that for every (u, v) ∈ E, u ∈ V′ or v ∈ V′. Let the size of the smallest vertex cover in G be k. Let S be any vertex cover of size k.

For a vertex v ∈ V, which of the following constraints will always ensure that v ∈ S?

GATE 2026 · CS1 Question 48 · MSQ

Consider a Boolean function F with the following minterm expression:

F(P,Q,R,S) = Σ m(1, 2, 3, 4, 5, 7, 10, 12, 13, 14)

Which of the following options is/are the minimal sum-of-products expression(s) of F?

GATE 2026 · CS1 Question 49 · MSQ

Let G(V, E) be a simple, undirected, edge-weighted graph with unique edge weights.

Which of the following statements about the minimum spanning trees (MST) of G is/are true?

GATE 2026 · CS1 Question 50 · MSQ

Consider the following pseudocode for depth-first search (DFS) algorithm which takes a directed graph G(V, E) as input, where d[v] and f[v] are the discovery time and finishing time, respectively, of the vertex v ∈ V.

DFS(G):
unmark all v ∈ V
t ← 0
for each v ∈ V
  if v is unmarked
    t ← Explore(G,v,t)
  end if
end for
Explore(G,v,t):
mark v
t ← t + 1
d[v] ← t
for each (v,w) ∈ E
  if w is unmarked
    t ← Explore(G,w,t)
  end if
end for
t ← t + 1
f[v] ← t
return t

Suppose that the input directed graph G(V, E) is a directed acyclic graph (DAG).

For an edge (u, v) ∈ E, which of the following options will NEVER be correct?

GATE 2026 · CS1 Question 51

Let L1 and L2 be two languages over a finite alphabet, such that L1 ∩ L2 and L2 are regular languages.

Which of the following statements is/are always true?

GATE 2026 · CS1 Question 52 · MSQ

Consider the following context-free grammar G.

S → abaABAbba
A → aaBBAb | bB abaa
B → aBb | ab

In the above grammar, S is the start symbol, a and b are terminal symbols, and A and B are non-terminal symbols.

Let L(G) be the language generated by the grammar G. For a string s ∈ L(G), let n1(s) be the number of a's in s and n2(s) be the number of b's in s.

Which of the following statements is/are true?

GATE 2026 · CS1 Question 53 · MSQ

Consider the following two syntax-directed definitions SDD1 and SDD2 for type declarations.

SDD1 (G1)
Grammar
D → T V
T → int
T → float
V → V1 id
V → id
Semantic Rules
D.type = T.type
V.type = T.type
T.type = int
T.type = float
V1.type = V.type
put(id.entry, V.type)
SDD2 (G2)
Grammar
D → D1 id
D → T id
T → int
T → float
Semantic Rules
D.type = D1.type
put(id.entry, D1.type)
D.type = T.type
put(id.entry, T.type)
T.type = int
T.type = float

D is the start symbol, and int, float and id are the three terminals. The non-terminal V1 is the same as V and the non-terminal D1 is the same as D. Here, the subscript is used to differentiate the grammar symbols on the two sides of a production. The function put updates the symbol table with the type information for an identifier.

Let P and Q be the languages specified by grammars G1 and G2, respectively.
Which of the following statements is/are true?

GATE 2026 · CS1 Question 54

Consider a system that has a cache memory unit and a memory management unit (MMU). The address input to the cache memory is a physical address. The MMU has a translation lookaside buffer (TLB). Assume that when a page is evicted from the main memory, the corresponding blocks in the cache are marked as invalid.

For a given memory reference, which of the following sequences of events can NEVER happen?

GATE 2026 · CS1 Question 55 · MSQ

An undirected, unweighted, simple graph G(V, E) is said to be 2-colorable if there exists a function c: V → {0, 1} such that for every (u, v) ∈ E, c(u) ≠ c(v).

Which of the following statements about 2-colorable graphs is/are true?

GATE 2026 · CS1 Question 56 · MSQ

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?

GATE 2026 · CS1 Question 57 · NAT

Let G be an undirected graph, which is a path on 8 vertices. The number of matchings in G is ______.
(Answer in integer)

GATE 2026 · CS1 Question 58 · NAT

Let X be a random variable which takes values in the set {1, 2, 3, 4, 5, 6, 7, 8}.

Further,

Pr(X = 1) = Pr(X = 2) = Pr(X = 5) = Pr(X = 7) = 1/6
Pr(X = 3) = Pr(X = 4) = Pr(X = 6) = Pr(X = 8) = 1/12

The expected value of X, denoted by E[X], is equal to ___________.
(Rounded off to two decimal places)

GATE 2026 · CS1 Question 59 · NAT

Consider a hard disk with a rotational speed of 15000 rpm. The time to move the read/write head from a track to its adjacent track is 1 millisecond. Initially, the head is on track 0. The number of sectors per track is 400. The sector size is 1024 bytes. It is necessary to transfer data from 10 randomly located sectors in each of the following tracks in the order: 5, 12 and 7.

The total time for the data transfer (in milliseconds) from the hard disk is _________. (rounded off to one decimal place)

GATE 2026 · CS1 Question 60 · NAT

The EX stage of a pipelined processor performs the memory read operations for LOAD instructions, and the operations for the arithmetic and logic instructions. Let tEX denote the time taken by the EX stage to perform the operation for an instruction. For each instruction type, the values of tEX and M (the number of instructions of that type in a sequence of 100 instructions for a program P), are given in the table below.

The duration of the pipeline clock cycle is 1 nanosecond. Assume that the latch time for the interstage buffers in the pipeline is negligible.

Instruction tEX (ns) M
LOAD1.815
IMUL1.510
IDIV2.55
FADD1.710
FSUB1.75
FMUL2.815
FDIV3.25
All other instructionsLess than 1.035

When program P is executed, the number of clock cycles for which the pipeline is stalled due to structural hazards in the EX stage is ______. (answer in integer)

GATE 2026 · CS1 Question 61 · NAT

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 n for which foo(n) returns 5 is ______. (answer in integer)

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

GATE 2026 · CS1 Question 62 · NAT

The following sequence corresponds to the preorder traversal of a binary search tree T:

50, 25, 13, 40, 30, 47, 75, 60, 70, 80, 77

The position of the element 60 in the postorder traversal of T is ______. (answer in integer)

Note: The position begins with 1.

GATE 2026 · CS1 Question 63 · NAT

Consider the following program snippet. Assume that the program compiles and runs successfully. Further, assume that the fork() system call is always successful in creating a process.

int main () {
    int i;
    for (i = 0; i < 3; i++){
        if (fork() == 0){
            continue;
        }
        break;
    }
    printf("Hello!");
    return 0;
}

The total number of times that the printf statement gets executed is ________. (answer in integer)

GATE 2026 · CS1 Question 64 · NAT

Consider a CPU that has to execute two types of processes. The first type, Actuators (A), requires a CPU burst of 6 seconds. The second type, Controllers (C), requires a CPU burst of 8 seconds. A new process of type A arrives at time t = 10, 20, 30, 40, and 50 (in seconds). Similarly, a new process of type C arrives at time t = 11, 22, 33, 44, and 55 (in seconds). The CPU scheduling policy is First Come First Serve (FCFS). The first process of type A starts running at t = 10 seconds.

The average waiting time (in seconds) for the 10 processes is ___________. (rounded off to one decimal place)

GATE 2026 · CS1 Question 65 · NAT

Consider a relational database schema with a relation R(A, B, C, D). If {A, B} and {A, C} are the only two candidate keys of the relation R, then the number of superkeys of relation R is ______. (answer in integer)

Post a Comment

0 Comments