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 PYQ2026Computer Organization and ArchitectureMachine Instructions and Addressing ModesMCQ · 2 marks
Consider a processor that has 1616 general purpose registers and it uses 22-byte instruction format for all its instructions. Variable-sized opcodes are permitted. There are three different types of instructions; M-type, R-type, and C-type. Each M-type instruction has 22 register operands and a 66-bit immediate operand. Each Rtype instruction has …
Official PYQ2026DatabasesFile Organization and Indexing (B and B+ Trees)MCQ · 2 marks
An index in a DBMS is said to be dense if an index entry appears for every search-key value in the indexed file. Otherwise it is called a sparse index. Consider the following two statements. S1\text{S1}: A hash index must be a dense index S1\text{S1}: A B+B^{+} tree index can be a sparse index Which one of the following options is correct?
Official PYQ2026Theory of ComputationRegular Expressions and Finite AutomataMSQ · 2 marks
Consider the following two finite automata D1D_{1} and D2D_{2}. Which of the following statements is/are true?
Official PYQ2026AlgorithmsSearching, Sorting, HashingMSQ · 2 marks
Consider a binary search tree (BST) with nn leaf nodes (n>0)(n>0). Given any node VV, the key present in the node is denoted as Val⁡(V)\operatorname{Val}(V). All the keys present in the given BST are distinct. The keys belong to the set of real numbers. For a node VV, let Suc⁡(V)\operatorname{Suc}(V) denote the node that is its inorder successor. If a …
Official PYQ2026Theory of ComputationRegular and Context-free LanguagesMSQ · 2 marks
Let Σ={a,b,c,d}\Sigma=\{a, b, c, d\} and let L={aibjckdℓ∣i,j,k,ℓ≥0}L=\left\{a^{i} b^{j} c^{k} d^{\ell} \mid i, j, k, \ell \geq 0\right\}. Which of the following constraints ensure(s) that the language LL is context-free?
Official PYQ2026Programming and Data StructuresArrays, Stacks and QueuesMSQ · 2 marks
Consider a stack SS and a queue QQ. Both of them are initially empty and have the capacity to store ten elements each. The elements 1,2,3,41,2,3,4, and 55 arrive one by one, in that order. When an element arrives, it is assigned either to SS (pushed on SS ) or to QQ (enqueued to QQ ). Once all the five elements are stored, the output is …
Official PYQ2026Operating SystemConcurrency and SynchronizationMSQ · 2 marks
Consider three processes P1, P2\text{P1, P2}, and P3\text{P3} running identical code, as shown in the pseudocode below. A\text{A} and B\text{B} are two binary semaphores initialized to 11 and 00, respectively. X\text{X} is a shared variable initialized to 00. Each line in the pseudocode is executed atomically. Pseudocode of P1, P2, and P3 …
Official PYQ2026Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageMSQ · 2 marks
Consider a system with a processor and a 44 KB direct mapped cache with block size of 1616 bytes. The system has a 1616 MB physical memory. Four words P,Q,R\mathrm{P}, \mathrm{Q}, \mathrm{R}, and S are accessed by the processor in the same order 1010 times. That is, there are a total of 4040 memory references in the sequence …
Official PYQ2026Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageNAT · 2 marks
To keep track of free blocks in a file system, one of the two approaches is generally used - using bitmaps (bit vectors) or using linked lists. Consider that the linked list approach is used to keep track of free blocks in a file system. Assume that the disk size is 1616 GB , block size is 22 KB , and block numbers used are 3232-bit long. A single …
Official PYQ2026Operating SystemMemory Management and Virtual MemoryNAT · 2 marks
A system has a Translation Lookaside Buffer (TLB) that has a reach of 11 MB. TLB reach is defined as the total amount of physical memory that can be accessed through the TLB entries. The paging system uses pages of size 44 KB. The virtual address space is 6464 GB and physical address space is 11 GB. If each TLB entry stores a 44-bit process id, …
Official PYQ2026Operating SystemMemory Management and Virtual MemoryNAT · 2 marks
Consider contiguous allocation of physical memory to processes using variable partitioning scheme. Suppose there are 88 holes in the memory of sizes 20KB,4 KB20 \mathrm{KB}, 4 \mathrm{~KB}, 25 KB,18 KB,7 KB,9 KB,15 KB25 \mathrm{~KB}, 18 \mathrm{~KB}, 7 \mathrm{~KB}, 9 \mathrm{~KB}, 15 \mathrm{~KB}, and 1212 KB. Assume that no two holes are adjacent. Two processes P1\text{P1} of …
Official PYQ2026Computer Organization and ArchitectureInstruction PipeliningNAT · 2 marks
A non-pipelined instruction execution unit that operates at 1.61.6 GHz clock takes an average of 55 clock cycles to complete the execution of an instruction. To improve the performance, the system was pipelined with a goal of achieving an average throughput of one instruction per clock cycle. However, it could operate only at 1.21.2 GHz due to pipeline …
Official PYQ2026Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageNAT · 2 marks
Consider a system with 11 MB physical memory and a word length of 11 byte. The system uses a direct mapped cache, with block numbers starting from 00. The word with physical address 0xA2C28\text{0xA2C28} is mapped to the cache block number 1761017610. The maximum possible size of the cache (in KB ) for this configuration is _______\_\_\_\_\_\_\_. (answer …
Official PYQ2026Computer NetworksTransport Layer: Flow Control, Congestion Control, UDP, TCP, SocketsNAT · 2 marks
Consider a new TCP connection between a sender and a receiver. The receiver advertised window is constant at 4848 KB, the maximum segment size (MSS) is 22 KB, and the slow start threshold for TCP congestion control is 1616 KB. Assume that there are no timeouts or duplicate acknowledgements. The number of rounds of transmission required for the …
Official PYQ2026Digital LogicCombinational CircuitsNAT · 2 marks
Consider the digital circuit shown below with two input lines A\text{A} and B\text{B}, two select lines S0\text{S0} and S1\text{S1}, and an output line Y\text{Y}. The blocks Q\text{Q} and M\text{M} represent active high 2:42:4 decoder and 44-to-11 multiplexer, respectively. Out of 1616 possible input combinations, the number of …
Official PYQ2026Programming and Data StructuresProgramming in CNAT · 2 marks
Consider the following ANSI-C program. #include <stdio.h> int main(){ int *ptr, a, b, c; a=5; b=11; c=20; ptr=&a; *ptr=c; ptr=&c; a=*(&b); c=*ptr-a; printf("%d",c); return(0); } The output of this program is ____\_\_\_\_ . (answer in integer) Note: Assume that the program compiles and runs successfully.
Official PYQ2026Programming and Data StructuresRecursionNAT · 2 marks
Consider the following ANSI-C function. int func(int start, int end){ int length=end+1-start; if((length<1)||(start<0)||(end<0)){ return(0); } if(length%3==0){ return(func(start+1, end)); }else if(length%3==1){ return(1+func(start, end-1)); }else { return(func(start+2, end)); } } The maximum possible value that can be returned from this function is …
Official PYQ2026Engineering MathematicsLinear Algebra: Matrices, Determinants, System of Linear EquationsNAT · 2 marks
The determinant of a 4×44 \times 4 matrix AA is 33. The value of the determinant of 2A2 A is ____\_\_\_\_. (answer in integer)
Official PYQ2026Engineering MathematicsConditional Probability and Bayes TheoremNAT · 2 marks
Suppose an unbiased coin is tossed 66 times. Each coin toss is independent of all previous coin tosses. Let E1E_{1} be the event that among the second, fourth, and sixth coin tosses, there are at least two heads. Let E2E_{2} be the event that among the first, second, third, and fifth coin tosses, there are equal number of heads and tails. The …
Official PYQ2026Engineering MathematicsCalculus: Limits, Continuity, DifferentiabilityNAT · 2 marks
Consider a function f:(0,1)→{0,1}f:(0,1) \rightarrow\{0,1\} defined as follows. For a real number r∈(0,1),f(r)=1r \in(0,1), f(r)=1 if the second digit after the decimal point in rr is one of the four digits 2,3,62,3,6 and 77. Otherwise, f(r)f(r) is equal to 00. The number of points in (0,1)(0,1) at which ff is discontinuous is ______\_\_\_\_\_\_. (answer in integer)