GATE 2025 CS (Set 2)

All 65 questions of GATE 2025 CS (Set 2)

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

Let p1p_1 and p2p_2 denote two arbitrary prime numbers. Which one of the following statements is correct for all values of p1p_1 and p2p_2?

  • (A)
    p1+p2p_1 + p_2 is not a prime number.
  • (B)
    p1p2p_1 p_2 is not a prime number.
  • (C)
    p1+p2+1p_1 + p_2 + 1 is a prime number.
  • (D)
    p1p2+1p_1 p_2 + 1 is a prime number.

Answer (official key): B

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

Q2 · General Aptitude · MCQ · 1 mark

Despite his initial hesitation, Rehman''s _________ to contribute to the success of the project never wavered.

Select the most appropriate option to complete the above sentence.

  • (A)
    ambivalence
  • (B)
    satisfaction
  • (C)
    resolve
  • (D)
    revolve

Answer (official key): C

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

Q3 · General Aptitude · MCQ · 1 mark

The paper as shown in the figure is folded to make a cube where each square corresponds to a particular face of the cube. Which one of the following options correctly represents the cube?

Note: The figures shown are representative.

Paper net for cube folding

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

Answer (official key): A

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

Q4 · General Aptitude · MCQ · 1 mark

If Pex=Qe−xPe^x = Qe^{-x} for all real values of xx, which one of the following statements is true?

  • (A)
    P=Q=0P = Q = 0
  • (B)
    P=Q=1P = Q = 1
  • (C)
    P=1;  Q=−1P = 1;\; Q = -1
  • (D)
    PQ=0\dfrac{P}{Q} = 0

Answer (official key): A

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

Q5 · General Aptitude · MCQ · 1 mark

Bird : Nest :: Bee : _______

Select the correct option to complete the analogy.

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

Answer (official key): C

Read the worked solution

Q6 · General Aptitude · MCQ · 2 marks

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

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

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

Answer (official key): B

Read the worked solution

Q7 · General Aptitude · MCQ · 2 marks

Which one of the following options is correct for the given data in the table?

Iteration (i)(i)0123
Input (I)(I)20−4-41015
Output (X)(X)20162641
Output (Y)(Y)20−80-80−800-800−12000-12000
  • (A)
    X(i)=X(i−1)+I(i)X(i) = X(i-1) + I(i); Y(i)=Y(i−1) I(i)Y(i) = Y(i-1)\,I(i); i>0i > 0
  • (B)
    X(i)=X(i−1) I(i)X(i) = X(i-1)\,I(i); Y(i)=Y(i−1)+I(i)Y(i) = Y(i-1) + I(i); i>0i > 0
  • (C)
    X(i)=X(i−1) I(i)X(i) = X(i-1)\,I(i); Y(i)=Y(i−1) I(i)Y(i) = Y(i-1)\,I(i); i>0i > 0
  • (D)
    X(i)=X(i−1)+I(i)X(i) = X(i-1) + I(i); Y(i)=Y(i−1) I(i−1)Y(i) = Y(i-1)\,I(i-1); i>0i > 0

Answer (official key): A

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

Q8 · General Aptitude · MCQ · 2 marks

In the given figure, PQRS is a square of side 2 cm and PLMN is a rectangle. The corner L of the rectangle is on the side QR. Side MN of the rectangle passes through the corner S of the square.

What is the area (in cm²) of the rectangle PLMN?

Note: The figure shown is representative.

Geometry figure for Q09

  • (A)
    222\sqrt{2}
  • (B)
    22
  • (C)
    88
  • (D)
    44

Answer (official key): D

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

Q9 · General Aptitude · MCQ · 2 marks

If IMAGE and FIELD are coded as FHBNJ and EMFJG respectively then, which one among the given options is the most appropriate code for BEACH?

  • (A)
    CEADP
  • (B)
    IDBFC
  • (C)
    JGIBC
  • (D)
    IBCEC

Answer (official key): B

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

Q10 · General Aptitude · MCQ · 2 marks

The diagram below shows a river system consisting of 7 segments, marked P, Q, R, S, T, U, and V. It splits the land into 5 zones, marked Z1, Z2, Z3, Z4, and Z5. We need to connect these zones using the least number of bridges. Out of the following options, which one is correct?

Note: The figure shown is representative.

River system diagram for Q10

  • (A)
    Bridges on P, Q, and T
  • (B)
    Bridges on P, Q, S, and T
  • (C)
    Bridges on Q, R, T, and V
  • (D)
    Bridges on P, Q, S, U, and V

Answer (official key): C

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

Q11 · Digital Logic · MSQ · 1 mark

Consider the following logic circuit diagram.

Logic circuit for Q31

Which is/are the CORRECT option(s) for the output function FF?

  • (A)
    X‾ Y‾\overline{X}\,\overline{Y}
  • (B)
    X‾+Y‾+XY‾\overline{X} + \overline{Y} + X\overline{Y}
  • (C)
    X‾ Y‾+X‾+XY‾\overline{X}\,\overline{Y} + \overline{X} + X\overline{Y}
  • (D)
    X+Y‾X + \overline{Y}

