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 PYQ2020Theory of ComputationRegular and Context-free LanguagesMCQ · 2 marks
Consider the following languages. L1={wxyx∣w,x,y∈(0+1)+}L2={xy∣x,y∈(a+b)∗,∣x∣=∣y∣,x≠y}\begin{array}{ll} L_1= \{ wxyx \mid w,x,y \in (0+1)^{+} \} \\ L_2= \{xy \mid x,y \in (a+b)^{*}, \mid x \mid=\mid y \mid, x \neq y \} \end{array} Which one of the following is TRUE?
Official PYQ2020Operating SystemConcurrency and SynchronizationMCQ · 2 marks
Each of a set of nn processes executes the following code using two semaphores aa and bb initialized to 11 and 00, respectively. Assume that count\text{count} is a shared variable initialized to 00 and not used in CODE SECTION P. CODE SECTION P\begin{array}{|c|} \hline \textbf{CODE SECTION P} \\ \hline \end{array} wait(a); count=count+1; if (count==n) …
Official PYQ2020Compiler DesignSyntax-directed TranslationMCQ · 2 marks
Consider the productions A→PQA \rightarrow PQ and A→XYA \rightarrow XY. Each of the five non-terminals A,P,Q,X,A, P, Q, X, and YY has two attributes: ss is a synthesized attribute, and ii is an inherited attribute. Consider the following rules. Rule 1:P.i=A.i+2, Q.i=P.i+A.i,1: P . i = A.i + 2, \: Q.i = P. i + A.i, and A.s=P.s+Q.sA.s = P.s +Q. s Rule 2:X.i=A.i+Y.s2: X.i = A.i + Y.s and …
Official PYQ2020Operating SystemI/O SchedulingMCQ · 2 marks
Consider the following five disk access requests of the form (request id, cylinder number) that are present in the disk scheduler queue at a given time. (P,155),(Q,85),(R,110),(S,30),(T,115)(P, 155), (Q,85), (R,110),(S, 30), (T,115) Assume the head is positioned at cylinder 100100. The scheduler follows Shortest Seek Time First scheduling to service the requests. Which one of the following …
Official PYQ2020DatabasesNormal FormsMCQ · 2 marks
Consider a relational table RR that is in 3NF3NF, but not in BCNF. Which one of the following statements is TRUE?
Official PYQ2020Engineering MathematicsPropositional and First Order LogicMCQ · 2 marks
Which one of the following predicate formulae is NOT logically valid? Note that WW is a predicate formula without any free occurrence of xx.
Official PYQ2020AlgorithmsShortest Paths (Dijkstra, Bellman-Ford)MCQ · 2 marks
Let G=(V,E)G = (V,E) be a directed, weighted graph with weight function w:E→Rw: E \rightarrow \mathbb{R}. For some function f:V→Rf: V \rightarrow \mathbb{R}, for each edge(u,v)∈E(u,v)\in E, define w′(u,v){w}'(u,v) as w(u,v)+f(u)−f(v)w(u,v)+f(u)-f(v). Which one of the options completes the following sentence so that it is TRUE? “The shortest paths in GG under ww are shortest …
Official PYQ2020Computer NetworksFragmentation and IP Addressing, IPv4, CIDRMCQ · 2 marks
An organization requires a range of IP address to assign one to each of its 15001500 computers. The organization has approached an Internet Service Provider (ISP) for this task. The ISP uses CIDR and serves the requests from the available IP address space 202.61.0.0/17202.61.0.0/17. The ISP wants to assign an address space to the organization which will minimize the …
Official PYQ2020Programming and Data StructuresBinary Search TreesMCQ · 2 marks
In a balanced binary search tree with nn elements, what is the worst case time complexity of reporting all elements in range [a,b][a,b]? Assume that the number of reported elements is kk.
Official PYQ2020Engineering MathematicsCombinatorics: Counting, Recurrence Relations, Generating FunctionsNAT · 2 marks
The number of permutations of the characters in LILAC so that no character appears in its original position, if the two L’s are indistinguishable, is ______.
Official PYQ2020Computer Organization and ArchitectureInstruction PipeliningNAT · 2 marks
Consider a non-pipelined processor operating at 2.52.5 GHz. It takes 55 clock cycles to complete an instruction. You are going to make a 55- stage pipeline out of this processor. Overheads associated with pipelining force you to operate the pipelined processor at 22 GHz. In a given program, assume that 30%30\% are memory instructions, 60%60 \% …
Official PYQ2020Computer Organization and ArchitectureMachine Instructions and Addressing ModesNAT · 2 marks
A processor has 6464 registers and uses 1616-bit instruction format. It has two types of instructions: I-type and R-type. Each I-type instruction contains an opcode, a register name, and a 44-bit immediate value. Each R-type instruction contains an opcode and two register names. If there are 88 distinct I-type opcodes, then the maximum number of …
Official PYQ2020Engineering MathematicsProbability: Random Variables and DistributionsNAT · 2 marks
For n>2n>2, let a∈{0,1}na \in \{0,1\}^n be a non-zero vector. Suppose that xx is chosen uniformly at random from {0,1}n\{0,1\}^n. Then, the probability that Σi=1naixi\displaystyle{} \Sigma_{i=1}^n a_i x_i is an odd number is______________
Official PYQ2020Programming and Data StructuresRecursionNAT · 2 marks
Consider the following C functions. int fun1(int n) { static int i= 0; if (n > 0) { ++i; fun1(n-1); } return (i); } int fun2(int n) { static int i= 0; if (n>0) { i = i+ fun1 (n) ; fun2(n-1) ; } return (i); } The return value of fun2(5)\text{fun}2 (5) is _________
Official PYQ2020Programming and Data StructuresBinary HeapsNAT · 2 marks
Consider the array representation of a binary min-heap containing 10231023 elements. The minimum number of comparisons required to find the maximum in the heap is ___________.
Official PYQ2020AlgorithmsAsymptotic Worst Case Time and Space ComplexityNAT · 2 marks
Consider the following C functions. int tob (int b, int* arr) { int i; for (i = 0; b>0; i++) { if (b%2) arr [i] = 1; else arr[i] = 0; b = b/2; } return (i); } int pp(int a, int b) { int arr[20]; int i, tot = 1, ex, len; ex = a; len = tob(b, arr); for (i=0; i<len ; i++) { if (arr[i] ==1) tot = tot * ex; ex= ex*ex; } return (tot) ; } The value returned …
Official PYQ2020AlgorithmsMinimum Spanning TreesNAT · 2 marks
Consider a graph G=(V,E)G = (V,E), where V={v1,v2,…,v100}V = \{v_1,v_2, \dots ,v_{100}\}, E={(vi,vj)∣1≤i<j≤100}E = \{(v_i,v_j) \mid 1\leq i < j \leq 100\}, and weight of the edge (vi,vj)(v_i,v_j) is ∣i–j∣\mid i – j \mid. The weight of minimum spanning tree of GG is _________
Official PYQ2020Operating SystemCPU SchedulingNAT · 2 marks
Consider the following set of processes, assumed to have arrived at time 00. Consider the CPU scheduling algorithms Shortest Job First (SJF) and Round Robin (RR). For RR, assume that the processes are scheduled in the orderP1,P2,P3,P4P_1, P_2, P_3, P_4. …
Official PYQ2020Theory of ComputationRegular and Context-free LanguagesNAT · 2 marks
Consider the following language. L={x∈{a,b}∗∣L = \{{ x\in \{a,b\}^*\mid}number of aa’s in xx divisible by 22 but not divisible by 3}3\} The minimum number of states in DFA that accepts LL is _________
Official PYQ2020Operating SystemMemory Management and Virtual MemoryNAT · 2 marks
Consider a paging system that uses 11-level page table residing in main memory and a TLB\textsf{TLB} for address translation. Each main memory access takes 100100 ns and TLB\textsf{TLB} lookup takes 2020 ns. Each page transfer to/from the disk takes 50005000 ns. Assume that the TLB\textsf{TLB} hit ratio is 95%95 \%, page fault rate is 10%10 \%. …