GATE 2024 CSE Question Paper PDF is available here. IISc Banglore conducted GATE 2024 CSE exam on February 10 in the Forenoon Session from 9:30 AM to 12:30 PM. Students had to answer 65 questions in GATE 2024 CSE Question Paper carrying a total weightage of 100 marks. 10 questions are from the General Aptitude section and 55 questions are from Engineering Mathematics and Core Discipline.

Also Check:

GATE 2024 CSE Slot-1 Question Paper with Answer Key PDFs

GATE 2024 CSE Question Paper PDF  download iconDownload Check Solutions

GATE 2024 CSE SET 1 Questions with Solutions

Question 1:

If → denotes increasing order of intensity, then the meaning of the words [dry → arid → parched] is analogous to [diet → fast → ______ ].

  1. starve
  2. reject
  3. feast
  4. deny

Question 2:

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

  1. depends on xy
  2. depends only on and not on y
  3. depends only on y and not on x
  4. is a constant

Question 3:

Consider the following sample of numbers: 9, 18, 11, 14, 15, 17, 10, 69, 11, 13 The median of the sample is:

  1. 13.5
  2. 14
  3. 11
  4. 18.7

Question 4:

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

  1. 21%
  2. 14 2/7%
  3. 10%
  4. 30%

Question 5:

For positive non-zero real variables p and q, if log(p² + q²) = log p + log q + 2 log 3, then, the value of (p⁴ + q⁴) / (p²q²) is:

  1. 79
  2. 81
  3. 9
  4. 83

Question 6:

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.

  1. down, down, for, for
  2. on, down, for, on
  3. down, out, for, on
  4. on, out, on, for

Question 7:

A rectangular paper sheet of dimensions 54 cm × 4 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:

  1. 1/π
  2. 2/π
  3. 3/π
  4. 4/π

Question 8:

The pie chart presents the percentage contribution of different macronutrients to a typical 2,000 kcal diet of a person. The typical energy density (kcal/g) of these macronutrients is given in the table. (Image of the pie chart is included in the pdf) The total fat (all three types), in grams, this person consumes is:
pie chart

The typical energy density (kcal/g) of these macronutrients is given in the table.

Macronutrient  Energy density (kcal/g)
Carbohydrates 4
Proteins 4
Unsaturated fat 9
Saturated fat 9
Trans fat 9
  1. 44.4
  2. 77.8
  3. 100
  4. 3,600

Question 9:

A rectangular paper of 20 cm × 8 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:

  1. 18
  2. 24
  3. 20
  4. 21

Question 10:

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

  1. 6
  2. 4
  3. 5
  4. 7

Question 11:

Let f : R → R be a function such that f(x) = max{x, x³}, x ∈ R, where R is the set of all real numbers. The set of all points where f(x) is NOT differentiable is:

  1. {-1, 1, 2}
  2. {-2, -1, 1}
  3. {0, 1}
  4. {-1, 0, 1}

Question 12:

The product of all eigenvalues of the matrix
Matrix
is:

  1. -1
  2. 0
  3. 1
  4. 2

Question 13:

Consider a system that uses 5 bits for representing signed integers in 2's complement format. In this system, two integers A and B are represented as A = 01010 and B = 11010. Which one of the following operations will result in either an arithmetic overflow or an arithmetic underflow?

  1. A + B
  2. A - B
  3. B - A
  4. 2 * B

Question 14:

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

  1. The events X and Y are mutually exclusive.
  2. The events X and Y are independent.
  3. Either event X or Y must occur.
  4. Event X is more likely than event Y.

Question 15:

Which one of the following statements is FALSE?

  1. 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.
  2. For bulk data transfer, the burst mode of DMA has a higher throughput than the cycle stealing mode.
  3. Programmed I/O mechanism has a better CPU utilization than the interrupt-driven I/O mechanism.
  4. The CPU can start executing an interrupt service routine faster with vectored interrupts than with non-vectored interrupts.