Answer (official key): A, B, C

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

Q12 · Calculus · MCQ · 1 mark

The value of xx such that x>1x > 1, satisfying the equation ∫1xtln⁡t dt=14\displaystyle\int_1^x t\ln t\,dt = \frac{1}{4} is

  • (A)
    e\sqrt{e}
  • (B)
    ee
  • (C)
    e2e^2
  • (D)
    e−1e - 1

Answer (official key): A

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

Q13 · Theory of Computation · MCQ · 1 mark

Let G1G_1, G2G_2 be Context Free Grammars (CFGs) and RR be a regular expression. For a grammar GG, let L(G)L(G) denote the language generated by GG.

Which ONE among the following questions is decidable?

  • (A)
    Is L(G1)=L(G2)L(G_1) = L(G_2)?
  • (B)
    Is L(G1)∩L(G2)=∅L(G_1) \cap L(G_2) = \emptyset?
  • (C)
    Is L(G1)=L(R)L(G_1) = L(R)?
  • (D)
    Is L(G1)=∅L(G_1) = \emptyset?

Answer (official key): D

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

Q14 · Programming and Data Structures · MCQ · 1 mark

Consider the following C program:

#include <stdio.h>
void stringcopy(char *, char *);

int main(){
    char a[30] = "@#Hello World!";
    stringcopy(a, a + 2);
    printf("%s\n", a);
    return 0;
}

void stringcopy(char *s, char *t) {
    while(*t)
        *s++ = *t++;
}

Which ONE of the following will be the output of the program?

  • (A)
    @#Hello World!
  • (B)
    Hello World!
  • (C)
    ello World!
  • (D)
    Hello World!d!

Answer (official key): D

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

Q15 · Computer Networks · MCQ · 1 mark

A machine receives an IPv4 datagram. The protocol field of the IPv4 header has the protocol number of a protocol X.

Which ONE of the following is NOT a possible candidate for X?

  • (A)
    Internet Control Message Protocol (ICMP)
  • (B)
    Internet Group Management Protocol (IGMP)
  • (C)
    Open Shortest Path First (OSPF)
  • (D)
    Routing Information Protocol (RIP)

Answer (official key): D

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

Q16 · Computer Networks · MCQ · 1 mark

Consider a network that uses Ethernet and IPv4. Assume that IPv4 headers do not use any options field. Each Ethernet frame can carry a maximum of 1500 bytes in its data field. A UDP segment is transmitted. The payload (data) in the UDP segment is 7488 bytes.

Which ONE of the following choices has the CORRECT total number of fragments transmitted and the size of the last fragment including IPv4 header?

  • (A)
    5 fragments, 1488 bytes
  • (B)
    6 fragments, 88 bytes
  • (C)
    6 fragments, 108 bytes
  • (D)
    6 fragments, 116 bytes

Answer (official key): D

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

Q17 · Programming and Data Structures · Numerical · 1 mark

int x=126, y=105;
do {
    if(x>y) x=x-y;
    else y=y-x;
} while(x!=y);
printf("%d", x);

The output of the given C code segment is ________. (Answer in integer)

Answer (official key): 21

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

Q18 · Databases · MSQ · 1 mark

An audit of a banking transactions system has found that on an earlier occasion, two joint holders of account AA attempted simultaneous transfers of Rs. 10000 each from account AA to account BB. Both transactions read the same value, Rs. 11000, as the initial balance in AA and were allowed to go through. BB was credited Rs. 10000 twice. AA was debited only once and ended up with a balance of Rs. 1000.

Which of the following properties is/are certain to have been violated by the system?

  • (A)
    Atomicity
  • (B)
    Consistency
  • (C)
    Isolation
  • (D)
    Durability

Answer (official key): B, C

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

Q19 · Computer Networks · MCQ · 1 mark

Not in GATE 2027 syllabus: ARP, DHCP and ICMP

Consider the following statements:

(i) Address Resolution Protocol (ARP) provides a mapping from an IP address to the corresponding hardware (link-layer) address. (ii) A single TCP segment from a sender S to a receiver R cannot carry both data from S to R and acknowledgement for a segment from R to S.

Which ONE of the following is CORRECT?

  • (A)
    Both (i) and (ii) are TRUE
  • (B)
    (i) is TRUE and (ii) is FALSE
  • (C)
    (i) is FALSE and (ii) is TRUE
  • (D)
    Both (i) and (ii) are FALSE

Answer (official key): B

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

Q20 · Digital Logic · Numerical · 1 mark

In a 4-bit ripple counter, if the period of the waveform at the last flip-flop is 64 microseconds, then the frequency of the ripple counter in kHz is ________. (Answer in integer)

Answer (official key): 250

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

Q21 · Programming and Data Structures · Numerical · 1 mark

Suppose the values 10, −4-4, 15, 30, 20, 5, 60, 19 are inserted in that order into an initially empty binary search tree. Let TT be the resulting binary search tree.

