GATE 2024 (Session 1) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2024 (Session 1)

65 questions

MCQ 29 · MSQ 20 · NAT 161-mark 30 · 2-mark 35

Questions 56–60 of 65

Q56Cache Memory2 marksNAT
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 _________

Q57System Call2 marksNAT
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 ___

Q58Network Layer Protocol2 marksNAT
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\mathrm{/N}" in a prefix indicates a subnet mask with the most significant N\mathrm{N} bits set to 1.

PrefixNext  hop  router10.1.1.0/24R110.1.1.128/25R210.1.1.64/26R310.1.1.192/26R4\begin{array}{|l|c|} \hline Prefix & Next\; hop \; router \\ \hline 10.1 .1 .0 / 24 & R1 \\ \hline 10.1 .1 .128 / 25 & R2 \\ \hline 10.1 .1 .64 / 26 & R3 \\ \hline 10.1 .1 .192 / 26 & R4 \\ \hline \end{array}

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 R2R 2 is

Q59Context Free Grammar2 marksNAT
Let G=(V,Σ,S,P)G=(V, \Sigma, S, P) be a context-free grammar in Chomsky Normal Form with Σ={a,b,c}\Sigma=\{a, b, c\} and VV containing 10 variable symbols including the start symbol SS. The string w=a30b30c30w=a^{30} b^{30} c^{30} is derivable from SS. The number of steps (application of rules) in the derivation S→∗wS \rightarrow^* w is _____

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