GATE CSE 2025 — Previous Year Questions

Real questions from the 2025 paper with options and answers. Take a timed test →

WhatsApp

41 questions · page 2 of 2

  1. Q26 · Computer Science & IT

    Consider the routing protocols given in List I and the names given in List II: List I List II (i) Distance vector routing (a) Bellman-Ford (ii) Link state routing (b) Dijkstra For matching of items in List I with those in List II, which ONE of the following options is CORRECT?
    • A.(i) – (a) and (ii) – (b)
    • B.(i) – (a) and (ii) – (a)
    • C.(i) – (b) and (ii) – (a)
    • D.(i) – (b) and (ii) – (b) Organising Institute: IIT Roorkee Page 16 of 48
    Show answer / उत्तर देखें

    Answer: A (i) – (a) and (ii) – (b)

    Official GATE 2025 answer key: (A).
  2. Q27 · Computer Science & IT

    A machine receives an IPv4 datagram. The protocol field of the IPv4 header has the protocol number of a protocol X. Which ONE of the following is NOT a possible candidate for X?
    • A.Internet Control Message Protocol (ICMP)
    • B.Internet Group Management Protocol (IGMP)
    • C.Open Shortest Path First (OSPF)
    • D.Routing Information Protocol (RIP) Organising Institute: IIT Roorkee Page 17 of 48
    Show answer / उत्तर देखें

    Answer: D Routing Information Protocol (RIP) Organising Institute: IIT Roorkee Page 17 of 48

    Official GATE 2025 answer key: (D).
  3. Q28 · Computer Science & IT

    Consider the following C program: #include <stdio.h> void stringcopy(char *, char *); int main(){ char a[30] = "@#Hello World!"; stringcopy(a, a + 2); printf("%s\n", a); return 0; } void stringcopy(char *s, char *t) { while(*t) *s++ = *t++; } Which ONE of the following will be the output of the program?
    • A.@#Hello World!
    • B.Hello World!
    • C.ello World!
    • D.Hello World!d! Organising Institute: IIT Roorkee Page 18 of 48
    Show answer / उत्तर देखें

    Answer: D Hello World!d! Organising Institute: IIT Roorkee Page 18 of 48

    Official GATE 2025 answer key: (D).
  4. Q29 · Computer Science & IT

    Consider an unordered list of 𝑁 distinct integers. What is the minimum number of element comparisons required to find an integer in the list that is NOT the largest in the list?
    • A.1
    • B.𝑁 − 1
    • C.𝑁
    • D.2𝑁 − 1
    Show answer / उत्तर देखें

    Answer: A 1

    Official GATE 2025 answer key: (A).
  5. Q30 · Computer Science & IT

    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?
    • A.Only (I) is correct.
    • B.Only (II) is correct.
    • C.Both (I) and (II) are correct.
    • D.Neither (I) nor (II) is correct. Organising Institute: IIT Roorkee Page 19 of 48
    Show answer / उत्तर देखें

    Answer: C Both (I) and (II) are correct.

    Official GATE 2025 answer key: (C).
  6. Q31 · Computer Science & IT

    Given the following syntax directed translation rules: Rule 1: 𝑅 → 𝐴𝐵 {𝐵. 𝑖 = 𝑅. 𝑖 − 1; 𝐴. 𝑖 = 𝐵. 𝑖; 𝑅. 𝑖 = 𝐴. 𝑖 + 1; } Rule 2: 𝑃 → 𝐶𝐷 {𝑃. 𝑖 = 𝐶. 𝑖 + 𝐷. 𝑖; 𝐷. 𝑖 = 𝐶. 𝑖 + 2; } Rule 3: 𝑄 → 𝐸𝐹 {𝑄. 𝑖 = 𝐸. 𝑖 + 𝐹. 𝑖; } Which ONE is the CORRECT option among the following?
    • A.Rule 1 is S-attributed and L-attributed; Rule 2 is S-attributed and not L-attributed; Rule 3 is neither S-attributed nor L-attributed
    • B.Rule 1 is neither S-attributed nor L-attributed; Rule 2 is S-attributed and L- attributed; Rule 3 is S-attributed and L-attributed
    • C.Rule 1 is neither S-attributed nor L-attributed; Rule 2 is not S-attributed and is L-attributed; Rule 3 is S-attributed and L-attributed
    • D.Rule 1 is S-attributed and not L-attributed; Rule 2 is not S-attributed and is L-attributed; Rule 3 is S-attributed and L-attributed Organising Institute: IIT Roorkee Page 20 of 48
    Show answer / उत्तर देखें

    Answer: C Rule 1 is neither S-attributed nor L-attributed; Rule 2 is not S-attributed and is L-attributed; Rule 3 is S-attributed and L-attributed

    Official GATE 2025 answer key: (C).
  7. Q32 · Computer Science & IT

    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?
    • A.5 fragments, 1488 bytes
    • B.6 fragments, 88 bytes
    • C.6 fragments, 108 bytes
    • D.6 fragments, 116 bytes
    Show answer / उत्तर देखें

    Answer: D 6 fragments, 116 bytes

    Official GATE 2025 answer key: (D).
  8. Q33 · Computer Science & IT

    Which ONE of the following languages is accepted by a deterministic pushdown automaton?
    • A.Any regular language.
    • B.Any context-free language.
    • C.Any language accepted by a non-deterministic pushdown automaton.
    • D.Any decidable language. Organising Institute: IIT Roorkee Page 21 of 48
    Show answer / उत्तर देखें

    Answer: A Any regular language.

    Official GATE 2025 answer key: (A).
  9. Q34 · Computer Science & IT

    Let 𝐺1, 𝐺2 be Context Free Grammars (CFGs) and 𝑅 be a regular expression. For a grammar 𝐺, let 𝐿(𝐺) denote the language generated by 𝐺. Which ONE among the following questions is decidable?
    • A.Is 𝐿(𝐺1) = 𝐿(𝐺2)?
    • B.Is 𝐿(𝐺1) ∩ 𝐿(𝐺2) = ∅?
    • C.Is 𝐿(𝐺1) = 𝐿(𝑅)?
    • D.Is 𝐿(𝐺1) = ∅?
    Show answer / उत्तर देखें

    Answer: D Is 𝐿(𝐺1) = ∅?

    Official GATE 2025 answer key: (D).
  10. Q35 · Computer Science & IT

    Processes 𝑃1, 𝑃2, 𝑃3, 𝑃4 arrive in that order at times 0, 1, 2, and 8 milliseconds respectively, and have execution times of 10, 13, 6, and 9 milliseconds respectively. Shortest Remaining Time First (SRTF) algorithm is used as the CPU scheduling policy. Ignore context switching times. Which ONE of the following correctly gives the average turnaround time of the four processes in milliseconds?
    • A.22
    • B.15
    • C.37
    • D.19 Organising Institute: IIT Roorkee Page 22 of 48
    Show answer / उत्तर देखें

    Answer: D 19 Organising Institute: IIT Roorkee Page 22 of 48

    Official GATE 2025 answer key: (D).
  11. Q36 · Computer Science & IT

    Suppose we are transmitting frames between two nodes using Stop-and-Wait protocol. The frame size is 3000 bits. The transmission rate of the channel is 2000 bps (bits/second) and the propagation delay between the two nodes is 100 milliseconds. Assume that the processing times at the source and destination are negligible. Also, assume that the size of the acknowledgement packet is negligible. Which ONE of the following most accurately gives the channel utilization for the above scenario in percentage?
    • A.88.23
    • B.93.75
    • C.85.44
    • D.66.67 Organising Institute: IIT Roorkee Page 28 of 48
    Show answer / उत्तर देखें

    Answer: A 88.23

    Official GATE 2025 answer key: (A).
  12. Q37 · Computer Science & IT

    Let 𝐺 be an edge-weighted undirected graph with positive edge weights. Suppose a positive constant 𝛼 is added to the weight of every edge. Which ONE of the following statements is TRUE about the minimum spanning trees (MSTs) and shortest paths (SPs) in 𝐺 before and after the edge weight update?
    • A.Every MST remains an MST, and every SP remains an SP.
    • B.MSTs need not remain MSTs, and every SP remains an SP.
    • C.Every MST remains an MST, and SPs need not remain SPs.
    • D.MSTs need not remain MSTs, and SPs need not remain SPs. Organising Institute: IIT Roorkee Page 29 of 48
    Show answer / उत्तर देखें

    Answer: C Every MST remains an MST, and SPs need not remain SPs.

    Official GATE 2025 answer key: (C).
  13. Q38 · Computer Science & IT

    A meld operation on two instances of a data structure combines them into one single instance of the same data structure. Consider the following data structures: P: Unsorted doubly linked list with pointers to the head node and tail node of the list. Q: Min-heap implemented using an array. R: Binary Search Tree. Which ONE of the following options gives the worst-case time complexities for meld operation on instances of size 𝑛 of these data structures?
    • A.P: Θ(1), Q: Θ(𝑛), R: Θ(𝑛)
    • B.P: Θ(1), Q: Θ(𝑛 log 𝑛), R: Θ(𝑛)
    • C.P: Θ(𝑛), Q: Θ(𝑛 log 𝑛), R: Θ(𝑛2)
    • D.P: Θ(1), Q: Θ(𝑛), R: Θ(𝑛 log 𝑛) Organising Institute: IIT Roorkee Page 30 of 48
    Show answer / उत्तर देखें

    Answer: A P: Θ(1), Q: Θ(𝑛), R: Θ(𝑛)

    Official GATE 2025 answer key: (A).
  14. Q39 · Computer Science & IT

    For a direct-mapped cache, 4 bits are used for the tag field and 12 bits are used to index into a cache block. The size of each cache block is one byte. Assume that there is no other information stored for each cache block. Which ONE of the following is the CORRECT option for the sizes of the main memory and the cache memory in this system (byte addressable), respectively?
    • A.64 KB and 4 KB
    • B.128 KB and 16 KB
    • C.64 KB and 8 KB
    • D.128 KB and 6 KB
    Show answer / उत्तर देखें

    Answer: A 64 KB and 4 KB

    Official GATE 2025 answer key: (A).
  15. Q40 · Computer Science & IT

    Given a Context-Free Grammar 𝐺 as follows: 𝑆 → 𝐴𝑎 | 𝑏𝐴𝑐 | 𝑑𝑐 | 𝑏𝑑𝑎 𝐴 → 𝑑 Which ONE of the following statements is TRUE?
    • A.𝐺 is neither LALR(1) nor SLR(1)
    • B.𝐺 is CLR(1), not LALR(1)
    • C.𝐺 is LALR(1), not SLR(1)
    • D.𝐺 is LALR(1), also SLR(1) Organising Institute: IIT Roorkee Page 31 of 48
    Show answer / उत्तर देखें

    Answer: C 𝐺 is LALR(1), not SLR(1)

    Official GATE 2025 answer key: (C).
  16. Q41 · Computer Science & IT

    An array 𝐴 of length 𝑛 with distinct elements is said to be bitonic if there is an index 1 ≤ 𝑖 ≤ 𝑛 such that 𝐴[1. . 𝑖] is sorted in the non-decreasing order and 𝐴[𝑖 + 1 . . 𝑛] is sorted in the non-increasing order. Which ONE of the following represents the best possible asymptotic bound for the worst-case number of comparisons by an algorithm that searches for an element in a bitonic array 𝐴?
    • A.Θ(𝑛)
    • B.Θ(1)
    • C.Θ(log2 𝑛)
    • D.Θ(log 𝑛)
    Show answer / उत्तर देखें

    Answer: D Θ(log 𝑛)

    Official GATE 2025 answer key: (D).