The number of edges in the path from the node containing 19 to the root node of TT is ___________. (Answer in integer)

Answer (official key): 4

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

Q22 · Compiler Design · MCQ · 1 mark

Given the following syntax directed translation rules:

Rule 1: R→AB  {B.i=R.i−1;  A.i=B.i;  R.i=A.i+1;}R \to AB \;\{B.i = R.i - 1;\; A.i = B.i;\; R.i = A.i + 1;\} Rule 2: P→CD  {P.i=C.i+D.i;  D.i=C.i+2;}P \to CD \;\{P.i = C.i + D.i;\; D.i = C.i + 2;\} Rule 3: Q→EF  {Q.i=E.i+F.i;}Q \to EF \;\{Q.i = E.i + F.i;\}

Which ONE is the CORRECT option among the following?

  • (A)
    Rule 1 is S-attributed and L-attributed; Rule 2 is S-attributed and not L-attributed; Rule 3 is neither S-attributed nor L-attributed
  • (B)
    Rule 1 is neither S-attributed nor L-attributed; Rule 2 is S-attributed and L-attributed; Rule 3 is S-attributed and L-attributed
  • (C)
    Rule 1 is neither S-attributed nor L-attributed; Rule 2 is not S-attributed and is L-attributed; Rule 3 is S-attributed and L-attributed
  • (D)
    Rule 1 is S-attributed and not L-attributed; Rule 2 is not S-attributed and is L-attributed; Rule 3 is S-attributed and L-attributed

Answer (official key): C

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

Q23 · Computer Networks · MCQ · 1 mark

Consider the routing protocols given in List I and the names given in List II:

List IList II
(i) Distance vector routing(a) Bellman-Ford
(ii) Link state routing(b) Dijkstra

For matching of items in List I with those in List II, which ONE of the following options is CORRECT?

  • (A)
    (i) – (a) and (ii) – (b)
  • (B)
    (i) – (a) and (ii) – (a)
  • (C)
    (i) – (b) and (ii) – (a)
  • (D)
    (i) – (b) and (ii) – (b)

Answer (official key): A

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

Q24 · Theory of Computation · MSQ · 1 mark

Consider the two lists List I and List II given below:

List IList II
(i) Context free languages(a) Closed under union
(ii) Recursive languages(b) Not closed under complementation
(iii) Regular languages(c) Closed under intersection

For matching of items in List I with those in List II, which of the following option(s) is/are CORRECT?

  • (A)
    (i) – (a), (ii) – (b), and (iii) – (c)
  • (B)
    (i) – (b), (ii) – (a), and (iii) – (c)
  • (C)
    (i) – (b), (ii) – (c), and (iii) – (a)
  • (D)
    (i) – (a), (ii) – (c), and (iii) – (b)

Answer (official key): B, C

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

Q25 · Algorithms · MSQ · 1 mark

Which of the following statements regarding Breadth First Search (BFS) and Depth First Search (DFS) on an undirected simple graph GG is/are TRUE?

  • (A)
    A DFS tree of GG is a Shortest Path tree of GG.
  • (B)
    Every non-tree edge of GG with respect to a DFS tree is a forward/back edge.
  • (C)
    If (u,v)(u, v) is a non-tree edge of GG with respect to a BFS tree, then the distances from the source vertex ss to uu and vv in the BFS tree are within ±1\pm 1 of each other.
  • (D)
    Both BFS and DFS can be used to find the connected components of GG.

Answer (official key): B, C, D

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

Q26 · Computer Organization and Architecture · MSQ · 1 mark

Which of the following is/are part of an Instruction Set Architecture of a processor?

  • (A)
    The size of the cache memory
  • (B)
    The clock frequency of the processor
  • (C)
    The number of cache memory levels
  • (D)
    The total number of registers

Answer (official key): D

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

Q27 · Operating System · MCQ · 1 mark

Processes P1P1, P2P2, P3P3, P4P4 arrive in that order at times 0, 1, 2, and 8 milliseconds respectively, and have execution times of 10, 13, 6, and 9 milliseconds respectively. Shortest Remaining Time First (SRTF) algorithm is used as the CPU scheduling policy. Ignore context switching times.

Which ONE of the following correctly gives the average turnaround time of the four processes in milliseconds?

  • (A)
    22
  • (B)
    15
  • (C)
    37
  • (D)
    19

Answer (official key): D

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

Q28 · Theory of Computation · MCQ · 1 mark

Which ONE of the following languages is accepted by a deterministic pushdown automaton?

  • (A)
    Any regular language.
  • (B)
    Any context-free language.
  • (C)
    Any language accepted by a non-deterministic pushdown automaton.
  • (D)
    Any decidable language.

Answer (official key): A

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

Q29 · Linear Algebra · MCQ · 1 mark

Let LL, MM, and NN be non-singular matrices of order 3 satisfying the equations L2=L−1L^2 = L^{-1}, M=L8M = L^8, and N=L2N = L^2.

Which ONE of the following is the value of the determinant of (M−N)(M - N)?

  • (A)
    00
  • (B)
    11
  • (C)
    22
  • (D)
    33

