GATE 2024 CS (Set 1)

All 65 questions of GATE 2024 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

If two distinct non-zero real variables xx and yy are such that (x+y)(x+y) is proportional to (x−y)(x-y), then the value of

xy\frac{x}{y}
  • (A)
    depends on xyxy
  • (B)
    depends only on xx and not on yy
  • (C)
    depends only on yy and not on xx
  • (D)
    is a constant

Answer (official key): D

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

Q2 · General Aptitude · MCQ · 1 mark

Consider the following sample of numbers:

9, 18, 11, 14, 15, 17, 10, 69, 11, 139,\ 18,\ 11,\ 14,\ 15,\ 17,\ 10,\ 69,\ 11,\ 13

The median of the sample is

  • (A)
    13.5
  • (B)
    14
  • (C)
    11
  • (D)
    18.7

Answer (official key): A

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

Q3 · General Aptitude · MCQ · 1 mark

If ‘→\to’ denotes increasing order of intensity, then the meaning of the words

[dry→arid→parched][\text{dry} \to \text{arid} \to \text{parched}]

is analogous to

[diet→fast→‾].[\text{diet} \to \text{fast} \to \underline{\hspace{1.5cm}}].

Which one of the given options is appropriate to fill the blank?

  • (A)
    starve
  • (B)
    reject
  • (C)
    feast
  • (D)
    deny

Answer (official key): A

Read the worked solution

Q4 · General Aptitude · MCQ · 1 mark

For positive non-zero real variables pp and qq, if

log⁡(p2+q2)=log⁡p+log⁡q+2log⁡3,\log(p^2+q^2) = \log p + \log q + 2\log 3,

then the value of

p4+q4p2q2\frac{p^4+q^4}{p^2 q^2}

is

  • (A)
    79
  • (B)
    81
  • (C)
    9
  • (D)
    83

Answer (official key): A

Read the worked solution

Q5 · General Aptitude · MCQ · 1 mark

The number of coins of ₹1, ₹5, and ₹10 denominations that a person has are in the ratio 5:3:135:3:13. Of the total amount, the percentage of money in ₹5 coins is

  • (A)
    21%21\%
  • (B)
    1427%14\frac{2}{7}\%
  • (C)
    10%10\%
  • (D)
    30%30\%

Answer (official key): C

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

Q6 · General Aptitude · MCQ · 2 marks

The least number of squares to be added in the figure to make AB a line of symmetry is

Figure for GATE 2024 CS (Set 1) question 6 (Spatial Aptitude)

  • (A)
    6
  • (B)
    4
  • (C)
    5
  • (D)
    7

Answer (official key): A

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

Q7 · General Aptitude · MCQ · 2 marks

In the given text, the blanks are numbered (i)–(iv). Select the best match for all the blanks.

Steve was advised to keep his head (i) before heading (ii) to bat; for, while he had a head (iii) batting, he could only do so with a cool head (iv) his shoulders.

  • (A)
    (i) down (ii) down (iii) on (iv) for
  • (B)
    (i) on (ii) down (iii) for (iv) on
  • (C)
    (i) down (ii) out (iii) for (iv) on
  • (D)
    (i) on (ii) out (iii) on (iv) for

Answer (official key): C

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

Q8 · General Aptitude · MCQ · 2 marks

A rectangular paper of 20 cm×8 cm20\ \text{cm} \times 8\ \text{cm} is folded 3 times. Each fold is made along the line of symmetry, which is perpendicular to its long edge. The perimeter of the final folded sheet (in cm) is

  • (A)
    18
  • (B)
    24
  • (C)
    20
  • (D)
    21

Answer (official key): A

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

Q9 · General Aptitude · MCQ · 2 marks

The pie chart presents the percentage contribution of different macronutrients to a typical 2,000 kcal diet of a person.

Macronutrient energy contribution

The typical energy density (kcal/g) of these macronutrients is given in the chart. The total fat (all three types), in grams, this person consumes is

  • (A)
    44.4
  • (B)
    77.8
  • (C)
    100
  • (D)
    3,600

Answer (official key): C

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

Q10 · General Aptitude · MCQ · 2 marks

A rectangular paper sheet of dimensions 54 cm×4 cm54\ \text{cm} \times 4\ \text{cm} is taken. The two longer edges of the sheet are joined together to create a cylindrical tube. A cube whose surface area is equal to the area of the sheet is also taken.

Then, the ratio of the volume of the cylindrical tube to the volume of the cube is

  • (A)
    1π\dfrac{1}{\pi}
  • (B)
    2π\dfrac{2}{\pi}
  • (C)
    3π\dfrac{3}{\pi}
  • (D)
    4π\dfrac{4}{\pi}

