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 PYQ2024DatabasesTransactions and Concurrency ControlMSQ · 1 mark
​​​​Which of the following statements about the Two Phase Locking (2PL2 \mathrm{PL}) protocol is/are TRUE?
Official PYQ2024Computer NetworksFragmentation and IP Addressing, IPv4, CIDRMSQ · 1 mark
​​​​​Which of the following statements about IPv4\text{IPv4} fragmentation is/are TRUE?
Official PYQ2024Computer Organization and ArchitectureInstruction PipeliningMCQ · 1 mark
​​​​​An instruction format has the following structure: Instruction Number: Opcode destination reg, source reg-11, source reg-22 Consider the following sequence of instructions to be executed in a pipelined processor: I 1: DIV R3, R1, R2\text{I 1: DIV R3, R1, R2} I 2: SUB R5, R3, R4\text{I 2: SUB R5, R3, R4} I 3: ADD R3, R5, R6\text{I 3: ADD R3, R5, R6} I 4: MUL R7, R3, R8\text{I 4: MUL R7, R3, R8} Which of the …
Official PYQ2024Computer NetworksFragmentation and IP Addressing, IPv4, CIDRMSQ · 1 mark
​​​​Which of the following fields of an IP\text{IP} header is/are always modified by any router before it forwards the IP\text{IP} packet?
Official PYQ2024Compiler DesignSyntax-directed TranslationMSQ · 1 mark
​​​​​Which of the following statements is/are FALSE?
Official PYQ2024Digital LogicBoolean AlgebraMSQ · 1 mark
​​​​For a Boolean variable xx, which of the following statements is/are FALSE?
Official PYQ2024Programming and Data StructuresProgramming in CMSQ · 1 mark
​​​Consider the following C\mathrm{C} function definition. int fX(char *a) { char *b = a; while (*b) b++; return b - a; } Which of the following statements is/are TRUE?
Official PYQ2024Engineering MathematicsPartial Orders and LatticesNAT · 1 mark
Let P\text{P} be the partial order defined on the set {1,2,3,4}\{1,2,3,4\} as follows P={(x,x)∣x∈{1,2,3,4}}∪{(1,2),(3,2),(3,4)}P=\{(x, x) \mid x \in\{1,2,3,4\}\} \cup\{(1,2),(3,2),(3,4)\} The number of total orders on {1,2,3,4}\{1,2,3,4\} that contain P\text{P} is __________.
Official PYQ2024AlgorithmsSearching, Sorting, HashingNAT · 1 mark
Let A\text{A} be an array containing integer values. The distance of A\text{A} is defined as the minimum number of elements in A\text{A} that must be replaced with another integer so that the resulting array is sorted in non-decreasing order. The distance of the array [2,5,3,1,4,2,6][2,5,3,1,4,2,6] is ___________.
Official PYQ2024Programming and Data StructuresProgramming in CMCQ · 2 marks
​​​​​What is the output of the following C\text{C} program? #include <stdio.h> int main() { double a[2]={20.0,25.0},* p,* q; p=a ; q=p+1 ; printf("%d,%d", (int) (q-p),( int)(* q- * p)); return 0;}
Official PYQ2024Operating SystemCPU SchedulingMCQ · 2 marks
​​​​Consider a single processor system with four processes A, B, C,\text{A, B, C,} and D\text{D}, represented as given below, where for each process the first value is its arrival time, and the second value is its CPU\text{CPU} burst time. A(0,10),B(2,6),C(4,3)\mathrm{A}(0,10), \mathrm{B}(2,6), \mathrm{C}(4,3), and D(6,7)\mathrm{D}(6,7). Which one of the following options …
Official PYQ2024Computer NetworksFragmentation and IP Addressing, IPv4, CIDRMCQ · 2 marks
​​​​​Which one of the following CIDR\text{CIDR} prefixes exactly represents the range of IP\text{IP} addresses 10.12.2.010.12 .2 .0 to 10.12.3.25510.12 .3 .255?
Official PYQ2024Programming and Data StructuresBinary Search TreesMCQ · 2 marks
​​​​​​You are given a set VV of distinct integers. A binary search tree TT is created by inserting all elements of VV one by one, starting with an empty tree. The tree TT follows the convention that, at each node, all values stored in the left subtree of the node are smaller than the value stored at the node. You are not aware of the sequence in …
Official PYQ2024Theory of ComputationRegular Expressions and Finite AutomataMCQ · 2 marks
​​Let M\text{M} be the 55-state NFA\text{NFA} with ϵ\epsilon-transitions shown in the diagram below. Which one of the following regular expressions represents the language accepted by M\text{M}?
Official PYQ2024AlgorithmsAlgorithm Design: Greedy TechniquesMCQ · 2 marks
​​​​Consider an array X\mathrm{X} that contains n\mathrm{n} positive integers. A subarray of X\mathrm{X} is defined to be a sequence of array locations with consecutive indices. The C\mathrm{C} code snippet given below has been written to compute the length of the longest subarray of X\mathrm{X} that contains at most two distinct integers. The …
Official PYQ2024Engineering MathematicsProbability: Random Variables and DistributionsMCQ · 2 marks
Let xx and yy be random variables, not necessarily independent, that take real values in the interval [0,1][0,1]. Let z=xyz=x y and let the mean values of x,y,zx, y, z be xˉ,yˉ,zˉ\bar{x}, \bar{y}, \bar{z}, respectively. Which one of the following statements is TRUE?
Official PYQ2024DatabasesRelational Model: Relational AlgebraMCQ · 2 marks
​​​​​The relation schema, Person (pid, city), describes the city of residence for every person uniquely identified by pid. The following relational algebra operators are available: selection, projection, cross product, and rename. To find the list of cities where at least 33 persons reside, using the above operators, the minimum number of cross product …
Official PYQ2024Operating SystemConcurrency and SynchronizationMSQ · 2 marks
​​​​​Consider a multi-threaded program with two threads T1\mathrm{T} 1 and T2\mathrm{T} 2. The threads share two semaphores: s1s1 (initialized to 11) and s2s2 (initialized to 00). The threads also share a global variable x\mathrm{x} (initialized to 00). The threads execute the code shown below. //code of T 1 wait (s1); x = x+1; print (x); …
Official PYQ2024Engineering MathematicsLinear Algebra: Matrices, Determinants, System of Linear EquationsMSQ · 2 marks
​​​​​Let AA be an n×nn \times n matrix over the set of all real numbers R\mathbb{R}. Let BB be a matrix obtained from AA by swapping two rows. Which of the following statements is/are TRUE?
Official PYQ2024Programming and Data StructuresArrays, Stacks and QueuesMSQ · 2 marks
​​​​​Let S1\mathrm{S} 1 and S2\mathrm{S} 2 be two stacks. S1\mathrm{S} 1 has capacity of 44 elements. S2\mathrm{S} 2 has capacity of 22 elements. S1\text{S1} already has 44 elements: 100,200,300100,200,300, and 400400, whereas S2\text{S2} is empty, as shown below. …