GATE 2026 CS (Set 1)

All 65 questions of GATE 2026 CS (Set 1)

Question text and figures as in the official paper, with the answer from the official key. Worked solutions for every question are in your report after you take the paper as a 3-hour test.

Q1 · General Aptitude · MCQ · 1 mark

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 ________.

  • (A)
    10
  • (B)
    15
  • (C)
    20
  • (D)
    25

Answer (official key): D

Worked solution: in your report after you take this paper.

Q2 · General Aptitude · MCQ · 1 mark

The figure shows two 4-tile patterns.

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?

  • (A)
    GATE 2026 CS (Set 1) question 2 (Spatial Aptitude), option A
  • (B)
    GATE 2026 CS (Set 1) question 2 (Spatial Aptitude), option B
  • (C)
    GATE 2026 CS (Set 1) question 2 (Spatial Aptitude), option C
  • (D)
    GATE 2026 CS (Set 1) question 2 (Spatial Aptitude), option D

Answer (official key): C

Worked solution: in your report after you take this paper.

Q3 · General Aptitude · MCQ · 1 mark

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?

  • (A)
    127
  • (B)
    64
  • (C)
    63
  • (D)
    32

Answer (official key): C

Worked solution: in your report after you take this paper.

Q4 · General Aptitude · MCQ · 1 mark

‘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.

Answer (official key): C

Worked solution: in your report after you take this 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

Read the worked solution

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

Read the worked solution

Q7 · General Aptitude · 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?

Front view, top view, and 3D options

  • (A)
    (i)
  • (B)
    (ii)
  • (C)
    (iii)
  • (D)
    (iv)

Answer (official key): D

Worked solution: in your report after you take this paper.

Q8 · General Aptitude · MCQ · 2 marks

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)
    1/6
  • (B)
    5/18
  • (C)
    7/18
  • (D)
    5/6

Answer (official key): C

Worked solution: in your report after you take this paper.

Q9 · General Aptitude · MCQ · 2 marks

Combinatorics deals with problems involving counting. For example, “How many distinct arrangements of NN distinct objects in MM 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

Answer (official key): B

Worked solution: in your report after you take this paper.

Q10 · General Aptitude · MCQ · 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

Answer (official key): A

Worked solution: in your report after you take this paper.

Q11 · Discrete Mathematics · MCQ · 1 mark

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

  • (A)
    512
  • (B)
    1025
  • (C)
    1023
  • (D)
    255

Answer (official key): A

Worked solution: in your report after you take this paper.

Q12 · Computer Organization and Architecture · MCQ · 1 mark

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

  • (A)
    Read-after-read
  • (B)
    Read-after-write
  • (C)
    Write-after-read
  • (D)
    Write-after-write

Answer (official key): B

Worked solution: in your report after you take this paper.

Q13 · Computer Networks · MSQ · 1 mark

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?

  • (A)
    HTTP 1.1 facilitates downloading multiple objects of the same webpage over the same TCP connection, if the objects are stored in the same server
  • (B)
    HTTP 1.1 facilitates downloading multiple objects of the same webpage over the same TCP connection, even if they are stored in different servers
  • (C)
    HTTP 1.1 facilitates sending a request for downloading one object without waiting for a previously requested object to be downloaded completely
  • (D)
    HTTP 1.1 facilitates downloading multiple webpages on the same server over a single TCP connection

Answer (official key): A, C, D

Worked solution: in your report after you take this paper.

Q14 · Linear Algebra · MCQ · 1 mark

For n>1n > 1, the maximum multiplicity of any eigenvalue of an n×nn \times n matrix with elements from R\mathbb{R} is

  • (A)
    nn
  • (B)
    n−1n-1
  • (C)
    1
  • (D)
    n+1n+1

Answer (official key): A

Worked solution: in your report after you take this paper.

Q15 · Algorithms · MCQ · 1 mark

Consider the following recurrence relations:

For all n>1n > 1,

T1(n)=4T1 ⁣(n2)+T2(n)T_1(n) = 4T_1\!\left(\frac{n}{2}\right) + T_2(n) T2(n)=5T2 ⁣(n4)+Θ(log⁡2n)T_2(n) = 5T_2\!\left(\frac{n}{4}\right) + \Theta(\log_2 n)

