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 PYQ2021Operating SystemProcesses and ThreadsMSQ · 2 marks
​​​​​​Consider the following multi-threaded code segment (in a mix of C and pseudo-code), invoked by two processes P1P_1 and P2P_2, and each of the processes spawns two threads T1T_1 and T2T_2: int x = 0; // global Lock L1; // global main () { create a thread to execute foo(); // Thread T1 create a thread to execute foo(); // Thread T2 wait for the …
Official PYQ2021Operating SystemDeadlockMSQ · 2 marks
Consider a computer system with multiple shared resource types, with one instance per resource type. Each instance can be owned by only one process at a time. Owning and freeing of resources are done by holding a global lock (L)(L). The following scheme is used to own a resource instance: function OWNRESOURCE(Resource R) Acquire lock L // a global lock if R …
Official PYQ2021Digital LogicNumber Representations (Fixed and Floating Point)MSQ · 2 marks
If the numerical value of a 22-byte unsigned integer on a little endian computer is 255255 more than that on a big endian computer, which of the following choices represent(s) the unsigned integer on a little endian computer?
Official PYQ2021Computer NetworksRouting Protocols: Shortest Path, Flooding, Distance Vector, Link StateMSQ · 2 marks
Consider a computer network using the distance vector routing algorithm in its network layer. The partial topology of the network is shown below. The objective is to find the shortest-cost path from the router RR to routers PP and QQ. Assume that RR does not initially know the shortest routes to PP and QQ. Assume that RR has three …
Official PYQ2021Theory of ComputationRegular Expressions and Finite AutomataMSQ · 2 marks
Which of the following regular expressions represent(s) the set of all binary numbers that are divisible by three? Assume that the string ϵ\epsilon is divisible by three.
Official PYQ2021AlgorithmsMinimum Spanning TreesMSQ · 2 marks
Consider the following directed graph: Which of the following is/are correct about the graph?
Official PYQ2021Operating SystemMemory Management and Virtual MemoryNAT · 2 marks
Consider a three-level page table to translate a 39−39-bit virtual address to a physical address as shown below: The page size is 4 KB  (1KB=210\text{4 KB} \;(1\text{KB}=2^{10} bytes)) and page table entry size at every level is 88 bytes. A process PP is currently using 2GB  (1GB=2302\text{GB}\;(1 \text{GB}=2^{30} bytes)) virtual memory which is mapped to …
Official PYQ2021AlgorithmsAsymptotic Worst Case Time and Space ComplexityNAT · 2 marks
Consider the following ANSI C\text{ANSI C} program #include <stdio.h> int foo(int x, int y, int q) { if ((x<=0) && (y<=0)) return q; if (x<=0) return foo(x, y-q, q); if (y<=0) return foo(x-q, y, q); return foo(x, y-q, q) + foo(x-q, y, q); } int main( ) { int r = foo(15, 15, 10); printf(“%d”, r); return 0; } The output of the program …
Official PYQ2021Engineering MathematicsCombinatorics: Counting, Recurrence Relations, Generating FunctionsNAT · 2 marks
Let SS be a set consisting of 1010 elements. The number of tuples of the form (A,B)(A,B) such that AA and BB are subsets of SS, and A⊆BA \subseteq B is ___________
Official PYQ2021Compiler DesignParsing (LL, LR)NAT · 2 marks
Consider the following augmented grammar with {#,@,<,>,a,b,c}\{ \#, @, <, >, a, b, c \} as the set of terminals. S’→SS→S#cSS→SSS→S@S→<S>S→aS→bS→c\begin{array}{l} S’ \rightarrow S \\ S \rightarrow S \# cS \\ S \rightarrow SS \\ S \rightarrow S @ \\ S \rightarrow < S > \\ S \rightarrow a \\ S \rightarrow b \\ S \rightarrow c \end{array}Let …
Official PYQ2021Digital LogicBoolean AlgebraNAT · 2 marks
Consider a Boolean function f(w,x,y,z)f(w,x,y,z) such that f(w,0,0,z)=1f(1,x,1,z)=x+zf(w,1,y,z)=wz+y\begin{array}{lll} f(w,0,0,z) & = & 1 \\ f(1,x,1,z) & =& x+z \\ f(w,1,y,z) & = & wz +y \end{array}The number of literals in the minimal sum-of-products expression of ff is _________
Official PYQ2021Computer NetworksData Link Layer: Framing, Error Detection, MAC, Ethernet BridgingNAT · 2 marks
Consider a network using the pure ALOHA\text{ALOHA} medium access control protocol, where each frame is of length 1,0001,000 bits. The channel transmission rate is 11 Mbps (=106=10^6 bits per second). The aggregate number of transmissions across all the nodes (including new frame transmissions and retransmitted frames due to collisions) is modelled as a …
Official PYQ2021Computer Organization and ArchitectureInstruction PipeliningNAT · 2 marks
Consider a pipelined processor with 55 stages, Instruction Fetch(IF)\text{Instruction Fetch} (\textsf{IF}), Instruction Decode(ID)\text{Instruction Decode} \textsf{(ID)}, Execute (EX)\text{Execute } \textsf{(EX)}, Memory Access (MEM)\text{Memory Access } \textsf{(MEM)}, and Write Back (WB)\text{Write Back } \textsf{(WB)}. Each stage of the pipeline, except the EX\textsf{EX} stage, takes one cycle. Assume that the …
Official PYQ2021AlgorithmsGraph Traversals (BFS, DFS)NAT · 2 marks
In a directed acyclic graph with a source vertex s\textsf{s}, the quality-score\textit{quality-score} of a directed path is defined to be the product of the weights of the edges on the path. Further, for a vertex vv other than s\textsf{s}, the quality-score of vv is defined to be the maximum among the quality-scores of all the paths from s\textsf{s} to …
Official PYQ2020General AptitudeMCQ · 1 mark
Raman is confident of speaking English _______six months as he has been practising regularly_______the last three weeks
Official PYQ2020General AptitudeMCQ · 1 mark
His knowledge of the subject was excellent but his classroom performance was_______.
Official PYQ2020General AptitudeMCQ · 1 mark
Select the word that fits the analogy: Cook : Cook :: Fly : _______
Official PYQ2020General AptitudeMCQ · 1 mark
The dawn of the 2121st century witnessed the melting glaciers oscillating between giving too much and too little to billions of people who depend on them for fresh water. The UN climate report estimates that without deep cuts to man-made emissions, at least 30%30\% of the northern hemisphere’s surface permafrost could melt by the end of the century. Given …
Official PYQ2020General AptitudeMCQ · 1 mark
There are multiple routes to reach from node 11 to node 22, as shown in the network. The cost of travel on an edge between two nodes is given in rupees. Nodes ‘a’,‘b’,‘c’,‘d’,‘e’,\text{‘}a\text{’}, \text{‘}b\text{’}, \text{‘}c\text{’}, \text{‘}d\text{’}, \text{‘}e\text{’}, and ‘f’\text{‘}f\text{’} are toll booths. The toll price at toll booths marked …
Official PYQ2020General AptitudeMCQ · 2 marks
Goods and Services Tax (GST) is an indirect tax introduced in India in 20172017 that is imposed on the supply of goods and services, and it subsumes all indirect taxes except few. It is a destination-based tax imposed on goods and services used, and it is not imposed at the point of origin from where goods come. GST also has a few components specific to …