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.

7 on this page
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 …