Assume that for all n≤1n \le 1, T1(n)=1T_1(n)=1 and T2(n)=1T_2(n)=1.

Which one of the following options is correct?

  • (A)
    T1(n)=Θ(n2)T_1(n)=\Theta(n^2)
  • (B)
    T1(n)=Θ(n2log⁡2n)T_1(n)=\Theta(n^2\log_2 n)
  • (C)
    T1(n)=Θ(nlog⁡45)T_1(n)=\Theta(n^{\log_4 5})
  • (D)
    T1(n)=Θ(nlog⁡45log⁡2n)T_1(n)=\Theta(n^{\log_4 5}\log_2 n)

Answer (official key): A

Worked solution: in your report after you take this paper.

Q16 · Computer Networks · MCQ · 1 mark

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

  • (A)
    The client and server use a two-way handshake mechanism before the start of data transmission
  • (B)
    The server cannot initiate closing of the connection before the client initiates closing of the connection
  • (C)
    The TCP connection is half-duplex
  • (D)
    The client and server can initiate closing of the connection at the same time

Answer (official key): D

Worked solution: in your report after you take this paper.

Q17 · Computer Organization and Architecture · MCQ · 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
  • (A)
    P–4, Q–3, R–1, S–2
  • (B)
    P–4, Q–2, R–1, S–3
  • (C)
    P–1, Q–4, R–3, S–2
  • (D)
    P–2, Q–3, R–1, S–4

Answer (official key): B

Worked solution: in your report after you take this paper.

Q18 · Computer Organization and Architecture · MCQ · 1 mark

Consider a processor PP 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+YZ = X + Y ?

Note: XX, YY, and ZZ are memory operands. R0R0, R1R1, and R2R2 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

Answer (official key): D

Worked solution: in your report after you take this paper.

Q19 · Probability and Statistics · MCQ · 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

  • (A)
    14\frac{1}{4}
  • (B)
    13\frac{1}{3}
  • (C)
    12\frac{1}{2}
  • (D)
    23\frac{2}{3}

Answer (official key): B

Worked solution: in your report after you take this paper.

Q20 · Linear Algebra · MSQ · 1 mark

Let n>1n > 1. Consider an n×nn \times n matrix MM with its elements from R\mathbb{R}. Let the vector

(0,1,0,0,…,0)∈Rn(0,1,0,0,\ldots,0) \in \mathbb{R}^n

be in the null space of MM.

Which of the following options is/are always correct?

  • (A)
    Determinant of MM is 11
  • (B)
    Determinant of MM is 00
  • (C)
    Rank of MM is 11
  • (D)
    There are at least two non-zero vectors in the null space of MM

Answer (official key): B, D

Worked solution: in your report after you take this paper.

Q21 · Theory of Computation · MSQ · 1 mark

Let MM 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 MM?

  • (A)
    32
  • (B)
    65
  • (C)
    1
  • (D)
    128

Answer (official key): B, D

Worked solution: in your report after you take this paper.

Q22 · Algorithms · MSQ · 1 mark

