Skip to content

GATE CS question library

Practise GATE CS Computer Science previous year questions free. Browse by subject, syllabus topic, year and question type, with answers and available solutions.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

20 on this page
Official PYQ2025DatabasesFile Organization and Indexing (B and B+ Trees)MSQ · 1 mark
Consider the following B+B^{+}tree with 55 nodes, in which a node can store at most 33 key values The value 2323 is now inserted in the B+B^{+}tree. Which of the following options(s) is/are CORRECT?
Official PYQ2025Computer NetworksTransport Layer: Flow Control, Congestion Control, UDP, TCP, SocketsMSQ · 1 mark
Consider the 33-way handshaking protocol for TCP connection establishment. Let the three packets exchanged during the connection establishment be denoted as P1, P2\text{P1, P2}, and P3\text{P3}, in order. Which of the following option(s) is/are TRUE with respect to TCP header flags that are set in the packets?
Official PYQ2025Engineering MathematicsLinear Algebra: Matrices, Determinants, System of Linear EquationsMSQ · 1 mark
Consider the given system of linear equations for variables xx and yy, where kk is a real-valued constant. Which of the following option(s) is/are CORRECT? x+ky=1kx+y=−1\begin{array}{l} x+k y=1 \\ k x+y=-1 \end{array}
Official PYQ2025Digital LogicBoolean AlgebraMSQ · 1 mark
Let XX be a 33-variable Boolean function that produces output as ′1′'1' when at least two of the input variables are ′1′'1'. Which of the following statement(s) is/are CORRECT, where a,b,c,d,ea, b, c, d, e are Boolean variables?
Official PYQ2025Digital LogicNumber Representations (Fixed and Floating Point)MSQ · 1 mark
The number −6-6 can be represented as 10101010 in 44-bit 22's complement representation. Which of the following is/are CORRECT 22 's complement representation(s) of −6-6?
Official PYQ2025Programming and Data StructuresBinary Search TreesMSQ · 1 mark
Which of the following statement(s) is/are TRUE for any binary search tree (BST) having nn distinct integers?
Official PYQ2025Computer Organization and ArchitectureALU, Data-path and Control UnitMSQ · 1 mark
A partial data path of a processor is given in the figure, where RA, RB,\text{RA, RB,} and RZ\text{RZ} are 3232-bit registers. Which option(s) is/are CORRECT related to arithmetic operations using the data path as shown?
Official PYQ2025Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
A regular language LL is accepted by a non-deterministic finite automaton (NFA) with nn states. Which of the following statement(s) is/are FALSE?
Official PYQ2025Engineering MathematicsCombinatorics: Counting, Recurrence Relations, Generating FunctionsNAT · 1 mark
Let S\text{S} be the set of all ternary strings defined over the alphabet {a,b,c}\{a, b, c\}. Consider all strings in S\text{S} that contain at least one occurrence of two consecutive symbols, that is, "aa"\text{"aa"}, "bb"\text{"bb"} or "cc"\text{"cc"}. The number of such strings of length 55 that are possible is __________. (Answer in integer).
Official PYQ2025Operating SystemCPU SchedulingNAT · 1 mark
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 there will always be a context switch whenever a process requests for an I/O, and also whenever the process returns from an I/O. The number of times the process will enter the ready …
Official PYQ2025Engineering MathematicsCalculus: Limits, Continuity, DifferentiabilityNAT · 1 mark
Consider the given function f(x)f(x). f(x)={ax+b for x<1x3+x2+1 for x≥1f(x)=\left\{\begin{array}{ll} a x+b & \text{ for } x<1 \\ x^{3}+x^{2}+1 & \text{ for } x \geq 1 \end{array}\right. If the function is differentiable everywhere, the value of bb must be ________. (rounded off to one decimal place)
Official PYQ2025Engineering MathematicsProbability: Random Variables and DistributionsNAT · 1 mark
A box contains 55 coins: 44 regular coins and 11 fake coin. When a regular coin is tossed, the probability P(P( head )=0.5)=0.5 and for a fake coin, P(P( head )=1)=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 __________. (rounded off to two decimal places)
Official PYQ2025AlgorithmsSearching, Sorting, HashingNAT · 1 mark
The pseudocode of a function fun ()\text{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]A[0, \ldots, 29] be an array storing 3030 distinct integers in descending order. The number of swap operations that will be performed, if the function fun ()\text{fun ()} is called …
Official PYQ2025Programming and Data StructuresProgramming in CNAT · 1 mark
#include <stdio.h> 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\text{C} program is __________. (Answer in integer)
Official PYQ2025Programming and Data StructuresBinary HeapsNAT · 1 mark
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\text{T} stores 3232 keys. The height of T\text{T} is ___________. (Answer in integer)
Official PYQ2025Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageMCQ · 2 marks
Consider a memory system with 1M1 \mathrm{M} bytes of main memory and 16 K16 \mathrm{~K} bytes of cache memory. Assume that the processor generates 2020-bit memory address, and the cache block size is 1616 bytes. If the cache uses direct mapping, how many bits will be required to store all the tag⁡\operatorname{tag} values? [Assume memory is byte …
Official PYQ2025Computer Organization and ArchitectureMachine Instructions and Addressing ModesMCQ · 2 marks
A processor has 6464 general-purpose registers and 5050 distinct instruction types. An instruction is encoded in 3232-bits. What is the maximum number of bits that can be used to store the immediate operand for the given instruction? ADD R1\text{ADD R1}, #25\#25 / / R 1=R 1+25\text{R 1=R 1+25}
Official PYQ2025Operating SystemCPU SchedulingMCQ · 2 marks
A computer has two processors, M1M_{1} and M2M_{2}. Four processes P1,P2,P3,P4P_{1}, P_{2}, P_{3}, P_{4} with CPU bursts of 20,16,2520,16,25, and 1010 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: M1M_{1} uses priority …
Official PYQ2025DatabasesTuple Calculus and SQLMCQ · 2 marks
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, pname, and tid denote player-id, playername 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 …
Official PYQ2025Computer NetworksFragmentation and IP Addressing, IPv4, CIDRMCQ · 2 marks
A packet with the destination IP\text{IP} address 145.36.109.70145.36 .109 .70 arrives at a router whose routing table is shown. Which interface will the packet be forwarded to? …