Question 16:

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:

  1. HTTP GET request for the index page
  2. DNS request to resolve the web server's name to its IP address
  3. HTTP GET request for an image object
  4. 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?

  1. (iv), (ii), (iii), (i)
  2. (ii), (iv), (iii), (i)
  3. (ii), (iv), (i), (iii)
  4. (iv), (ii), (i), (iii)

Question 17:

Given an integer array of size *N*, 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:

  1. both O(N) and Ω(N)
  2. O(N) but not Ω(N)
  3. Ω(N) but not O(N)
  4. neither O(N) nor Ω(N)

Question 18:

Consider the following C program:


#include 
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?

  1. The program prints 9 as output.
  2. The program prints 10 as output.
  3. The program gets stuck in an infinite loop.
  4. The program prints 6 as output.

Question 19:

Consider the following C program:


#include 
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?

  1. The program will not terminate.
  2. The program will terminate with no output.
  3. The program will terminate with 4321 as output.
  4. The program will terminate with 1234 as output.

Question 20:

Let S 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 S?
ER Diagram Options
Correct Answer:


Question 21:

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

  1. Only the root node
  2. All leaf nodes
  3. All internal nodes
  4. Only the leftmost leaf node

Question 22:

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

  1. R can have a multi-attribute key
  2. R cannot have a foreign key
  3. R cannot have a composite attribute
  4. R cannot have more than one candidate key

Question 23:

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

  1. L1 = L2 if and only if L1 ∩ L2 = ∅
  2. L1 ∪ L3 is not regular
  3. L3 is not regular
  4. L1 ∪ L2 is regular

Question 24:

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

  1. Threads can only be implemented in kernel space
  2. Each thread has its own file descriptor table for open files
  3. All the threads belonging to a process share a common stack
  4. Threads belonging to a process are by default not protected from each other

Question 25:

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

  1. Running to Ready
  2. Waiting to Running
  3. Ready to Waiting
  4. Running to Terminated

Question 26:

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

  1. Shift-reduce Parser
  2. Predictive Parser
  3. LL(1) Parser
  4. LR Parser

Question 27:

Let A and B be two events in a probability space with P(A) = 0.3, P(B) = 0.5, and P(A ∩ B) = 0.1. Which of the following statements is/are TRUE?

  1. The two events A and B are independent
  2. P(A ∪ B) = 0.7
  3. P(A ∩ Bc) = 0.2, where Bc is the complement of the event B
  4. P(Ac ∩ Bc) = 0.4, where Ac and Bc are the complements of the events A and B, respectively

Question 28:

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.Logic Circuit

Which of the following statements about the circuit is/are CORRECT?

  1. With no propagation delays, the output Y is always logic Zero
  2. With no propagation delays, the output Y is always logic One
  3. With propagation delays, the output Y can have a transient logic One after X transitions from logic Zero to logic One
  4. With propagation delays, the output Y can have a transient logic Zero after X transitions from logic One to logic Zero

Question 29:

TCP client P successfully establishes a connection to TCP server Q. Let NP denote the sequence number in the SYN sent from P to Q. Let NQ denote the acknowledgement number in the SYN ACK from Q to P. Which of the following statements is/are CORRECT?

  1. The sequence number NP is chosen randomly by P
  2. The sequence number NP is always 0 for a new connection
  3. The acknowledgement number NQ is equal to NP
  4. The acknowledgement number NQ is equal to NP + 1

Question 30:

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?

  1. 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
  2. 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
  3. Forwarding cannot prevent all pipeline stalls
  4. Forwarding does not require any extra hardware to retrieve the data from the pipeline stages

Question 31:

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?

  1. Source IP
  2. Destination IP
  3. Header Checksum
  4. Total Length

Question 32:

Let A and B be non-empty finite sets such that there exist one-to-one and onto functions (i) from A to B and (ii) from A × A to A ∪ B. The number of possible values of |A| is ____.

