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 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 \%. …
Official PYQ2020DatabasesFile Organization and Indexing (B and B+ Trees)NAT · 2 marks
Consider a database implemented using B+B^+ tree for file indexing and installed on a disk drive with block size of 4 KB\text{4 KB}. The size of search key is 12 bytes\text{12 bytes} and the size of tree/disk pointer is 8 bytes\text{8 bytes}. Assume that the database has one million records. Also assume that no node of the B+B^+ tree and no records are present …
Official PYQ2020Engineering MathematicsGraphs: Connectivity, Matching, ColouringNAT · 2 marks
Graph GG is obtained by adding vertex ss to K3,4K_{3,4} and making ss adjacent to every vertex of K3,4K_{3,4}. The minimum number of colours required to edge-colour GG is _______
Official PYQ2020Computer NetworksTransport Layer: Flow Control, Congestion Control, UDP, TCP, SocketsNAT · 2 marks
Consider a TCP\textsf{TCP} connection between a client and a server with the following specifications; the round trip time is 66 ms, the size of the receiver advertised window is 5050 KB, slow-start threshold at the client is 3232 KB, and the maximum segment size is 22 KB. The connection is established at time t=0t=0. Assume that there are no …
Official PYQ2019General AptitudeMCQ · 1 mark
The expenditure on the project _____ as follows: equipment Rs.2020 lakhs, salaries Rs.1212 lakhs, and contingency Rs.33 lakhs.
Official PYQ2019General AptitudeMCQ · 1 mark
The search engine’s business model ____ around the fulcrum of trust.
Official PYQ2019General AptitudeMCQ · 1 mark
Ten friends planned to share equally the cost of buying a gift for their teacher. When two of them decided not to contribute, each of the other friends had to pay Rs. 150150 more. The cost of the gift was Rs. ____