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 PYQ2021Theory of ComputationRegular Expressions and Finite AutomataMCQ · 2 marks
Suppose we want to design a synchronous circuit that processes a string of 00’s and 11’s. Given a string, it produces another string by replacing the first 11 in any subsequence of consecutive 11’s by a 00. Consider the following example. …
Official PYQ2021Engineering MathematicsProbability: Random Variables and DistributionsMCQ · 2 marks
In an examination, a student can choose the order in which two questions (QuesA\textsf{QuesA} and QuesB\textsf{QuesB}) must be attempted. If the first question is answered wrong, the student gets zero marks. If the first question is answered correctly and the second question is not answered correctly, the student gets the marks only for the first question. If …
Official PYQ2021AlgorithmsAlgorithm Design: Greedy TechniquesMCQ · 2 marks
Consider the string abbccddeee\textrm{abbccddeee}. Each letter in the string must be assigned a binary code satisfying the following properties: For any two letters, the code assigned to one letter must not be a prefix of the code assigned to the other letter. For any two letters of the same frequency, the letter which occurs earlier in the dictionary order is …
Official PYQ2021Compiler DesignLocal OptimizationMCQ · 2 marks
​​​​​​Consider the following ANSI C\text{ANSI C} code segment: z=x + 3 + y->f1 + y->f2; for (i = 0; i < 200; i = i + 2) { if (z > i) { p = p + x + 3; q = q + y->f1; } else { p = p + y->f2; q = q + x + 3; } } Assume that the variable yy points to a struct\textsf{struct} (allocated on the heap) containing two fields f1\textsf{f1} and …
Official PYQ2021DatabasesTuple Calculus and SQLMCQ · 2 marks
The relation scheme given below is used to store information about the employees of a company, where empId\textsf{empId} is the key and deptId\textsf{deptId} indicates the department to which the employee is assigned. Each employee is assigned to exactly one department. emp(empId‾, name, gender, salary, deptId)\textsf{emp($\underline{\textsf{empId}}$, name, gender, salary, deptId)} Consider the …
Official PYQ2021Computer NetworksData Link Layer: Framing, Error Detection, MAC, Ethernet BridgingMCQ · 2 marks
Consider the cyclic redundancy check (CRC)\text{(CRC)} based error detecting scheme having the generator polynomial X3+X+1X^3+X+1. Suppose the message m4m3m2m1m0=11000m_4m_3m_2m_1m_0=11000 is to be transmitted. Check bits c2c1c0c_2c_1c_0 are appended at the end of the message by the transmitter using the above CRC\text{CRC} scheme. The transmitted bit string is denoted by …
Official PYQ2021Programming and Data StructuresProgramming in CMCQ · 2 marks
Consider the following ANSI C\text{ANSI C} program: #include <stdio.h> #include <stdlib.h> struct Node{ int value; struct Node *next;}; int main( ) { struct Node *boxE, *head, *boxN; int index=0; boxE=head= (struct Node *) malloc(sizeof(struct Node)); head → value = index; for (index =1; index<=3; index++){ boxN = (struct Node *) malloc …
Official PYQ2021DatabasesTransactions and Concurrency ControlMCQ · 2 marks
​​​​​Let SS be the following schedule of operations of three transactions T1T_1, T2T_2 and T3T_3 in a relational database system: R2(Y),R1(X),R3(Z),R1(Y)W1(X),R2(Z),W2(Y),R3(X),W3(Z)R_2(Y), R_1(X), R_3(Z), R_1(Y)W_1(X), R_2(Z), W_2(Y), R_3(X), W_3(Z) Consider the statements PP and QQ below: PP: SS is conflict-serializable. QQ: If T3T_3 commits before T1T_1 finishes, then SS …
Official PYQ2021Theory of ComputationRegular and Context-free LanguagesMCQ · 2 marks
​​​​​​Consider the following two statements about regular languages: S1S_1: Every infinite regular language contains an undecidable language as a subset. S2S_2: Every finite language is regular. Which one of the following choices is correct?
Official PYQ2021Engineering MathematicsSets, Relations and FunctionsMCQ · 2 marks
For two nn-dimensional real vectors PP and QQ, the operation s(P,Q)s(P,Q) is defined as follows: s(P,Q)=∑i=1n(P[i]⋅Q[i])s(P,Q) = \displaystyle \sum_{i=1}^n (P[i] \cdot Q[i]) Let L\mathcal{L} be a set of 1010-dimensional non-zero real vectors such that for every pair of distinct vectors P,Q∈LP,Q \in \mathcal{L}, s(P,Q)=0s(P,Q)=0. What is the maximum cardinality possible …
Official PYQ2021AlgorithmsAsymptotic Worst Case Time and Space ComplexityMCQ · 2 marks
For constants a≥1a \geq 1 and b>1b>1, consider the following recurrence defined on the non-negative integers: T(n)=a⋅T(nb)+f(n)T(n) = a \cdot T \left(\dfrac{n}{b} \right) + f(n) Which one of the following options is correct about the recurrence T(n)T(n)?
Official PYQ2021DatabasesNormal FormsMSQ · 2 marks
Suppose the following functional dependencies hold on a relation UU with attributes P,Q,R,SP,Q,R,S, and TT: P→QRP \rightarrow QR RS→TRS \rightarrow T Which of the following functional dependencies can be inferred from the above functional dependencies?
Official PYQ2021Theory of ComputationContext-free Grammars and Push-down AutomataMSQ · 2 marks
For a string ww, we define wRw^R to be the reverse of ww. For example, if w=01101w=01101 then wR=10110w^R=10110. Which of the following languages is/are context-free?
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 …