Correct Answer: 2
View Solution

Step 1: Condition for bijection from A to B. For a one-to-one and onto function to exist from A to B, the cardinalities of A and B must be equal. Let |A| = |B| = n.

Step 2: Condition for bijection from A × A to A ∪ B. The cardinality of A × A is n², and the cardinality of A ∪ B is |A| + |B| = 2n. For a one-to-one and onto function to exist, these cardinalities must be equal:

n² = 2n.

Step 3: Solve the equation. Simplify:

n² - 2n = 0
n(n - 2) = 0
Thus, n = 0 or n = 2. Since A and B are non-empty, n = 2.


Question 33:

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

The value of the expression 3 + 1 + 5 * 2 / 7 + 2 - 4 - 7 - 6 / 2 as per the above rules is ____.


Question 34:

The number of spanning trees in a complete graph of 4 vertices labelled A, B, C, and D is ____.

Correct Answer: 16
View Solution

Step 1: Recall the formula for spanning trees in a complete graph. The number of spanning trees in a complete graph with n vertices is given by Cayley's formula:

T = nn-2

Step 2: Substitute the value of n. For n = 4:

T = 44-2 = 4² = 16


Question 35:

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

The total number of tuples obtained by evaluating the following expression: σB(R R.A=S.A S) is ___.


Question 36:

Consider a network path P → Q → R between nodes P and R via router Q. Node P sends a file of size 106 bytes to R via this path by splitting the file into chunks of 103 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 106 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 = 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?

  1. 8.000
  2. 8.008
  3. 15.992
  4. 16.000

Question 37:

Consider the following syntax-directed definition (SDD).

S → DHTU  {S.val = D.val + H.val + T.val + U.val; }
D → "M" D1  {D.val = 5 + D1.val; }
D → ε  {D.val = −5; }
H → "L" H1  {H.val = 5·10 + H1.val; }
H → ε  {H.val = −10; }
T → "C" T1  {T.val = 5·100 + T1.val; }
T → ε  {T.val = −5; }
U → "K"  {U.val = 5; }
Given the input "MMLK", which one of the following options is the CORRECT value computed by the SDD (in the attribute S.val)?

  1. 45
  2. 50
  3. 55
  4. 65

Question 38:

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

S → daT | (1)
T → aS | bT | (2)
R→ (3) | ε
The set of terminals is {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, e}, FIRST(R) = {c, ε},
FOLLOW(S) = FOLLOW(T) = {c, f, $}, FOLLOW(R) = {f}.
Which one of the following options CORRECTLY fills in the incomplete productions?

  1. S → Rf, T → ε, R → cTR
  2. S → fR, T → ε, R → cTR
  3. S → fR, T → cT, R → cR
  4. S → Rf, T → cT, R → cR

Question 39:

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?

  1. 6 and 6
  2. 6 and 7
  3. 7 and 7
  4. 7 and 6

Question 40:

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

T1: a = a + 1; b = b + 1;
T2: b = 2 × b; a = 2 × a;
Which one of the following options lists all the possible combinations of values of a and b after both T1 and T2 finish execution?

  1. (a = 4, b = 4); (a = 3, b = 3); (a = 4, b = 3)
  2. (a = 3, b = 4); (a = 4, b = 3); (a = 3, b = 3)
  3. (a = 4, b = 4); (a = 4, b = 3); (a = 3, b = 4)
  4. (a = 2, b = 2); (a = 2, b = 3); (a = 3, b = 4)

Question 41:

An array [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?

  1. 82, 90, 101
  2. 82, 11, 93
  3. 131, 11, 93
  4. 131, 111, 90

Question 42:

Consider the following recurrence relation:

T(n) =
{
    √nT(√n) + n   for n > 1,
    1               for n = 1.
}
Which one of the following options is CORRECT?

  1. Τ(n) = Θ(n log log n)
  2. Τ(n) = Θ(n log n)
  3. Τ(n) = Θ(n2 log n)
  4. Τ(n) = Θ(n² log log n)

Question 43:

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

  1. 53
  2. 52
  3. 27
  4. 1

Question 44:

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

  1. (X, Y) → (Z, W) implies X → (Z, W)
  2. (X, Y) → (Z, W) implies (X, Y) → Z
  3. ((X, Y) → Z and W → Y) implies (X, W) → Z
  4. (X → Y and Y → Z) implies X → Z

Question 45:

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

  1. There are no back-edges in G with respect to the tree T
  2. There are no cross-edges in G with respect to the tree T
  3. There are no forward-edges in G with respect to the tree T
  4. The only edges in G are the edges in T

Question 46:

Consider the following read-write schedule S over three transactions T1, T2, and T3, 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);
Which of the following transaction schedules is/are conflict equivalent to S?

  1. T1T2T3
  2. T1T3T2
  3. T3T2T1
  4. T3T1T2

Question 47:

Consider a Boolean expression given by F(X, Y, Z) = ∑(3,5,6,7). Which of the following statements is/are CORRECT?

  1. F(X, Y, Z) = Π(0, 1, 2, 4)
  2. F(X, Y, Z) = X̅Y̅ + YZ + XZ̅
  3. F(X, Y, Z) is independent of input Y
  4. F(X, Y, Z) is independent of input X

Question 48:

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?

  1. If the inputs are x = 20, y = 10, then the return value is greater than 210
  2. If the inputs are x = 20, y = 20, then the return value is greater than 220
  3. If the inputs are x = 20, y = 10, then the return value is less than 210
  4. If the inputs are x = 10, y = 20, then the return value is greater than 220

Question 49:

Let A be any n × m matrix, where m > n. Which of the following statements is/are TRUE about the system of linear equations Ax = 0?

  1. There exist at least m − n linearly independent solutions to this system
  2. There exist m − n linearly independent vectors such that every solution is a linear combination of these vectors
  3. There exists a non-zero solution in which at least m − n variables are 0
  4. There exists a solution in which at least n variables are non-zero

Question 50:

Consider the 5-state DFA M accepting the language L(M) ⊆ (0 + 1)* shown below. For any string w ∈ (0 + 1)*, let n0(w) be the number of 0's in w and n1(w) be the number of 1's in w.DFA Diagram

Which of the following statements is/are FALSE?

  1. States 2 and 4 are distinguishable in M
  2. States 3 and 4 are distinguishable in M
  3. States 2 and 5 are distinguishable in M
  4. Any string w with n0(w) = n1(w) is in L(M)

Question 51:

The chromatic number of a graph is the minimum number of colours used in a proper colouring of the graph. Let G be any graph with n vertices and chromatic number k. Which of the following statements is/are always TRUE?

  1. G contains a complete subgraph with k vertices
  2. G contains an independent set of size at least n/k
  3. G contains at least k(k − 1)/2 edges
  4. G contains a vertex of degree at least k
Correct Answer: (2), (3)
View Solution

Step 1: Independent set size. An independent set is a set of vertices such that no two vertices are adjacent. For a graph with chromatic number k, the graph can be partitioned into k independent sets. The largest independent set must have at least *n* / *k* vertices. Hence, (2) is true.

Step 2: Number of edges. The chromatic number k implies there is at least a complete subgraph Kk. A complete subgraph with k vertices has *k*(k − 1)/2 edges. Therefore, G must contain at least *k*(k – 1)/2 edges. Hence, (3) is true.

Step 3: Remaining options.

  • Option (1) is not necessarily true because the graph may not contain a complete subgraph with k vertices.
  • Option (4) is also not necessarily true because there may not be a vertex of degree k.


Question 52:

Consider the operators ◇ and ☐ defined by a◇b = a + 2b and a☐b = ab, for positive integers. Which of the following statements is/are TRUE?

  1. Operator ◇ obeys the associative law
  2. Operator ☐ obeys the associative law
  3. Operator ☐ over the operator ◇ obeys the distributive law
  4. Operator ◇ over the operator ☐ obeys the distributive law

Question 53:

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?

  1. A read miss in WBC never evicts a dirty block
  2. A read miss in WTC never triggers a write-back operation of a cache block to main memory
  3. A write hit in WBC can modify the value of the dirty bit of a cache block
  4. A write miss in WTC always writes the victim cache block to main memory before loading the missed block to the cache

Question 54:

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


Question 55:

The baseline execution time of a program on a 2 GHz single core machine is 100 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 _____.

Correct Answer: 3
View Solution

Step 1: Divide the execution time into parallel and serial components. The program's execution time is 100 ns. The parallelizable part is 90%, and the non-parallelizable part is 10%: Parallelizable time = 90 ns, Non-parallelizable time = 10 ns.

Step 2: Calculate the execution time for k cores. Using Amdahl's Law and considering overhead, the execution time is given by:

Tk = Parallelizable time / k + Non-parallelizable time + (k - 1) × Overhead
Substitute values:
Tk = 90/k + 10 + 10 × (k - 1)

Step 3: Minimize Tk. For k = 3:

T3 = 90/3 + 10 + 10 × (3 - 1) = 30 + 10 + 20 = 60 ns.
Checking k = 2 and k = 4, T3 is minimum.


Question 56:

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

Correct Answer: 3.00
View Solution

Step 1: Calculate the effective CPI with cache misses. The total CPI is given by:

CPI = Ideal CPI + Miss contribution.
For instruction cache: Instruction miss penalty = 0.02 × 100 = 2 cycles. For data cache (25% load/store): Data miss penalty = 0.25 × 0.08 × 100 = 2 cycles. Total CPI:
CPI = 2 + 2 + 2 = 6.

Step 2: Compute speedup with a perfect cache. With no cache misses, the CPI reduces to 2. The speedup is:

Speedup = CPI with cache misses / CPI without cache misses = 6 / 2 = 3.00.


Question 57:

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


Question 58:

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.
Routing Table

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


Question 59:

Let G = (V, Σ, S, P) be a context-free grammar in Chomsky Normal Form with ∑ = {a,b,c} and V containing 10 variable symbols including the start symbol S. The string w = a30b30c30 is derivable from S. The number of steps (application of rules) in the derivation S →* w is ____.


Question 60:

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

Correct Answer: 60
View Solution

Step 1: Understand the relationship between connected components and edges in a DFS forest. In a connected component, the number of edges is one less than the number of vertices. For C connected components, the number of vertices in each component can be written as: n1, n2,...,nc, where n1 + n2 + … + nc = 100. The total number of edges in the graph is:

Total edges = (n1 - 1) + (n2 - 1) + ··· + (nc − 1) = 100 - C.

Step 2: Compute the number of connected components. Given that the number of edges is 40:

100 - C = 40 => C = 60.


Question 61:

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

r = 0* + 1* and s = 01* + 10*.
The total number of strings of length less than or equal to 5, which are neither in r nor in s, is ____.


Question 62:

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


Question 63:

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

Correct Answer: 0.150
View Solution

Step 1: Use conditional probability. The probability of drawing a red ball given that the first ball is red is:

P(Second ball is red | First ball is red) = Remaining red balls / Total remaining balls = 9 / 24

Step 2: Calculate the probability of both balls being red.

P(Both balls red) = P(First ball is red) × P(Second ball is red | First ball is red)
P(Both balls red) = (10/25) * (9/24) = 90/600 = 0.150.


Question 64:

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.
Multiplexer Circuit

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


Question 65:

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 of 542 bytes, while the second link (router to receiver) has an MTU of 360 bytes. The number of fragments that would be delivered at the receiver is _____.

 


Also Check:

GATE Previous Year Question Papers

Other PG Exam Question Papers