Consider a hash table P[0,1,…,10]P[0,1,\ldots,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.h(x) = (x + 7) \bmod 11.

Consider the following sequence of insertions performed on PP:

1, 13, 22, 15, 11, 241,\ 13,\ 22,\ 15,\ 11,\ 24

Which of the following positions in the hash table is/are empty after these insertions are performed?

  • (A)
    0
  • (B)
    10
  • (C)
    2
  • (D)
    1

Answer (official key): C

Worked solution: in your report after you take this paper.

Q23 · Compiler Design · MSQ · 1 mark

Which of the following statements is/are true?

  • (A)
    LL(1) parser uses backtracking
  • (B)
    For a grammar to be LL(1), it must be left-recursive
  • (C)
    For a grammar to be LL(1), it must be left-factored
  • (D)
    The LL(1) parsers are more powerful than the SLR parsers

Answer (official key): C

Worked solution: in your report after you take this paper.

Q24 · Digital Logic · MSQ · 1 mark

Consider the following Boolean expression of a function FF:

F(P,Q)=(P‾+Q)⊕(P‾Q)F(P,Q) = (\overline{P} + Q) \oplus (\overline{P}Q)

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

  • (A)
    P⊕Q‾\overline{P \oplus Q}
  • (B)
    P⊕QP \oplus Q
  • (C)
    P‾⊕Q\overline{P} \oplus Q
  • (D)
    P‾⊕Q‾\overline{P} \oplus \overline{Q}

Answer (official key): A, C

Worked solution: in your report after you take this paper.

Q25 · Databases · MSQ · 1 mark

Let P,Q,RP,Q,R and SS be the attributes of a relation in a relational schema. Let X→YX \to Y indicate functional dependency in the context of a relational database, where X,Y⊆{P,Q,R,S}X,Y \subseteq \{P,Q,R,S\}.

Which of the following options is/are always true?

  • (A)
    If ({P,Q}→{R}(\{P,Q\} \to \{R\} and {P}→{R})\{P\} \to \{R\}), then {Q}→{R}\{Q\} \to \{R\}
  • (B)
    If {P,Q}→{R}\{P,Q\} \to \{R\}, then ({P}→{R}(\{P\} \to \{R\} or {Q}→{R})\{Q\} \to \{R\})
  • (C)
    If ({P}→{R}(\{P\} \to \{R\} and {Q}→{S})\{Q\} \to \{S\}), then {P,Q}→{R,S}\{P,Q\} \to \{R,S\}
  • (D)
    If {P}→{R}\{P\} \to \{R\}, then {P,Q}→{R}\{P,Q\} \to \{R\}

Answer (official key): C, D

Worked solution: in your report after you take this paper.

Q26 · Operating System · MSQ · 1 mark

With respect to deadlocks in an operating system, which of the following statements is/are FALSE?

  • (A)
    Banker’s algorithm is used to prevent deadlocks
  • (B)
    Deadlock formation can be prevented by ensuring that the hold and wait condition is not allowed
  • (C)
    An assignment edge in a resource allocation graph is marked from a process to a resource
  • (D)
    A safe state guarantees that all processes can finish without formation of a deadlock

Answer (official key): A, C

Worked solution: in your report after you take this paper.

Q27 · Compiler Design · MSQ · 1 mark

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?

  • (A)
    S1 and S2 have syntactic errors
  • (B)
    S2 has a lexical error and S3 has a syntactic error
  • (C)
    S1 has a lexical error and S3 has a semantic error
  • (D)
    S1 has a syntactic error and S3 has a semantic error

Answer (official key): C

Worked solution: in your report after you take this paper.

Q28 · Digital Logic · MSQ · 1 mark

Consider the 8-bit signed integers XX, YY and ZZ represented using the sign-magnitude form. The binary representations of XX and YY are as follows:

X:10110100Y:01001100X: 10110100 \qquad Y: 01001100

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

  • (A)
    Z=X+YZ = X + Y
  • (B)
    Z=X−YZ = X - Y
  • (C)
    Z=−X+YZ = -X + Y
  • (D)
    Z=−X−YZ = -X - Y

Answer (official key): B, C

Worked solution: in your report after you take this paper.

Q29 · Theory of Computation · MSQ · 1 mark

Consider the following grammar where SS is the start symbol, and aa and bb are terminal symbols.

S→aSbS∣bS∣ϵS \to aSbS \mid bS \mid \epsilon

Which of the following statements is/are true?

  • (A)
    The grammar is ambiguous
  • (B)
    The string abbabb has two distinct derivations in this grammar
  • (C)
    The string abababab has only one rightmost derivation
  • (D)
    The language generated by the grammar is undecidable

Answer (official key): A, B, C

Worked solution: in your report after you take this paper.

Q30 · Programming and Data Structures · MSQ · 1 mark

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

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

  • (A)
    n+12\dfrac{n+1}{2}
  • (B)
    n−12\dfrac{n-1}{2}
  • (C)
    n−32\dfrac{n-3}{2}
  • (D)
    nn

Answer (official key): B, C

Worked solution: in your report after you take this paper.

Q31 · Programming and Data Structures · Numerical · 1 mark

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)

Note: Assume that the program compiles and runs successfully.

