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 PYQ2018General AptitudeMCQ · 2 marks
In appreciation of the social improvements completed in a town, a wealthy philanthropist decided to gift Rs  750Rs\; 750 to each male senior citizen in the town and Rs  1000Rs\; 1000 to each female senior citizen. Altogether, there were 300 senior citizens eligible for this gift. However, only 89th\dfrac{8}{9}^{\text{th}} of the eligible men and …
Official PYQ2018General AptitudeMCQ · 1 mark
The area of a square is dd. What is the area of the circle which has the diagonal of the square as its diameter?
Official PYQ2018General AptitudeMCQ · 1 mark
What would be the smallest natural number which when divided either by 2020 or by 4242 or by 7676 leaves a remainder of 77 in each case?
Official PYQ2018General AptitudeMCQ · 1 mark
A ________ investigation can sometimes yield new facts, but typically organized ones are more successful. The word that best fills the blank in the above sentence is
Official PYQ2018General AptitudeMCQ · 1 mark
"From where are they bringing their books? _______ bringing _______ books from ________" The words that best fill the blanks in the above sentence are
Official PYQ2017Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageNAT · 1 mark
A cache memory unit with capacity of NN words and block size of BB words is to be designed. If it is designed as a direct mapped cache, the length of the TAG\textsf{TAG} field is 1010 bits. If the cache unit is now designed as a 1616-way set-associative cache, the length of the TAG\textsf{TAG} field is ____________ bits.
Official PYQ2017Compiler DesignRuntime EnvironmentsNAT · 1 mark
Consider the expression (a−1)∗(((b+c)/3)+d)(a-1) * (((b+c)/3)+d). Let XX be the minimum number of registers required by an optimal code generation (without any register spill) algorithm for a load/store architecture, in which only load and store instructions can have memory operands and arithmetic instructions can have only register or immediate operands. ​​​​​​​The …
Official PYQ2017Computer Organization and ArchitectureMemory Hierarchy: Cache, Main Memory and Secondary StorageNAT · 1 mark
Consider a 22-way set associative cache with 256256 blocks and uses LRU\text{LRU} replacement. Initially the cache is empty. Conflict misses are those misses which occur due to the contention of multiple blocks for the same cache set. Compulsory misses occur due to first time access to the block. The following sequence of access to memory blocks : …
Official PYQ2017Programming and Data StructuresLinked ListsMCQ · 1 mark
Consider the C code fragment given below. typedef struct node { int data; node* next; } node; void join(node* m, node* n) { node* p = n; while(p->next != NULL) { p = p->next; } p->next = m; } Assuming that m and n point to valid NULL-terminated linked lists, invocation of join will
Official PYQ2017Computer Organization and ArchitectureInstruction PipeliningNAT · 1 mark
Instruction execution in a processor is divided into 55 stages, Instruction Fetch (IF), Instruction Decode (ID), Operand fetch (OF), Execute (EX), and Write Back (WB). These stages take 5, 4, 20, 10 and 3 nanoseconds (ns) respectively. A pipelined implementation of the processor requires buffering between each pair of consecutive stages with a delay of 2 …
Official PYQ2017AlgorithmsAlgorithm Design: Greedy TechniquesMCQ · 1 mark
Consider the following table: …
Official PYQ2017AlgorithmsAsymptotic Worst Case Time and Space ComplexityMCQ · 1 mark
Consider the following functions from positive integers to real numbers: 1010, n\sqrt{n}, nn, log⁡2n\log_{2}n, 100n\frac{100}{n}. The CORRECT arrangement of the above functions in increasing order of asymptotic complexity is:
Official PYQ2017Engineering MathematicsPropositional and First Order LogicMCQ · 1 mark
Consider the first-order logic sentence F:∀x(∃yR(x,y))F:\forall x(\exists yR(x,y)). Assuming non-empty logical domains, which of the sentences below are implied by FF? ∃y(∃xR(x,y))\exists y(\exists xR(x,y)) ∃y(∀xR(x,y))\exists y(\forall xR(x,y)) ∀y(∃xR(x,y))\forall y(\exists xR(x,y)) ¬∃x(∀y¬R(x,y))¬\exists x(\forall y¬R(x,y))
Official PYQ2017Engineering MathematicsPropositional and First Order LogicMCQ · 1 mark
The statement (¬p)⇒(¬q)\left ( ¬p \right ) \Rightarrow \left ( ¬q \right ) is logically equivalent to which of the statements below? p⇒qp \Rightarrow q q⇒pq \Rightarrow p (¬q)∨p\left ( ¬q \right ) \vee p (¬p)∨q\left ( ¬p \right ) \vee q
Official PYQ2017Programming and Data StructuresProgramming in CNAT · 1 mark
The output of executing the following C program is _______________ . #include<stdio.h> int total(int v) { static int count = 0; while(v) { count += v&1; v >>= 1; } return count; } void main() { static int x=0; int i=5; for(; i>0; i--) { x = x + total(i); } printf("%d\n", x); }
Official PYQ2017Programming and Data StructuresProgramming in CNAT · 1 mark
Consider the following C program. #include<stdio.h> #include<string.h> void printlength(char *s, char *t) { unsigned int c=0; int len = ((strlen(s) - strlen(t)) > c) ? strlen(s) : strlen(t); printf("%d\n", len); } void main() { char *x = "abc"; char *y = "defgh"; printlength(x,y); } Recall that strlenstrlen is defined in string.hstring.h as …
Official PYQ2017General AptitudeMCQ · 1 mark
A contour line joins locations having the same height above the mean sea level. The following is a contour plot of a geographical region. Contour lines are shown at 2525 m intervals in this plot. If in a flood, the water level rises to 525525 m, which of the villages P,Q,R,S,TP, Q, R, S, T get submerged?
Official PYQ2017General AptitudeMCQ · 1 mark
Arun, Gulab, Neel and Shweta must choose one shirt each from a pile of four shirts coloured red, pink, blue and white respectively. Arun dislikes the colour red and Shweta dislikes the colour white. Gulab and Neel like all the colours. In how many different ways can they choose the shirts so that no one has a shirt with a colour he or she dislikes?
Official PYQ2017General AptitudeMCQ · 1 mark
The expression (x+y)−∣x−y∣2\large \frac{(x+y) - |x-y|}{2} is equal to :
Official PYQ2017General AptitudeMCQ · 1 mark
"The hold of the nationalist imagination on our colonial past is such that anything inadequately or improperly nationalist is just not history." Which of the following statements best reflects the author's opinion?