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 the following function. double f(double x){ if( abs(x*x - 3) < 0.01) return x; else return f(x/2 + 1.5/x); } Give a value (to decimals) such that will return :_____.
Consider the expression tree shown. Each leaf represents a numerical value, which can either be or . Over all possible choices of the values at the leaves, the maximum possible value of the expression represented by the tree is ___.
Suppose are sorted sequences having lengths respectively. They are to be merged into a single sequence by merging together two sequences at a time. The number of comparisons that will be needed in the worst case by the optimal algorithm for doing this is ____.
Consider two strings = "qpqrr" and = "pqprqrp". Let be the length of the longest common subsequence (not necessarily contiguous) between and and let be the number of such longest common subsequences between and . Then ___.
Let . Let . Which one of the following is TRUE?
Let be the encoding of a Turing machine as a string over . Let Then is:
For a C program accessing , the following intermediate code is generated by a compiler. Assume that the size of an integer is bits and the size of a character is bits. t0 = i ∗ 1024 t1 = j ∗ 32 t2 = k ∗ 4 t3 = t1 + t0 t4 = t3 + t2 t5 = X[t4] Which one of the following statements about the source code for the C program is …
A computer has twenty physical page frames which contain pages numbered through . Now a program accesses the pages numbered in that order, and repeats the access sequence THRICE. Which one of the following page replacement policies experiences the same number of page faults as the optimal page replacement policy for …
Three processes , and each execute a loop of iterations. In each iteration of the loop, a process performs a single computation that requires CPU milliseconds and then initiates a single I/O operation that lasts for milliseconds. It is assumed that the computer where the processes execute has sufficient number of …
Consider the procedure below for the Producer-Consumer problem which uses semaphores: semaphore n = 0; semaphore s = 1; void producer() { while(true) { produce(); semWait(s); addToBuffer(); semSignal(s); semSignal(n); } } void consumer() { while(true) { semWait(s); semWait(n); removeFromBuffer(); semSignal(s); consume(); } } Which one of the following is …
Consider a join (relation algebra) between relations and using the nested loop method. There are buffers each of size equal to disk block size, out of which one buffer is reserved for intermediate results. Assuming the join will have fewer number of disk block accesses if
Consider the following schedule S of transactions …
A graphical HTML browser resident at a network client machine accesses a static HTML webpage from a HTTP server . The static HTML page has exactly one static embedded image which is also at . Assuming no caching, which one of the following is correct about the HTML webpage loading (including the embedded image)?
An IP machine has a path to another via three and . acts as an , and connects to via and downloads a file. Session layer encryption is used, with as the shared key encryption protocol. Consider the following four …
Consider the store and forward packet switched network given below. Assume that the bandwidth of each link is bytes / sec. A user on host sends a file of size bytes to host through routers and in three different ways. In the first case a single packet containing the complete file is transmitted from to . …
In the diagram shown below, is an Ethernet LAN and is a Token-Ring LAN. An packet originates from sender and traverses to , as shown. The links within each and across the two s, are all point-to-point optical links. The initial value of the field is . The maximum possible value …
Which of the following socket API functions converts an unconnected active TCP socket into a passive socket?
Which of the following is TRUE about the interior gateway routing protocols Routing Information Protocol and Open Shortest Path First
Given an instance of the STUDENTS relation as shown as below …
The maximum number of superkeys for the relation schema with as the key is _____.