Answer (official key): A

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

Q30 · Linear Algebra · MCQ · 1 mark

If A=(122−1)A = \begin{pmatrix}1 & 2\\2 & -1\end{pmatrix}, then which ONE of the following is A8A^8?

  • (A)
    (250025)\begin{pmatrix}25 & 0\\0 & 25\end{pmatrix}
  • (B)
    (12500125)\begin{pmatrix}125 & 0\\0 & 125\end{pmatrix}
  • (C)
    (62500625)\begin{pmatrix}625 & 0\\0 & 625\end{pmatrix}
  • (D)
    (3125003125)\begin{pmatrix}3125 & 0\\0 & 3125\end{pmatrix}

Answer (official key): C

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

Q31 · Compiler Design · MCQ · 1 mark

Consider the following statements about the use of backpatching in a compiler for intermediate code generation:

(I) Backpatching can be used to generate code for Boolean expression in one pass. (II) Backpatching can be used to generate code for flow-of-control statements in one pass.

Which ONE of the following options is CORRECT?

  • (A)
    Only (I) is correct.
  • (B)
    Only (II) is correct.
  • (C)
    Both (I) and (II) are correct.
  • (D)
    Neither (I) nor (II) is correct.

Answer (official key): C

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

Q32 · Discrete Mathematics · MCQ · 1 mark

Let P(x)P(x) be an arbitrary predicate over the domain of natural numbers.

Which ONE of the following statements is TRUE?

  • (A)
    (P(0)∧(∀x [P(x)⇒P(x+1)]))⇒(∀x P(x))\bigl(P(0) \wedge (\forall x\,[P(x) \Rightarrow P(x+1)])\bigr) \Rightarrow (\forall x\, P(x))
  • (B)
    (P(0)∧(∀x [P(x)⇒P(x−1)]))⇒(∀x P(x))\bigl(P(0) \wedge (\forall x\,[P(x) \Rightarrow P(x-1)])\bigr) \Rightarrow (\forall x\, P(x))
  • (C)
    (P(1000)∧(∀x [P(x)⇒P(x−1)]))⇒(∀x P(x))\bigl(P(1000) \wedge (\forall x\,[P(x) \Rightarrow P(x-1)])\bigr) \Rightarrow (\forall x\, P(x))
  • (D)
    (P(1000)∧(∀x [P(x)⇒P(x+1)]))⇒(∀x P(x))\bigl(P(1000) \wedge (\forall x\,[P(x) \Rightarrow P(x+1)])\bigr) \Rightarrow (\forall x\, P(x))

Answer (official key): A

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

Q33 · Programming and Data Structures · MCQ · 1 mark

Consider a binary tree TT in which every node has either zero or two children. Let n>0n > 0 be the number of nodes in TT.

Which ONE of the following is the number of nodes in TT that have exactly two children?

  • (A)
    n−22\dfrac{n-2}{2}
  • (B)
    n−12\dfrac{n-1}{2}
  • (C)
    n2\dfrac{n}{2}
  • (D)
    n+12\dfrac{n+1}{2}

Answer (official key): B

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

Q34 · Algorithms · MCQ · 1 mark

Consider an unordered list of NN distinct integers.

What is the minimum number of element comparisons required to find an integer in the list that is NOT the largest in the list?

  • (A)
    11
  • (B)
    N−1N - 1
  • (C)
    NN
  • (D)
    2N−12N - 1

Answer (official key): A

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

Q35 · Computer Organization and Architecture · Numerical · 1 mark

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

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

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

Answer (official key): 13

Read the worked solution

Q36 · Probability and Statistics · Numerical · 2 marks

A quadratic polynomial (x−α)(x−β)(x - \alpha)(x - \beta) over complex numbers is said to be square invariant if (x−α)(x−β)=(x−α2)(x−β2)(x - \alpha)(x - \beta) = (x - \alpha^2)(x - \beta^2). Suppose from the set of all square invariant quadratic polynomials we choose one at random.

The probability that the roots of the chosen polynomial are equal is __________. (rounded off to one decimal place)

Answer (official key): 0.5

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

Q37 · Computer Organization and Architecture · MCQ · 2 marks

For a direct-mapped cache, 4 bits are used for the tag field and 12 bits are used to index into a cache block. The size of each cache block is one byte. Assume that there is no other information stored for each cache block.

Which ONE of the following is the CORRECT option for the sizes of the main memory and the cache memory in this system (byte addressable), respectively?

  • (A)
    64 KB and 4 KB
  • (B)
    128 KB and 16 KB
  • (C)
    64 KB and 8 KB
  • (D)
    128 KB and 6 KB

Answer (official key): A

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

Q38 · Digital Logic · MSQ · 2 marks

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

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

Answer (official key): A, D

Read the worked solution

Q39 · Computer Organization and Architecture · Numerical · 2 marks

A 5-stage instruction pipeline has stage delays of 180, 250, 150, 170, and 250, respectively, in nanoseconds. The delay of an inter-stage latch is 10 nanoseconds. Assume that there are no pipeline stalls due to branches and other hazards. The time taken to process 1000 instructions in microseconds is ___________. (rounded off to two decimal places)

