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 PYQ2015Software Engineering (Historical)MCQ · 1 mark
Consider the following software items: Program-XX, Control Flow Diagram of Program-YY and Control Flow Diagram of Program-ZZ as shown below The values of McCabe's Cyclomatic complexity of program-XX, program-YY, and program-ZZ respectively are
Official PYQ2015Programming and Data StructuresProgramming in CNAT · 1 mark
Consider the following C program: #include<stdio.h> int f1(void); int f2(void); int f3(void); int x=10; int main() { int x=1; x += f1() + f2 () + f3() + f2(); printf("%d", x); return 0; } int f1() { int x = 25; x++; return x;} int f2() { static int x = 50; x++; return x;} int f3() { x *= 10; return x;} The output of the program is ______.
Official PYQ2015Theory of ComputationUndecidabilityMCQ · 1 mark
Language L1L_1 is polynomial time reducible to language L2L_2. Language L3L_3 is polynomial time reducible to language L2L_2, which in turn polynomial time reducible to language L4L_4. Which of the following is/are true?  if L4∈P, then L2∈P\text{ if } L_4 \in P, \text{ then } L_2 \in P  if L1∈P or L3∈P, then L2∈P\text{ if } L_1 \in P\text{ or } L_3 \in P, \text{ then } L_2 \in P …
Official PYQ2015Operating SystemDeadlockMCQ · 1 mark
Consider the following policies for preventing deadlock in a system with mutually exclusive resources. Process should acquire all their resources at the beginning of execution. If any resource is not available, all resources acquired so far are released. The resources are numbered uniquely, and processes are allowed to request for resources only in …
Official PYQ2015Computer Organization and ArchitectureInstruction PipeliningNAT · 1 mark
Consider the following reservation table for a pipeline having three stages S1,S2 and S3S_1, S_2 \text{ and } S_3. …
Official PYQ2015Numerical Methods (Historical)NAT · 1 mark
The velocity vv (in kilometer/minute) of a motorbike which starts form rest, is given at fixed intervals of time tt (in minutes) as follows: t2468101214161820 v10182529322011520 The approximate distance (in kilometers) rounded to two places of decimals covered in 20 minutes using Simpson's 1/3rd1/3^{rd} rule is ________.
Official PYQ2015AlgorithmsAsymptotic Worst Case Time and Space ComplexityNAT · 1 mark
Suppose c=⟨c[0],…,c[k−1]⟩c = \langle c[0], \dots, c[k-1]\rangle is an array of length kk, where all the entries are from the set {0,1}\{0, 1\}. For any positive integers a and na \text{ and } n, consider the following pseudocode. DOSOMETHING (c, a, n) z ← 1 for i ← 0 to k-1 do z ← z² mod n if c[i]=1 then z ← (z × a) mod n return z If …
Official PYQ2015Programming and Data StructuresProgramming in CNAT · 1 mark
Consider the following C program: #include<stdio.h> int main() { int i, j, k = 0; j=2 * 3 / 4 + 2.0 / 5 + 8 / 5; k-=--j; for (i=0; i<5; i++) { switch(i+k) { case 1: case 2: printf("\n%d", i+k); case 3: printf("\n%d", i+k); default: printf("\n%d", i+k); } } return 0; } The number of times printf statement is executed is _______.
Official PYQ2015Computer Organization and ArchitecturePipeline HazardsMCQ · 1 mark
Consider the following code sequence having five instructions from I1 to I5I_1 \text{ to } I_5. Each of these instructions has the following format. OP Ri, Rj, Rk Where operation OP is performed on contents of registers Rj and Rk and the result is stored in register Ri. I1I_1: ADD R1, R2, R3 I2I_2: MUL R7, R1, R3 I3I_3: SUB R4, R1, R5 I4I_4: ADD R3, R2, …
Official PYQ2015DatabasesFile Organization and Indexing (B and B+ Trees)NAT · 1 mark
Consider a B+B^+ tree in which the search key is 1212 bytes\text{bytes} long, block size is 10241024 bytes\text{bytes}, record pointer is 1010 bytes\text{bytes} long and the block pointer is 88 bytes\text{bytes} long. The maximum number of keys that can be accommodated in each non-leaf node of the tree is ______.
Official PYQ2015Engineering MathematicsMaxima and Minima, Mean Value Theorem, IntegrationMCQ · 1 mark
If for non-zero x, af(x)+bf(1x)=1x−25x, \: af(x) + bf(\frac{1}{x}) = \frac{1}{x} - 25 where a≠b then ∫12f(x)dxa \neq b \text{ then } \int\limits_1^2 f(x)dx is
Official PYQ2015Digital LogicBoolean AlgebraMCQ · 1 mark
Given the function F=P′+QRF = P' +QR, where FF is a function in three Boolean variables P,QP, Q and RR and P′=!PP'=!P, consider the following statements. (S1)F=∑(4,5,6)(S1) F = \sum(4, 5, 6) (S2)F=∑(0,1,2,3,7)(S2) F = \sum(0, 1, 2, 3, 7) (S3)F=Π(4,5,6)(S3) F = \Pi (4, 5, 6) (S4)F=Π(0,1,2,3,7)(S4) F = \Pi (0, 1, 2, 3, 7) Which of the following is true?
Official PYQ2015Digital LogicBoolean AlgebraNAT · 1 mark
The total number of prime implicants of the function f(w,x,y,z)=∑(0,2,4,5,6,10)f(w, x, y, z) = \sum (0, 2, 4, 5, 6, 10) is __________
Official PYQ2015AlgorithmsAsymptotic Worst Case Time and Space ComplexityMCQ · 1 mark
Let f(n)=nf(n) = n and g(n)=n(1+sin⁡ n)g(n) = n^{(1 + \sin \: n)}, where nn is a positive integer. Which of the following statements is/are correct? f(n)=O(g(n))f(n) = O(g(n)) f(n)=Ω(g(n))f(n) = \Omega(g(n))
Official PYQ2015Engineering MathematicsSets, Relations and FunctionsMCQ · 1 mark
Let RR be a relation on the set of ordered pairs of positive integers such that ((p,q),(r,s))∈R((p,q),(r,s)) \in R if and only if p−s=q−rp-s=q-r. Which one of the following is true about RR?
Official PYQ2015AlgorithmsMinimum Spanning TreesNAT · 1 mark
Let GG be a connected undirected graph of 100100 vertices and 300300 edges. The weight of a minimum spanning tree of GG is 500500. When the weight of each edge of GG is increased by five, the weight of a minimum spanning tree becomes ______.
Official PYQ2015AlgorithmsAsymptotic Worst Case Time and Space ComplexityMCQ · 1 mark
Consider the following recursive C function. void get(int n) { if (n<1) return; get (n-1); get (n-3); printf("%d", n); } If get(6)get(6) function is being called in main()main() then how many times will the get()get() function be invoked before returning to the main()main()?
Official PYQ2015Computer NetworksFragmentation and IP Addressing, IPv4, CIDRNAT · 1 mark
In the network 200.10.11.144/27200.10.11.144/27, the fourth\text{fourth} octet (in decimal) of the last IP\text{IP} address of the network which can be assigned to a host is _______.
Official PYQ2015Engineering MathematicsProbability: Random Variables and DistributionsNAT · 1 mark
Suppose XiX_i for i=1,2,3i=1, 2, 3 are independent and identically distributed random variables whose probability mass functions are Pr[Xi=0]=Pr[Xi=1]=12 for i=1,2,3Pr[X_i = 0] = Pr[X_i = 1] = \frac{1} {2} \text{ for } i = 1, 2, 3. Define another random variable Y=X1X2⊕X3Y = X_1X_2 \oplus X_3, where ⊕\oplus denotes XOR. Then Pr[Y=0∣X3=0]=Pr[Y=0 \mid X_3 = 0] =______.
Official PYQ2015Computer NetworksPacket, Circuit and Virtual Circuit SwitchingNAT · 1 mark
Two hosts are connected via a packet switch with 10710^7 bits per second links. Each link has a propagation delay of 2020 microseconds. The switch begins forwarding a packet 3535 microseconds after it receives the same. If 1000010000 bits of data are to be transmitted between the two hosts using a packet size of 50005000 bits, the time elapsed between …