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
The following program consists of concurrent processes and binary semaphores. The semaphores are initialized as and …
The following program is to be tested for statement coverage: begin if (a==b) {S1; exit;} else if (c==d) {S2;} else {S3; exit;} S4; end The test cases T1, T2, T3 and T4 given below are expressed in terms of the properties satisfied by the values of variables and . The exact values are not given. T1: a, b, c and d are all equal T2: a, b, c …
The following functional dependencies hold for relations and The relation contains tuples and the relation contains tuples. What is the maximum number of tuples possible in the natural join ?
Consider the following schedule for transactions and …
Let be any string of length in . Let be the set of all substrings of . What is the minimum number of states in non-deterministic finite automation that accepts ?
Consider the languages
Let . i.e., is the set of all the bit strings with even numbers of s. Which one of the regular expressions below represents ?
The grammar is
The program below uses six temporary variables . a = 1 b = 10 c = 20 d = a + b e = c + d f = c + e b = c + e e = b + f d = 5 + e return d + f Assuming that all operations take their operands from registers, what is the minimum number of registers needed to execute this program without spilling?
The following C function takes a singly-linked list as input argument. It modifies the list by moving the last element to the front of the list and returns the modified list. Some part of the code is left blank. typedef struct node { int value; struct node *next; } Node; Node *move_to-front(Node *head) { Node *p, *q; if ((head == NULL) || (head -> next == …
What is the value printed by the following C program? #include<stdio.h> int f(int *a, int n) { if (n <= 0) return 0; else if (*a % 2 == 0) return *a+f(a+1, n-1); else return *a - f(a+1, n-1); } int main() { int a[] = {12, 7, 13, 4, 11, 6}; printf("%d", f(a, 6)); return 0; }
The weight of a sequence of real numbers is defined as . A subsequence of a sequence is obtained by deleting some elements from the sequence, keeping the order of the remaining elements the same. Let denote the maximum possible weight of a subsequence of and …
A stage pipelined processor has Instruction Fetch (IF), Instruction Decode (ID), Operand Fetch (OF), Perform Operation (PO) and Write Operand (WO) stages. The IF, ID, OF and WO stages take clock cycle each for any instruction. The PO stage takes clock cycle for ADD and SUB instructions, clock cycles for MUL instruction and clock …
In the sequential circuit shown below, if the initial value of the output is . What are the next four values of ?
What is the boolean expression for the output of the combinational logic circuit of NOR gates given below?
Which of the following statements are true? Shortest remaining time first scheduling may cause starvation Preemptive scheduling may cause starvation Round robin is better than FCFS in terms of response time
A system uses FIFO policy for system replacement. It has page frames with no pages loaded to begin with. The system first accesses distinct pages in some order and then accesses the same pages but now in the reverse order. How many page faults will occur?
What is the appropriate pairing of items in the two columns listing various activities encountered in a software life cycle? P. Requirements Capture 1. Module Development and Integration Q. Design 2. Domain Analysis R. Implementation 3. Structural and Behavioral Modeling S. Maintenance 4. Performance Tuning
Consider the methods used by processes and for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables and are randomly assigned. …
The cyclomatic complexity of each of the modules and shown below is What is the cyclomatic complexity of the sequential integration shown on the right hand side?
