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 PYQ2024Computer NetworksFragmentation and IP Addressing, IPv4, CIDRMSQ · 1 mark
Which of the following fields is/are modified in the IP\text{IP} header of a packet going out of a network address translation (NAT)\text{(NAT)} device from an internal network to an external network?
Official PYQ2024Engineering MathematicsSets, Relations and FunctionsNAT · 1 mark
Let AA and BB be non-empty finite sets such that there exist one-to-one and onto functions (i)\text{(i)} from AA to BB and (ii)\text{(ii)} from A×AA \times A to A∪BA \cup B. The number of possible values of |A|\text{|A|} is ___________.
Official PYQ2024Compiler DesignParsing (LL, LR)NAT · 1 mark
Consider the operator precedence and associativity rules for the integer arithmetic operators given in the table below. …
Official PYQ2024Engineering MathematicsGraphs: Connectivity, Matching, ColouringNAT · 1 mark
The number of spanning trees in a complete graph of 44 vertices labelled A, B, C,\text{A, B, C,} and D\text{D} is _________.
Official PYQ2024DatabasesRelational Model: Relational AlgebraNAT · 1 mark
Consider the following two relations, R(A,B)R(A, B) and S(A,C)S(A, C): …
Official PYQ2024Computer NetworksRouting Protocols: Shortest Path, Flooding, Distance Vector, Link StateMCQ · 2 marks
Consider a network path P−Q−R\mathrm{P}-\mathrm{Q}-\mathrm{R} between nodes P\mathrm{P} and R\mathrm{R} via router Q\mathrm{Q}. Node P\mathrm{P} sends a file of size 10610^6 bytes to R\text{R} via this path by splitting the file into chunks of 10310^3 bytes each. Node P\text{P} sends these chunks one after the other without any wait time …
Official PYQ2024Compiler DesignSyntax-directed TranslationMCQ · 2 marks
​Consider the following syntax-directed definition (SDD)\text{(SDD)}. …
Official PYQ2024Compiler DesignIntermediate Code GenerationMCQ · 2 marks
Consider the following pseudo-code. L 1: t1 = -1 L 2: t2 = 0 L 3: t3 = 0 L 4: t4 = 4 * t3 L 5: t5 = 4 * t2 L 6: t6 = t5 * M L 7: t7 = t4 + t6 L 8: t8 = a[t7] L 9: if t8 <= max goto L11 L 10: t1 = t8 L 11: t3 = t3 + 1 L 12: if t3 < M goto L4 L 13: t2 = t2 + 1 L 14: if t2 < N goto L3 L 15: max = t1 Which one of the following options CORRECTLY …
Official PYQ2024Operating SystemProcesses and ThreadsMCQ · 2 marks
​​​Consider the following two threads T1\mathrm{T} 1 and T2\mathrm{T} 2 that update two shared variables a\mathrm{a} and b\mathrm{b}. Assume that initially a=b=1\mathrm{a}=\mathrm{b}=1. Though context switching between threads can happen at any time, each statement of T1\mathrm{T} 1 or T2\mathrm{T} 2 is executed atomically without interruption. …
Official PYQ2024AlgorithmsSearching, Sorting, HashingMCQ · 2 marks
​​​​​An array [82,101,90,11,111,75,33,131,44,93][82,101,90,11,111,75,33,131,44,93] is heapified. Which one of the following options represents the first three elements in the heapified array?
Official PYQ2024AlgorithmsAsymptotic Worst Case Time and Space ComplexityMCQ · 2 marks
Consider the following recurrence relation: T(n)={nT(n)+n for n≥1,1 for n=1T(n)=\left\{\begin{array}{c}\sqrt{n} T(\sqrt{n})+n \text{ for } n \geq 1, \\ 1 \quad \text{ for } n=1\end{array}\right. Which one of the following options is CORRECT?
Official PYQ2024Programming and Data StructuresBinary HeapsMCQ · 2 marks
Consider a binary min-heap containing 105105 distinct elements. Let kk be the index (in the underlying array) of the maximum element stored in the heap. The number of possible values of kk is
Official PYQ2024DatabasesNormal FormsMSQ · 2 marks
​The symbol →\rightarrow indicates functional dependency in the context of a relational database. Which of the following options is/are TRUE?
Official PYQ2024AlgorithmsGraph Traversals (BFS, DFS)MCQ · 2 marks
​​​​Let GG be a directed graph and TT a depth first search (DFS)\text{(DFS)} spanning tree in GG that is rooted at a vertex vv. Suppose TT is also a breadth first search (BFS)\text{(BFS)} tree in GG, rooted at vv. Which of the following statements is/are TRUE for every such graph GG and tree TT?
Official PYQ2024DatabasesTransactions and Concurrency ControlMSQ · 2 marks
​​​​Consider the following read-write schedule S\text{S} over three transactions T1,T2T_{1}, T_{2}, and T3T_{3}, where the subscripts in the schedule indicate transaction IDs: S:r1(z);w1(z);r2(x);r3(y);w3(y);r2(y);w2(x);w2(y);S: r_{1}(z) ; w_{1}(z) ; r_{2}(x) ; r_{3}(y) ; w_{3}(y) ; r_{2}(y) ; w_{2}(x) ; w_{2}(y) ; Which of the following transaction schedules is/are conflict equivalent to …
Official PYQ2024Digital LogicMinimization (K-Maps etc.)MSQ · 2 marks
Consider a Boolean expression given by F(X, Y, Z)=∑(3,5,6,7)\text{F(X, Y, Z)}=\sum(3,5,6,7). Which of the following statements is/are CORRECT?
Official PYQ2024Programming and Data StructuresProgramming in CMSQ · 2 marks
​​Consider the following C\mathrm{C} function definition. int f (int x, int y){ for (int i=0 ; i<y ; i++ ) { x= x + x + y; } return x; } Which of the following statements is/are TRUE about the above function?
Official PYQ2024Engineering MathematicsLinear Algebra: Matrices, Determinants, System of Linear EquationsMCQ · 2 marks
​​Let AA be any n×mn \times m matrix, where m>nm>n. Which of the following statements is/are TRUE about the system of linear equations Ax=0Ax=0?
Official PYQ2024Theory of ComputationRegular Expressions and Finite AutomataMSQ · 2 marks
​Consider the 55 -state DFA\text{DFA}. MM accepting the language L(M)⊂(0+1)∗L(M) \subset(0+1)^{*} shown below. For any string w∈(0+1)∗w \in(0+1)^* let n0(w)n_0(w) be the number of 0′s0^{\prime} s in ww and n1(w)n_1(w) be the number of 1 's in ww. Which of the following statements is/are FALSE?
Official PYQ2024Engineering MathematicsGraphs: Connectivity, Matching, ColouringMSQ · 2 marks
​​​The chromatic number of a graph is the minimum number of colours used in a proper colouring of the graph. Let GG be any graph with nn vertices and chromatic number kk. Which of the following statements is/are always TRUE?