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 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?
Official PYQ2024Engineering MathematicsMonoids and GroupsMSQ · 2 marks
Consider the operators ⋄\diamond and □\square defined by a⋄b=a+2b,a□b=aba \diamond b=a+2 b, a \square b=a b, for positive integers. Which of the following statements is/are TRUE?
Official PYQ2024Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageMSQ · 2 marks
​​​​Consider two set-associative cache memory architectures: WBC\text{WBC}, which uses the write back policy, and WTC\text{WTC}, which uses the write through policy. Both of them use the LRU\text{LRU} (Least Recently Used) block replacement policy. The cache memory is connected to the main memory. Which of the following statements is/are TRUE?
Official PYQ2024Operating SystemI/O SchedulingNAT · 2 marks
Consider a 512512 GB hard disk with 3232 storage surfaces. There are 40964096 sectors per track and each sector holds 10241024 bytes of data. The number of cylinders in the hard disk is _________.
Official PYQ2024Operating SystemSystem CallsNAT · 2 marks
Consider the following code snippet using the fork () and wait () system calls. Assume that the code compiles and runs correctly, and that the system calls run successfully without any errors. int x=3; while (x>0){ fork (); printf("hello"); wait (NULL) ; X-- ; } The total number of times the printf statement is executed is __________.
Official PYQ2024Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageNAT · 2 marks
A given program has 25%25 \% load/store instructions. Suppose the ideal CPI\text{CPI} (cycles per instruction) without any memory stalls is 22. The program exhibits 2%2 \% miss rate on instruction cache and 8%8 \% miss rate on data cache. The miss penalty is 100100 cycles. The speedup (rounded off to two decimal places) achieved with a perfect …
Official PYQ2024Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageNAT · 2 marks
The baseline execution time of a program on a 2GHz2 \mathrm{GHz} single core machine is 100100 nanoseconds ( ns)n s). The code corresponding to 90%90 \% of the execution time can be fully parallelized. The overhead for using an additional core is 10 ns10 ~ns when running on a multicore system. Assume that all cores in the multicore system run their share …
Official PYQ2024Compiler DesignParsing (LL, LR)NAT · 2 marks
Let G=(V,Σ,S,P)G=(V, \Sigma, S, P) be a context-free grammar in Chomsky Normal Form with Σ={a,b,c}\Sigma=\{a, b, c\} and VV containing 1010 variable symbols including the start symbol SS. The string w=a30b30c30w=a^{30} b^{30} c^{30} is derivable from SS. The number of steps (application of rules) in the derivation S→∗wS \rightarrow^* w is __________.
Official PYQ2024Computer NetworksRouting Protocols: Shortest Path, Flooding, Distance Vector, Link StateNAT · 2 marks
Consider the entries shown below in the forwarding table of an IP\text{IP} router. Each entry consists of an IP\text{IP} prefix and the corresponding next hop router for packets whose destination IP\text{IP} address matches the prefix. The notation " /N\mathrm{N} " in a prefix indicates a subnet mask with the most significant N\mathrm{N} bits set …
Official PYQ2024AlgorithmsGraph Traversals (BFS, DFS)NAT · 2 marks
The number of edges present in the forest generated by the DFS\text{DFS} traversal of an undirected graph GG with 100100 vertices is 4040. The number of connected components in GG is __________.