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
Let denote the number of binary strings of length that contain no consecutive s. Which of the following recurrences does satisfy?
Delayed branching can help in the handling of control hazards For all delayed conditional branch instructions, irrespective of whether the condition evaluates to true or false,
Consider the following C functions: int f1 (int n) { if(n == 0 || n == 1) return n; else return (2 * f1(n-1) + 3 * f1(n-2)); } int f2(int n) { int i; int X[N], Y[N], Z[N]; X[0] = Y[0] = Z[0] = 0; X[1] = 1; Y[1] = 2; Z[1] = 3; for(i = 2; i <= n; i++){ X[i] = Y[i-1] + Z[i-2]; Y[i] = 2 * X[i]; Z[i] = 3 * X[i]; } return X[n]; } The running time of …
Consider a machine with a -way set associative data cache of size and block size . The cache is managed using virtual addresses and the page size is . A program to be run on this machine begins as follows: double ARR[1024][1024]; int i, j; /*Initialize array ARR to 0.0 */ for(i = …
Consider the following relational schemes for a library database: Book (Title, Author, Catalog_no, Publisher, Year, Price) Collection(Title, Author, Catalog_no) with the following functional dependencies: …
Let R and S be two relations with the following schema where is the key for both schemas. Which of the following queries are equivalent? …
A processor uses bit physical address and bit virtual addresses, with a page frame size of Kbytes. Each page table entry is of size bytes. A three level page table is used for virtual to physical address translation, where the virtual address is used as follows: Bits are used to index into the first level page table. Bits …
A process executes the following code for(i=0; i<n; i++) fork(); The total number of child processes created is
Which of the following is NOT true of deadlock prevention and deadlock avoidance schemes?
Which of the following statements about synchronous and asynchronous I/O is NOT true?
The and operations on counting semaphores, where s is a counting semaphore, are defined as follows: If then wait; If then wake up process waiting on s; Assume that and the wait and signal operations on binary semaphores are provided. Two binary semaphores …
The following C function takes a single-linked list of integers as a parameter and rearranges the elements of the list. The function is called with the list containing the integers in the given order. What will be the contents of the list after function completes execution? struct node { int value; struct node *next; }; void …
Choose the correct option to fill and so that the program below prints an input string in reverse order. Assume that the input string is terminated by a new line character. void reverse(void) { int c; if(?1) reverse(); ?2 } main() { printf("Enter text"); printf("\n"); reverse(); printf("\n"); }
A computer on a network is regulated by a token bucket. The token bucket is filled at a rate of . It is initially filled to capacity with . What is the maximum duration for which the computer can transmit at the full ?
What is printed by the following C program? int f(int x, int *py, int **ppz) { int y, z; **ppz += 1; z = **ppz; // corrected z = *ppz; to z = **ppz; *py += 2; y = *py; x += 3; return x+y+z; } void main() { int c, *b, **a; c = 4; b = &c; a = &b; printf("%d", f(c, b, a)); }
A client process P needs to make a TCP connection to a server process S. Consider the following situation: the server process S executes a , a and a system call in that order, following which it is preempted. Subsequently, the client process P executes a system call followed by …
If a class network on the Internet has a subnet mask of , what is the maximum number of hosts per subnet?
In the slow start phase of the TCP congestion algorithm, the size of the congestion window:
An LALR(1) parser for a grammar G can have shift-reduce (S-R) conflicts if and only if
Which of the following are true? A programming language which does not permit global variables of any kind and has no nesting of procedures/functions, but permits recursion can be implemented with static storage allocation Multi-level access link (or display) arrangement is needed to arrange activation records only if the programming language being …