Answer (official key): A

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

Q11 · Probability and Statistics · MSQ · 1 mark

Let AA and BB be two events in a probability space with

P(A)=0.3,P(B)=0.5,P(A∩B)=0.1.P(A)=0.3,\qquad P(B)=0.5,\qquad P(A\cap B)=0.1.

Which of the following statements is/are TRUE?

  • (A)
    The two events AA and BB are independent
  • (B)
    P(A∪B)=0.7P(A\cup B)=0.7
  • (C)
    P(A∩Bc)=0.2P(A\cap B^c)=0.2
  • (D)
    P(Ac∩Bc)=0.4P(A^c\cap B^c)=0.4

Answer (official key): B, C

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

Q12 · Databases · MCQ · 1 mark

Let SS be the specification:

“Instructors teach courses. Students register for courses. Courses are allocated classrooms. Instructors guide students.”

Which one of the following ER diagrams CORRECTLY represents SS?

ER diagram options for Q20

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

Answer (official key): D

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

Q13 · Databases · MCQ · 1 mark

In a B+ tree, the requirement of at least half-full (50%) node occupancy is relaxed for which one of the following cases?

  • (A)
    Only the root node
  • (B)
    All leaf nodes
  • (C)
    All internal nodes
  • (D)
    Only the leftmost leaf node

Answer (official key): A

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

Q14 · Operating System · MSQ · 1 mark

Which of the following process state transitions is/are NOT possible?

  • (A)
    Running to Ready
  • (B)
    Waiting to Running
  • (C)
    Ready to Waiting
  • (D)
    Running to Terminated

Answer (official key): B, C

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

Q15 · Theory of Computation · MSQ · 1 mark

Let L1,L2L_1, L_2 be two regular languages and L3L_3 a language which is not regular. Which of the following statements is/are always TRUE?

  • (A)
    L1=L2L_1 = L_2 if and only if L1∩L2‾=ϕL_1 \cap \overline{L_2} = \phi
  • (B)
    L1∪L3L_1 \cup L_3 is not regular
  • (C)
    L3‾\overline{L_3} is not regular
  • (D)
    L1‾∪L2‾\overline{L_1} \cup \overline{L_2} is regular

Answer (official key): C, D

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

Q16 · Compiler Design · MSQ · 1 mark

Which of the following is/are Bottom-Up Parser(s)?

  • (A)
    Shift-reduce Parser
  • (B)
    Predictive Parser
  • (C)
    LL(1) Parser
  • (D)
    LR Parser

Answer (official key): A, D

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

Q17 · Computer Organization and Architecture · MSQ · 1 mark

Consider a 5-stage pipelined processor with Instruction Fetch (IF), Instruction Decode (ID), Execute (EX), Memory Access (MEM), and Register Writeback (WB) stages. Which of the following statements about forwarding is/are CORRECT?

  • (A)
    In a pipelined execution, forwarding means the result from a source stage of an earlier instruction is passed on to the destination stage of a later instruction
  • (B)
    In forwarding, data from the output of the MEM stage can be passed on to the input of the EX stage of the next instruction
  • (C)
    Forwarding cannot prevent all pipeline stalls
  • (D)
    Forwarding does not require any extra hardware to retrieve the data from the pipeline stages

Answer (official key): A, B, C

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

Q18 · Digital Logic · MSQ · 1 mark

Consider the circuit shown below where the gates may have propagation delays. Assume that all signal transitions occur instantaneously and that wires have no delays. Which of the following statements about the circuit is/are CORRECT?

Circuit for Q28

  • (A)
    With no propagation delays, the output YY is always logic Zero
  • (B)
    With no propagation delays, the output YY is always logic One
  • (C)
    With propagation delays, the output YY can have a transient logic One after XX transitions from logic Zero to logic One
  • (D)
    With propagation delays, the output YY can have a transient logic Zero after XX transitions from logic One to logic Zero

Answer (official key): A, C

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

Q19 · Computer Networks · MSQ · 1 mark

TCP client PP successfully establishes a connection to TCP server QQ. Let NPN_P denote the sequence number in the SYN sent from PP to QQ. Let NQN_Q denote the acknowledgement number in the SYN ACK from QQ to PP.

Which of the following statements is/are CORRECT?

  • (A)
    The sequence number NPN_P is chosen randomly by PP
  • (B)
    The sequence number NPN_P is always 0 for a new connection
  • (C)
    The acknowledgement number NQN_Q is equal to NPN_P
  • (D)
    The acknowledgement number NQN_Q is equal to NP+1N_P + 1

