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 PYQ2006Compiler DesignParsing (LL, LR)MCQ · 1 mark
The grammar S→AC∣CBS\rightarrow AC\mid CB C→aCb∣ϵC\rightarrow aCb\mid \epsilon A→aA∣aA\rightarrow aA\mid a B→Bb∣bB\rightarrow Bb\mid b generates the language L={aibj∣i≠j}L=\left \{ a^{i}b^{j}\mid i\neq j \right \}. In this grammar what is the length of the derivation (number of steps starting from SS) to generate the string albma^{l}b^{m} with l≠ml\neq m
Official PYQ2006Programming and Data StructuresBinary HeapsMCQ · 1 mark
Statement for Linked Answer Questions 76 & 77: A 33-ary max heap is like a binary max heap, but instead of 22 children, nodes have 33 children. A 33-ary heap can be represented by an array as follows: The root is stored in the first location, a[0]a[0], nodes in the next level, from left to right, is stored from a[1]a[1] to a[3]a[3]. The nodes …
Official PYQ2006Computer NetworksData Link Layer: Framing, Error Detection, MAC, Ethernet BridgingMCQ · 1 mark
Consider the diagram shown below where a number of LANs are connected by (transparent) bridges. In order to avoid packets looping through circuits in the graph, the bridges organize themselves in a spanning tree. First, the root bridge is identified as the bridge with the least serial number. Next, the root sends out (one or more) data units to enable the …
Official PYQ2006Engineering MathematicsGraphs: Connectivity, Matching, ColouringMCQ · 1 mark
The 2n2^n vertices of a graph GG corresponds to all subsets of a set of size nn, for n≥6n \geq 6. Two vertices of GG are adjacent if and only if the corresponding sets intersect in exactly two elements. The number of connected components in GG is:
Official PYQ2006Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageMCQ · 1 mark
Consider two cache organizations. First one is 3232 kBkB 22-way set associative with 3232 bytebyte block size, the second is of same size but direct mapped. The size of an address is 3232 bitsbits in both cases . A 22-to-11 multiplexer has latency of 0.6ns0.6 ns while a k−k-bit comparator has latency of k10ns\frac{k}{10} ns. The hit latency …
Official PYQ2006Engineering MathematicsGraphs: Connectivity, Matching, ColouringMCQ · 1 mark
The 2n2^n vertices of a graph GG corresponds to all subsets of a set of size nn, for n≥6n \geq 6. Two vertices of GG are adjacent if and only if the corresponding sets intersect in exactly two elements. The maximum degree of a vertex in GG is:
Official PYQ2006Operating SystemConcurrency and SynchronizationMCQ · 1 mark
Barrier is a synchronization construct where a set of processes synchronizes globally i.e., each process in the set arrives at the barrier and waits for all others to arrive and then all processes leave the barrier. Let the number of processes in the set be three and SS be a binary semaphore with the usual PP and VV functions. Consider the following …
Official PYQ2006Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageMCQ · 1 mark
A CPU has a 3232 KBKB direct mapped cache with 128128 byte-block size. Suppose AA is two dimensional array of size 512×512512 \times512 with elements that occupy 8−bytes8-bytes each. Consider the following two CC code segments, P1P1 and P2P2. P1P1: for (i=0; i<512; i++) { for (j=0; j<512; j++) { x +=A[i] [j]; } } P2: for (i=0; i<512; i++) …
Official PYQ2006Compiler DesignParsing (LL, LR)MCQ · 1 mark
Which one of the following grammars generates the language L={aibj∣i≠j}L=\left \{ a^{i}b^{j}\mid i\neq j \right \}?
Official PYQ2006Computer NetworksData Link Layer: Framing, Error Detection, MAC, Ethernet BridgingMCQ · 1 mark
Consider the diagram shown below where a number of LANs are connected by (transparent) bridges. In order to avoid packets looping through circuits in the graph, the bridges organize themselves in a spanning tree. First, the root bridge is identified as the bridge with the least serial number. Next, the root sends out (one or more) data units to enable the …
Official PYQ2006Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageMCQ · 1 mark
A CPU has a 32KB32 KB direct mapped cache with 128128 byte-block size. Suppose A is two dimensional array of size 512×512512 \times512 with elements that occupy 88-bytes each. Consider the following two C code segments, P1P1 and P2P2. P1: for (i=0; i<512; i++) { for (j=0; j<512; j++) { x +=A[i] [j]; } } P2: for (i=0; i<512; i++) { for (j=0; …
Official PYQ2006Operating SystemConcurrency and SynchronizationMCQ · 1 mark
Barrier is a synchronization construct where a set of processes synchronizes globally i.e., each process in the set arrives at the barrier and waits for all others to arrive and then all processes leave the barrier. Let the number of processes in the set be three and SS be a binary semaphore with the usual PP and VV functions. Consider the following …
Official PYQ2006Programming and Data StructuresBinary HeapsMCQ · 1 mark
Statement for Linked Answer Questions 76 & 77: A 33-ary max heap is like a binary max heap, but instead of 22 children, nodes have 33 children. A 33-ary heap can be represented by an array as follows: The root is stored in the first location, a[0]a[0], nodes in the next level, from left to right, is stored from a[1]a[1] to a[3]a[3]. The nodes …
Official PYQ2006Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageMCQ · 1 mark
Consider two cache organizations. First one is 32  KB  2-way32 \; \textsf{KB}\;2\text{-way} set associative with 32  byte32 \; \text{byte} block size, the second is of same size but direct mapped. The size of an address is 32  bits32\; \text{bits} in both cases . A 2-to-12\text{-to-}1 multiplexer has latency of 0.6  ns0.6 \; \text{ns} while a k-bitk\text{-bit} comparator has …
Official PYQ2006Engineering MathematicsGraphs: Connectivity, Matching, ColouringMCQ · 1 mark
The 2n2^n vertices of a graph GG corresponds to all subsets of a set of size nn, for n≥6n \geq 6. Two vertices of GG are adjacent if and only if the corresponding sets intersect in exactly two elements. The number of vertices of degree zero in GG is:
Official PYQ2006DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the relation enrolled (student, course) in which (student, course) is the primary key, and the relation paid (student, amount) where student is the primary key. Assume no null values and no foreign keys or integrity constraints. Assume that amounts 6000,7000,8000,90006000, 7000, 8000, 9000 and 1000010000 were each paid by 20%20\% of the students. Consider these …
Official PYQ2006DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the relation enrolled (student, course) in which (student, course) is the primary key, and the relation paid (student, amount) where student is the primary key. Assume no null values and no foreign keys or integrity constraints. Given the following four queries: Query1: select student from enrolled where student in (select student from paid) Query2: …
Official PYQ2006DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the relation account (customer, balance) where the customer is a primary key and there are no null values. We would like to rank customers according to decreasing balance. The customer with the largest balance gets rank 1.1. Ties are not broke but ranks are skipped: if exactly two customers have the largest balance they each get rank 11 and …
Official PYQ2006Operating SystemDeadlockMCQ · 1 mark
Consider the following snapshot of a system running nn processes. Process ii is holding xix_i instances of a resource RR, 1≤i≤n1\leq i\leq n . Currently, all instances of RR are occupied. Further, for all ii, process ii has placed a request for an additional yiy_i instances while holding the xix_i instances it already has. There are …
Official PYQ2006Operating SystemCPU SchedulingMCQ · 1 mark
Consider three processes, all arriving at time zero, with total execution time of 1010, 2020 and 3030 units, respectively. Each process spends the first 20%\text{20\%} of execution time doing I/O, the next 70%\text{70\%} of time doing computation, and the last 10%\text{10\%} of time doing I/O again. The operating system uses a shortest remaining …