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 PYQ2017Programming and Data StructuresProgramming in CMCQ · 1 mark
Consider the following function implemented in C: void printxy(int x, int y) { int *ptr; x=0; ptr=&x; y=*ptr; *ptr=1; printf(“%d, %d”, x, y); } The output of invoking printxy(1,1)printxy(1,1) is:
Official PYQ2017Theory of ComputationContext-free Grammars and Push-down AutomataMCQ · 1 mark
Identify the language generated by the following grammar, where SS is the start variable. S→XYS \rightarrow XY X→aX∣aX \rightarrow aX \mid a Y→aYb∣ϵY \rightarrow aYb \mid \epsilon
Official PYQ2017Operating SystemProcesses and ThreadsMCQ · 1 mark
Which of the following is/are shared by all the threads in a process? Program counter Stack Address space Registers
Official PYQ2017DatabasesIntegrity ConstraintsNAT · 1 mark
Consider the following tables T1T1 and T2.T2. …
Official PYQ2017Computer NetworksTransport Layer: Flow Control, Congestion Control, UDP, TCP, SocketsMCQ · 1 mark
Consider socket API on a Linux machine that supports connected UDP sockets. A connected UDP socket is a UDP socket on which connect function has already been called. Which of the following statements is/are CORRECT? A connected UDP socket can be used to communicate with multiple peers simultaneously. A process can successfully call connect function again for …
Official PYQ2017AlgorithmsGraph Traversals (BFS, DFS)MCQ · 1 mark
The Breadth First Search (BFS) algorithm has been implemented using the queue data structure. Which one of the following is a possible order of visiting the nodes in the graph below?
Official PYQ2017Programming and Data StructuresProgramming in CMCQ · 1 mark
Match the following: …
Official PYQ2017Engineering MathematicsSets, Relations and FunctionsNAT · 1 mark
Consider the quadratic equation x2−13x+36=0x^2-13x+36=0 with coefficients in a base bb. The solutions of this equation in the same base bb are x=5x=5 and x=6x=6. Then b=b= _____
Official PYQ2017Theory of ComputationRegular Expressions and Finite AutomataNAT · 1 mark
The minimum possible number of states of a deterministic finite automaton that accepts the regular language LL = {w1aw2w_{1}aw_{2} | w1,w2w_{1},w_{2} ∈\in {a,b}∗\left \{ a,b \right \}^{*} , ∣w1∣=2,∣w2∣≥3\left | w_{1} \right | = 2, \left | w_{2} \right |\geq 3} is ______________ .
Official PYQ2017DatabasesER-modelMCQ · 1 mark
An ER model of a database consists of entity types AA and BB. These are connected by a relationship RR which does not have its own attribute. Under which one of the following conditions, can the relational table for R be merged with that of A?
Official PYQ2017AlgorithmsAsymptotic Worst Case Time and Space ComplexityMCQ · 1 mark
Match the algorithms with their time complexities: …
Official PYQ2017Engineering MathematicsPropositional and First Order LogicMCQ · 1 mark
Let p,q,rp, q, r denote the statements ”It is raining”, “It is cold”, and “It is pleasant”, respectively. Then the statement “It is not raining and it is pleasant, and it is not pleasant only if it is raining and it is cold” is represented by
Official PYQ2017Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Let L1,L2L_1, L_2 be any two context-free languages and RR be any regular language. Then which of the following is/are CORRECT? L1∪L2L_1 \cup L_2 is context-free L1‾\overline{L_1} is context-free L1−RL_1 - R is context-free L1∩L2L_1 \cap L_2 is context-free
Official PYQ2016Theory of ComputationContext-free Grammars and Push-down AutomataMCQ · 1 mark
Consider the transition diagram of a PDA given below with input alphabet Σ={a,b}\Sigma=\{a,b\} and stack alphabet Γ={X,Z}\Gamma = \{X,Z\}. ZZ is the initial stack symbol. Let LL denote the language accepted by the PDA Which one of the following is TRUE?
Official PYQ2016Programming and Data StructuresGraphsNAT · 1 mark
Consider the weighted undirected graph with 44 vertices, where the weight of edge {i,j}\{i,j\} is given by the entry WijW_{ij} in the matrix WW. W=[02852058850x58x0]\begin{bmatrix} 0&2 &8 &5 \\ 2&0 &5 &8 \\ 8&5 &0 &x \\ 5& 8 &x &0 \end{bmatrix} The largest possible integer value of xx, for which at least one …
Official PYQ2016AlgorithmsMinimum Spanning TreesMCQ · 1 mark
G=(V,E)G=(V, E) is an undirected simple graph in which each edge has a distinct weight, and ee is a particular edge of GG. Which of the following statements about the minimum spanning trees (MSTs)(MSTs) of GG is/are TRUE? If ee is the lightest edge of some cycle in GG, then every MST of GG includes ee. If ee is the heaviest edge of some …
Official PYQ2016Programming and Data StructuresProgramming in CMCQ · 1 mark
What will be the output of the following CC program? void count (int n) { static int d=1; printf ("%d",n); printf ("%d",d); d++; if (n>1) count (n-1); printf ("%d",d); } void main(){ count (3); }
Official PYQ2016AlgorithmsMinimum Spanning TreesNAT · 1 mark
Let GG be a complete undirected graph on 44 vertices, having 66 edges with weights being 1,2,3,4,5,1, 2, 3, 4, 5, and 66. The maximum possible weight that a minimum weight spanning tree of GG can have is __________
Official PYQ2016Digital LogicCombinational CircuitsMCQ · 1 mark
Consider the two cascade 22 to 11 multiplexers as shown in the figure . The minimal sum of products form of the output XX is
Official PYQ2016Computer NetworksTransport Layer: Flow Control, Congestion Control, UDP, TCP, SocketsNAT · 1 mark
For a host machine that uses the token bucket algorithm for congestion control, the token bucket has a capacity of 11 megabyte\text{megabyte} and the maximum output rate is 2020 megabytes\text{megabytes} per second\text{second}. Tokens arrive at a rate to sustain output at a rate of 1010 megabytes\text{megabytes} per second\text{second}. The token bucket is currently …