GATE CSE 2025 — Previous Year Questions

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

WhatsApp

55 questions · page 2 of 3

  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).
  17. Q42 · General Aptitude

    Ravi had ______ younger brother who taught at ______ university. He was widely regarded as ______ honorable man. Select the option with the correct sequence of articles to fill in the blanks.
    • A.a; a; an
    • B.the; an; a
    • C.a; an; a
    • D.an; an; a Organising Institute: IIT Roorkee Page 2 of 64
    Show answer / उत्तर देखें

    Answer: A a; a; an

    Official GATE 2025 answer key: (A).
  18. Q43 · General Aptitude

    The CEO’s decision to downsize the workforce was considered myopic because it sacrificed long-term stability to accommodate short-term gains. Select the most appropriate option that can replace the word “myopic” without changing the meaning of the sentence.
    • A.visionary
    • B.shortsighted
    • C.progressive
    • D.innovative Organising Institute: IIT Roorkee Page 3 of 64
    Show answer / उत्तर देखें

    Answer: B shortsighted

    Official GATE 2025 answer key: (B).
  19. Q44 · General Aptitude

    The average marks obtained by a class in an examination were calculated as 30.8. However, while checking the marks entered, the teacher found that the marks of one student were entered incorrectly as 24 instead of 42. After correcting the marks, the average becomes 31.4. How many students does the class have?
    • A.25
    • B.28
    • C.30
    • D.32 Organising Institute: IIT Roorkee Page 4 of 64
    Show answer / उत्तर देखें

    Answer: C 30

    Official GATE 2025 answer key: (C).
  20. Q45 · General Aptitude

    Consider the relationships among P, Q, R, S, and T: • P is the brother of Q. • S is the daughter of Q. • T is the sister of S. • R is the mother of Q. The following statements are made based on the relationships given above. (1) R is the grandmother of S. (2) P is the uncle of S and T. (3) R has only one son. (4) Q has only one daughter. Which one of the following options is correct?
    • A.Both (1) and (2) are true.
    • B.Both (1) and (3) are true.
    • C.Only (3) is true.
    • D.Only (4) is true. Organising Institute: IIT Roorkee Page 5 of 64
    Show answer / उत्तर देखें

    Answer: A Both (1) and (2) are true.

    Official GATE 2025 answer key: (A).
  21. Q46 · General Aptitude

    “I put the brown paper in my pocket along with the chalks, and possibly other things. I suppose every one must have reflected how primeval and how poetical are the things that one carries in one’s pocket: the pocket-knife, for instance the type of all human tools, the infant of the sword. Once I planned to write a book of poems entirely about the things in my pocket. But I found it would be too long: and the age of the great epics is past.” (From G.K. Chesterton’s “A Piece of Chalk”) Based only on the information provided in the above passage, which one of the following statements is true?
    • A.The author of the passage carries a mirror in his pocket to reflect upon things.
    • B.The author of the passage had decided to write a poem on epics.
    • C.The pocket-knife is described as the infant of the sword.
    • D.Epics are described as too inconvenient to write. Organising Institute: IIT Roorkee Page 7 of 64
    Show answer / उत्तर देखें

    Answer: C The pocket-knife is described as the infant of the sword.

    Official GATE 2025 answer key: (C).
  22. Q47 · General Aptitude

    A fair six-faced dice, with the faces labelled ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, and ‘6’, is rolled thrice. What is the probability of rolling ‘6’ exactly once?
    • A.75 216
    • B.1 6
    • C.1 18
    • D.25 216 Organising Institute: IIT Roorkee Page 9 of 64
    Show answer / उत्तर देखें

    Answer: A 75 216

    Official GATE 2025 answer key: (A).
  23. Q48 · General Aptitude

    A shop has 4 distinct flavors of ice-cream. One can purchase any number of scoops of any flavor. The order in which the scoops are purchased is inconsequential. If one wants to purchase 3 scoops of ice-cream, in how many ways can one make that purchase?
    • A.4
    • B.20
    • C.24
    • D.48
    Show answer / उत्तर देखें

    Answer: B 20

    Official GATE 2025 answer key: (B).
  24. Q49 · General Aptitude

    Despite his initial hesitation, Rehman’s _________ to contribute to the success of the project never wavered. Select the most appropriate option to complete the above sentence.
    • A.ambivalence
    • B.satisfaction
    • C.resolve
    • D.revolve Organising Institute: IIT Roorkee Page 2 of 48
    Show answer / उत्तर देखें

    Answer: C resolve

    Official GATE 2025 answer key: (C).
  25. Q50 · General Aptitude

    Bird : Nest :: Bee : _______ Select the correct option to complete the analogy.
    • A.Kennel
    • B.Hammock
    • C.Hive
    • D.Lair Organising Institute: IIT Roorkee Page 3 of 48
    Show answer / उत्तर देखें

    Answer: C Hive

    Official GATE 2025 answer key: (C).