GATE 2025 CS (Set 1)

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

Ravi had ______ younger brother who taught at ______ university. He was widely regarded as ______ honorable man.

Select the option with the correct sequence of articles to fill in the blanks.

  • (A)
    a; a; an
  • (B)
    the; an; a
  • (C)
    a; an; a
  • (D)
    an; an; a

Answer (official key): A

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

Q2 · General Aptitude · MCQ · 1 mark

According to the map shown in the figure, which one of the following statements is correct?

Note: The figure shown is representative.

Campus Map

  • (A)
    The library is located to the northwest of the canteen.
  • (B)
    The hospital is located to the east of the chemistry lab.
  • (C)
    The chemistry lab is to the southeast of physics lab.
  • (D)
    The classrooms and canteen are next to each other.

Answer (official key): C

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

Q3 · General Aptitude · MCQ · 1 mark

Consider the relationships among P, Q, R, S, and T:

  • P is the brother of Q.
  • S is the daughter of Q.
  • T is the sister of S.
  • R is the mother of Q.

The following statements are made based on the relationships given above.

  1. R is the grandmother of S.
  2. P is the uncle of S and T.
  3. R has only one son.
  4. Q has only one daughter.

Which one of the following options is correct?

  • (A)
    Both (1) and (2) are true.
  • (B)
    Both (1) and (3) are true.
  • (C)
    Only (3) is true.
  • (D)
    Only (4) is true.

Answer (official key): A

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

Q4 · General Aptitude · MCQ · 1 mark

The CEO's decision to downsize the workforce was considered myopic because it sacrificed long-term stability to accommodate short-term gains.

Select the most appropriate option that can replace the word "myopic" without changing the meaning of the sentence.

  • (A)
    visionary
  • (B)
    shortsighted
  • (C)
    progressive
  • (D)
    innovative

Answer (official key): B

Read the worked solution

Q5 · General Aptitude · MCQ · 1 mark

The average marks obtained by a class in an examination were calculated as 30.830.8. However, while checking the marks entered, the teacher found that the marks of one student were entered incorrectly as 2424 instead of 4242. After correcting the marks, the average becomes 31.431.4. How many students does the class have?

  • (A)
    2525
  • (B)
    2828
  • (C)
    3030
  • (D)
    3232

Answer (official key): C

Read the worked solution

Q6 · General Aptitude · MCQ · 2 marks

A shop has 44 distinct flavors of ice-cream. One can purchase any number of scoops of any flavor. The order in which the scoops are purchased is inconsequential. If one wants to purchase 33 scoops of ice-cream, in how many ways can one make that purchase?

  • (A)
    44
  • (B)
    2020
  • (C)
    2424
  • (D)
    4848

Answer (official key): B

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

Q7 · General Aptitude · MCQ · 2 marks

"I put the brown paper in my pocket along with the chalks, and possibly other things. I suppose every one must have reflected how primeval and how poetical are the things that one carries in one's pocket: the pocket-knife, for instance the type of all human tools, the infant of the sword. Once I planned to write a book of poems entirely about the things in my pocket. But I found it would be too long: and the age of the great epics is past."

