πŸ“š

GATE CS - Previous Year Questions

Actual GATE CS exam questions from previous years (2020-2025)

142 questionsÒ€’15 pagesÒ€’~213 min

Use this quiz track to strengthen recall, speed, and exam-style decision making. Attempt one page first, review explanations, and then re-attempt incorrect questions without notes.

A good scoring strategy is to mark uncertain questions, finish known ones quickly, and return with elimination logic. This improves accuracy while keeping momentum under time constraints.

Progress: 0 / 1420%
Page 5 of 15 β€’ Questions 41-50 of 142
Q41medium

[GATE CS 2025 Set-2 Q18] 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?

Q42medium

[GATE CS 2025 Set-2 Q19] 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?

Q43medium

[GATE CS 2025 Set-2 Q20] 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?

Q44medium

[GATE CS 2025 Set-2 Q21] 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?

Q45medium

[GATE CS 2025 Set-2 Q22] 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?

Q46medium

[GATE CS 2025 Set-2 Q23] 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?

Q47medium

[GATE CS 2025 Set-2 Q24] Which ONE of the following languages is accepted by a deterministic pushdown automaton?

Q48medium

[GATE CS 2025 Set-2 Q25] Let 𝐺 ,𝐺 be Context Free Grammars (CFGs) and 𝑅 be a regular expression. For a 1 2 grammar 𝐺, let 𝐿(𝐺) denote the language generated by 𝐺. Which ONE among the following questions is decidable?

Q49medium

[GATE CS 2025 Set-2 Q26] 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?

Q50medium

[GATE CS 2025 Set-2 Q27] An audit of a banking transactions system has found that on an earlier occasion, two joint holders of account 𝐴 attempted simultaneous transfers of Rs. 10000 each from account 𝐴 to account 𝐡. Both transactions read the same value, Rs. 11000, as the initial balance in 𝐴 and were allowed to go through. 𝐡 was credited Rs. 10000 twice. 𝐴 was debited only once and ended up with a balance of Rs. 1000. Which of the following properties is/are certain to have been violated by the system?

......

Quiz Pages

Navigate directly to paginated quiz sets. These links help you revise by page and make every page discoverable.