Answer (official key): 9

Worked solution: in your report after you take this paper.

Q32 · Databases · MSQ · 1 mark

In the context of relational database normalization, which of the following statements is/are true?

  • (A)
    It is always possible to obtain a dependency-preserving 3NF decomposition of a relation
  • (B)
    It is always possible to obtain a dependency-preserving 1NF decomposition of a relation
  • (C)
    It is not always possible to obtain a dependency-preserving BCNF decomposition of a relation
  • (D)
    It is not always possible to obtain a dependency-preserving 2NF decomposition of a relation

Answer (official key): A, B, C

Worked solution: in your report after you take this paper.

Q33 · Programming and Data Structures · Numerical · 1 mark

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)

Answer (official key): 11

Worked solution: in your report after you take this paper.

Q34 · Operating System · Numerical · 1 mark

Consider a system consisting of kk instances of a resource RR, being shared by 5 processes. Assume that each process requires a maximum of two instances of resource RR 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 kk for the system to be deadlock-free is ________.
(answer in integer)

Answer (official key): 6

Worked solution: in your report after you take this paper.

Q35 · Calculus · Numerical · 1 mark

Consider the function f:R→Rf:\mathbb{R}\to\mathbb{R} defined as follows:

f(x)={c1ex−c2log⁡e(1x),if x>03,otherwisef(x)= \begin{cases} c_1 e^x - c_2 \log_e\left(\frac{1}{x}\right), & \text{if } x>0 \\ 3, & \text{otherwise} \end{cases}

where c1,c2∈Rc_1, c_2 \in \mathbb{R}.

If ff is continuous at x=0x=0, then c1+c2=c_1 + c_2 = _________.
(answer in integer)

Answer (official key): 3

Worked solution: in your report after you take this paper.

Q36 · Digital Logic · MCQ · 2 marks

Consider a 2-bit saturating up/down counter that performs the saturating up count when the input PP is 0, and the saturating down count when PP 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.

PPQ1Q_1Q0Q_0Q1+Q_1^+Q0+Q_0^+
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, D1D_1 and D0D_0?

  • (A)
    D1=PQ1+P‾Q0+Q1Q0,D0=PQ0+P‾Q1+Q1Q0‾D_1 = P Q_1 + \overline{P}Q_0 + Q_1Q_0,\quad D_0 = P Q_0 + \overline{P}Q_1 + \overline{Q_1Q_0}
  • (B)
    D1=P‾Q1+P‾Q0+Q1Q0,D0=P‾ Q0‾+P‾Q1+Q1Q0‾D_1 = \overline{P}Q_1 + \overline{P}Q_0 + Q_1Q_0,\quad D_0 = \overline{P}\,\overline{Q_0} + \overline{P}Q_1 + \overline{Q_1Q_0}
  • (C)
    D1=P‾ Q1‾+P‾Q0+Q1Q0,D0=P‾Q0+P‾Q1+Q1Q0‾D_1 = \overline{P}\,\overline{Q_1} + \overline{P}Q_0 + Q_1Q_0,\quad D_0 = \overline{P}Q_0 + \overline{P}Q_1 + \overline{Q_1Q_0}
  • (D)
    D1=P Q1‾+P‾Q0+Q1Q0,D0=P Q0‾+P‾Q1+Q1Q0‾D_1 = P\,\overline{Q_1} + \overline{P}Q_0 + Q_1Q_0,\quad D_0 = P\,\overline{Q_0} + \overline{P}Q_1 + \overline{Q_1Q_0}

Answer (official key): B

Worked solution: in your report after you take this paper.

Q37 · Programming and Data Structures · MCQ · 2 marks

Let PP be the set of all integers from 1 to 15. Consider any order of insertion of the elements of PP 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?

  • (A)
    4
  • (B)
    2
  • (C)
    10
  • (D)
    5

Answer (official key): D

Worked solution: in your report after you take this paper.

Q38 · Programming and Data Structures · MCQ · 2 marks

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?

  • (A)
    E1: head == NULL
    E2: 1 + getListSize(head)
  • (B)
    E1: head->next == NULL
    E2: 1 + getListSize(head->next)
  • (C)
    E1: head == NULL
    E2: 1 + getListSize(head->next)
  • (D)
    E1: head->next == NULL
    E2: 1 + getListSize(head)

Answer (official key): B

Worked solution: in your report after you take this paper.

Q39 · Computer Organization and Architecture · MCQ · 2 marks

The size of the physical address space of a processor is 2322^{32} bytes. The capacity of a cache memory unit is 2232^{23} bytes. The cache block size is 128 bytes. The cache memory unit can be built as a direct mapped cache or as a KK-way set-associative cache, where K=2LK = 2^L and L∈{1,2,3}L \in \{1,2,3\}. Let the length of the TAG field be MM bits for the direct mapped cache, and NN bits for the set-associative cache.

Which one of the following options is true?

  • (A)
    N=M+LN = M + L
  • (B)
    N=M−LN = M - L
  • (C)
    N=M+KN = M + K
  • (D)
    N=M−KN = M - K

Answer (official key): A

Worked solution: in your report after you take this paper.

Q40 · Digital Logic · MCQ · 2 marks

Consider the real valued variables XX, YY and ZZ represented using the IEEE 754 single-precision floating-point format. The binary representations of XX and YY in hexadecimal notation are as follows:

X: 35C00000Y: 34A00000X:\ \texttt{35C00000} \qquad Y:\ \texttt{34A00000}

Let Z=X+YZ = X + Y.

Which one of the following is the binary representation of ZZ, in hexadecimal notation?

  • (A)
    35C80000
  • (B)
    35CC0000
  • (C)
    35E80000
  • (D)
    35EC0000

Answer (official key): C

Worked solution: in your report after you take this paper.

Q41 · Calculus · MSQ · 2 marks

Let f:R→Rf:\mathbb{R}\to\mathbb{R} be defined as follows:

f(x)=(∣x∣2−x)(x−∣x∣2)f(x) = \left(\frac{|x|}{2} - x\right)\left(x - \frac{|x|}{2}\right)

Which of the following statements is/are true?

  • (A)
    ff has a local maximum
  • (B)
    ff has a local minimum
  • (C)
    f′f' is continuous over R\mathbb{R}
  • (D)
    f′f' is not differentiable over R\mathbb{R}

Answer (official key): A, C, D

Worked solution: in your report after you take this paper.

Q42 · Algorithms · MSQ · 2 marks

Let G(V,E)G(V,E) be a simple, undirected graph. A vertex cover of GG is a subset V′⊆VV' \subseteq V such that for every (u,v)∈E(u,v) \in E, u∈V′u \in V' or v∈V′v \in V'. Let the size of the smallest vertex cover in GG be kk. Let SS be any vertex cover of size kk.

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

  • (A)
    The degree of vv is at least k+1k+1
  • (B)
    The vertex vv is on a path of length k+1k+1
  • (C)
    The vertex vv is on a cycle of length k+1k+1
  • (D)
    The vertex vv is a part of a clique of size kk

Answer (official key): A

Worked solution: in your report after you take this paper.

Q43 · Digital Logic · MSQ · 2 marks

Consider a Boolean function FF with the following minterm expression:

F(P,Q,R,S)=∑m(1,2,3,4,5,7,10,12,13,14)F(P,Q,R,S) = \sum 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 FF?

  • (A)
    P‾S+QR‾+P‾ Q‾R+Q‾RS‾\overline{P}S + Q\overline{R} + \overline{P}\,\overline{Q}R + \overline{Q}R\overline{S}
  • (B)
    P‾S+QR‾+P‾ Q‾R+PRS‾\overline{P}S + Q\overline{R} + \overline{P}\,\overline{Q}R + PR\overline{S}
  • (C)
    P‾S+QR‾+PQS‾+PRS‾\overline{P}S + Q\overline{R} + PQ\overline{S} + PR\overline{S}
  • (D)
    P‾S+QR‾+PQS‾+Q‾RS‾\overline{P}S + Q\overline{R} + PQ\overline{S} + \overline{Q}R\overline{S}

Answer (official key): B, D

Worked solution: in your report after you take this paper.

Q44 · Algorithms · MCQ · 2 marks

Let G(V,E)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∈Vs \in V be a vertex in GG. For every u∈Vu \in V and for every k≥0k \geq 0, let dk(u)d_k(u) denote the weight of a shortest path (in terms of weight) from ss to uu of length at most kk. If there is no path from ss to uu of length at most kk, then dk(u)=∞d_k(u)=\infty.

Consider the statements:

S1: For every k≥0k \geq 0 and u∈Vu \in V, dk+1(u)≤dk(u)d_{k+1}(u) \le d_k(u).

S2: For every (u,v)∈E(u,v) \in E, if (u,v)(u,v) is part of a shortest path (in terms of weight) from ss to vv, then for every k≥0k \geq 0, dk(u)≤dk(v)d_k(u) \le d_k(v).

Which one of the following options is correct?

  • (A)
    Only S1 is true
  • (B)
    Only S2 is true
  • (C)
    Both S1 and S2 are true
  • (D)
    Neither S1 nor S2 is true

Answer (official key): A

Worked solution: in your report after you take this paper.

Q45 · Algorithms · MSQ · 2 marks

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

DFS(G)(G):
unmark all v∈Vv \in V
t←0t \leftarrow 0
for each v∈Vv \in V
if vv is unmarked
t←Explore(G,v,t)t \leftarrow \text{Explore}(G,v,t)
end if
end for

Explore(G,v,t)(G,v,t):
mark vv
t←t+1t \leftarrow t + 1
d[v]←td[v] \leftarrow t
for each (v,w)∈E(v,w) \in E
if ww is unmarked
t←Explore(G,w,t)t \leftarrow \text{Explore}(G,w,t)
end if
end for
t←t+1t \leftarrow t + 1
f[v]←tf[v] \leftarrow t
return tt

Suppose that the input directed graph G(V,E)G(V,E) is a directed acyclic graph (DAG). For an edge (u,v)∈E(u,v) \in E, which of the following options will NEVER be correct?

  • (A)
    d[u]<d[v]<f[v]<f[u]d[u] < d[v] < f[v] < f[u]
  • (B)
    d[v]<d[u]<f[u]<f[v]d[v] < d[u] < f[u] < f[v]
  • (C)
    d[v]<f[v]<d[u]<f[u]d[v] < f[v] < d[u] < f[u]
  • (D)
    d[u]<d[v]<f[u]<f[v]d[u] < d[v] < f[u] < f[v]

Answer (official key): B, D

Worked solution: in your report after you take this paper.

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

Read the worked solution

Q47 · Computer Networks · MCQ · 2 marks

Consider the implementation of sliding window protocol over a lossless link, with a window size of WW frames, where each frame is of size 1000 bits (including header). The bandwidth of the link is 100 kbps (1k=103)(1k = 10^3) 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 WW (in number of frames) required to achieve 100% link utilization?

  • (A)
    10
  • (B)
    21
  • (C)
    20
  • (D)
    11

Answer (official key): B

Worked solution: in your report after you take this paper.

Q48 · Computer Networks · MCQ · 2 marks

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 tt denote the time (in milliseconds) at which the transmission of segment number 2000 starts.

Which one of the following options is correct?

  • (A)
    9≤t<109 \le t < 10
  • (B)
    10≤t<1110 \le t < 11
  • (C)
    11≤t<1211 \le t < 12
  • (D)
    12≤t<1312 \le t < 13

Answer (official key): B

Worked solution: in your report after you take this paper.

Q49 · Algorithms · MSQ · 2 marks

Let G(V,E)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 GG is/are true?

  • (A)
    In every cycle CC of GG, the edge with the largest weight in CC is not in any MST
  • (B)
    In every cycle CC of GG, the edge with the smallest weight in CC is in every MST
  • (C)
    For every vertex v∈Vv \in V, the edge with the largest weight incident on vv is not in any MST
  • (D)
    For every vertex v∈Vv \in V, the edge with the smallest weight incident on vv is in every MST

Answer (official key): A, D

Worked solution: in your report after you take this paper.

Q50 · Databases · MCQ · 2 marks

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

E={⟨u⟩∣∃v ∃w ⟨u,v⟩∈R∧⟨v,w⟩∈S}E = \{\langle u\rangle \mid \exists v\ \exists w\ \langle u,v\rangle \in R \land \langle v,w\rangle \in S\}

be a tuple relational calculus expression.

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

  • (A)
    ΠP(R⋈R.P=S.XS)\Pi_P(R \bowtie_{R.P = S.X} S)
  • (B)
    ΠP(S⋈S.X=R.QR)\Pi_P(S \bowtie_{S.X = R.Q} R)
  • (C)
    ΠP(R⋈R.P=S.YS)\Pi_P(R \bowtie_{R.P = S.Y} S)
  • (D)
    ΠP(S⋈S.Y=R.QR)\Pi_P(S \bowtie_{S.Y = R.Q} R)

Answer (official key): B

Worked solution: in your report after you take this paper.

Q51 · Computer Organization and Architecture · Numerical · 2 marks

Not in GATE 2027 syllabus: Secondary storage (magnetic disk)

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)