(From G.K. Chesterton's "A Piece of Chalk")

Based only on the information provided in the above passage, which one of the following statements is true?

  • (A)
    The author of the passage carries a mirror in his pocket to reflect upon things.
  • (B)
    The author of the passage had decided to write a poem on epics.
  • (C)
    The pocket-knife is described as the infant of the sword.
  • (D)
    Epics are described as too inconvenient to write.

Answer (official key): C

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

Q8 · General Aptitude · MCQ · 2 marks

A fair six-faced dice, with the faces labelled '1', '2', '3', '4', '5', and '6', is rolled thrice. What is the probability of rolling '6' exactly once?

  • (A)
    75216\frac{75}{216}
  • (B)
    16\frac{1}{6}
  • (C)
    118\frac{1}{18}
  • (D)
    25216\frac{25}{216}

Answer (official key): A

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

Q9 · General Aptitude · MCQ · 2 marks

A square paper, shown in figure (I), is folded along the dotted lines as shown in the figures (II) and (III). Then a few cuts are made as shown in figure (IV). Which one of the following patterns will be obtained when the paper is unfolded?

Note: The figures shown are representative.

Paper Folding Question

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

Answer (official key): A

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

Q10 · General Aptitude · MCQ · 2 marks

In the diagram, the lines QRQR and STST are parallel to each other. The shortest distance between these two lines is half the shortest distance between the point PP and line QRQR. What is the ratio of the area of the triangle PSTPST to the area of the trapezium SQRTSQRT?

Note: The figure shown is representative.

Geometry Diagram

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

Answer (official key): A

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

Q11 · Databases · MCQ · 1 mark

A schedule of three database transactions R1(X)  W1(Y)  R2(X)  R2(Y)  R3(Y)  ABORT(T1)R_1(X)\; W_1(Y)\; R_2(X)\; R_2(Y)\; R_3(Y)\; ABORT(T_1) is shown. The transaction T1T_1 aborts at the end. Which other transaction(s) will be required to be rolled back?

  • (A)
    Only T2T_2
  • (B)
    Only T3T_3
  • (C)
    Both T2T_2 and T3T_3
  • (D)
    Neither T2T_2 nor T3T_3

Answer (official key): C

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

Q12 · Computer Organization and Architecture · MCQ · 1 mark

Suppose a program is running on a non-pipelined single processor computer system. The computer is connected to an external device that can interrupt the processor asynchronously. The processor needs to execute the interrupt service routine (ISR) to serve this interrupt. The following steps (not necessarily in order) are taken by the processor when the interrupt arrives:

(i) The processor saves the content of the program counter. (ii) The program counter is loaded with the start address of the ISR. (iii) The processor finishes the present instruction.

Which ONE of the following is the CORRECT sequence of steps?

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

Answer (official key): A

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

Q13 · Theory of Computation · MCQ · 1 mark

Consider the following context-free grammar GG, where S,A,BS, A, B are variables and a,ba, b are terminals:

S→aaB∣AbbS \to aaB \mid Abb A→a∣aAA \to a \mid aA B→b∣bBB \to b \mid bB

Which ONE of the languages L(G)L(G) is accepted by GG?

  • (A)
    L(G)={a2bn∣n≥1}∪{anb2∣n≥1}L(G)=\{a^2b^n\mid n\ge 1\}\cup\{a^n b^2\mid n\ge 1\}
  • (B)
    L(G)={anb2n∣n≥1}∪{a2nbn∣n≥1}L(G)=\{a^n b^{2n}\mid n\ge 1\}\cup\{a^{2n}b^n\mid n\ge 1\}
  • (C)
    L(G)={anbn∣n≥1}L(G)=\{a^n b^n\mid n\ge 1\}
  • (D)
    L(G)={a2nb2n∣n≥1}L(G)=\{a^{2n}b^{2n}\mid n\ge 1\}

Answer (official key): A

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

Q14 · Compiler Design · MCQ · 1 mark

Which ONE of the following techniques used in compiler code optimization uses live variable analysis?

  • (A)
    Run-time function call management
  • (B)
    Register assignment to variables
  • (C)
    Strength reduction
  • (D)
    Constant folding

Answer (official key): B

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

Q15 · Operating System · MCQ · 1 mark

Consider a demand paging memory management system with 32-bit logical address, 20-bit physical address, and page size of 2048 bytes. Assuming that the memory is byte addressable, what is the maximum number of entries in the page table?

  • (A)
    2212^{21}
  • (B)
    2202^{20}
  • (C)
    2222^{22}
  • (D)
    2242^{24}

Answer (official key): A

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

Q16 · Computer Networks · MCQ · 1 mark

Identify the ONE CORRECT matching between the OSI layers and their corresponding functionalities:

  • (a) Network layer
  • (b) Transport layer
  • (c) Datalink layer

Functionalities:

  • (I) Packet routing
  • (II) Framing and error handling
  • (III) Host to host communication
  • (A)
    (a)-(I), (b)-(II), (c)-(III)
  • (B)
    (a)-(I), (b)-(III), (c)-(II)
  • (C)
    (a)-(II), (b)-(I), (c)-(III)
  • (D)
    (a)-(III), (b)-(II), (c)-(I)

Answer (official key): B

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

Q17 · Discrete Mathematics · MCQ · 1 mark

Let g(.)g(.) be a function from AA to BB, f(.)f(.) be a function from BB to CC, and their composition f(g(.))f(g(.)) be a mapping from AA to CC.

If f(.)f(.) and f(g(.))f(g(.)) are onto (surjective) functions, which ONE of the following is TRUE about the function g(.)g(.)?

  • (A)
    g(.)g(.) must be an onto (surjective) function.
  • (B)
    g(.)g(.) must be a one-to-one (injective) function.
  • (C)
    g(.)g(.) must be a bijective function, that is, both one-to-one and onto.
  • (D)
    g(.)g(.) is not required to be a one-to-one or onto function.

Answer (official key): D

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

Q18 · Algorithms · MCQ · 1 mark

Let GG be any undirected graph with positive edge weights, and TT be a minimum spanning tree of GG. For any two vertices uu and vv, let d1(u,v)d_1(u,v) and d2(u,v)d_2(u,v) be the shortest distances between uu and vv in GG and TT, respectively. Which ONE of the options is CORRECT for all possible G,T,u,vG, T, u, v?

  • (A)
    d1(u,v)=d2(u,v)d_1(u,v)=d_2(u,v)
  • (B)
    d1(u,v)≤d2(u,v)d_1(u,v)\le d_2(u,v)
  • (C)
    d1(u,v)≥d2(u,v)d_1(u,v)\ge d_2(u,v)
  • (D)
    d1(u,v)≠d2(u,v)d_1(u,v)\ne d_2(u,v)

Answer (official key): B

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

Q19 · Compiler Design · MCQ · 1 mark

Which ONE of the following statements is FALSE regarding the symbol table?

  • (A)
    Symbol table is responsible for keeping track of the scope of variables.
  • (B)
    Symbol table can be implemented using a binary search tree.
  • (C)
    Symbol table is not required after the parsing phase.
  • (D)
    Symbol table is created during the lexical analysis phase.

Answer (official key): C

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

Q20 · Algorithms · MCQ · 1 mark

Consider the following recurrence relation:

T(n)=2T(n−1)+n2nfor n>0,T(0)=1.T(n) = 2T(n-1) + n2^n \quad \text{for } n > 0,\qquad T(0)=1.

Which ONE of the following options is CORRECT?

  • (A)
    T(n)=Θ(n22n)T(n)=\Theta(n^2 2^n)
  • (B)
    T(n)=Θ(n2n)T(n)=\Theta(n2^n)
  • (C)
    T(n)=Θ((log⁡n)22n)T(n)=\Theta((\log n)^2 2^n)
  • (D)
    T(n)=Θ(4n)T(n)=\Theta(4^n)

Answer (official key): A

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

Q21 · Computer Networks · MSQ · 1 mark

Consider the 3-way handshaking protocol for TCP connection establishment. Let the three packets exchanged during the connection establishment be denoted as P1, P2, and P3, in order. Which of the following option(s) is/are TRUE with respect to TCP header flags that are set in the packets?

  • (A)
    P3: SYN = 1, ACK = 1
  • (B)
    P2: SYN = 1, ACK = 1
  • (C)
    P2: SYN = 0, ACK = 1
  • (D)
    P1: SYN = 1

Answer (official key): B, D

Read the worked solution

Q22 · Linear Algebra · MSQ · 1 mark

Consider the given system of linear equations for variables xx and yy, where kk is a real-valued constant. Which of the following option(s) is/are CORRECT?

x+ky=1x + ky = 1 kx+y=−1kx + y = -1

  • (A)
    There is exactly one value of kk for which the above system of equations has no solution.
  • (B)
    There exist an infinite number of values of kk for which the system of equations has no solution.
  • (C)
    There exists exactly one value of kk for which the system of equations has exactly one solution.
  • (D)
    There exists exactly one value of kk for which the system of equations has an infinite number of solutions.

Answer (official key): A, D

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

Q23 · Computer Organization and Architecture · MSQ · 1 mark

The number −6-6 can be represented as 10101010 in 4-bit 2's complement representation. Which of the following is/are CORRECT 2's complement representation(s) of −6-6?

  • (A)
    1000 1010 in 8-bits
  • (B)
    1111 1010 in 8-bits
  • (C)
    1000 0000 0000 1010 in 16-bits
  • (D)
    1111 1111 1111 1010 in 16-bits

Answer (official key): B, D

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

Q24 · Theory of Computation · MSQ · 1 mark

A regular language LL is accepted by a non-deterministic finite automaton (NFA) with nn states. Which of the following statement(s) is/are FALSE?

  • (A)
    LL may have an accepting NFA with < nn states.
  • (B)
    LL may have an accepting DFA with < nn states.
  • (C)
    There exists a DFA with ≤2n\le 2^n states that accepts LL.
  • (D)
    Every DFA that accepts LL has > 2n2^n states.

Answer (official key): D

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

Q25 · Programming and Data Structures · MSQ · 1 mark

Which of the following statement(s) is/are TRUE for any binary search tree (BST) having nn distinct integers?

  • (A)
    The maximum length of a path from the root node to any other node is (n−1)(n - 1).
  • (B)
    An inorder traversal will always produce a sorted sequence of elements.
  • (C)
    Finding an element takes O(log⁡2n)O(\log_2 n) time in the worst case.
  • (D)
    Every BST is also a Min-Heap.

Answer (official key): A, B

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

Q26 · Digital Logic · MSQ · 1 mark

Let XX be a 3-variable Boolean function that produces output as '1' when at least two of the input variables are '1'. Which of the following statement(s) is/are CORRECT, where a,b,c,d,ea, b, c, d, e are Boolean variables?

  • (A)
    X(a,b,X(c,d,e))=X(X(a,b,c),d,e)X(a, b, X(c, d, e)) = X(X(a, b, c), d, e)
  • (B)
    X(a,b,X(a,b,c))=X(a,b,c)X(a, b, X(a, b, c)) = X(a, b, c)
  • (C)
    X(a,b,X(a,c,d))=(X(a,b,a) AND X(c,d,c))X(a, b, X(a, c, d)) = (X(a, b, a) \text{ AND } X(c, d, c))
  • (D)
    X(a,b,c)=X(a,X(a,b,c),X(a,c,c))X(a, b, c) = X(a, X(a, b, c), X(a, c, c))

Answer (official key): B, D

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

Q27 · Computer Organization and Architecture · MSQ · 1 mark

A partial data path of a processor is given in the figure, where RA, RB, and RZ are 32-bit registers. Which option(s) is/are CORRECT related to arithmetic operations using the data path as shown?

Processor Datapath

  • (A)
    The data path can implement arithmetic operations involving two registers.
  • (B)
    The data path can implement arithmetic operations involving one register and one immediate value.
  • (C)
    The data path can implement arithmetic operations involving two immediate values.
  • (D)
    The data path can only implement arithmetic operations involving one register and one immediate value.

Answer (official key): A, B, C

Read the worked solution

Q28 · Programming and Data Structures · MSQ · 1 mark

Consider the following B+ tree with 5 nodes, in which a node can store at most 3 key values. The value 23 is now inserted in the B+ tree. Which of the following option(s) is/are CORRECT?

B+ Tree

  • (A)
    None of the nodes will split.
  • (B)
    At least one node will split and redistribute.
  • (C)
    The total number of nodes will remain same.
  • (D)
    The height of the tree will increase.

Answer (official key): B, D

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

Q29 · Discrete Mathematics · Numerical · 1 mark

Let S be the set of all ternary strings defined over the alphabet {a,b,c}. Consider all strings in S that contain at least one occurrence of two consecutive symbols, that is, “aa”, “bb” or “cc”. The number of such strings of length 5 that are possible is _______. (Answer in integer)

Answer (official key): 195

Read the worked solution

Q30 · Programming and Data Structures · Numerical · 1 mark

The height of any rooted tree is defined as the maximum number of edges in the path from the root node to any leaf node. Suppose a Min-Heap T stores 32 keys. The height of T is _____________. (Answer in integer)

Answer (official key): 5

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

Q31 · Probability and Statistics · Numerical · 1 mark

A box contains 5 coins: 4 regular coins and 1 fake coin. When a regular coin is tossed, the probability P(head)=0.5 and for a fake coin, P(head)=1. You pick a coin at random and toss it twice, and get two heads. The probability that the coin you have chosen is the fake coin is _______. (rounded off to two decimal places)

Answer (official key): 0.49 to 0.51

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

Q32 · Programming and Data Structures · Numerical · 1 mark

The pseudocode of a function fun() is given below:

fun(int A[0,…,n-1]){ for i=0 to n-2 for j=0 to n-i-2 if (A[j]>A[j+1]) then swap A[j] and A[j+1] }

Let A[0,…,29] be an array storing 30 distinct integers in descending order. The number of swap operations that will be performed, if the function fun() is called with A[0,…,29] as argument, is __________. (Answer in integer)

Answer (official key): 435

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

Q33 · Calculus · Numerical · 1 mark

Consider the given function f(x).

f(x) = { ax + b, for x < 1 x^3 + x^2 + 1, for x \ge 1 }

If the function is differentiable everywhere, the value of b must be ________. (rounded off to one decimal place)

Answer (official key): -2.1 to -1.9

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

Q34 · Operating System · Numerical · 1 mark

Suppose in a multiprogramming environment, the following C program segment is executed. A process goes into I/O queue whenever an I/O related operation is performed. Assume that there will always be a context switch whenever a process requests for an I/O, and also whenever the process returns from an I/O. The number of times the process will enter the ready queue during its lifetime (not counting the time the process enters the ready queue when it is run initially) is _______. (Answer in integer)

int main()
{
 int x=0,i=0;
 scanf("%d",&x);
 for(i=0; i<20; i++)
 {
  x = x+20;
  printf("%d\\n",x);
 }
 return 0;
}

Answer (official key): 21

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

Q35 · Programming and Data Structures · Numerical · 1 mark

#include <stdio.h> void foo(int *p, int x){ *p=x; } int main(){ int *z; int a = 20, b = 25; z = &a; foo(z,b); printf("%d",a); return 0; }

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

Answer (official key): 25

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

Q36 · Operating System · MCQ · 2 marks

A computer has two processors, M1M_1 and M2M_2. Four processes P1P_1, P2P_2, P3P_3, P4P_4 with CPU bursts of 20, 16, 25, and 10 milliseconds, respectively, arrive at the same time and these are the only processes in the system. The scheduler uses non-preemptive priority scheduling, with priorities decided as follows:

  • M1M_1 uses priority of execution for the processes as P1>P3>P2>P4P_1 > P_3 > P_2 > P_4, i.e., P1P_1 and P4P_4 have highest and lowest priorities, respectively.
  • M2M_2 uses priority of execution for the processes as P2>P3>P4>P1P_2 > P_3 > P_4 > P_1, i.e., P2P_2 and P1P_1 have highest and lowest priorities, respectively.

A process PiP_i is scheduled to a processor MkM_k, if the processor is free and no other process PjP_j is waiting with higher priority. At any given point of time, a process can be allocated to any one of the free processors without violating the execution priority rules. Ignore the context switch time. What will be the average waiting time of the processes in milliseconds?

  • (A)
    9.009.00
  • (B)
    8.758.75
  • (C)
    6.506.50
  • (D)
    7.507.50

Answer (official key): A

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

Q37 · Theory of Computation · MCQ · 2 marks

Consider the following two languages over the alphabet {a,b,c}\{a,b,c\}, where mm and nn are natural numbers.

L1={ambmcm+n∣m,n≥1}L_1 = \{a^m b^m c^{m+n} \mid m,n \ge 1\} L2={ambncm+n∣m,n≥1}L_2 = \{a^m b^n c^{m+n} \mid m,n \ge 1\}

Which ONE of the following statements is CORRECT?

  • (A)
    Both L1L_1 and L2L_2 are context-free languages.
  • (B)
    L1L_1 is a context-free language but L2L_2 is not a context-free language.
  • (C)
    L1L_1 is not a context-free language but L2L_2 is a context-free language.
  • (D)
    Neither L1L_1 nor L2L_2 are context-free languages.

Answer (official key): C

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

Q38 · Computer Organization and Architecture · MCQ · 2 marks

Consider a memory system with 1extM1 ext{M} bytes of main memory and 16extK16 ext{K} bytes of cache memory. Assume that the processor generates 20-bit memory address, and the cache block size is 16 bytes. If the cache uses direct mapping, how many bits will be required to store all the tag values? [Assume memory is byte addressable, 1extK=2101 ext{K}=2^{10}, 1extM=2201 ext{M}=2^{20}.]

  • (A)
    6imes2106 imes 2^{10}
  • (B)
    8imes2108 imes 2^{10}
  • (C)
    2122^{12}
  • (D)
    2142^{14}

Answer (official key): A

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

Q39 · Digital Logic · MCQ · 2 marks

Consider the following four variable Boolean function in sum-of-product form

F(b3,b2,b1,b0)=Σ(0,2,4,8,10,11,12).F(b_3,b_2,b_1,b_0)=\Sigma(0,2,4,8,10,11,12).

The value of the function is computed by considering b3b2b1b0b_3b_2b_1b_0 as a 4-bit binary number, where b3b_3 denotes the most significant bit and b0b_0 denotes the least significant bit. Note that there are no don't care terms. Which ONE of the following options is the CORRECT minimized Boolean expression for FF?

  • (A)
    ar b_1ar b_0 + ar b_2ar b_0 + b_1ar b_2 b_3
  • (B)
    ar b_1ar b_0 + ar b_2ar b_0
  • (C)
    ar b_2ar b_0 + b_1 b_2 b_3
  • (D)
    ar b_0ar b_2 + ar b_3

Answer (official key): A

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

Q40 · Linear Algebra · MCQ · 2 marks

Let AA be a 2imes22 imes 2 matrix as given.

A = egin{bmatrix} 1 & 1 \ 1 & -1 \end{bmatrix}

What are the eigenvalues of the matrix A13A^{13}?

  • (A)
    1,−11, -1
  • (B)
    22,−222\sqrt{2}, -2\sqrt{2}
  • (C)
    42,−424\sqrt{2}, -4\sqrt{2}
  • (D)
    642,−64264\sqrt{2}, -64\sqrt{2}

Answer (official key): D

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

Q41 · Computer Networks · MCQ · 2 marks

A packet with the destination IP address 145.36.109.70 arrives at a router whose routing table is shown below. Which interface will the packet be forwarded to?

Routing table:

  • 145.36.0.0/16 -> E1
  • 145.36.128.0/17 -> E2
  • 145.36.64.0/18 -> E3
  • 145.36.255.0/24 -> E4
  • Default -> E5
  • (A)
    E3
  • (B)
    E1
  • (C)
    E2
  • (D)
    E5

Answer (official key): A

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

Q42 · Databases · MCQ · 2 marks

Consider two relations describing teamsteams and playersplayers in a sports league:

  • teams(tid,tname)teams(tid, tname): tidtid, tnametname are team-id and team-name, respectively
  • players(pid,pname,tid)players(pid, pname, tid): pidpid, pnamepname, and tidtid denote player-id, player-name and the team-id of the player, respectively

Which ONE of the following tuple relational calculus queries returns the name of the players who play for the team having tnametname as 'MI'?

  • (A)
    { p.pname∣p∈players∧∃t (t∈teams∧p.tid=t.tid∧t.tname=′MI′) }\{\, p.pname \mid p \in players \wedge \exists t \,(t \in teams \wedge p.tid = t.tid \wedge t.tname = 'MI') \,\}
  • (B)
    { p.pname∣p∈teams∧∃t (t∈players∧p.tid=t.tid∧t.tname=′MI′) }\{\, p.pname \mid p \in teams \wedge \exists t \,(t \in players \wedge p.tid = t.tid \wedge t.tname = 'MI') \,\}
  • (C)
    { p.pname∣p∈players∧∃t (t∈teams∧t.tname=′MI′) }\{\, p.pname \mid p \in players \wedge \exists t \,(t \in teams \wedge t.tname = 'MI') \,\}
  • (D)
    { p.pname∣p∈teams∧∃t (t∈players∧t.tname=′MI′) }\{\, p.pname \mid p \in teams \wedge \exists t \,(t \in players \wedge t.tname = 'MI') \,\}

Answer (official key): A

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

Q43 · Algorithms · MCQ · 2 marks

Let G(V,E)G(V,E) be an undirected and unweighted graph with 100 vertices. Let d(u,v)d(u,v) denote the number of edges in a shortest path between vertices uu and vv in VV. Let the maximum value of d(u,v)d(u,v), u,v∈Vu,v \in V such that uevu e v, be 30. Let TT be any breadth-first-search tree of GG. Which ONE of the given options is CORRECT for every such graph GG?

  • (A)
    The height of TT is exactly 15.
  • (B)
    The height of TT is exactly 30.
  • (C)
    The height of TT is at least 15.
  • (D)
    The height of TT is at least 30.

Answer (official key): C

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

Q44 · Theory of Computation · MCQ · 2 marks

Consider the following two languages over the alphabet {a,b}\{a,b\}:

L1={αβα∣α∈{a,b}+ and β∈{a,b}+}L_1 = \{\alpha\beta\alpha \mid \alpha \in \{a,b\}^{+} \text{ and } \beta \in \{a,b\}^{+}\} L2={αβα∣α∈{a}+ and β∈{a,b}+}L_2 = \{\alpha\beta\alpha \mid \alpha \in \{a\}^{+} \text{ and } \beta \in \{a,b\}^{+}\}

Which ONE of the following statements is CORRECT?

  • (A)
    Both L1L_1 and L2L_2 are regular languages.
  • (B)
    L1L_1 is a regular language but L2L_2 is not a regular language.
  • (C)
    L1L_1 is not a regular language but L2L_2 is a regular language.
  • (D)
    Neither L1L_1 nor L2L_2 is a regular language.

Answer (official key): C

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

Q45 · Computer Organization and Architecture · MCQ · 2 marks

A processor has 64 general-purpose registers and 50 distinct instruction types. An instruction is encoded in 32-bits. What is the maximum number of bits that can be used to store the immediate operand for the given instruction?

ADD R1, #25 // R1 = R1 + 25

  • (A)
    1616
  • (B)
    2020
  • (C)
    2222
  • (D)
    2424

Answer (official key): B

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

Q46 · Theory of Computation · MSQ · 2 marks

Consider the following deterministic finite automaton (DFA) defined over the alphabet Σ={a,b}\Sigma = \{a,b\}. Identify which of the following language(s) is/are accepted by the given DFA.

DFA for Q50

  • (A)
    The set of all strings containing an even number of bb's.
  • (B)
    The set of all strings containing the pattern babbab.
  • (C)
    The set of all strings ending with the pattern babbab.
  • (D)
    The set of all strings not containing the pattern abaaba.

Answer (official key): C

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

Q47 · Discrete Mathematics · MSQ · 2 marks

Let A={0,1,2,3,… }A = \{0,1,2,3,\dots\} be the set of non-negative integers. Let F\mathcal{F} be the set of functions from AA to itself. For any two functions f1,f2∈Ff_1, f_2 \in \mathcal{F}, define

(f1⊙f2)(n)=f1(n)+f2(n)(f_1 \odot f_2)(n) = f_1(n) + f_2(n)

for every n∈An \in A. Which of the following is/are CORRECT about the mathematical structure (F,⊙)(\mathcal{F}, \odot)?

  • (A)
    (F,⊙)(\mathcal{F}, \odot) is an Abelian group.
  • (B)
    (F,⊙)(\mathcal{F}, \odot) is an Abelian monoid.
  • (C)
    (F,⊙)(\mathcal{F}, \odot) is a non-Abelian group.
  • (D)
    (F,⊙)(\mathcal{F}, \odot) is a non-Abelian monoid.

Answer (official key): B

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

Q48 · Compiler Design · MSQ · 2 marks

Which of the following statement(s) is/are TRUE while computing First and Follow during top-down parsing by a compiler?

  • (A)
    For a production A→ϵA \to \epsilon, ϵ\epsilon will be added to First(A)First(A).
  • (B)
    If there is an input right end marker, it will be added to First(S)First(S), where SS is the start symbol.
  • (C)
    For a production A→ϵA \to \epsilon, ϵ\epsilon will be added to Follow(A)Follow(A).
  • (D)
    If there is an input right end marker, it will be added to Follow(S)Follow(S), where SS is the start symbol.

Answer (official key): A, D

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

Q49 · Databases · MSQ · 2 marks

Consider a relational schema team(name,city,owner)team(name, city, owner), with functional dependencies:

{name→city,  name→owner}\{ name \to city,\; name \to owner \}

The relation teamteam is decomposed into two relations, t1(name,city)t_1(name, city) and t2(name,owner)t_2(name, owner). Which of the following statement(s) is/are TRUE?

  • (A)
    The relation teamteam is NOT in BCNF.
  • (B)
    The relations t1t_1 and t2t_2 are in BCNF.
  • (C)
    The decomposition constitutes a lossless join.
  • (D)
    The relation teamteam is NOT in 3NF.

Answer (official key): B, C

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

Q50 · Discrete Mathematics · MSQ · 2 marks

Which of the following predicate logic formulae is/are CORRECT representation(s) of the statement: “Everyone has exactly one mother”?

The meanings of the predicates used are:

  • mother(y,x)mother(y,x): yy is the mother of xx
  • noteq(x,y)noteq(x,y): xx and yy are not equal
  • (A)
    ∀x∃y∃z(mother(y,x)∧¬mother(z,x))\forall x \exists y \exists z (mother(y,x) \land \neg mother(z,x))
  • (B)
    ∀x∃y[mother(y,x)∧∀z(noteq(z,y)→¬mother(z,x))]\forall x \exists y \left[mother(y,x) \land \forall z \left(noteq(z,y) \to \neg mother(z,x)\right)\right]
  • (C)
    ∀x∀y[mother(y,x)→∃z(mother(z,x)∧¬noteq(z,y))]\forall x \forall y \left[mother(y,x) \to \exists z \left(mother(z,x) \land \neg noteq(z,y)\right)\right]
  • (D)
    ∀x∃y[mother(y,x)∧¬∃z(noteq(z,y)∧mother(z,x))]\forall x \exists y \left[mother(y,x) \land \neg \exists z \left(noteq(z,y) \land mother(z,x)\right)\right]

Answer (official key): B, D

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

Q51 · Probability and Statistics · Numerical · 2 marks

Consider a probability distribution given by the density function P(x)P(x):

P(x)={Cx2,1≤x≤40,otherwiseP(x) = \begin{cases} Cx^2, & 1 \leq x \leq 4 \\ 0, & \text{otherwise} \end{cases}

The probability that xx lies between 2 and 3, i.e., P(2≤x≤3)P(2 \leq x \leq 3), is __________. (rounded off to three decimal places)

Answer (official key): 0.3 to 0.302

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

Q52 · Operating System · Numerical · 2 marks

A disk of size 512M bytes is divided into blocks of 64K bytes. A file is stored in the disk using linked allocation. In linked allocation, each data block reserves 4 bytes to store the pointer to the next data block. The link part of the last data block contains a NULL pointer (also of 4 bytes). Suppose a file of 1M bytes needs to be stored in the disk. Assume, 1K = 2^10 and 1M = 2^20. The amount of space in bytes that will be wasted due to internal fragmentation is ______. (Answer in integer)

Answer (official key): 65468

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

Q53 · Programming and Data Structures · Numerical · 2 marks

Consider the following C program: #include <stdio.h> int gate (int n) { int d, t, newnum, turn; newnum = turn = 0; t=1; while (n>=t) t = 10; t /=10; while (t>0) { d = n/t; n = n%t; t /= 10; if (turn) newnum = 10newnum + d; turn = (turn + 1) % 2; } return newnum; } int main () { printf ("%d", gate(14362)); return 0; } The value printed by the given C program is _______ . (Answer in integer)

Answer (official key): 46

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

Q54 · Probability and Statistics · Numerical · 2 marks

Suppose a 5-bit message is transmitted from a source to a destination through a noisy channel. The probability that a bit of the message gets flipped during transmission is 0.01. Flipping of each bit is independent of one another. The probability that the message is delivered error-free to the destination is ______ . (rounded off to three decimal places)

Answer (official key): 0.949 to 0.952

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

Q55 · Algorithms · Numerical · 2 marks

In a double hashing scheme, h1(k)=k mod 11h_1(k) = k \bmod 11 and h2(k)=1+(k mod 7)h_2(k) = 1 + (k \bmod 7). The hash table has size m=11m = 11, with slots numbered 0 through 10. The hash function for the ii-th probe (i≥0i \geq 0) is:

h(k, i)=(h1(k)+i⋅h2(k)) mod mh(k,\, i) = \bigl(h_1(k) + i \cdot h_2(k)\bigr) \bmod m

The following keys are inserted in the given order: 63, 50, 25, 79, 67, 24.

The slot at which key 24 is stored is ___________. (Answer in integer)

Answer (official key): 10

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

Q56 · Compiler Design · Numerical · 2 marks

Refer to the given 3-address code sequence. This code sequence is split into basic blocks. The number of basic blocks is ________. (Answer in integer)

1001: i = 1
1002: j = 1
1003: t1 = 10*i
1004: t2 = t1+j
1005: t3 = 8*t2
1006: t4 = t3-88
1007: a[t4] = 0.0
1008: j = j+1
1009: if j <= 10 goto 1003
1010: i = i+1
1011: if i <= 10 goto 1002
1012: i = 1
1013: t5 = i-1
1014: t6 = 88*t5
1015: a[t6] = 1.0
1016: i = i+1
1017: if i <= 10 goto 1013

Answer (official key): 6

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

Q57 · Programming and Data Structures · Numerical · 2 marks

#include <stdio.h> int foo(int S[],int size){ if(size == 0) return 0; if(size == 1) return 1; if(S[0] != S[1]) return 1+foo(S+1,size-1); return foo(S+1,size-1); } int main(){ int A[]={0,1,2,2,2,0,0,1,1}; printf("%d",foo(A,9)); return 0; } The value printed by the given C program is _______ . (Answer in integer)

Answer (official key): 5

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

Q58 · Databases · Numerical · 2 marks

Consider the following database tables of a sports league. player(pid,pname,age) 1,Jasprit,31 2,Atharva,24 3,Ishan,26 4,Axar,30

coach(cid,cname) 101,Ricky 102,Mark 103,Trevor

team(tid,tname,city,cid) 10,MI,Mumbai,102 20,DC,Delhi,101 30,PK,Mohali,103

members(pid,tid) 1,10 2,30 3,10 4,20 An instance of the table and an SQL query are given. SELECT MIN(P.age) FROM player P WHERE P.pid IN ( SELECT M.pid FROM team T, coach C, members M WHERE C.cname = 'Mark' AND T.cid = C.cid AND M.tid = T.tid ) The value returned by the given SQL query is ______ . (Answer in integer)

Answer (official key): 26

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

Q59 · Operating System · Numerical · 2 marks

In optimal page replacement algorithm, information about all future page references is available to the operating system (OS). A modification of the optimal page replacement algorithm is as follows: The OS correctly predicts only up to next 4 page references (including the current page) at the time of allocating a frame to a page. A process accesses the pages in the following order of page numbers: 1, 3, 2, 4, 2, 3, 1, 2, 4, 3, 1, 4. If the system has three memory frames that are initially empty, the number of page faults that will occur during execution of the process is ________ . (Answer in integer)

Answer (official key): 6

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

Q60 · Digital Logic · Numerical · 2 marks

Consider a finite state machine (FSM) with one input XXX and one output fff, represented by the given state transition table. The minimum number of states required to realize this FSM is ________. (Answer in integer) Present state | Next state (X=0) | Next state (X=1) | Output f (X=0) | Output f (X=1) A | F | B | 0 | 0 B | D | C | 0 | 0 C | F | E | 0 | 0 D | G | A | 1 | 0 E | D | C | 0 | 0 F | F | B | 1 | 1 G | G | H | 0 | 1 H | G | A | 1 | 0

Answer (official key): 5

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

Q61 · Algorithms · Numerical · 2 marks

The maximum value of xxx such that the edge between the nodes B and C is included in every minimum spanning tree of the given graph is _________ . (Answer in integer)

Answer (official key): 5

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

Q62 · Computer Networks · Numerical · 2 marks

Suppose a message of size 15000 bytes is transmitted from a source to a destination using IPv4 protocol via two routers as shown in the figure. Each router has a defined maximum transmission unit (MTU) as shown in the figure, including IP header. The number of fragments that will be delivered to the destination is ________ . (Answer in integer)

IPv4 Fragmentation Figure

Answer (official key): 7

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

Q63 · Programming and Data Structures · Numerical · 2 marks

Let LIST be a datatype for an implementation of linked list defined as follows:

typedef struct list {
  int data;
  struct list *next;
} LIST;

Suppose a program has created two linked lists, L1 and L2, whose contents are given in the figure below (code for creating L1 and L2 is not provided here). L1 contains 9 nodes, and L2 contains 7 nodes. Consider the following C program segment that modifies the list L1. The number of nodes that will be there in L1 after the execution of the code segment is ________ . (Answer in integer)

int find (int query, LIST *list) { while (list != NULL){ if(list->data == query) return 1; list = list->next; } return 0; } int main () { … … … ptr1=L1; ptr2=L2; while (ptr1->next != NULL){ query = ptr1->next->data; if (find (query, L2)) ptr1->next = ptr1->next->next; else ptr1 = ptr1->next; } … … … return 0; }

Answer (official key): 5

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

Q64 · Digital Logic · Numerical · 2 marks

Consider the given sequential circuit designed using D-Flip-flops. The circuit is initialized with some value (initial state). The number of distinct states the circuit will go through before returning back to the initial state is _________ . (Answer in integer)

Sequential Circuit Figure

Answer (official key): 7 to 8

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

Q65 · Computer Organization and Architecture · Numerical · 2 marks

A computer has a memory hierarchy consisting of two-level cache (L1 and L2) and a main memory. If the processor needs to access data from memory, it first looks into L1 cache. If the data is not found in L1 cache, it goes to L2 cache. If it fails to get the data from L2 cache, it goes to main memory, where the data is definitely available. Hit rates and access times of various memory units are shown in the figure. The average memory access time in nanoseconds (ns) is ________. (rounded off to two decimal places)

Memory Hierarchy Figure

Answer (official key): 11.83 to 11.87

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