Answer (official key): A, D

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

Q20 · Operating System · MSQ · 1 mark

Which of the following statements about threads is/are TRUE?

  • (A)
    Threads can only be implemented in kernel space
  • (B)
    Each thread has its own file descriptor table for open files
  • (C)
    All the threads belonging to a process share a common stack
  • (D)
    Threads belonging to a process are by default not protected from each other

Answer (official key): D

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

Q21 · Databases · MSQ · 1 mark

Which of the following statements about a relation RR in first normal form (1NF) is/are TRUE?

  • (A)
    RR can have a multi-attribute key
  • (B)
    RR cannot have a foreign key
  • (C)
    RR cannot have a composite attribute
  • (D)
    RR cannot have more than one candidate key

Answer (official key): A, C

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

Q22 · Discrete Mathematics · Numerical · 1 mark

Let AA and BB be non-empty finite sets such that there exist one-to-one and onto functions: (i) from AA to BB, and (ii) from A×AA \times A to A∪BA \cup B.

The number of possible values of ∣A∣|A| is __________.
(answer in integer)

Answer (official key): 2

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

Q23 · Discrete Mathematics · Numerical · 1 mark

The number of spanning trees in a complete graph of 4 vertices labelled A, B, C, and D is __________.
(answer in integer)

Answer (official key): 16

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

Q24 · Compiler Design · Numerical · 1 mark

Consider the operator precedence and associativity rules for the integer arithmetic operators given in the table below.

OperatorPrecedenceAssociativity
++HighestLeft
−-HighRight
∗*MediumRight
//LowRight

The value of the expression

3+1+5∗2/7+2−4−7−6/23 + 1 + 5 * 2 / 7 + 2 - 4 - 7 - 6 / 2

as per the above rules is __________.
(answer in integer)

Answer (official key): 6

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

Q25 · Computer Networks · MSQ · 1 mark

Which of the following fields is/are modified in the IP header of a packet going out of a network address translation (NAT) device from an internal network to an external network?

  • (A)
    Source IP
  • (B)
    Destination IP
  • (C)
    Header Checksum
  • (D)
    Total Length

Answer (official key): A, C

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

Q26 · Databases · Numerical · 1 mark

Consider the following two relations, R(A,B)R(A,B) and S(A,C)S(A,C):

R.AR.AR.BR.B
1020
2030
3040
3050
5095
S.AS.AS.CS.C
1090
3045
4080

The total number of tuples obtained by evaluating the following expression

σB<C(R⋈R.A=S.AS)\sigma_{B<C}(R \bowtie_{R.A=S.A} S)

is __________.
(answer in integer)

Answer (official key): 2

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

Q27 · Programming and Data Structures · MCQ · 1 mark

Consider the following C program:

#include <stdio.h>
void fX();
int main(){
  fX();
  return 0;
}
void fX(){
  char a;
  if((a=getchar()) != '\n')
    fX();
  if(a != '\n')
    putchar(a);
}

Assume that the input to the program from the command line is 1234 followed by a newline character. Which one of the following statements is CORRECT?

  • (A)
    The program will not terminate
  • (B)
    The program will terminate with no output
  • (C)
    The program will terminate with 4321 as output
  • (D)
    The program will terminate with 1234 as output

Answer (official key): C

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

Q28 · Computer Organization and Architecture · MCQ · 1 mark

Which one of the following statements is FALSE?

  • (A)
    In the cycle stealing mode of DMA, one word of data is transferred between an I/O device and main memory in a stolen cycle
  • (B)
    For bulk data transfer, the burst mode of DMA has a higher throughput than the cycle stealing mode
  • (C)
    Programmed I/O mechanism has a better CPU utilization than the interrupt driven I/O mechanism
  • (D)
    The CPU can start executing an interrupt service routine faster with vectored interrupts than with non-vectored interrupts

Answer (official key): C

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

Q29 · Linear Algebra · MCQ · 1 mark

The product of all eigenvalues of the matrix

[123456789]\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}

is

  • (A)
    −1-1
  • (B)
    00
  • (C)
    11
  • (D)
    22

Answer (official key): B

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

Q30 · Algorithms · MCQ · 1 mark

Given an integer array of size NN, we want to check if the array is sorted (in either ascending or descending order). An algorithm solves this problem by making a single pass through the array and comparing each element of the array only with its adjacent elements. The worst-case time complexity of this algorithm is

  • (A)
    both O(N)O(N) and Ω(N)\Omega(N)
  • (B)
    O(N)O(N) but not Ω(N)\Omega(N)
  • (C)
    Ω(N)\Omega(N) but not O(N)O(N)
  • (D)
    neither O(N)O(N) nor Ω(N)\Omega(N)

