GATE CS 2024 Set 2

65 questions · Previous year paper

The GATE 2024 Computer Science and Information Technology paper, Set 2: 65 questions for 100 marks in 180 minutes, with General Aptitude (15 marks) and the technical section (85 marks). Answers follow the official final answer key; every question has a short explanation.

Take it as a timed test: ₹99

Computer Science and Information Technology

Question 11

MCQ · 1 mark · −0.33

Consider a computer with a 4 MHz processor. Its DMA controller can transfer 8 bytes in 1 cycle from a device to main memory through cycle stealing at regular intervals. Which one of the following is the data transfer rate (in bits per second) of the DMA controller if 1% of the processor cycles are used for DMA?

Options for Question 11

Explanation

Answer: (C)

A 4 MHz processor runs \(4 \times 10^{6}\) cycles per second. With cycle stealing, the DMA controller gets 1% of them:

\[0.01 \times 4 \times 10^{6} = 4 \times 10^{4} \text{ cycles per second}.\]

Each stolen cycle moves 8 bytes, that is \(8 \times 8 = 64\) bits, so the transfer rate is

\[4 \times 10^{4} \times 64 = 2.56 \times 10^{6} \text{ bits per second},\]

which is written 25,60,000 in the Indian digit grouping used by the options. Note that the rate is asked in bits, so the 8 bytes per cycle must be multiplied by 8.

Answer: C

Question 12

MCQ · 1 mark · −0.33

Let \(p\) and \(q\) be the following propositions:

\(p\): Fail grade can be given.

\(q\): Student scores more than 50% marks.

Consider the statement: “Fail grade cannot be given when student scores more than 50% marks.”

Which one of the following is the CORRECT representation of the above statement in propositional logic?

Options for Question 12

Explanation

Answer: (A)

“\(X\) when \(Y\)” means “whenever \(Y\) holds, \(X\) holds”, which is the implication \(Y \rightarrow X\).

  • The condition \(Y\) is “student scores more than 50% marks”, that is \(q\).
  • The consequence \(X\) is “fail grade cannot be given”, that is \(\neg p\).

So the statement is \(q \rightarrow \neg p\). Option B drops the negation and says a fail grade can be given. Option D, \(\neg p \rightarrow q\), is the converse of \(q \rightarrow \neg p\) and is not equivalent to it, and option C has neither the right direction nor the negation.

Answer: A

Question 13

MCQ · 1 mark · −0.33

Consider the following C program. Assume parameters to a function are evaluated from right to left.

#include <stdio.h>

int g(int p) { printf("%d", p); return p; }
int h(int q) { printf("%d", q); return q; }

void f(int x, int y) {
  g(x);
  h(y);
}

int main() {
  f(g(10),h(20));
}

Which one of the following options is the CORRECT output of the above C program?

Options for Question 13

Explanation

Answer: (A)

Follow the calls in order.

  • In main, the arguments of f are evaluated right to left: h(20) runs first and prints 20, then g(10) prints 10.
  • f(10, 20) then runs its body in order: g(x) prints 10 and h(y) prints 20.

Nothing separates the numbers, so the output is 20101020. Left-to-right evaluation would print 10, 20, 10, 20 instead, which is option D. Standard C leaves the order of argument evaluation unspecified, which is why the question fixes it.

Answer: A

Question 14

MCQ · 1 mark · −0.33

The format of a single-precision floating-point number as per the IEEE 754 standard is:

Sign
(1bit)
Exponent
(8 bits)
Mantissa
(23 bits)

Choose the largest floating-point number among the following options.

Options for Question 14

Explanation

Answer: (B)

All four have sign bit 0, so compare their values using the exponent bias of 127.

  • A: exponent 0111 1111 is 127, so the value is \((2 - 2^{-23}) \times 2^{0}\), just under 2.
  • B: exponent 1111 1110 is 254, so the value is \((2 - 2^{-23}) \times 2^{127}\), about \(3.4 \times 10^{38}\).
  • C: an all-ones exponent is reserved. With a non-zero mantissa the pattern means NaN (not a number), which has no value to compare.
  • D: exponent 127 with a zero mantissa is exactly 1.

B is in fact the largest finite single-precision number, so it is the largest option.

Answer: B

Question 15

MCQ · 1 mark · −0.33

Let \(T(n)\) be the recurrence relation defined as follows:

\(T(0) = 1\),
\(T(1) = 2\), and
\(T(n) = 5T(n - 1) - 6T(n - 2)\) for \(n \ge 2\)

Which one of the following statements is TRUE?

Options for Question 15

Explanation

Answer: (A)

The characteristic equation is \(r^{2} - 5r + 6 = 0\), with roots 2 and 3, so \(T(n) = a \cdot 2^{n} + b \cdot 3^{n}\).

