GATE CSE & IT
2,749 questions · 40 years · 20 subjects
Public preview: use this branch page to find high-signal topics and keyed questions. Explanations are being added selectively, starting with recent and recurring concepts.
Worked PYQ examples
Open a few full study-layer explanations before signing in.
A short MSQ where the real trap is subspace closure, not calculation.
Shows how to convert graph wording into a reliable solve path.
Separates a common false intuition from the actual invariant.
Good example of wrong-option autopsy for algorithm statements.
Tests whether the standard theorem is being applied precisely.
Subjects
By Year
High-yield topics
All trends →Practice CSE & IT PYQs
80 questions shown in Computer Science. Filter for cleaner practice sessions.
If $Pe^x = Qe^{-x}$ for all real values of $x$, which one of the following statements is true?
Let $p_1$ and $p_2$ denote two arbitrary prime numbers. Which one of the following statements is correct for all values of $p_1$ and $p_2$?
Which one of the following options is correct for the given data in the table?
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?
The diagram below shows a river system consisting of 7 segments, marked P, Q, R, S, T, U, and V. It splits the land into 5 zones, marked Z1, Z2, Z3, Z4, and Z5. We need to connect...
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 pur...
If A = $\begin{pmatrix} 1 & 2 \ -2 & -1 \end{pmatrix}$, then which ONE of the following is A⁸ ?
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. T...
The value of x such that x > 1, satisfying the equation $\int_{1}^{x} t \ln t \, dt = \frac{1}{4}$ is
Which ONE of the following statements is FALSE regarding the symbol table?
Consider a binary tree T in which every node has either zero or two children. Let n > 0 be the number of nodes in T. Which ONE of the following is the number of nodes in T that hav...
Which ONE of the following techniques used in compiler code optimization uses live variable analysis?
Let L, M, and N be non-singular matrices of order 3 satisfying the equations L^2 = L^-1, M = L^8 and N = L^2. Which ONE of the following is the value of the determinant of (M - N)?
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, w...
Let P(x) be an arbitrary predicate over the domain of natural numbers. Which ONE of the following statements is TRUE?
A schedule of three database transactions T1, T2, and T3 is shown. Ri(A) and Wi(A) denote read and write of data item A by transaction Ti, i = 1,2,3. The transaction T1 aborts at t...
Identify the ONE CORRECT matching between the OSI layers and their corresponding functionalities as shown. OSI Layers (a) Network layer (b) Transport layer (c) Datalink layer Funct...
Consider the following statements: (i) Address Resolution Protocol (ARP) provides a mapping from an IP address to the corresponding hardware (link-layer) address. (ii) A single TCP...
Consider the routing protocols given in List I and the names given in List II: List I (i) Distance vector routing (ii) Link state routing List II (a) Bellman-Ford (b) Dijkstra For...
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) functio...
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₁(u, v) and d₂(u, v) be the shortest distances...
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?
Consider the following C program: #include void stringcopy (char *, char *); int main() { char a [30] = "@#Hello World!"; stringcopy (a, a + 2); printf("%s\n", a); return 0; } void...
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 ar...
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?
Consider an unordered list of N 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?
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 C...
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...
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...
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; } Rule 2: P → CD {P.i = C.i + D.i; D.i = C.i + 2; } Rule 3: Q → EF {...
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 UD...
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
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,...
Which ONE of the following languages is accepted by a deterministic pushdown automaton?
Let G1, G2 be Context Free Grammars (CFGs) and R be a regular expression. For a grammar G, let L(G) denote the language generated by G. Which ONE among the following questions is d...
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?
Which of the following statement(s) is/are TRUE for any binary search tree (BST) having n distinct integers?
Processes P1, P2, P3, P4 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 Re...
An audit of a banking transactions system has found that on an earlier occasion, two joint holders of account A attempted simultaneous transfers of Rs. 10000 each from account A to...
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...
Which of the following is/are part of an Instruction Set Architecture of a processor?
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?
Which of the following statements regarding Breadth First Search (BFS) and Depth First Search (DFS) on an undirected simple graph G is/are TRUE?
Suppose in a multiprogramming environment, the following C program segment is executed. A process goes into I/O queue whenever an I/O related operation is performed. Assume that th...
Consider the two lists List I and List II given below: List I (i) Context free languages (ii) Recursive languages (iii) Regular languages List II (a) Closed under union (b) Not clo...
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...
Consider the following logic circuit diagram. Which is/are the CORRECT option(s) for the output function F?
The following two signed 2's complement numbers (multiplicand M and multiplier Q) are being multiplied using Booth's algorithm: M: 1100 1101 1110 1101 and Q: 1010 0100 1010 1010 Th...
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 an...
int x=126,y=105; do { if (x>y) x=x-y; else y=y-x; } while(x!=y); printf("%d",x); The output of the given C code segment is __________. (Answer in integer)
The pseudocode of a function fun () is given below: fun(int A[0,...,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, ...,29] be an array...
#include void foo(int *p, int x) { *p=x; } int main() { int *z; int a = 20, b = 25; z = &a; foo(z,b); printf("%d",a); return 0; } The output of the given C program is __________. (...
In a 4-bit ripple counter, if the period of the waveform at the last flip-flop is 64 microseconds, then the frequency of the ripple counter in kHz is __________. (Answer in integer...
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 ___...
Suppose the values 10, -4, 15, 30, 20, 5, 60, 19 are inserted in that order into an initially empty binary search tree. Let T be the resulting binary search tree. The number of edg...
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 t...
Consider a memory system with 1M bytes of main memory and 16K bytes of cache memory. Assume that the processor generates 20-bit memory address, and the cache block size is 16 bytes...
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 t...
Let G be an edge-weighted undirected graph with positive edge weights. Suppose a positive constant $\alpha$ is added to the weight of every edge. Which ONE of the following stateme...
A computer has two processors, M₁ and M₂. Four processes P₁, P₂, P₃, P₄ with CPU bursts of 20, 16, 25, and 10 milliseconds, respectively, arrive at the same time and these are the...
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...
Consider two relations describing teams and players in a sports league: * teams (tid, tname): tid, tname are team-id and team-name, respectively * players(pid, pname, tid): pid, pn...
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 oth...
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? Subnet Address Subnet Mask...
Given a Context-Free Grammar G as follows: S→Aa | bAc | dc | bda A→d Which ONE of the following statements is TRUE?
Let A be a 2 x 2 matrix as given. $A = \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}$ What are the eigenvalues of the matrix $A^{13}$ ?
An array A of length n with distinct elements is said to be bitonic if there is an index 1 ≤ i ≤ n such that A[1..i] is sorted in the non-decreasing order and A[i + 1..n] is sorted...
Consider the following four variable Boolean function in sum-of-product form $F(b_3, b_2, b_1, b_0) = \Sigma(0, 2, 4, 8, 10, 11, 12)$. where the value of the function is computed b...
Let F be the set of all functions from {1,..., n} to {0,1}. Define the binary relation ≤ on F as follows: ∀f,g∈F, f≤ g if and only if ∀x ∈ {1, ..., n}, f(x) ≤ g(x), where 0 ≤ 1. Wh...
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...
Given the following Karnaugh Map for a Boolean function F(w,x, y, z): Which one or more of the following Boolean expression(s) represent(s) F?
Consider the following two languages over the alphabet {a, b}: L₁ = { αβα |α ∈ {a,b}+ AND β∈ {a,b}+ } L₂ = {αβα|α ∈ {a}+ AND β∈ {a,b}+ } Which ONE of the following statements is CO...
Consider a system of linear equations $PX = Q$ where $P \in \mathbb{R}^{3 \times 3}$ and $Q \in \mathbb{R}^{3 \times 1}$. Suppose $P$ has an LU decomposition, $P = LU$, where $L =...
Consider a stack data structure into which we can PUSH and POP records. Assume that each record pushed in the stack has a positive integer key and that all keys are distinct. We wi...
Consider the following two languages over the alphabet {a, b, c}, where m and n are natural numbers. L₁ = {a^m b^m c^(m+n) | m, n ≥ 1} L₂ = {a^m b^n c^(m+n) | m, n ≥ 1} Which ONE o...
Which of the following statement(s) is/are TRUE while computing First and Follow during top down parsing by a compiler?
Consider the following relational schema along with all the functional dependencies that hold on them. R1(A, B, C, D, E): { D → E, EA → B, EB → C} R2(A, B, C, D): { A → D, A → B, C...
Consider a relational schema team (name, city, owner), with functional dependencies {name → city, name → owner}. The relation team is decomposed into two relations, t1(name, city)...
Consider a demand paging system with three frames, and the following page reference string: 123454164513 2. The contents of the frames are as follows initially and after each refer...
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 ar...