Answer (official key): A

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

Q31 · Programming and Data Structures · MCQ · 1 mark

Consider the following C program:

#include <stdio.h>
int main(){
  int a = 6;
  int b = 0;
  while(a < 10) {
    a = a / 12 + 1;
    a += b;
  }
  printf("%d", a);
  return 0;
}

Which one of the following statements is CORRECT?

  • (A)
    The program prints 9 as output
  • (B)
    The program prints 10 as output
  • (C)
    The program gets stuck in an infinite loop
  • (D)
    The program prints 6 as output

Answer (official key): C

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

Q32 · Computer Networks · MCQ · 1 mark

A user starts browsing a webpage hosted at a remote server. The browser opens a single TCP connection to fetch the entire webpage from the server. The webpage consists of a top-level index page with multiple embedded image objects. Assume that all caches (e.g., DNS cache, browser cache) are all initially empty. The following packets leave the user’s computer in some order.

(i) HTTP GET request for the index page
(ii) DNS request to resolve the web server’s name to its IP address
(iii) HTTP GET request for an image object
(iv) TCP SYN to open a connection to the web server

Which one of the following is the CORRECT chronological order (earliest in time to latest) of the packets leaving the computer?

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

Answer (official key): C

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

Q33 · Probability and Statistics · MCQ · 1 mark

Consider a permutation sampled uniformly at random from the set of all permutations of {1,2,3,…,n}\{1,2,3,\dots,n\} for some n≥4n\ge 4. Let XX be the event that 1 occurs before 2 in the permutation, and YY the event that 3 occurs before 4. Which one of the following statements is TRUE?

  • (A)
    The events XX and YY are mutually exclusive
  • (B)
    The events XX and YY are independent
  • (C)
    Either event XX or YY must occur
  • (D)
    Event XX is more likely than event YY

Answer (official key): B

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

Q34 · Digital Logic · MCQ · 1 mark

Consider a system that uses 5 bits for representing signed integers in 2’s complement format. In this system, two integers AA and BB are represented as

A=01010andB=11010.A = 01010 \qquad\text{and}\qquad B = 11010.

Which one of the following operations will result in either an arithmetic overflow or an arithmetic underflow?

  • (A)
    A+BA+B
  • (B)
    A−BA-B
  • (C)
    B−AB-A
  • (D)
    2∗B2*B

Answer (official key): B

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

Q35 · Calculus · MCQ · 1 mark

Let f:R→Rf:\mathbb{R}\to\mathbb{R} be a function such that

f(x)=max⁡{x, x3},x∈R,f(x)=\max\{x,\ x^3\}, \qquad x\in\mathbb{R},

where R\mathbb{R} is the set of all real numbers. The set of all points where f(x)f(x) is NOT differentiable is

  • (A)
    {−1,1,2}\{-1, 1, 2\}
  • (B)
    {−2,−1,1}\{-2, -1, 1\}
  • (C)
    {0,1}\{0, 1\}
  • (D)
    {−1,0,1}\{-1, 0, 1\}

Answer (official key): D

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

Q36 · Operating System · MCQ · 2 marks

Consider the following two threads T1 and T2 that update two shared variables aa and bb. Assume that initially a=b=1a = b = 1. Though context switching between threads can happen at any time, each statement of T1 or T2 is executed atomically without interruption.

T1T2
a=a+1;a = a + 1;b=2∗b;b = 2 * b;
b=b+1;b = b + 1;a=2∗a;a = 2 * a;

Which one of the following options lists all the possible combinations of values of aa and bb after both T1 and T2 finish execution?

  • (A)
    (a=4, b=4); (a=3, b=3); (a=4, b=3)(a=4,\ b=4);\ (a=3,\ b=3);\ (a=4,\ b=3)
  • (B)
    (a=3, b=4); (a=4, b=3); (a=3, b=3)(a=3,\ b=4);\ (a=4,\ b=3);\ (a=3,\ b=3)
  • (C)
    (a=4, b=4); (a=4, b=3); (a=3, b=4)(a=4,\ b=4);\ (a=4,\ b=3);\ (a=3,\ b=4)
  • (D)
    (a=2, b=2); (a=2, b=3); (a=3, b=4)(a=2,\ b=2);\ (a=2,\ b=3);\ (a=3,\ b=4)

Answer (official key): A

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

Q37 · Computer Networks · MCQ · 2 marks