Answer (official key): 77.3

Worked solution: in your report after you take this paper.

Q52 · Discrete Mathematics · Numerical · 2 marks

Let GG be an undirected graph, which is a path on 8 vertices. The number of matchings in GG is ________.
(answer in integer)

Answer (official key): 34

Worked solution: in your report after you take this paper.

Q53 · Programming and Data Structures · Numerical · 2 marks

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

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

The position of the element 60 in the postorder traversal of TT is ________.
(answer in integer)

Note: The position begins with 1.

Answer (official key): 7

Worked solution: in your report after you take this paper.

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

Read the worked solution

Q55 · Discrete Mathematics · MSQ · 2 marks

An undirected, unweighted, simple graph G(V,E)G(V,E) is said to be 2-colorable if there exists a function

c:V→{0,1}c: V \to \{0,1\}

such that for every (u,v)∈E(u,v) \in E,

c(u)≠c(v).c(u) \ne c(v).

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

  • (A)
    If GG is 2-colorable, then GG may contain cycles of odd length
  • (B)
    If GG is 2-colorable, then GG may contain cycles of even length
  • (C)
    An optimal algorithm for testing whether GG is 2-colorable runs in time Θ(∣V∣+∣E∣)\Theta(|V|+|E|)
  • (D)
    An optimal algorithm for testing whether GG is 2-colorable runs in time Θ(∣E∣log⁡∣V∣)\Theta(|E|\log|V|)

