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 PYQ2023Computer NetworksTransport Layer: Flow Control, Congestion Control, UDP, TCP, SocketsMSQ · 2 marks
Suppose you are asked to design a new reliable byte-stream transport protocol like TCP.\text{TCP}. This protocol, named myTCP\textsf{myTCP}, runs over a 100 Mbps100 \mathrm{~Mbps} network with Round Trip Time of 150150 milliseconds and the maximum segment lifetime of 22 minutes. Which of the following is/are valid lengths of the Sequence Number field in the …
Official PYQ2023Computer NetworksFragmentation and IP Addressing, IPv4, CIDRMSQ · 2 marks
Suppose in a web browser, you click on the www. gate-2023.in  URL\textsf{www. gate-2023.in}\; \text{URL}. The browser cache is empty. The IP address\text{IP address} for this URL\text{URL} is not cached in your local host, so a DNS\text{DNS} lookup is triggered (by the local DNS\text{DNS} server deployed on your local host) over the 33-tier DNS\text{DNS} hierarchy in an …
Official PYQ2023Engineering MathematicsProbability: Random Variables and DistributionsMSQ · 2 marks
Consider a random experiment where two fair coins are tossed. Let AA be the event that denotes HEAD\text{HEAD} on both the throws, BB be the event that denotes HEAD\text{HEAD} on the first throw, and CC be the event that denotes HEAD\text{HEAD} on the second throw. Which of the following statements is/are TRUE?\text{TRUE}?
Official PYQ2023Engineering MathematicsGraphs: Connectivity, Matching, ColouringMSQ · 2 marks
Let GG be a simple, finite, undirected graph with vertex set {v1,…,vn}\left\{v_{1}, \ldots, v_{n}\right\}. Let Δ(G)\Delta(G) denote the maximum degree of GG and let N={1,2,…}\mathbb{N}=\{1,2, \ldots\} denote the set of all possible colors. Color the vertices of GG using the following greedy strategy: for i=1,…,ni=1, \ldots, n …
Official PYQ2023AlgorithmsAsymptotic Worst Case Time and Space ComplexityMSQ · 2 marks
Consider functions Function_1\textsf{Function\_1} and Function_2\textsf{Function\_2} expressed in pseudocode as follows: Function_1 while n>1 do for i=1 to n do x = x + 1; end for n = ⌊n/2⌋; end while Function_2 for i = 1 to 100 * n do x = x + 1; end for Let f1(n)f_{1}(n) and f2(n)f_{2}(n) denote the number of times the statement “x = x + 1”\textsf{“x = x + 1”} is executed in …
Official PYQ2023AlgorithmsGraph Traversals (BFS, DFS)NAT · 2 marks
Let U={1,2,3}U=\{1,2,3\}. Let 2U2^{U} denote the powerset of UU. Consider an undirected graph GG whose vertex set is 2U2^{U}. For any A,B∈2U,(A,B)A, B \in 2^{U},(A, B) is an edge in GG if and only if (i) A≠BA \neq B, and (ii) either A⊊BA \subsetneq B or B⊊AB \subsetneq A. For any vertex AA in GG, the set of all possible orderings in which the …
Official PYQ2023Operating SystemMemory Management and Virtual MemoryNAT · 2 marks
Consider a computer system with 5757-bit virtual addressing using multi-level tree-structured page tables with L\mathrm{L} levels for virtual to physical address translation. The page size is 4 KB(1 KB=1024 B)4 \mathrm{~KB}(1 \mathrm{~KB}=1024 \mathrm{~B}) and a page table entry at any of the levels occupies 88 bytes. The value of L\mathrm{L} is …
Official PYQ2023Operating SystemMemory Management and Virtual MemoryNAT · 2 marks
Consider the following two-dimensional array D\text{D} in the C\text{C} programming language, which is stored in row-major order: int D[128][128]; Demand paging is used for allocating memory and each physical page frame holds 512512 elements of the array D.\text{D}. The Least Recently Used (LRU)\text{(LRU)} page-replacement policy is used by the …
Official PYQ2023Programming and Data StructuresArrays, Stacks and QueuesNAT · 2 marks
Consider a sequence aa of elements a0=1,a1=5,a2=7,a3=8,a4=9a_{0}=1, a_{1}=5, a_{2}=7, a_{3}=8, a_{4}=9, and a5=2a_{5}=2. The following operations are performed on a stack SS and a queue Q,Q, both of which are initially empty. push\textsf{push} the elements of aa from a0a_{0} to a5a_{5} in that order into SS. enqueue\textsf{enqueue} the elements of aa from …
Official PYQ2023DatabasesTuple Calculus and SQLNAT · 2 marks
Consider the following table named Student\text{Student} in a relational database. The primary key of this table is rollNum.\text{rollNum}. Student\text{Student} …
Official PYQ2023Compiler DesignSyntax-directed TranslationNAT · 2 marks
Consider the syntax directed translation given by the following grammar and semantic rules. Here N,I,FN, I, F and BB are non-terminals. NN is the starting non-terminal, and #,0\#, \mathbf{0} and 1\mathbf{1} are lexical tokens corresponding to input letters “#", “0" and “1",\text{“\#", “0" and “1"}, respectively. X.valX.val denotes the synthesized attribute (a …
Official PYQ2023Theory of ComputationRegular Expressions and Finite AutomataNAT · 2 marks
Consider the language LL over the alphabet {0,1}\{0,1\}, given below: L={w∈{0,1}∗∣w does not contain three or more consecutive 1 ’s }.L=\left\{w \in\{0,1\}^{*} \mid w \text{ does not contain three or more consecutive } 1 \text{ 's }\right\} . The minimum number of states in a Deterministic Finite-State Automaton (DFA)\text{(DFA)} for LL is ____________.
Official PYQ2023DatabasesFile Organization and Indexing (B and B+ Trees)NAT · 2 marks
Consider a database of fixed-length records, stored as an ordered file. The database has 25,00025,000 records, with each record being 100100 bytes, of which the primary key occupies 1515 bytes. The data file is block-aligned in that each data record is fully contained within a block. The database is indexed by a primary index file, which is also stored as a …
Official PYQ2023Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageNAT · 2 marks
An 88-way set associative cache of size 64 KB  (1 KB=1024  bytes)64 \mathrm{~KB} \;(1 \mathrm{~KB}=1024\; \text{bytes}) is used in a system with 3232-bit address. The address is sub-divided into TAG, INDEX,\text{TAG, INDEX}, and BLOCK OFFSET.\text{BLOCK OFFSET.} The number of bits in the TAG\text{TAG} is ___________.
Official PYQ2023Computer NetworksFragmentation and IP Addressing, IPv4, CIDRNAT · 2 marks
The forwarding table of a router is shown below. …
Official PYQ2023General AptitudeMCQ · 1 mark
We reached the station late, and _______ missed the train.
Official PYQ2023General AptitudeMCQ · 1 mark
Kind : _______ : : Often : Frequently (By word meaning)
Official PYQ2023General AptitudeMCQ · 1 mark
A series of natural numbers F1,F2,F3,F4,F5,F6,F7,…F_1, F_2, F_3, F_4, F_5, F_6, F_7, \ldots obeys Fn+1=Fn+Fn−1F_{n+1}=F_n+F_{n-1} for all integers n≥2n \geq 2. If F6=37,F_6=37, and F7=60,F_7=60, then what is F1?F_1 ?
Official PYQ2023General AptitudeMCQ · 1 mark
A survey for a certain year found that 90%90\% of pregnant women received medical care at least once before giving birth. Of these women, 60%60\% received medical care from doctors, while 40%40\% received medical care from other healthcare providers. Given this information, which one of the following statements can be inferred with certainty?
Official PYQ2023General AptitudeMCQ · 1 mark
Looking at the surface of a smooth 33-dimensional object from the outside, which one of the following options is TRUE?\text{TRUE}?