Consider a network path P—Q—R between nodes P and R via router Q. Node P sends a file of size 10610^6 bytes to R via this path by splitting the file into chunks of 10310^3 bytes each. Node P sends these chunks one after the other without any wait time between the successive chunk transmissions. Assume that the size of extra headers added to these chunks is negligible, and that the chunk size is less than the MTU. Each of the links P—Q and Q—R has a bandwidth of 10610^6 bits/sec, and negligible propagation latency. Router Q immediately transmits every packet it receives from P to R, with negligible processing and queueing delays. Router Q can simultaneously receive on link P—Q and transmit on link Q—R.

Assume P starts transmitting the chunks at time t=0t = 0.

Which one of the following options gives the time (in seconds, rounded off to 3 decimal places) at which R receives all the chunks of the file?

  • (A)
    8.000
  • (B)
    8.008
  • (C)
    15.992
  • (D)
    16.000

Answer (official key): B

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

Q38 · Compiler Design · MCQ · 2 marks

Consider the following grammar GG, with SS as the start symbol. The grammar GG has three incomplete productions denoted by (1), (2), and (3).

S→daT∣(1)S \to daT \mid (1) T→aS∣bT∣(2)T \to aS \mid bT \mid (2) R→(3)∣ϵR \to (3) \mid \epsilon

The set of terminals is {a,b,c,d,f}\{a, b, c, d, f\}. The FIRST and FOLLOW sets of the different non-terminals are as follows.

FIRST(S)={c,d,f},FIRST(T)={a,b,ϵ},FIRST(R)={c,ϵ}FIRST(S) = \{c, d, f\}, \quad FIRST(T) = \{a, b, \epsilon\}, \quad FIRST(R) = \{c, \epsilon\} FOLLOW(S)=FOLLOW(T)={c,f,$},FOLLOW(R)={f}FOLLOW(S) = FOLLOW(T) = \{c, f, \$\}, \quad FOLLOW(R) = \{f\}

Which one of the following options CORRECTLY fills in the incomplete productions?

  • (A)
    (1) S→RfS \to Rf (2) T→ϵT \to \epsilon (3) R→cTRR \to cTR
  • (B)
    (1) S→fRS \to fR (2) T→ϵT \to \epsilon (3) R→cTRR \to cTR
  • (C)
    (1) S→fRS \to fR (2) T→cTT \to cT (3) R→cRR \to cR
  • (D)
    (1) S→RfS \to Rf (2) T→cTT \to cT (3) R→cRR \to cR

Answer (official key): A

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

Q39 · Compiler Design · MCQ · 2 marks

Consider the following pseudo-code.

L1: t1 = -1
L2: t2 = 0
L3: t3 = 0
L4: t4 = 4 * t3
L5: t5 = 4 * t2
L6: t6 = t5 * M
L7: t7 = t4 + t6
L8: t8 = a[t7]
L9: if t8 <= max goto L11
L10: t1 = t8
L11: t3 = t3 + 1
L12: if t3 < M goto L4
L13: t2 = t2 + 1
L14: if t2 < N goto L3
L15: max = t1

Which one of the following options CORRECTLY specifies the number of basic blocks and the number of instructions in the largest basic block, respectively?

  • (A)
    6 and 6
  • (B)
    6 and 7
  • (C)
    7 and 7
  • (D)
    7 and 6

Answer (official key): D

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

Q40 · Compiler Design · MCQ · 2 marks

Consider the following syntax-directed definition (SDD).

S→DHTU{S.val=D.val+H.val+T.val+U.val;}S \to DHTU \quad \{ S.val = D.val + H.val + T.val + U.val; \} D→"M"D1{D.val=5+D1.val;}D \to "M"D_1 \quad \{ D.val = 5 + D_1.val; \} D→ϵ{D.val=−5;}D \to \epsilon \quad \{ D.val = -5; \} H→"L"H1{H.val=5∗10+H1.val;}H \to "L"H_1 \quad \{ H.val = 5 * 10 + H_1.val; \} H→ϵ{H.val=−10;}H \to \epsilon \quad \{ H.val = -10; \} T→"C"T1{T.val=5∗100+T1.val;}T \to "C"T_1 \quad \{ T.val = 5 * 100 + T_1.val; \} T→ϵ{T.val=−5;}T \to \epsilon \quad \{ T.val = -5; \} U→"K"{U.val=5;}U \to "K" \quad \{ U.val = 5; \}

Given "MMLK" as the input, which one of the following options is the CORRECT value computed by the SDD (in the attribute S.valS.val)?

  • (A)
    45
  • (B)
    50
  • (C)
    55
  • (D)
    65