Answer (official key): 260.2 to 261.2

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

Q40 · Computer Organization and Architecture · Numerical · 2 marks

An application executes 6.4×1086.4 \times 10^8 number of instructions in 6.3 seconds. There are four types of instructions, the details of which are given in the table. The duration of a clock cycle in nanoseconds is _________. (rounded off to one decimal place)

Instruction typeCPINumber of instructions executed
Branch22.25×1082.25 \times 10^8
Load51.20×1081.20 \times 10^8
Store41.65×1081.65 \times 10^8
Arithmetic31.30×1081.30 \times 10^8

Answer (official key): 3

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

Q41 · Programming and Data Structures · Numerical · 2 marks

Consider the following C program:

#include <stdio.h>
int g(int n) {
    return (n+10);
}
int f(int n) {
    return g(n*2);
}
int main() {
    int sum, n;
    sum=0;
    for (n=1; n<3; n++)
        sum += g(f(n));
    printf ("%d", sum);
    return 0;
}

The output of the given C program is ________. (Answer in integer)

Answer (official key): 46

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

Q42 · Computer Networks · MCQ · 2 marks

Suppose we are transmitting frames between two nodes using Stop-and-Wait protocol. The frame size is 3000 bits. The transmission rate of the channel is 2000 bps and the propagation delay between the two nodes is 100 milliseconds. Assume that the processing times at the source and destination are negligible. Also, assume that the size of the acknowledgement packet is negligible.

Which ONE of the following most accurately gives the channel utilization for the above scenario in percentage?

  • (A)
    88.23
  • (B)
    93.75
  • (C)
    85.44
  • (D)
    66.67

Answer (official key): A

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

Q43 · Compiler Design · MCQ · 2 marks

Given a Context-Free Grammar GG as follows:

S→Aa∣bAc∣dc∣bdaS \to Aa \mid bAc \mid dc \mid bda A→dA \to d

Which ONE of the following statements is TRUE?

  • (A)
    GG is neither LALR(1) nor SLR(1)
  • (B)
    GG is CLR(1), not LALR(1)
  • (C)
    GG is LALR(1), not SLR(1)
  • (D)
    GG is LALR(1), also SLR(1)

Answer (official key): C

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

Q44 · Discrete Mathematics · MSQ · 2 marks

Let F\mathcal{F} be the set of all functions from {1,…,n}\{1, \ldots, n\} to {0,1}\{0,1\}. Define the binary relation ⪯\preceq on F\mathcal{F} as follows:

∀f,g∈F,  f⪯g  ⟺  ∀x∈{1,…,n},  f(x)≤g(x),  where 0≤1.\forall f, g \in \mathcal{F},\; f \preceq g \iff \forall x \in \{1, \ldots, n\},\; f(x) \leq g(x),\;\text{where } 0 \leq 1.

Which of the following statement(s) is/are TRUE?

  • (A)
    ⪯\preceq is a symmetric relation
  • (B)
    (F,⪯)(\mathcal{F}, \preceq) is a partial order
  • (C)
    (F,⪯)(\mathcal{F}, \preceq) is a lattice
  • (D)
    ⪯\preceq is an equivalence relation

Answer (official key): B, C

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

Q45 · Operating System · MSQ · 2 marks

P={P1,P2,P3,P4}P = \{P_1, P_2, P_3, P_4\} consists of all active processes in an operating system. R={R1,R2,R3,R4}R = \{R_1, R_2, R_3, R_4\} consists of single instances of distinct types of resources in the system.

The resource allocation graph has the following assignment and claim edges.

Assignment edges: R1→P1R_1 \to P_1, R2→P2R_2 \to P_2, R3→P3R_3 \to P_3, R4→P4R_4 \to P_4

Claim edges: P1→R2P_1 \to R_2, P2→R3P_2 \to R_3, P3→R1P_3 \to R_1, P2→R4P_2 \to R_4, P4→R2P_4 \to R_2

Which of the following statement(s) is/are CORRECT?

  • (A)
    Aborting P1P_1 makes the system deadlock free.
  • (B)
    Aborting P3P_3 makes the system deadlock free.
  • (C)
    Aborting P2P_2 makes the system deadlock free.
  • (D)
    Aborting P1P_1 and P4P_4 makes the system deadlock free.

Answer (official key): C, D

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

Q46 · Probability and Statistics · Numerical · 2 marks

The unit interval (0,1)(0,1) is divided at a point chosen uniformly distributed over (0,1)(0,1) in R\mathbb{R} into two disjoint subintervals.

The expected length of the subinterval that contains 0.4 is ___________. (rounded off to two decimal places)

Answer (official key): 0.7 to 0.8

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

Q47 · Theory of Computation · Numerical · 2 marks

Let Σ={1,2,3,4}\Sigma = \{1,2,3,4\}. For x∈Σ∗x \in \Sigma^*, let prod(x)\mathit{prod}(x) be the product of symbols in xx modulo 7. We take prod(ϵ)=1\mathit{prod}(\epsilon) = 1, where ϵ\epsilon is the null string.