Answer (official key): B, C

Worked solution: in your report after you take this paper.

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

Read the worked solution

Q57 · Compiler Design · MSQ · 2 marks

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

DD is the start symbol, and int, float and id are the three terminals. The non-terminal V1V_1 is the same as VV and the non-terminal D1D_1 is the same as DD. Here, the subscript is used only 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 PP and QQ be the languages specified by grammars G1G_1 and G2G_2, respectively.

SDD1

Grammar G1G_1 with semantic rules:

D→TVD.type=T.type,  V.type=T.typeD \to TV \qquad D.type = T.type,\; V.type = T.type T→intT.type=intT \to int \qquad T.type = int T→floatT.type=floatT \to float \qquad T.type = float V→V1 idV1.type=V.type,  put(id.entry, V.type)V \to V_1\ id \qquad V_1.type = V.type,\; put(id.entry,\ V.type) V→idput(id.entry, V.type)V \to id \qquad put(id.entry,\ V.type)

SDD2

Grammar G2G_2 with semantic rules:

D→D1 idD.type=D1.type,  put(id.entry, D1.type)D \to D_1\ id \qquad D.type = D_1.type,\; put(id.entry,\ D_1.type) D→T idD.type=T.type,  put(id.entry, T.type)D \to T\ id \qquad D.type = T.type,\; put(id.entry,\ T.type) T→intT.type=intT \to int \qquad T.type = int T→floatT.type=floatT \to float \qquad T.type = float