Answer (official key): A

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

Q41 · Algorithms · MSQ · 2 marks

Let GG be a directed graph and TT a depth first search (DFS) tree in GG that is rooted at a vertex vv. Suppose TT is also a breadth first search (BFS) tree in GG, rooted at vv. Which of the following statements is/are TRUE for every such graph GG and tree TT?

  • (A)
    There are no back-edges in GG with respect to the tree TT
  • (B)
    There are no cross-edges in GG with respect to the tree TT
  • (C)
    There are no forward-edges in GG with respect to the tree TT
  • (D)
    The only edges in GG are the edges in TT

Answer (official key): C

Read the worked solution

Q42 · Programming and Data Structures · MCQ · 2 marks

An array

[82, 101, 90, 11, 111, 75, 33, 131, 44, 93][82,\ 101,\ 90,\ 11,\ 111,\ 75,\ 33,\ 131,\ 44,\ 93]

is heapified. Which one of the following options represents the first three elements in the heapified array?

  • (A)
    82, 90, 101
  • (B)
    82, 11, 93
  • (C)
    131, 11, 93
  • (D)
    131, 111, 90

Answer (official key): D

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

Q43 · Theory of Computation · MSQ · 2 marks

Consider the 5-state DFA MM accepting the language

L(M)⊂(0+1)∗L(M) \subset (0+1)^*

shown below. For any string w∈(0+1)∗w \in (0+1)^*, let n0(w)n_0(w) be the number of 0's in ww and n1(w)n_1(w) be the number of 1's in ww.

5-state DFA for Q50

Which of the following statements is/are FALSE?

  • (A)
    States 2 and 4 are distinguishable in MM
  • (B)
    States 3 and 4 are distinguishable in MM
  • (C)
    States 2 and 5 are distinguishable in MM
  • (D)
    Any string ww with n0(w)=n1(w)n_0(w)=n_1(w) is in L(M)L(M)

Answer (official key): B, C

Read the worked solution

Q44 · Programming and Data Structures · MSQ · 2 marks

Consider the following C function definition.

int f(int x, int y) {
  for (int i=0; i<y; i++) {
    x = x + x + y;
  }
  return x;
}

Which of the following statements is/are TRUE about the above function?

  • (A)
    If the inputs are x=20, y=10x=20,\ y=10, then the return value is greater than 2202^{20}
  • (B)
    If the inputs are x=20, y=20x=20,\ y=20, then the return value is greater than 2202^{20}
  • (C)
    If the inputs are x=20, y=10x=20,\ y=10, then the return value is less than 2102^{10}
  • (D)
    If the inputs are x=10, y=20x=10,\ y=20, then the return value is greater than 2202^{20}

Answer (official key): B, D

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

Q45 · Digital Logic · MSQ · 2 marks

Consider a Boolean expression given by

F(X,Y,Z)=∑(3,5,6,7).F(X,Y,Z)=\sum(3,5,6,7).

Which of the following statements is/are CORRECT?

  • (A)
    F(X,Y,Z)=Π(0,1,2,4)F(X,Y,Z)=\Pi(0,1,2,4)
  • (B)
    F(X,Y,Z)=XY+YZ+XZF(X,Y,Z)=XY + YZ + XZ
  • (C)
    F(X,Y,Z)F(X,Y,Z) is independent of input YY
  • (D)
    F(X,Y,Z)F(X,Y,Z) is independent of input XX

Answer (official key): A, B

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

Q46 · Linear Algebra · MSQ · 2 marks

Let AA be any n×mn \times m matrix, where m>nm > n. Which of the following statements is/are TRUE about the system of linear equations

Ax=0 ?Ax = 0 \ ?
  • (A)
    There exist at least m−nm-n linearly independent solutions to this system
  • (B)
    There exist m−nm-n linearly independent vectors such that every solution is a linear combination of these vectors
  • (C)
    There exists a non-zero solution in which at least m−nm-n variables are 00
  • (D)
    There exists a solution in which at least nn variables are non-zero

Answer (official key): A

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

Q47 · Databases · MSQ · 2 marks

The symbol →\to indicates functional dependency in the context of a relational database. Which of the following options is/are TRUE?

  • (A)
    (X,Y)→(Z,W)(X,Y) \to (Z,W) implies X→(Z,W)X \to (Z,W)
  • (B)
    (X,Y)→(Z,W)(X,Y) \to (Z,W) implies (X,Y)→Z(X,Y) \to Z
  • (C)
    ((X,Y)→Z and W→Y)((X,Y) \to Z \text{ and } W \to Y) implies (X,W)→Z(X,W) \to Z
  • (D)
    (X→Y and Y→Z)(X \to Y \text{ and } Y \to Z) implies X→ZX \to Z