For example, prod(124)=(1×2×4) mod 7=1\mathit{prod}(124) = (1 \times 2 \times 4) \bmod 7 = 1.

Define L={x∈Σ∗∣prod(x)=2}L = \{x \in \Sigma^* \mid \mathit{prod}(x) = 2\}.

The number of states in a minimum state DFA for LL is ___________. (Answer in integer)

Answer (official key): 6

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

Q48 · Operating System · MSQ · 2 marks

Consider a demand paging system with three frames, and the following page reference string: 1 2 3 4 5 4 1 6 4 5 1 3 2. The contents of the frames are as follows initially and after each reference (from left to right):

initially1*2*3*4*5*416*451*3*2*
Frame 1–1111111666662
Frame 2––224444444111
Frame 3–––33555555533

The *-marked references cause page replacements.

Which one or more of the following could be the page replacement policy/policies in use?

  • (A)
    Least Recently Used page replacement policy
  • (B)
    Least Frequently Used page replacement policy
  • (C)
    Most Frequently Used page replacement policy
  • (D)
    Optimal page replacement policy

Answer (official key): D

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

Q49 · Operating System · Numerical · 2 marks

A computer system supports a logical address space of 2322^{32} bytes. It uses two-level hierarchical paging with a page size of 4096 bytes. A logical address is divided into a bb-bit index to the outer page table, an offset within the page of the inner page table, and an offset within the desired page. Each entry of the inner page table uses eight bytes. All the pages in the system have the same size.

The value of bb is ___________. (Answer in integer)

Answer (official key): 11

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

Q50 · Theory of Computation · MSQ · 2 marks

Let Σ={a,b,c}\Sigma = \{a, b, c\}. For x∈Σ∗x \in \Sigma^*, and α∈Σ\alpha \in \Sigma, let #α(x)\#_\alpha(x) denote the number of occurrences of α\alpha in xx.

