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
Consider a processor that has general purpose registers and it uses -byte instruction format for all its instructions. Variable-sized opcodes are permitted. There are three different types of instructions; M-type, R-type, and C-type. Each M-type instruction has register operands and a -bit immediate operand. Each Rtype instruction has …
An index in a DBMS is said to be dense if an index entry appears for every search-key value in the indexed file. Otherwise it is called a sparse index. Consider the following two statements. : A hash index must be a dense index : A tree index can be a sparse index Which one of the following options is correct?
Consider the following two finite automata and . Which of the following statements is/are true?
Consider a binary search tree (BST) with leaf nodes . Given any node , the key present in the node is denoted as . All the keys present in the given BST are distinct. The keys belong to the set of real numbers. For a node , let denote the node that is its inorder successor. If a …
Let and let . Which of the following constraints ensure(s) that the language is context-free?
Consider a stack and a queue . Both of them are initially empty and have the capacity to store ten elements each. The elements , and arrive one by one, in that order. When an element arrives, it is assigned either to (pushed on ) or to (enqueued to ). Once all the five elements are stored, the output is …
Consider three processes , and running identical code, as shown in the pseudocode below. and are two binary semaphores initialized to and , respectively. is a shared variable initialized to . Each line in the pseudocode is executed atomically. Pseudocode of P1, P2, and P3 …
Consider a system with a processor and a KB direct mapped cache with block size of bytes. The system has a MB physical memory. Four words , and S are accessed by the processor in the same order times. That is, there are a total of memory references in the sequence …
To keep track of free blocks in a file system, one of the two approaches is generally used - using bitmaps (bit vectors) or using linked lists. Consider that the linked list approach is used to keep track of free blocks in a file system. Assume that the disk size is GB , block size is KB , and block numbers used are -bit long. A single …
A system has a Translation Lookaside Buffer (TLB) that has a reach of MB. TLB reach is defined as the total amount of physical memory that can be accessed through the TLB entries. The paging system uses pages of size KB. The virtual address space is GB and physical address space is GB. If each TLB entry stores a -bit process id, …
Consider contiguous allocation of physical memory to processes using variable partitioning scheme. Suppose there are holes in the memory of sizes , , and KB. Assume that no two holes are adjacent. Two processes of …
A non-pipelined instruction execution unit that operates at GHz clock takes an average of clock cycles to complete the execution of an instruction. To improve the performance, the system was pipelined with a goal of achieving an average throughput of one instruction per clock cycle. However, it could operate only at GHz due to pipeline …
Consider a system with MB physical memory and a word length of byte. The system uses a direct mapped cache, with block numbers starting from . The word with physical address is mapped to the cache block number . The maximum possible size of the cache (in KB ) for this configuration is . (answer …
Consider a new TCP connection between a sender and a receiver. The receiver advertised window is constant at KB, the maximum segment size (MSS) is KB, and the slow start threshold for TCP congestion control is KB. Assume that there are no timeouts or duplicate acknowledgements. The number of rounds of transmission required for the …
Consider the digital circuit shown below with two input lines and , two select lines and , and an output line . The blocks and represent active high decoder and -to- multiplexer, respectively. Out of possible input combinations, the number of …
Consider the following ANSI-C program. #include <stdio.h> int main(){ int *ptr, a, b, c; a=5; b=11; c=20; ptr=&a; *ptr=c; ptr=&c; a=*(&b); c=*ptr-a; printf("%d",c); return(0); } The output of this program is . (answer in integer) Note: Assume that the program compiles and runs successfully.
Consider the following ANSI-C function. int func(int start, int end){ int length=end+1-start; if((length<1)||(start<0)||(end<0)){ return(0); } if(length%3==0){ return(func(start+1, end)); }else if(length%3==1){ return(1+func(start, end-1)); }else { return(func(start+2, end)); } } The maximum possible value that can be returned from this function is …
The determinant of a matrix is . The value of the determinant of is . (answer in integer)
Suppose an unbiased coin is tossed times. Each coin toss is independent of all previous coin tosses. Let be the event that among the second, fourth, and sixth coin tosses, there are at least two heads. Let be the event that among the first, second, third, and fifth coin tosses, there are equal number of heads and tails. The …
Consider a function defined as follows. For a real number if the second digit after the decimal point in is one of the four digits and . Otherwise, is equal to . The number of points in at which is discontinuous is . (answer in integer)