Answer (official key): B, C, D

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

Q48 · Databases · MSQ · 2 marks

Consider the following read-write schedule SS over three transactions T1T_1, T2T_2, and T3T_3, where the subscripts in the schedule indicate transaction IDs:

S: r1(z); w1(z); r2(x); r3(y); w3(y); r2(y); w2(x); w2(y);S:\ r_1(z);\ w_1(z);\ r_2(x);\ r_3(y);\ w_3(y);\ r_2(y);\ w_2(x);\ w_2(y);

Which of the following transaction schedules is/are conflict equivalent to SS?

  • (A)
    T1T2T3T_1 T_2 T_3
  • (B)
    T1T3T2T_1 T_3 T_2
  • (C)
    T3T2T1T_3 T_2 T_1
  • (D)
    T3T1T2T_3 T_1 T_2

Answer (official key): B, C, D

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

Q49 · Programming and Data Structures · MCQ · 2 marks

Consider a binary min-heap containing 105 distinct elements. Let kk be the index (in the underlying array) of the maximum element stored in the heap. The number of possible values of kk is

  • (A)
    53
  • (B)
    52
  • (C)
    27
  • (D)
    1

Answer (official key): A

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

Q50 · Algorithms · MCQ · 2 marks

Consider the following recurrence relation:

