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 PYQ2021General AptitudeMCQ · 2 marks
Six students P, Q, R, S, T and U\text{P, Q, R, S, T and U}, with distinct heights, compare their heights and make the following observations. Observation I\text{Observation I}: S\text{S} is taller than R\text{R}. Observation II\text{Observation II}: Q\text{Q} is the shortest of all. Observation III\text{Observation III}: U\text{U} is taller than only one student. Observation IV\text{Observation IV}: …
Official PYQ2021AlgorithmsMinimum Spanning TreesMCQ · 1 mark
Let GG be a connected undirected weighted graph. Consider the following two statements. S1S_1: There exists a minimum weight edge in GG which is present in every minimum spanning tree of GG. S2S_2: If every edge in GG has distinct weight, then GG has a unique minimum spanning tree. Which one of the following options is correct?
Official PYQ2021Programming and Data StructuresBinary HeapsMCQ · 1 mark
​​​​​Let HH be a binary min-heap consisting of nn elements implemented as an array. What is the worst case time complexity of an optimal algorithm to find the maximum element in HH?
Official PYQ2021Digital LogicNumber Representations (Fixed and Floating Point)MCQ · 1 mark
The format of the single-precision floating point representation of a real number as per the IEEE 754\text{IEEE 754} standard is as follows: signexponentmantissa\begin{array}{|c|c|c|} \hline \text{sign} & \text{exponent} & \text{mantissa} \\ \hline \end{array} Which one of the following choices is correct with respect to the smallest normalized positive number …
Official PYQ2021Compiler DesignLexical AnalysisMCQ · 1 mark
Consider the following ANSI C\text{ANSI C} program: int main () { Integer x; return 0; } Which one of the following phases in a seven-phase CC compiler will throw an error?
Official PYQ2021DatabasesIntegrity ConstraintsMCQ · 1 mark
Consider the following statements S1S1 and S2S2 about the relational data model: S1S1: A relation scheme can have at most one foreign key. S2S2: A foreign key in a relation scheme RR cannot be used to refer to tuples of R.R. Which one of the following choices is correct?
Official PYQ2021Digital LogicCombinational CircuitsMCQ · 1 mark
Which one of the following circuits implements the Boolean function given below? f(x,y,z)=m0+m1+m3+m4+m5+m6f(x,y,z) = m_0+m_1+m_3+m_4+m_5+m_6, where mim_i is the ithi^{\text{th}} minterm.
Official PYQ2021Computer NetworksTransport Layer: Flow Control, Congestion Control, UDP, TCP, SocketsMCQ · 1 mark
Consider the three-way handshake mechanism followed during TCP\text{TCP} connection establishment between hosts PP and QQ. Let XX and YY be two random 3232-bit starting sequence numbers chosen by PP and QQ respectively. Suppose PP sends a TCP\text{TCP} connection request message to QQ with a TCP\text{TCP} segment having …
Official PYQ2021AlgorithmsSearching, Sorting, HashingMCQ · 1 mark
What is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size nn?
Official PYQ2021Theory of ComputationRegular Expressions and Finite AutomataMCQ · 1 mark
Let L⊆{0,1}∗L \subseteq \{0,1\}^* be an arbitrary regular language accepted by a minimal DFA\text{DFA} with kk states. Which one of the following languages must necessarily be accepted by a minimal DFA\text{DFA} with kk states?
Official PYQ2021Programming and Data StructuresProgramming in CMCQ · 1 mark
Consider the following ANSI C\text{ANSI C} program. #include <stdio.h> int main() { int arr[4][5]; int i, j; for (i=0; i<4; i++) ​​​​​​{ for (j=0; j<5; j++) { arr[i][j] = 10 * i + j; } } printf(“%d”, *(arr[1]+9)); return 0; } What is the output of the above program?
Official PYQ2021Engineering MathematicsSets, Relations and FunctionsMSQ · 1 mark
Consider the following sets, where n≥2n \geq 2: S1S_1: Set of all n×nn \times n matrices with entries from the set {a,b,c}\{ a, b, c\} S2S_2: Set of all functions from the set {0,1,2,…,n2−1}\{0,1,2, \dots, n^2-1\} to the set {0,1,2}\{0, 1, 2\} Which of the following choice(s) is/are correct?
Official PYQ2021Theory of ComputationRegular and Context-free LanguagesMSQ · 1 mark
Let L1L_1 be a regular language and L2L_2 be a context-free language. Which of the following languages is/are context-free?
Official PYQ2021Compiler DesignIntermediate Code GenerationMCQ · 1 mark
In the context of compilers, which of the following is/are NOT\text{NOT} an intermediate representation of the source program?
Official PYQ2021Operating SystemCPU SchedulingMSQ · 1 mark
Which of the following statement(s) is/are correct in the context of CPU\text{CPU} scheduling?
Official PYQ2021Engineering MathematicsPropositional and First Order LogicMSQ · 1 mark
Choose the correct choice(s) regarding the following proportional logic assertion SS: S:((P∧Q)→R)→((P∧Q)→(Q→R))S: (( P \wedge Q) \rightarrow R) \rightarrow (( P \wedge Q) \rightarrow (Q \rightarrow R))
Official PYQ2021Programming and Data StructuresTreesNAT · 1 mark
Consider a complete binary tree with 77 nodes. Let AA denote the set of first 33 elements obtained by performing Breadth-First Search (BFS)\text{(BFS)} starting from the root. Let BB denote the set of first 33 elements obtained by performing Depth-First Search (DFS)\text{(DFS)} starting from the root. The value of ∣A−B∣\mid A-B \mid is …
Official PYQ2021Theory of ComputationRegular Expressions and Finite AutomataNAT · 1 mark
Consider the following deterministic finite automaton (DFA)\text{(DFA)} The number of strings of length 88 accepted by the above automaton is ___________
Official PYQ2021Digital LogicNumber Representations (Fixed and Floating Point)NAT · 1 mark
If xx and yy are two decimal digits and (0.1101)2=(0.8xy5)10(0.1101)_2 = (0.8xy5)_{10}, the decimal value of x+yx+y is ___________
Official PYQ2021Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageNAT · 1 mark
Consider a set-associative cache of size 2KB (1KB=210\text{2KB (1KB} =2^{10} bytes)\text{)} with cache block size of 6464 bytes. Assume that the cache is byte-addressable and a 3232 -bit address is used for accessing the cache. If the width of the tag field is 2222 bits, the associativity of the cache is _________