Which of the following statements is/are true?

  • (A)
    The languages PP and QQ are the same
  • (B)
    SDD2 is S-attributed and contains only synthesized attributes
  • (C)
    SDD1 is L-attributed and contains only inherited attributes
  • (D)
    The specifications of SDD1 and SDD2 are such that the same entries get added to the symbol table

Answer (official key): A, B, D

Worked solution: in your report after you take this paper.

Q58 · Probability and Statistics · Numerical · 2 marks

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

Pr⁡(X=1)=Pr⁡(X=2)=Pr⁡(X=5)=Pr⁡(X=7)=16\Pr(X=1)=\Pr(X=2)=\Pr(X=5)=\Pr(X=7)=\frac{1}{6}

and

Pr⁡(X=3)=Pr⁡(X=4)=Pr⁡(X=6)=Pr⁡(X=8)=112.\Pr(X=3)=\Pr(X=4)=\Pr(X=6)=\Pr(X=8)=\frac{1}{12}.

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

Answer (official key): 4.24 to 4.26

Worked solution: in your report after you take this paper.

Q59 · Theory of Computation · MSQ · 2 marks

Consider the following context-free grammar GG.

S→abaABAbbaS \to abaABAbba A→aaBBAb∣bBabaaA \to aaBBAb \mid bBabaa B→aBb∣abB \to aBb \mid ab

