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
Suppose we want to design a synchronous circuit that processes a string of ’s and ’s. Given a string, it produces another string by replacing the first in any subsequence of consecutive ’s by a . Consider the following example. …
In an examination, a student can choose the order in which two questions ( and ) must be attempted. If the first question is answered wrong, the student gets zero marks. If the first question is answered correctly and the second question is not answered correctly, the student gets the marks only for the first question. If …
Consider the string . Each letter in the string must be assigned a binary code satisfying the following properties: For any two letters, the code assigned to one letter must not be a prefix of the code assigned to the other letter. For any two letters of the same frequency, the letter which occurs earlier in the dictionary order is …
Consider the following code segment: z=x + 3 + y->f1 + y->f2; for (i = 0; i < 200; i = i + 2) { if (z > i) { p = p + x + 3; q = q + y->f1; } else { p = p + y->f2; q = q + x + 3; } } Assume that the variable points to a (allocated on the heap) containing two fields and …
The relation scheme given below is used to store information about the employees of a company, where is the key and indicates the department to which the employee is assigned. Each employee is assigned to exactly one department. Consider the …
Consider the cyclic redundancy check based error detecting scheme having the generator polynomial . Suppose the message is to be transmitted. Check bits are appended at the end of the message by the transmitter using the above scheme. The transmitted bit string is denoted by …
Consider the following program: #include <stdio.h> #include <stdlib.h> struct Node{ int value; struct Node *next;}; int main( ) { struct Node *boxE, *head, *boxN; int index=0; boxE=head= (struct Node *) malloc(sizeof(struct Node)); head → value = index; for (index =1; index<=3; index++){ boxN = (struct Node *) malloc …
Let be the following schedule of operations of three transactions , and in a relational database system: Consider the statements and below: : is conflict-serializable. : If commits before finishes, then …
Consider the following two statements about regular languages: : Every infinite regular language contains an undecidable language as a subset. : Every finite language is regular. Which one of the following choices is correct?
For two -dimensional real vectors and , the operation is defined as follows: Let be a set of -dimensional non-zero real vectors such that for every pair of distinct vectors , . What is the maximum cardinality possible …
For constants and , consider the following recurrence defined on the non-negative integers: Which one of the following options is correct about the recurrence ?
Suppose the following functional dependencies hold on a relation with attributes , and : Which of the following functional dependencies can be inferred from the above functional dependencies?
For a string , we define to be the reverse of . For example, if then . Which of the following languages is/are context-free?
Consider the following multi-threaded code segment (in a mix of C and pseudo-code), invoked by two processes and , and each of the processes spawns two threads and : int x = 0; // global Lock L1; // global main () { create a thread to execute foo(); // Thread T1 create a thread to execute foo(); // Thread T2 wait for the …
Consider a computer system with multiple shared resource types, with one instance per resource type. Each instance can be owned by only one process at a time. Owning and freeing of resources are done by holding a global lock . The following scheme is used to own a resource instance: function OWNRESOURCE(Resource R) Acquire lock L // a global lock if R …
If the numerical value of a -byte unsigned integer on a little endian computer is more than that on a big endian computer, which of the following choices represent(s) the unsigned integer on a little endian computer?
Consider a computer network using the distance vector routing algorithm in its network layer. The partial topology of the network is shown below. The objective is to find the shortest-cost path from the router to routers and . Assume that does not initially know the shortest routes to and . Assume that has three …
Which of the following regular expressions represent(s) the set of all binary numbers that are divisible by three? Assume that the string is divisible by three.
Consider the following directed graph: Which of the following is/are correct about the graph?
Consider a three-level page table to translate a bit virtual address to a physical address as shown below: The page size is bytes and page table entry size at every level is bytes. A process is currently using bytes virtual memory which is mapped to …
