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 PYQ2026AlgorithmsGraph Traversals (BFS, DFS)MSQ · 2 marks
Consider the following pseudocode for depth-first search (DFS) algorithm which takes a directed graph G(V,E)G(V, E) as input, where d[v]d[v] and f[v]f[v] are the discovery time and finishing time, respectively, of the vertex v∈Vv \in V. …
Official PYQ2026Theory of ComputationRegular and Context-free LanguagesMCQ · 2 marks
Let L1L_{1} and L2L_{2} be two languages over a finite alphabet, such that L1∩L2L_{1} \cap L_{2} and L2L_{2} are regular languages. Which of the following statements is/are always true?
Official PYQ2026Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageMSQ · 2 marks
Consider a system that has a cache memory unit and a memory management unit (MMU). The address input to the cache memory is a physical address. The MMU has a translation lookaside buffer (TLB). Assume that when a page is evicted from the main memory, the corresponding blocks in the cache are marked as invalid. For a given memory reference, which of the …
Official PYQ2026Compiler DesignSyntax-directed TranslationMSQ · 2 marks
Consider the following two syntax-directed definitions SDD1\text{SDD1} and SDD2\text{SDD2} for type declarations. …
Official PYQ2026Theory of ComputationRegular and Context-free LanguagesMSQ · 2 marks
Consider the following context-free grammar GG. S→abaABAbbaA→aaBBAb∣bBabaaB→aBb∣ab\begin{array}{l} S \rightarrow a b a A B A b b a \\ A \rightarrow a a B B A b \mid b B a b a a \\ B \rightarrow a B b \mid a b \end{array} In the above grammar, SS is the start symbol, aa and bb are terminal symbols, and AA and BB are non-terminal symbols. Let L(G)L(G) be the language …
Official PYQ2026Engineering MathematicsGraphs: Connectivity, Matching, ColouringMSQ · 2 marks
An undirected, unweighted, simple graph G(V,E)G(V, E) is said to be 22-colorable if there exists a function c:V→{0,1}c: V \rightarrow\{0,1\} such that for every (u,v)∈E,c(u)≠c(v)(u, v) \in E, c(u) \neq c(v). Which of the following statements about 22-colorable graphs is/are true?
Official PYQ2026Engineering MathematicsGraphs: Connectivity, Matching, ColouringNAT · 2 marks
Let GG be an undirected graph, which is a path on 88 vertices. The number of matchings in GG is ____\_\_\_\_. (answer in integer)
Official PYQ2026Computer NetworksRouting Protocols: Shortest Path, Flooding, Distance Vector, Link StateMSQ · 2 marks
An ISP having an address block 202.16.0.0/15202.16.0.0/15 assigns a block of 60006000 IP addresses to a client, using the classless internet domain routing (CIDR) super-netting approach. Which of the following address blocks can be assigned by the ISP?
Official PYQ2026Engineering MathematicsProbability: Random Variables and DistributionsNAT · 2 marks
Let XX be a random variable which takes values in the set {1,2,3,4,5,6,7,8}\{1,2,3,4,5,6,7,8\}. Further, Pr⁡(X=1)=Pr⁡(X=2)=Pr⁡(X=5)=Pr⁡(X=7)=16\operatorname{Pr}(X=1)=\operatorname{Pr}(X=2)=\operatorname{Pr}(X=5)=\operatorname{Pr}(X=7)=\frac{1}{6} and Pr⁡(X=3)=Pr⁡(X=4)=Pr⁡(X=6)=Pr⁡(X=8)=112\operatorname{Pr}(X=3)=\operatorname{Pr}(X=4)=\operatorname{Pr}(X=6)=\operatorname{Pr}(X=8)=\frac{1}{12}. The expected value of XX, denoted by …
Official PYQ2026Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageNAT · 2 marks
Consider a hard disk with a rotational speed of 1500015000 rpm. The time to move the read/write head from a track to its adjacent track is 11 millisecond. Initially, the head is on track 00. The number of sectors per track is 400400. The sector size is 10241024 bytes. It is necessary to transfer data from 1010 randomly located sectors in each of the …
Official PYQ2026Computer Organization and ArchitecturePipeline HazardsNAT · 2 marks
The EX stage of a pipelined processor performs the memory read operations for LOAD instructions, and the operations for the arithmetic and logic instructions. Let tEXt_{E X} denote the time taken by the EX stage to perform the operation for an instruction. For each instruction type, the values of tEXt_{E X} and MM (the number of instructions of that …
Official PYQ2026AlgorithmsAsymptotic Worst Case Time and Space ComplexityNAT · 2 marks
Consider the recursive functions represented by the following code segment: int bar(int n) { if (n == 1) return 0; else return 1 + bar(n/2); } int foo(int n) { if (n == 1) return 1; else return 1 + foo(bar(n)); } The smallest positive integer n for which f∘∘(n)\mathrm{f} \circ \circ(\mathrm{n}) returns 55 is ____\_\_\_\_. (answer in integer) Note: Ignore …
Official PYQ2026AlgorithmsSearching, Sorting, HashingNAT · 2 marks
The following sequence corresponds to the preorder traversal of a binary search tree TT : 50,25,13,40,30,47,75,60,70,80,7750,25,13,40,30,47,75,60,70,80,77 The position of the element 6060 in the postorder traversal of TT is ____\_\_\_\_ . (answer in integer) Note: The position begins with 11.
Official PYQ2026Operating SystemSystem CallsNAT · 2 marks
Consider the following program snippet. Assume that the program compiles and runs successfully. Further, assume that the fork() system call is always successful in creating a process. int main () { int i; for (i = 0; i < 3; i++) { if (fork() == 0) { continue; } break; } printf("Hello!"); return 0; } The total number of times that the printf statement gets …
Official PYQ2026Operating SystemCPU SchedulingNAT · 2 marks
Consider a CPU that has to execute two types of processes. The first type, Actuators (A), requires a CPU burst of 66 seconds. The second type, Controllers (C), requires a CPU burst of 88 seconds. A new process of type A arrives at time t=10t=10, 20,30,4020, 30, 40, and 5050 (in seconds). Similarly, a new process of type C arrives at time t=t= …
Official PYQ2026DatabasesER-modelNAT · 2 marks
Consider a relational database schema with a relation R(A,B,C,D)R(A, B, C, D). If {A,B}\{A, B\} and {A,C}\{A, C\} are the only two candidate keys of the relation RR, then the number of superkeys of relation RR is ____\_\_\_\_. (answer in integer)
Official PYQ2026General AptitudeMCQ · 1 mark
Expedite, Hasten, Hurry, ____\_\_\_\_ Fill the blank by choosing a word with a meaning similar to that of the words given above.
Official PYQ2026General AptitudeMCQ · 1 mark
A black square PQRS has been cut into two parts. One part of it is shown in Panel I.\text{I}. Which one of the shapes in Panel II\text{II} is the other part?
Official PYQ2026General AptitudeMCQ · 1 mark
A day can only be cloudy or sunny. The probability of a day being cloudy is 0.50.5, independent of the condition on other days. What is the probability that in any given four days, there will be three cloudy days and one sunny day?
Official PYQ2026General AptitudeMCQ · 1 mark
The values of Stock A\text{A} and Stock B\text{B} on a particular day are Rs. 5050 and Rs. 8080, respectively. An investor invests Rs. 100100 in Stock A\text{A} and Rs. 8080 in Stock B\text{B}. He sells all the stocks the next day when the value of Stock A\text{A} is Rs. 5555 and Stock B\text{B} is Rs. 7070. The profit made by …