The GATE 2025 CSE Question paper with Solution PDF is available to download here for Slot 1. GATE 2025 was conducted by IIT Roorkee. As per the exam pattern, students answered 65 questions in the GATE 2025 CSE Question Paper carrying a total weightage of 100 marks. 10 questions are from the General Aptitude section and 55 questions are from Engineering Mathematics and Core Discipline.
The difficulty level of GATE 2025 CSE Slot 1 was moderate to difficult, as per the initial feedback, the students experienced a good attempt of questions ranging from 50-55.
GATE 2025 CSE Question Paper with Solutions PDF (Slot 1)
GATE 2025 CSE Question Paper with Answer Key | ![]() |
Check Solutions |
General Aptitude
Question 1:
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.
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.
View Solution
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?
View Solution
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?
View Solution
According to the map shown in the figure, which one of the following statements is correct?
Note: The figure shown is representative.
View Solution
“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?
View Solution
In the diagram, the lines QR and ST are parallel to each other. The shortest distance between these two lines is half the shortest distance between the point P and the line QR. What is the ratio of the area of the triangle PST to the area of the trapezium SQRT?
Note: The figure shown is representative
View Solution
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?
View Solution
A square paper, shown in figure (I), is folded along the dotted lines as shown in figures (II) and (III). Then a few cuts are made as shown in figure (IV). Which one of the following patterns will be obtained when the paper is unfolded?
Note: The figures shown are representative.
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?
View Solution
Engineering Mathematics and Core Discipline
Question 11:
Suppose a program is running on a non-pipelined single processor computer system. The computer is connected to an external device that can interrupt the processor asynchronously. The processor needs to execute the interrupt service routine (ISR) to serve this interrupt. The following steps (not necessarily in order) are taken by the processor when the interrupt arrives:
(i) The processor saves the content of the program counter.
(ii) The program counter is loaded with the start address of the ISR.
(iii) The processor finishes the present instruction.
Which ONE of the following is the CORRECT sequence of steps?
View Solution
When an interrupt occurs in a non-pipelined processor, the processor follows a specific sequence of steps to handle the interrupt. The general process is as follows:
1. Step iii: The processor finishes the present instruction. This is necessary because the processor cannot leave the current instruction unfinished when the interrupt occurs. It must complete the instruction before handling the interrupt.
2. Step i: After completing the current instruction, the processor saves the content of the program counter (PC). This is crucial because the processor needs to remember the location in the program where it left off, so it can resume from that point once the interrupt has been handled.
3. Step ii: The program counter is then loaded with the start address of the interrupt service routine (ISR). This step ensures that the processor starts executing the ISR instead of continuing the normal program flow.
Thus, the correct order is:
1. Finish the present instruction (iii),
2. Save the content of the program counter (i),
3. Load the program counter with the ISR address (ii).
Therefore, the correct answer is (A) (iii), (i), (ii). Quick Tip: When dealing with interrupts, remember that the current instruction must be completed first. After that, the state (program counter) is saved, and the ISR address is loaded into the program counter.
Which ONE of the following statements is FALSE regarding the symbol table?
View Solution
Which ONE of the following techniques used in compiler code optimization uses live variable analysis?
View Solution
Consider a demand paging memory management system with 32-bit logical address, 20-bit physical address, and page size of 2048 bytes. Assuming that the memory is byte addressable, what is the maximum number of entries in the page table?
View Solution
A schedule of three database transactions \(T_1\), \(T_2\), and \(T_3\) is shown. \(R_i(A)\) and \(W_i(A)\) denote read and write of data item A by transaction \(T_i\), \(i = 1, 2, 3\). The transaction \(T_1\) aborts at the end. Which other transaction(s) will be required to be rolled back?
\texttt{R_1(X) W_1(Y) R_2(X) R_2(Y) R_3(Y) ABORT(T_1)
View Solution
Identify the ONE CORRECT matching between the OSI layers and their corresponding functionalities as shown.
View Solution
g(.) is a function from A to B, f(.) is a function from B to C, and their composition defined as f(g(.)) is a mapping from A to C. If f(.) and f(g(.)) are onto (surjective) functions, which ONE of the following is TRUE about the function g(.)?
View Solution
Let G be any undirected graph with positive edge weights, and T be a minimum spanning tree of G. For any two vertices, u and v, let \( d_1(u, v) \) and \( d_2(u, v) \) be the shortest distances between u and v in G and T, respectively. Which ONE of the following options is CORRECT for all possible G, T, u, and v?
View Solution
Consider the following context-free grammar \(G\), where \(S\), \(A\), and \(B\) are the variables (non-terminals), \(a\) and \(b\) are the terminal symbols, \(S\) is the start variable, and the rules of \(G\) are described as:
\[ S \to aaB \mid Abb \] \[ A \to a \mid AaA \] \[ B \to b \mid bB \]
Which ONE of the languages \(L(G)\) is accepted by \(G\)?
View Solution
Consider the following recurrence relation: \[ T(n) = 2T(n - 1) + n2^n for n > 0, \, T(0) = 1. \]
Which ONE of the following options is CORRECT?
View Solution
Consider the following \(B^+\) tree with 5 nodes, in which a node can store at most 3 key values. The value 23 is now inserted in the \(B^+\) tree. Which of the following options(s) is/are CORRECT?
View Solution
Consider the 3-way handshaking protocol for TCP connection establishment. Let the three packets exchanged during the connection establishment be denoted as P1, P2, and P3, in order. Which of the following option(s) is/are TRUE with respect to TCP header flags that are set in the packets?
View Solution
Consider the given system of linear equations for variables \(x\) and \(y\), where \(k\) is a real-valued constant. Which of the following option(s) is/are CORRECT? \[ x + ky = 1 \] \[ kx + y = -1 \]
View Solution
Let \(X\) be a 3-variable Boolean function that produces output as ‘1’ when at least two of the input variables are ‘1’. Which of the following statement(s) is/are CORRECT, where \(a, b, c, d, e\) are Boolean variables?
View Solution
The number \(-6\) can be represented as \(1010\) in 4-bit 2’s complement representation. Which of the following is/are CORRECT 2’s complement representation(s) of \(-6\)?
View Solution
Which of the following statement(s) is/are TRUE for any binary search tree (BST) having \(n\) distinct integers?
View Solution
A partial data path of a processor is given in the figure, where RA, RB, and RZ are 32-bit registers. Which option(s) is/are CORRECT related to arithmetic operations using the data path as shown?
View Solution
A regular language \(L\) is accepted by a non-deterministic finite automaton (NFA) with \(n\) states. Which of the following statement(s) is/are FALSE?
View Solution
Suppose in a multiprogramming environment, the following C program segment is executed. A process goes into the I/O queue whenever an I/O related operation is performed. Assume that there will always be a context switch whenever a process requests an I/O, and also whenever the process returns from an I/O. The number of times the process will enter the ready queue during its lifetime (not counting the time the process enters the ready queue when it is run initially) is ________ (Answer in integer).
View Solution
Let’s break down the operations and their implications on the ready and I/O queues:
Step 1: Initial Entry into the Ready Queue:
When the process is first run, it enters the ready queue. This is counted as the first entry into the ready queue.
Step 2: Entering the I/O Queue:
The `scanf("%d", \&x)` function is called in the program, which is an I/O operation. When the process executes `scanf()`, it enters the I/O queue because it's waiting for user input. This causes a context switch.
Step 3: Returning from I/O:
After the user provides input and the process continues, it exits the I/O queue and enters the ready queue. This is a context switch from the I/O queue back to the ready queue. Therefore, the process enters the ready queue again after the I/O operation.
Step 4: Repeating for Each Iteration:
The `for` loop runs 20 times. Inside each iteration, the program performs the `printf("%d\n", x)` operation, which is another I/O operation. Each time `printf()` is executed, the process goes to the I/O queue and returns to the ready queue once the I/O operation is completed.
Calculation of Ready Queue Entries:
For the initial entry into the ready queue, the process enters once when it is first run.
During each iteration of the loop, there are two key events:
1. The process enters the I/O queue when it calls `printf()`.
2. The process returns from the I/O queue to the ready queue after `printf()` completes.
Since the loop runs 20 times, each iteration results in one entry into the I/O queue and one return to the ready queue.
Thus, in total:
The process enters the ready queue once initially.
It enters the ready queue 20 times after each I/O operation during the loop.
Therefore, the process will enter the ready queue a total of: \[ 1 \, (initial) + 20 \, (one for each iteration) = 21 \, times. \]
Thus, the correct answer is 21. Quick Tip: Each I/O operation (like `scanf()` and `printf()`) causes a context switch, where the process moves between the I/O queue and the ready queue. Count the number of iterations and operations to determine the number of context switches.
Let \( S \) be the set of all ternary strings defined over the alphabet \( \{a, b, c\} \). Consider all strings in \( S \) that contain at least one occurrence of two consecutive symbols, that is, "aa", "bb", or "cc". The number of such strings of length 5 that are possible is ______.
View Solution
Consider the given function \( f(x) \).
\[ f(x) = \begin{cases} ax + b & for x < 1
x^3 + x^2 + 1 & for x \geq 1 \end{cases} \]
If the function is differentiable everywhere, the value of \( b \) must be ________ (rounded off to one decimal place).
View Solution
A box contains 5 coins: 4 regular coins and 1 fake coin. When a regular coin is tossed, the probability \( P(head) = 0.5 \), and for a fake coin, \( P(head) = 1 \). You pick a coin at random and toss it twice, and get two heads. The probability that the coin you have chosen is the fake coin is _____.
View Solution
The pseudocode of a function \( fun() \) is given below:
\[ fun(int A[0, \ldots, n-1]) \{ \]
\[ for i = 0 to n-2
for j = 0 to n - i - 2
if (A[j] > A[j+1]) then swap A[j] and A[j+1]
\} \]
Let \( A[0, \ldots, 29] \) be an array storing 30 distinct integers in descending order. The number of swap operations that will be performed, if the function \( fun() \) is called with \( A[0, \ldots, 29] \) as argument, is ________ (Answer in integer).
View Solution
The given C program is as follows:
#include
The output of the given C program is _________. (Answer in integer)
View Solution
Let’s analyze the program step by step:
1. Function `foo`: The function `foo` takes two arguments: a pointer `p` and an integer `x`. Inside the function, the value of `x` is assigned to the variable that `p` is pointing to. In this case, `p` points to `a`, so `a` will be updated to the value of `x`, which is 25.
2. In the `main` function:
`a` is initialized to 20, and `b` is initialized to 25.
`z` is a pointer, and it is assigned the address of `a`, so `z` now points to `a`.
`foo(z, b)` is called, which passes `z` (the address of `a`) and `b` (which is 25) to the function.
- Inside `foo`, `z = b` sets the value of `a` to 25 because `z` points to `a`.
3. Output: After the call to `foo`, `a` is updated to 25, and the `printf` statement prints the value of `a`, which is now 25.
Thus, the output of the program is 25. Quick Tip: In C, when you pass a pointer to a function, any modification to the value pointed to by the pointer will affect the original variable. Ensure you understand how pointers work when analyzing such programs.
The height of any rooted tree is defined as the maximum number of edges in the path from the root node to any leaf node. Suppose a Min-Heap \( T \) stores 32 keys. The height of \( T \) is _____________ (Answer in integer).
View Solution
Consider a memory system with 1M bytes of main memory and 16K bytes of cache memory. Assume that the processor generates a 20-bit memory address, and the cache block size is 16 bytes. If the cache uses direct mapping, how many bits will be required to store all the tag values? [Assume memory is byte addressable, 1K = \(2^{10}\), 1M = \(2^{20}\).]
View Solution
A processor has 64 general-purpose registers and 50 distinct instruction types. An instruction is encoded in 32-bits. What is the maximum number of bits that can be used to store the immediate operand for the given instruction?
View Solution
A computer has two processors, \( M_1 \) and \( M_2 \). Four processes \( P_1, P_2, P_3, P_4 \) with CPU bursts of 20, 16, 25, and 10 milliseconds, respectively, arrive at the same time and these are the only processes in the system. The scheduler uses non-preemptive priority scheduling, with priorities decided as follows:
\( M_1 \) uses priority of execution for the processes as \( P_1 > P_3 > P_2 > P_4 \), i.e., \( P_1 \) has the highest priority and \( P_4 \) has the lowest.
\( M_2 \) uses priority of execution for the processes as \( P_2 > P_3 > P_4 > P_1 \), i.e., \( P_2 \) has the highest priority and \( P_1 \) has the lowest.
A process \( P_i \) is scheduled to a processor \( M_k \), if the processor is free and no other process \( P_j \) is waiting with higher priority. At any given point of time, a process can be allocated to any of the free processors without violating the execution priority rules. Ignore the context switch time. What will be the average waiting time of the processes in milliseconds?
View Solution
Consider two relations describing teams and players in a sports league:
teams(tid, tname): \texttt{tid, \texttt{tname are team-id and team-name, respectively.
players(pid, pname, tid): \texttt{pid, \texttt{pname, and tid denote player-id, player-name, and the team-id of the player, respectively.
Which ONE of the following tuple relational calculus queries returns the name of the players who play for the team having tname as 'MI'?
View Solution
A packet with the destination IP address 145.36.109.70 arrives at a router whose routing table is shown. Which interface will the packet be forwarded to?
View Solution
Let \( A \) be a \( 2 \times 2 \) matrix as given:
What are the eigenvalues of the matrix \( A^{13} \)?
View Solution
Consider the following four variable Boolean function in sum-of-product form \[ F(b_3, b_2, b_1, b_0) = \sum(0, 2, 4, 8, 10, 11, 12), \]
where the value of the function is computed by considering \( b_3 b_2 b_1 b_0 \) as a 4-bit binary number, where \( b_3 \) denotes the most significant bit and \( b_0 \) denotes the least significant bit. Note that there are no don’t care terms. Which ONE of the following options is the CORRECT minimized Boolean expression for \( F \)?
View Solution
Let \( G(V, E) \) be an undirected and unweighted graph with 100 vertices. Let \( d(u, v) \) denote the number of edges in a shortest path between vertices \( u \) and \( v \) in \( V \). Let the maximum value of \( d(u, v) \), \( u, v \in V \) such that \( u \neq v \), be 30. Let \( T \) be any breadth-first-search tree of \( G \). Which ONE of the given options is CORRECT for every such graph \( G \)?
View Solution
Consider the following two languages over the alphabet \( \{a, b\} \): \[ L_1 = \{ \alpha \beta \alpha \mid \alpha \in \{a, b\}^+ and \beta \in \{a, b\}^+ \} \] \[ L_2 = \{ \alpha \beta \alpha \mid \alpha \in \{a\}^+ and \beta \in \{a, b\}^+ \} \]
Which ONE of the following statements is CORRECT?
View Solution
Consider the following two languages over the alphabet \( \{a, b, c\} \), where \( m \) and \( n \) are natural numbers.
\[ L_1 = \{ a^m b^{m+n} c^{m+n} \mid m, n \geq 1 \} \] \[ L_2 = \{ a^m b^n c^{m+n} \mid m, n \geq 1 \} \]
Which ONE of the following statements is CORRECT?
View Solution
Which of the following statement(s) is/are TRUE while computing First and Follow during top-down parsing by a compiler?
View Solution
Consider a relational schema team(name, city, owner), with functional dependencies \( \{ name \rightarrow city, name \rightarrow owner \} \).
The relation team is decomposed into two relations, \( t_1(name, city) \) and \( t_2(name, owner) \). Which of the following statement(s) is/are TRUE?
View Solution
Which of the following predicate logic formulae/formula is/are CORRECT representation(s) of the statement: "Everyone has exactly one mother"?
The meanings of the predicates used are:
\( mother(y, x) \): \( y \) is the mother of \( x \)
\( noteq(x, y) \): \( x \) and \( y \) are not equal
View Solution
Let \( A = \{0, 1, 2, 3, \dots\} \) be the set of non-negative integers. Let \( F \) be the set of functions from \( A \) to itself. For any two functions, \( f_1, f_2 \in F \), we define \[ (f_1 \circ f_2)(n) = f_1(n) + f_2(n) \]
for every number \( n \in A \). Which of the following is/are CORRECT about the mathematical structure \( (F, \circ) \)?
View Solution
Consider the following deterministic finite automaton (DFA) defined over the alphabet, \( \Sigma = \{a, b\} \). Identify which of the following language(s) is/are accepted by the given DFA.
View Solution
A disk of size 512M bytes is divided into blocks of 64K bytes. A file is stored in the disk using linked allocation. In linked allocation, each data block reserves 4 bytes to store the pointer to the next data block. The link part of the last data block contains a NULL pointer (also of 4 bytes). Suppose a file of 1M bytes needs to be stored in the disk. Assume, 1K = \(2^{10}\) and 1M = \(2^{20}\). The amount of space in bytes that will be wasted due to internal fragmentation is ______. (Answer in integer)
View Solution
Refer to the given 3-address code sequence. This code sequence is split into basic blocks. The number of basic blocks is _________. (Answer in integer)
View Solution
We need to identify the basic blocks in the given code. A basic block is a sequence of consecutive instructions where the control flow enters at the beginning and exits at the end without any intermediate branches or jumps, except possibly at the end.
Step 1: Identifying Basic Blocks
The given code contains the following branches and jumps, which help in determining the basic blocks:
1. Block 1: Instructions 1001 to 1002 (initializations of \( i \) and \( j \)).
2. Block 2: Instructions 1003 to 1007 (computation of \( t1 \), \( t2 \), \( t3 \), \( t4 \), and assignment to \( a[t4] \)).
3. Block 3: Instructions 1008 to 1009 (update \( j \) and the conditional jump "if \( j \leq 10 \) goto 1003").
4. Block 4: Instructions 1010 to 1011 (update \( i \) and the conditional jump "if \( i \leq 10 \) goto 1002").
5. Block 5: Instructions 1012 to 1017 (resetting \( i \), computing \( t5 \), \( t6 \), assigning to \( a[t6] \), and the conditional jump "if \( i \leq 10 \) goto 1013").
6. Block 6: Instructions 1013 to 1017 (additional operations and a conditional jump based on \( i \)).
Step 2: Counting the Basic Blocks
After analyzing the control flow, we find that the code is divided into 6 basic blocks.
Thus, the number of basic blocks is 6. Quick Tip: To count basic blocks, look for the jumps or conditional statements ("if" or "goto") that affect the flow. Each section of the code between these jumps forms a basic block.
A computer has a memory hierarchy consisting of two-level cache (L1 and L2) and a main memory. If the processor needs to access data from memory, it first looks into L1 cache. If the data is not found in L1 cache, it goes to L2 cache. If it fails to get the data from L2 cache, it goes to main memory, where the data is definitely available. Hit rates and access times of various memory units are shown in the figure. The average memory access time in nanoseconds (ns) is ________. (rounded off to two decimal places)
View Solution
In optimal page replacement algorithm, information about all future page references is available to the operating system (OS). A modification of the optimal page replacement algorithm is as follows:
The OS correctly predicts only up to next 4 page references (including the current page) at the time of allocating a frame to a page.
A process accesses the pages in the following order of page numbers:
1, 3, 2, 4, 2, 3, 1, 2, 4, 3, 1, 4.
If the system has three memory frames that are initially empty, the number of page faults that will occur during execution of the process is ________. (Answer in integer)
View Solution
Consider the following database tables of a sports league.
player (\( pid \), \( pname \), \( age \))
coach (\( cid \), \( cname \))
team (\( tid \), \( tname \), \( city \), \( cid \))
members (\( pid \), \( tid \))
An instance of the table and an SQL query are given.
Player table
coach table:
team table:
members table:
SQL query: \[ SELECT MIN(P.age) \] \[ FROM player P \] \[ WHERE P.pid IN ( \] \[ SELECT M.pid \] \[ FROM team T, coach C, members M \] \[ WHERE C.cname = 'Mark' \] \[ AND T.cid = C.cid \] \[ AND M.tid = T.tid) \]
The value returned by the given SQL query is ________. (Answer in integer)
View Solution
Suppose a 5-bit message is transmitted from a source to a destination through a noisy channel. The probability that a bit of the message gets flipped during transmission is 0.01. Flipping of each bit is independent of one another. The probability that the message is delivered error-free to the destination is ______. (rounded off to three decimal places)
View Solution
Suppose a message of size 15000 bytes is transmitted from a source to a destination using IPv4 protocol via two routers as shown in the figure. Each router has a defined maximum transmission unit (MTU) as shown in the figure, including IP header. The number of fragments that will be delivered to the destination is ______. (Answer in integer)
View Solution
Consider a probability distribution given by the density function \( P(x) \). \[ P(x) = \begin{cases} Cx^2, & for 1 \leq x \leq 4,
0, & for x < 1 or x > 4. \end{cases} \]
The probability that \( x \) lies between 2 and 3, i.e., \( P(2 \leq x \leq 3) \), is ______. (rounded off to three decimal places)
View Solution
Consider a finite state machine (FSM) with one input \(X\) and one output \(f\), represented by the given state transition table. The minimum number of states required to realize this FSM is ________ (Answer in integer).
View Solution
Consider the given sequential circuit designed using D-Flip-flops. The circuit is initialized with some value (initial state). The number of distinct states the circuit will go through before returning back to the initial state is:
View Solution
The value printed by the given C program is ________ (Answer in integer).
View Solution
Let LIST be a datatype for an implementation of a linked list defined as follows:
\begin{verbatim
typedef struct list {
int data;
struct list next;
LIST;
\end{verbatim
Suppose a program has created two linked lists, L1 and L2, whose contents are given in the figure below (code for creating L1 and L2 is not provided here). L1 contains 9 nodes, and L2 contains 7 nodes.
Consider the following C program segment that modifies the list L1. The number of nodes that will be there in L1 after the execution of the code segment is:
View Solution
Consider the following C program
The value printed by the given C program is ________ (Answer in integer).
View Solution
The maximum value of \(x\) such that the edge between the nodes B and C is included in every minimum spanning tree of the given graph is
________ (answer in integer).
View Solution
In a double hashing scheme, \( h_1(k) = k \mod 11 \) and \( h_2(k) = 1 + (k \mod 7) \) are the auxiliary hash functions. The size \( m \) of the hash table is 11. The hash function for the \( i \)-th probe in the open address table is \( [h_1(k) + i \cdot h_2(k)] \mod m \). The following keys are inserted in the given order: 63, 50, 25, 79, 67, 24.
The slot at which key 24 gets stored is:
View Solution
Comments