Which one or more of the following option(s) define(s) regular language(s)?

  • (A)
    {ambn∣m,n≥0}\{a^m b^n \mid m, n \geq 0\}
  • (B)
    {a,b}∗∩{ambncm−n∣m≥n≥0}\{a, b\}^* \cap \{a^m b^n c^{m-n} \mid m \geq n \geq 0\}
  • (C)
    {w∣w∈{a,b}∗,  #a(w)≡2(mod7),  and  #b(w)≡3(mod9)}\{w \mid w \in \{a,b\}^*,\; \#_a(w) \equiv 2 \pmod{7},\; \text{and}\; \#_b(w) \equiv 3 \pmod{9}\}
  • (D)
    {w∣w∈{a,b}∗,  #a(w)≡2(mod7),  and  #a(w)=#b(w)}\{w \mid w \in \{a,b\}^*,\; \#_a(w) \equiv 2 \pmod{7},\; \text{and}\; \#_a(w) = \#_b(w)\}

Answer (official key): A, C

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

Q51 · Databases · MSQ · 2 marks

Consider the database transactions T1 and T2, and data items X and Y. Which of the schedule(s) is/are conflict serializable?

Transaction T1: R1(X), W1(Y), R1(X), W1(X), COMMIT(T1) Transaction T2: W2(X), W2(Y), COMMIT(T2)

  • (A)
    R1(X), W2(X), W1(Y), W2(Y), R1(X), W1(X), COMMIT(T2), COMMIT(T1)
  • (B)
    W2(X), R1(X), W2(Y), W1(Y), R1(X), COMMIT(T2), W1(X), COMMIT(T1)
  • (C)
    R1(X), W1(Y), W2(X), W2(Y), R1(X), W1(X), COMMIT(T1), COMMIT(T2)
  • (D)
    W2(X), R1(X), W1(Y), W2(Y), R1(X), COMMIT(T2), W1(X), COMMIT(T1)

Answer (official key): B

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

Q52 · Programming and Data Structures · Numerical · 2 marks

Consider the following C program:

#include <stdio.h>
int main(){
    int a;
    int arr[5] = {30, 50, 10};
    int *ptr;
    ptr = &arr[0] + 1;
    a = *ptr;
    (*ptr)++;
    ptr++;
    printf("%d", a + (*ptr) + arr[1]);
    return 0;
}

The output of the above program is ___________. (Answer in integer)

Answer (official key): 111

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

Q53 · Databases · Numerical · 2 marks

In a B+^+-tree where each node can hold at most four key values, a root to leaf path consists of the following nodes:

A=(49,77,83,−),B=(7,19,33,44),C=(20∗,22∗,25∗,26∗)A = (49, 77, 83, -),\quad B = (7, 19, 33, 44),\quad C = (20^*, 22^*, 25^*, 26^*)

The *-marked keys signify that these are data entries in a leaf.

Assume that a pointer between keys k1k_1 and k2k_2 points to a subtree containing keys in [k1,k2)[k_1, k_2), and that when a leaf is created, the smallest key in it is copied up into its parent.

A record with key value 23 is inserted into the B+^+-tree.

The smallest key value in the parent of the leaf that contains 25∗25^* is __________. (Answer in integer)

Answer (official key): 33

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

Q54 · Digital Logic · MSQ · 2 marks

Which of the following Boolean algebraic equation(s) is/are CORRECT?

  • (A)
    AˉBC+ABˉCˉ+AˉBˉCˉ+ABˉC+ABC=BC+BˉCˉ+AˉBˉ\bar{A}BC + A\bar{B}\bar{C} + \bar{A}\bar{B}\bar{C} + A\bar{B}C + ABC = BC + \bar{B}\bar{C} + \bar{A}\bar{B}
  • (B)
    AB+AˉC+BC=AB+AˉCAB + \bar{A}C + BC = AB + \bar{A}C
  • (C)
    (A+C)(Aˉ+B)=AB+AˉC(A + C)(\bar{A} + B) = AB + \bar{A}C
  • (D)
    (A+Bˉ+Dˉ)(C+D)(Aˉ+C+D)(A+B+Dˉ)‾=AˉD+CˉDˉ\overline{(A + \bar{B} + \bar{D})(C + D)(\bar{A} + C + D)(A + B + \bar{D})} = \bar{A}D + \bar{C}\bar{D}

Answer (official key): B, C, D

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

Q55 · Databases · MSQ · 2 marks

Consider the following relational schema:

Students (rollno: integer, name: string, age: integer, cgpa: real)
Courses  (courseno: integer, cname: string, credits: integer)
Enrolled (rollno: integer, courseno: integer, grade: string)

Which of the following options is/are correct SQL query/queries to retrieve the names of the students enrolled in course number (i.e., courseno) 1470?

  • (A)
    Option A using EXISTS
  • (B)
    Option B using SIZEOF (non-standard SQL)
  • (C)
    Option C using COUNT(*) > 0
  • (D)
    Option D using NATURAL JOIN

Answer (official key): A, C, D

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

Q56 · Algorithms · MCQ · 2 marks

Let GG be an edge-weighted undirected graph with positive edge weights. Suppose a positive constant α\alpha is added to the weight of every edge.

Which ONE of the following statements is TRUE about the minimum spanning trees (MSTs) and shortest paths (SPs) in GG before and after the edge weight update?

  • (A)
    Every MST remains an MST, and every SP remains an SP.
  • (B)
    MSTs need not remain MSTs, and every SP remains an SP.
  • (C)
    Every MST remains an MST, and SPs need not remain SPs.
  • (D)
    MSTs need not remain MSTs, and SPs need not remain SPs.

Answer (official key): C

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

Q57 · Algorithms · MCQ · 2 marks

An array AA of length nn with distinct elements is said to be bitonic if there is an index 1≤i≤n1 \leq i \leq n such that A[1..i]A[1..i] is sorted in the non-decreasing order and A[i+1..n]A[i+1..n] is sorted in the non-increasing order.

Which ONE of the following represents the best possible asymptotic bound for the worst-case number of comparisons by an algorithm that searches for an element in a bitonic array AA?

  • (A)
    Θ(n)\Theta(n)
  • (B)
    Θ(1)\Theta(1)
  • (C)
    Θ(log⁡2n)\Theta(\log^2 n)
  • (D)
    Θ(log⁡n)\Theta(\log n)

Answer (official key): D

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

Q58 · Programming and Data Structures · MCQ · 2 marks

A meld operation on two instances of a data structure combines them into one single instance of the same data structure. Consider the following data structures:

P: Unsorted doubly linked list with pointers to the head node and tail node of the list. Q: Min-heap implemented using an array. R: Binary Search Tree.

Which ONE of the following options gives the worst-case time complexities for meld operation on instances of size nn of these data structures?

  • (A)
    P: Θ(1)\Theta(1), Q: Θ(n)\Theta(n), R: Θ(n)\Theta(n)
  • (B)
    P: Θ(1)\Theta(1), Q: Θ(nlog⁡n)\Theta(n \log n), R: Θ(n)\Theta(n)
  • (C)
    P: Θ(n)\Theta(n), Q: Θ(nlog⁡n)\Theta(n \log n), R: Θ(n2)\Theta(n^2)
  • (D)
    P: Θ(1)\Theta(1), Q: Θ(n)\Theta(n), R: Θ(nlog⁡n)\Theta(n \log n)

Answer (official key): A

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

Q59 · Algorithms · Numerical · 2 marks

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

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

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

Tree for Q59

Answer (official key): 6

Read the worked solution

Q60 · Programming and Data Structures · MSQ · 2 marks

Consider a stack data structure into which we can PUSH and POP records. Assume that each record pushed in the stack has a positive integer key and that all keys are distinct.

We wish to augment the stack data structure with an O(1)O(1) time MIN operation that returns a pointer to the record with smallest key present in the stack

  1. without deleting the corresponding record, and
  2. without increasing the complexities of the standard stack operations.

Which one or more of the following approach(es) can achieve it?

  • (A)
    Keep with every record in the stack, a pointer to the record with the smallest key below it.
  • (B)
    Keep a pointer to the record with the smallest key in the stack.
  • (C)
    Keep an auxiliary array in which the key values of the records in the stack are maintained in sorted order.
  • (D)
    Keep a Min-Heap in which the key values of the records in the stack are maintained.

Answer (official key): A

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

Q61 · Linear Algebra · MSQ · 2 marks

Consider a system of linear equations PX=QPX = Q where P∈R3×3P \in \mathbb{R}^{3 \times 3} and Q∈R3×1Q \in \mathbb{R}^{3 \times 1}. Suppose PP has an LU decomposition, P=LUP = LU, where

L=[100l2110l31l321]andU=[u11u12u130u22u2300u33].L = \begin{bmatrix}1 & 0 & 0\\l_{21} & 1 & 0\\l_{31} & l_{32} & 1\end{bmatrix} \quad \text{and} \quad U = \begin{bmatrix}u_{11} & u_{12} & u_{13}\\0 & u_{22} & u_{23}\\0 & 0 & u_{33}\end{bmatrix}.

Which of the following statement(s) is/are TRUE?

  • (A)
    The system PX=QPX = Q can be solved by first solving LY=QLY = Q and then UX=YUX = Y.
  • (B)
    If PP is invertible, then both LL and UU are invertible.
  • (C)
    If PP is singular, then at least one of the diagonal elements of UU is zero.
  • (D)
    If PP is symmetric, then both LL and UU are symmetric.

Answer (official key): A, B, C

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

Q62 · Computer Organization and Architecture · MSQ · 2 marks

Three floating point numbers XX, YY, and ZZ are stored in three registers RX, RY, and RZ, respectively in IEEE 754 single precision format as given below in hexadecimal:

RX=0xC1100000\text{RX} = \texttt{0xC1100000}, RY=0x40C00000\text{RY} = \texttt{0x40C00000}, and RZ=0x41400000\text{RZ} = \texttt{0x41400000}

Which of the following option(s) is/are CORRECT?

  • (A)
    4(X+Y)+Z=04(X + Y) + Z = 0
  • (B)
    2Y−Z=02Y - Z = 0
  • (C)
    4X+3Z=04X + 3Z = 0
  • (D)
    X+Y+Z=0X + Y + Z = 0

Answer (official key): A, B, C

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

Q63 · Compiler Design · MSQ · 2 marks

Consider two grammars G1G_1 and G2G_2 with the production rules given below:

G1:S→if  E  then  S∣if  E  then  S  else  S∣aE→bG_1: S \to \mathit{if}\; E\; \mathit{then}\; S \mid \mathit{if}\; E\; \mathit{then}\; S\; \mathit{else}\; S \mid a \qquad E \to b

G2:S→if  E  then  S∣MM→if  E  then  M  else  S∣cE→bG_2: S \to \mathit{if}\; E\; \mathit{then}\; S \mid M \qquad M \to \mathit{if}\; E\; \mathit{then}\; M\; \mathit{else}\; S \mid c \qquad E \to b

where if\mathit{if}, then\mathit{then}, else\mathit{else}, aa, bb, cc are the terminals.

Which of the following option(s) is/are CORRECT?

  • (A)
    G1G_1 is not LL(1)LL(1) and G2G_2 is LL(1)LL(1).
  • (B)
    G1G_1 is LL(1)LL(1) and G2G_2 is not LL(1)LL(1).
  • (C)
    G1G_1 and G2G_2 are not LL(1)LL(1).
  • (D)
    G1G_1 and G2G_2 are ambiguous.

Answer (official key): C, D

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

Q64 · Computer Organization and Architecture · Numerical · 2 marks

Given a computing system with two levels of cache (L1 and L2) and a main memory. The first level (L1) cache access time is 1 nanosecond (ns) and the "hit rate" for L1 cache is 90% while the processor is accessing the data from L1 cache. Whereas, for the second level (L2) cache, the "hit rate" is 80% and the "miss penalty" for transferring data from L2 cache to L1 cache is 10 ns. The "miss penalty" for the data to be transferred from main memory to L2 cache is 100 ns.

Then the average memory access time in this system in nanoseconds is ___________. (rounded off to one decimal place)

Answer (official key): 4

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

Q65 · Databases · MSQ · 2 marks

Consider the following relational schema along with all the functional dependencies that hold on them.

R1(A,B,C,D,E)R1(A, B, C, D, E): {D→E,  EA→B,  EB→C}\{D \to E,\; EA \to B,\; EB \to C\} R2(A,B,C,D)R2(A, B, C, D): {A→D,  A→B,  C→A}\{A \to D,\; A \to B,\; C \to A\}

Which of the following statement(s) is/are TRUE?

  • (A)
    R1R1 is in 3NF
  • (B)
    R2R2 is in 3NF
  • (C)
    R1R1 is NOT in 3NF
  • (D)
    R2R2 is NOT in 3NF

Answer (official key): C, D

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