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 PYQ2007DatabasesNormal FormsMCQ · 1 mark
Which one of the following statements is FALSE\text{FALSE}?
Official PYQ2007DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the table employee(empId, name, department, salary) and the two queries Q1, Q2Q_1, \, Q_2 below. Assuming that department 55 has more than one employee, and we want to find the employees who get higher salary than anyone in the department 5,5, which one of the statements is TRUE for any arbitrary employee table? Q1:Q_1: Select e.empId From …
Official PYQ2007DatabasesTuple Calculus and SQLMCQ · 1 mark
Consider the relation employee(name, sex, supervisorName) with name as the key, supervisorName gives the name of the supervisor of the employee under consideration. What does the following Tuple Relational Calculus query produce? …
Official PYQ2007Operating SystemConcurrency and SynchronizationMCQ · 1 mark
Two processes, P1P1 and P2P2, need to access a critical section of code. Consider the following synchronization construct used by the processes: /* P1 */ while (true) { wants1 = true; while (wants2 == true); /* Critical Section */ wants1 = false; } /* Remainder section */ /* P2 */ while (true) { wants2 = true; while (wants1 == true); /* Critical Section …
Official PYQ2007Operating SystemDeadlockMCQ · 1 mark
A single processor system has three resource types X,YX, Y and ZZ, which are shared by three processes. There are 55 units of each resource type. Consider the following scenario, where the column alloc denotes the number of units of each resource type allocated to each process, and the column request denotes the number of units of each resource type …
Official PYQ2007Operating SystemMemory Management and Virtual MemoryMCQ · 1 mark
A virtual memory system uses First In First Out (FIFO) page replacement policy and allocates a fixed number of frames to a process. Consider the following statements: P: Increasing the number of page frames allocated to a process sometimes increases the page fault rate. Q: Some programs do not exhibit locality of reference. Which one of the following is …
Official PYQ2007Operating SystemCPU SchedulingMCQ · 1 mark
An operating system used Shortest Remaining System Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes: …
Official PYQ2007Computer Organization and ArchitectureMachine Instructions and Addressing ModesMCQ · 1 mark
In a simplified computer the instructions are: …
Official PYQ2007Compiler DesignParsing (LL, LR)MCQ · 1 mark
Consider the following two statements: P: Every regular grammar is LL(1) Q: Every regular set has a LR(1) grammar Which of the following is TRUE?
Official PYQ2007Compiler DesignParsing (LL, LR)MCQ · 1 mark
Consider the grammar with non-terminals N={S,C,S1}N=\left\{S,C,S_1\right\}, terminals T={a,b,i,t,e}T=\left\{a, b, i, t, e\right\}, with SS as the start symbol, and the following set of rules: S→iCtSS1∣aS \rightarrow iCtSS_1 \mid a S1→eS∣ϵS_1 \rightarrow eS \mid \epsilon C→bC \rightarrow b The grammar is NOT LL(1) because:
Official PYQ2007AlgorithmsAsymptotic Worst Case Time and Space ComplexityMCQ · 1 mark
Consider the following C program segment: int IsPrime (n) { int i, n; for (i=2; i<=sqrt(n);i++) if(n%i == 0) {printf("Not Prime \n"); return 0;} return 1; } Let T(n)T(n) denote number of times the forfor loop is executed by the program on input nn. Which of the following is TRUE?
Official PYQ2007AlgorithmsAsymptotic Worst Case Time and Space ComplexityMCQ · 1 mark
An array of nn numbers is given, where nn is an even number. The maximum as well as the minimum of these nn numbers needs to be determined. Which of the following is TRUE about the number of comparisons needed?
Official PYQ2007AlgorithmsMinimum Spanning TreesMCQ · 1 mark
Let ww be the minimum weight among all edge weights in an undirected connected graph. Let ee be a specific edge of weight ww. Which of the following is FALSE?
Official PYQ2007Digital LogicBoolean AlgebraMCQ · 1 mark
Which of the following is TRUE about formulae in Conjunctive Normal Form?
Official PYQ2007Programming and Data StructuresBinary HeapsMCQ · 1 mark
Consider the process of inserting an element into a Max Heap\text{Max Heap}, where the Max Heap\text{Max Heap} is represented by an array. Suppose we perform a binary search on the path from the new leaf to the root to find the position for the newly inserted element, the number of comparisons performed is:
Official PYQ2007Programming and Data StructuresTreesMCQ · 1 mark
Consider the following C program segment where CellNode\text{CellNode} represents a node in a binary tree: struct CellNode { struct CellNode *leftChild; int element; struct CellNode *rightChild; }; int Getvalue (struct CellNode *ptr) { int value = 0; if (ptr != NULL) { if ((ptr->leftChild == NULL) && (ptr->rightChild == NULL)) value = 1; else value …
Official PYQ2007AlgorithmsAsymptotic Worst Case Time and Space ComplexityMCQ · 1 mark
What is the time complexity\text{time complexity} of the following recursive function? int DoSomething (int n) { if (n <= 2) return 1; else return (DoSomething (floor (sqrt(n))) + n); }
Official PYQ2007AlgorithmsAsymptotic Worst Case Time and Space ComplexityMCQ · 1 mark
In the following C function, let n≥mn \geq m. int gcd(n,m) { if (n%m == 0) return m; n = n%m; return gcd(m,n); } How many recursive calls are made by this function?
Official PYQ2007Programming and Data StructuresTreesMCQ · 1 mark
A complete n−aryn-ary tree is a tree in which each node has nn children or no children. Let II be the number of internal nodes and LL be the number of leaves in a complete n−aryn-ary tree. If L=41L = 41 and I=10I = 10, what is the value of nn?
Official PYQ2007Programming and Data StructuresRecursionMCQ · 1 mark
Consider the following C function: int f(int n) { static int r = 0; if (n <= 0) return 1; if (n > 3) { r = n; return f(n-2) + 2; } return f(n-1) + r; } What is the value of f(5)f(5)?