T(n)={n T(n)+n,for n≥11,for n=1T(n)= \begin{cases} \sqrt{n}\,T(\sqrt{n}) + n, & \text{for } n \ge 1 \\ 1, & \text{for } n = 1 \end{cases}

Which one of the following options is CORRECT?

  • (A)
    T(n)=Θ(nlog⁡log⁡n)T(n)=\Theta(n \log \log n)
  • (B)
    T(n)=Θ(nlog⁡n)T(n)=\Theta(n \log n)
  • (C)
    T(n)=Θ(n2log⁡n)T(n)=\Theta(n^2 \log n)
  • (D)
    T(n)=Θ(n2log⁡log⁡n)T(n)=\Theta(n^2 \log \log n)

Answer (official key): A

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

Q51 · Algorithms · Numerical · 2 marks

The number of edges present in the forest generated by the DFS traversal of an undirected graph GG with 100 vertices is 40. The number of connected components in GG is _________

Answer (official key): 60

Read the worked solution

Q52 · Discrete Mathematics · MSQ · 2 marks

Consider the operators ⋄\diamond and □\square defined by

a⋄b=a+2b,a□b=ab,a \diamond b = a + 2b,\qquad a \square b = ab,

for positive integers.

Which of the following statements is/are TRUE?

  • (A)
    Operator ⋄\diamond obeys the associative law
  • (B)
    Operator □\square obeys the associative law
  • (C)
    Operator ⋄\diamond over the operator □\square obeys the distributive law
  • (D)
    Operator □\square over the operator ⋄\diamond obeys the distributive law

Answer (official key): B, D

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

Q53 · Computer Organization and Architecture · Numerical · 2 marks

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

Consider a 512 GB hard disk with 32 storage surfaces. There are 4096 sectors per track and each sector holds 1024 bytes of data. The number of cylinders in the hard disk is _________
(answer in integer)

Answer (official key): 4096

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

Q54 · Computer Networks · Numerical · 2 marks

Consider the entries shown below in the forwarding table of an IP router. Each entry consists of an IP prefix and the corresponding next hop router for packets whose destination IP address matches the prefix. The notation “/N” in a prefix indicates a subnet mask with the most significant N bits set to 1.

PrefixNext hop router
10.1.1.0/24R1
10.1.1.128/25R2
10.1.1.64/26R3
10.1.1.192/26R4

This router forwards 20 packets each to 5 hosts. The IP addresses of the hosts are 10.1.1.16, 10.1.1.72, 10.1.1.132, 10.1.1.191, and 10.1.1.205. The number of packets forwarded via the next hop router R2 is _______

Answer (official key): 40

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

Q55 · Computer Organization and Architecture · Numerical · 2 marks

The baseline execution time of a program on a 2 GHz single core machine is 100 nanoseconds (ns). The code corresponding to 90% of the execution time can be fully parallelized. The overhead for using an additional core is 10 ns when running on a multicore system. Assume that all cores in the multicore system run their share of the parallelized code for an equal amount of time.

The number of cores that minimize the execution time of the program is ________
(answer in integer)

Answer (official key): 3

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

Q56 · Digital Logic · Numerical · 2 marks

Consider a digital logic circuit consisting of three 2-to-1 multiplexers M1, M2, and M3 as shown below. X1 and X2 are inputs of M1. X3 and X4 are inputs of M2. A, B, and C are select lines of M1, M2, and M3, respectively.

MUX circuit for Q64

For an instance of inputs X1=1X1=1, X2=1X2=1, X3=0X3=0, and X4=0X4=0, the number of combinations of A,B,CA, B, C that give the output Y=1Y=1 is _________

Answer (official key): 4

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

Q57 · Operating System · Numerical · 2 marks

Consider the following code snippet using the fork() and wait() system calls. Assume that the code compiles and runs correctly, and that the system calls run successfully without any errors.

int x = 3;
while(x > 0) {
  fork();
  printf("hello");
  wait(NULL);
  x--;
}

The total number of times the printf statement is executed is _______

Answer (official key): 14

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

Q58 · Discrete Mathematics · MSQ · 2 marks

The chromatic number of a graph is the minimum number of colours used in a proper colouring of the graph. Let GG be any graph with nn vertices and chromatic number kk.

Which of the following statements is/are always TRUE?

  • (A)
    GG contains a complete subgraph with kk vertices
  • (B)
    GG contains an independent set of size at least n/kn/k
  • (C)
    GG contains at least k(k−1)/2k(k-1)/2 edges
  • (D)
    GG contains a vertex of degree at least kk

Answer (official key): B, C

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

Q59 · Computer Organization and Architecture · MSQ · 2 marks

Consider two set-associative cache memory architectures: WBC, which uses the write back policy, and WTC, which uses the write through policy. Both of them use the LRU (Least Recently Used) block replacement policy. The cache memory is connected to the main memory.

Which of the following statements is/are TRUE?

  • (A)
    A read miss in WBC never evicts a dirty block
  • (B)
    A read miss in WTC never triggers a write back operation of a cache block to main memory
  • (C)
    A write hit in WBC can modify the value of the dirty bit of a cache block
  • (D)
    A write miss in WTC always writes the victim cache block to main memory before loading the missed block to the cache

Answer (official key): B, C

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

Q60 · Theory of Computation · Numerical · 2 marks

Let G=(V,Σ,S,P)G = (V, \Sigma, S, P) be a context-free grammar in Chomsky Normal Form with Σ={a,b,c}\Sigma = \{a,b,c\} and VV containing 10 variable symbols including the start symbol SS. The string

w=a30b30c30w = a^{30} b^{30} c^{30}

is derivable from SS.

The number of steps (application of rules) in the derivation

S⇒∗wS \Rightarrow^* w

is _________

Answer (official key): 179

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

Q61 · Operating System · Numerical · 2 marks

Consider a memory management system that uses a page size of 2 KB. Assume that both the physical and virtual addresses start from 0. Assume that the pages 0, 1, 2, and 3 are stored in the page frames 1, 3, 2, and 0, respectively. The physical address (in decimal format) corresponding to the virtual address 2500 (in decimal format) is _________

Answer (official key): 6596

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

Q62 · Probability and Statistics · Numerical · 2 marks

A bag contains 10 red balls and 15 blue balls. Two balls are drawn randomly without replacement. Given that the first ball drawn is red, the probability (rounded off to 3 decimal places) that both balls drawn are red is _________

Answer (official key): 0.37 to 0.38

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

Q63 · Theory of Computation · Numerical · 2 marks

Consider the following two regular expressions over the alphabet {0,1}\{0,1\}:

r=0∗+1∗r = 0^* + 1^* s=01∗+10∗s = 01^* + 10^*

The total number of strings of length less than or equal to 5, which are neither in rr nor in ss, is _________

Answer (official key): 44

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

Q64 · Computer Organization and Architecture · Numerical · 2 marks

A given program has 25% load/store instructions. Suppose the ideal CPI (cycles per instruction) without any memory stalls is 2. The program exhibits 2% miss rate on instruction cache and 8% miss rate on data cache. The miss penalty is 100 cycles.

The speedup (rounded off to two decimal places) achieved with a perfect cache (i.e., with NO data or instruction cache misses) is _________

Answer (official key): 3

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

Q65 · Computer Networks · Numerical · 2 marks

Consider sending an IP datagram of size 1420 bytes (including 20 bytes of IP header) from a sender to a receiver over a path of two links with a router between them. The first link (sender to router) has an MTU (Maximum Transmission Unit) size of 542 bytes, while the second link (router to receiver) has an MTU size of 360 bytes. The number of fragments that would be delivered at the receiver is ________

Answer (official key): 6

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