In the above grammar, SS is the start symbol, aa and bb are terminal symbols, and AA and BB are non-terminal symbols.

Let L(G)L(G) be the language generated by the grammar GG. For a string s∈L(G)s \in L(G), let n1(s)n_1(s) be the number of aa's in ss and n2(s)n_2(s) be the number of bb's in ss.

Which of the following statements is/are true?

  • (A)
    There is a string s∈L(G)s \in L(G) such that n1(s)<n2(s)n_1(s) < n_2(s)
  • (B)
    For every string s∈L(G)s \in L(G), n1(s)≥n2(s)n_1(s) \ge n_2(s)
  • (C)
    There is a string s∈L(G)s \in L(G) such that n1(s)>2n2(s)n_1(s) > 2n_2(s)
  • (D)
    For every string s∈L(G)s \in L(G), n1(s)≤2n2(s)n_1(s) \le 2n_2(s)

Answer (official key): B, D

Worked solution: in your report after you take this paper.

Q60 · Operating System · MSQ · 2 marks

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?

  • (A)
    TLB miss, Page table hit, Cache hit
  • (B)
    TLB hit, Page table miss, Cache hit
  • (C)
    TLB miss, Page table miss, Cache hit
  • (D)
    TLB miss, Page table miss, Cache miss

Answer (official key): B, C

Worked solution: in your report after you take this paper.

Q61 · Theory of Computation · MSQ · 2 marks

Let L1L_1 and L2L_2 be two languages over a finite alphabet, such that L1∩L2L_1 \cap L_2 and L2L_2 are regular languages.

Which of the following statements is/are always true?

  • (A)
    L1L_1 is regular
  • (B)
    L1∪L2L_1 \cup L_2 is regular
  • (C)
    L2L_2 is context-free
  • (D)
    L1L_1 is context-free

Answer (official key): C

Worked solution: in your report after you take this paper.

Q62 · Computer Organization and Architecture · Numerical · 2 marks

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 tEXt_{EX} denote the time taken by the EX stage to perform the operation for an instruction. For each instruction type, the values of tEXt_{EX} and MM (the number of instructions of that type in a sequence of 100 instructions for a program PP), 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.

InstructiontEXt_{EX} in nanosecondsMM
LOAD1.815
IMUL1.510
IDIV2.55
FADD1.710
FSUB1.75
FMUL2.815
FDIV3.25
All other instructionsLess than 1.035

When program PP 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)

Answer (official key): 95

Worked solution: in your report after you take this paper.

Q63 · Operating System · Numerical · 2 marks

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)

Answer (official key): 4

Worked solution: in your report after you take this paper.

Q64 · Databases · Numerical · 2 marks

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

Answer (official key): 6

Worked solution: in your report after you take this paper.

Q65 · Operating System · Numerical · 2 marks

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,t = 10, 20, 30, 40, and 50 seconds. Similarly, a new process of type C arrives at time t=11,22,33,44,t = 11, 22, 33, 44, and 55 seconds. The CPU scheduling policy is First Come First Serve (FCFS). The first process of type A starts running at t=10t = 10 seconds.

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

Answer (official key): 9.5

Worked solution: in your report after you take this paper.