GATE 2025 (Session 2) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2025 (Session 2)

65 questions

MCQ 32 · MSQ 18 · NAT 151-mark 30 · 2-mark 35

Questions 21–25 of 65

Q21Intermediate Code Generation1 markMCQ−0.33 if wrong
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?

Q22Syntax-directed Translation1 markMCQ−0.33 if wrong
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;}\text{Rule 1: } R \rightarrow 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;}\text{Rule 2: } P \rightarrow CD \{ P.i = C.i + D.i; D.i = C.i + 2; \}
Rule 3: Q→EF{Q.i=E.i+F.i;}\text{Rule 3: } Q \rightarrow EF \{ Q.i = E.i + F.i; \}

Which ONE is the CORRECT option among the following?

Q23Network Layer Protocol1 markMCQ−0.33 if wrong
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?

Q24Push-down Automata1 markMCQ−0.33 if wrong
Which ONE of the following languages is accepted by a deterministic pushdown automaton?

Q25Context Free Language1 markMCQ−0.33 if wrong
Let G1,G2G_1, G_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?