The initial values fix the constants: \(a + b = 1\) and \(2a + 3b = 2\), giving \(a = 1\) and \(b = 0\). Hence \(T(n) = 2^{n}\) exactly; for instance, \(T(2) = 5 \cdot 2 - 6 \cdot 1 = 4\).

These starting values make the \(3^{n}\) term vanish, so option C, which follows the larger root, is wrong here. Forms like \(n2^{n}\) and \(n3^{n}\) arise only from a repeated root.

Answer: A

Question 16

MCQ · 1 mark · −0.33

Let \(f(x)\) be a continuous function from \(\mathbb{R}\) to \(\mathbb{R}\) such that

\[f(x) = 1 - f(2 - x)\]

Which one of the following options is the CORRECT value of \(\int_{0}^{2} f(x)\,dx\) ?

Options for Question 16

Explanation

Answer: (B)

Let \(I = \int_{0}^{2} f(x)\,dx\). The substitution \(x \to 2 - x\) maps \([0, 2]\) onto itself, so also \(I = \int_{0}^{2} f(2 - x)\,dx\). Adding the two forms and using \(f(x) + f(2 - x) = 1\):

\[2I = \int_{0}^{2} \big[f(x) + f(2 - x)\big]\,dx = \int_{0}^{2} 1\,dx = 2,\]

so \(I = 1\). Geometrically, the graph is symmetric about the point \((1, \frac{1}{2})\), so the parts above and below the line \(y = \frac{1}{2}\) cancel and the integral is \(2 \times \frac{1}{2} = 1\). For example, \(f(x) = \frac{x}{2}\) satisfies the condition, and its integral from 0 to 2 is 1.

Answer: B

Question 17

MCQ · 1 mark · −0.33

Let \(A\) be the adjacency matrix of a simple undirected graph \(G\). Suppose \(A\) is its own inverse. Which one of the following statements is always TRUE?

Options for Question 17

Explanation

Answer: (B)

\(A\) is its own inverse exactly when \(A^{2} = I\). The entry \((A^{2})_{ij}\) counts the walks of length 2 from vertex \(i\) to vertex \(j\).

  • The diagonal entry \((A^{2})_{ii}\) is the degree of \(i\), so \(A^{2} = I\) forces every vertex to have degree exactly 1.
  • When every degree is 1, no two vertices share a neighbour, so the off-diagonal entries are 0, as required.

So \(G\) is a set of disjoint edges, that is, a perfect matching, and every perfect matching does satisfy \(A^{2} = I\). A cycle fails because its vertices have degree 2. A complete graph works only as \(K_{2}\), a single edge, so two disjoint edges already show that C is not always true. A single edge also rules out D.

Answer: B

Question 18

MCQ · 1 mark · −0.33

When six unbiased dice are rolled simultaneously, the probability of getting all distinct numbers (i.e., 1, 2, 3, 4, 5, and 6) is

Options for Question 18

Explanation

Answer: (B)

Each die shows one of 6 faces independently, so there are \(6^{6} = 46656\) equally likely outcomes.

For all six numbers to be distinct, the dice must show 1 to 6 in some order. The first die can take any of 6 values, the second any of the remaining 5, and so on, giving \(6! = 720\) favourable outcomes.

\[P = \frac{6!}{6^{6}} = \frac{720}{46656} = \frac{5}{324}\]

(Dividing 720 and 46656 by their common factor 144 gives 5 and 324.)

Answer: B

Question 19

MCQ · 1 mark · −0.33

Once the DBMS informs the user that a transaction has been successfully completed, its effect should persist even if the system crashes before all its changes are reflected on disk. This property is called

Options for Question 19

Explanation

Answer: (A)

This is durability, the D in ACID: once a transaction has committed, its changes must survive any later failure. The DBMS ensures it by forcing the transaction's log records to stable storage before it reports the commit, so after a crash the recovery manager can redo committed changes that had not yet reached the data pages on disk.

  • Atomicity is all-or-nothing execution: a transaction's changes are applied completely or not at all.
  • Consistency means a transaction takes the database from one valid state to another.
  • Isolation means concurrent transactions do not see each other's intermediate results.

Answer: A

Question 20

MCQ · 1 mark · −0.33

In the context of owner and weak entity sets in the ER (Entity-Relationship) data model, which one of the following statements is TRUE?

Options for Question 20

Explanation

Answer: (A)

A weak entity set has no key of its own. A weak entity is identified only by combining its partial key (discriminator) with the key of the owner entity it is linked to through the identifying relationship. A weak entity without an owner could not be identified at all, so every weak entity must take part in that relationship: the weak entity set has total participation.

The owner side has no such requirement. With Employee as the owner and Dependent as the weak entity set, for example, an employee may have no dependents. So the owner's participation can be partial, which rules out B and C, and D fails because the weak side must be total.

Answer: A

Questions 11 to 20 of 65