Skip to content

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
Official PYQ2008Operating SystemConcurrency and SynchronizationMCQ · 1 mark
The PP and VV operations on counting semaphores, where s is a counting semaphore, are defined as follows: P(s):P(s): s=s−1;s=s-1; If s<0s < 0 then wait; V(s):V(s): s=s+1;s=s+1; If s≤0s \leq0 then wake up process waiting on s; Assume that PbP_b and VbV_b the wait and signal operations on binary semaphores are provided. Two binary semaphores xbx_b …
Official PYQ2008Programming and Data StructuresLinked ListsMCQ · 1 mark
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 1,2,3,4,5,6,71, 2, 3, 4, 5, 6, 7 in the given order. What will be the contents of the list after function completes execution? struct node { int value; struct node *next; }; void …
Official PYQ2008Programming and Data StructuresProgramming in CMCQ · 1 mark
Choose the correct option to fill ?1?1 and ?2?2 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"); }
Official PYQ2008Computer NetworksTransport Layer: Flow Control, Congestion Control, UDP, TCP, SocketsMCQ · 1 mark
A computer on a 10Mbps10\text{Mbps} network is regulated by a token bucket. The token bucket is filled at a rate of 2Mbps2\text{Mbps}. It is initially filled to capacity with 16Megabits16\text{Megabits}. What is the maximum duration for which the computer can transmit at the full 10Mbps10\text{Mbps}?
Official PYQ2008Programming and Data StructuresProgramming in CMCQ · 1 mark
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)); }
Official PYQ2008Computer NetworksTransport Layer: Flow Control, Congestion Control, UDP, TCP, SocketsMCQ · 1 mark
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 socket()\text{socket()}, a bind()\text{bind()} and a listen()\text{listen()} system call in that order, following which it is preempted. Subsequently, the client process P executes a socket()\text{socket()} system call followed by …
Official PYQ2008Computer NetworksFragmentation and IP Addressing, IPv4, CIDRMCQ · 1 mark
If a class BB network on the Internet has a subnet mask of 255.255.248.0255.255.248.0, what is the maximum number of hosts per subnet?
Official PYQ2008Computer NetworksTransport Layer: Flow Control, Congestion Control, UDP, TCP, SocketsMCQ · 1 mark
In the slow start phase of the TCP congestion algorithm, the size of the congestion window:
Official PYQ2008Compiler DesignParsing (LL, LR)MCQ · 1 mark
An LALR(1) parser for a grammar G can have shift-reduce (S-R) conflicts if and only if
Official PYQ2008Compiler DesignRuntime EnvironmentsMCQ · 1 mark
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 …
Official PYQ2008Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Which of the following are regular sets? {anb2m∣n≥0,m≥0}\left\{a^nb^{2m} \mid n \geq 0, m \geq 0 \right\} {anbm∣n=2m}\left\{a^nb^m \mid n =2m \right\} {anbm∣n≠m}\left\{a^nb^m \mid n \neq m \right\} {xcy∣x,y,∈{a,b}∗}\left\{xcy \mid x, y, \in \left\{a, b\right\} ^* \right\}
Official PYQ2008Theory of ComputationRegular Expressions and Finite AutomataMCQ · 1 mark
Match the following NFAs with the regular expressions they correspond to: P Q R S ϵ+0(01∗1+00)∗01∗\epsilon + 0\left(01^*1+00\right)^*01^* ϵ+0(10∗1+00)∗0\epsilon + 0\left(10^*1+00\right)^*0 ϵ+0(10∗1+10)∗1\epsilon + 0\left(10^*1+10\right)^*1 ϵ+0(10∗1+10)∗10∗\epsilon + 0\left(10^*1+10\right)^*10^*
Official PYQ2008Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Match the following: …
Official PYQ2008Theory of ComputationUndecidabilityMCQ · 1 mark
Which of the following statements is false?
Official PYQ2008AlgorithmsAsymptotic Worst Case Time and Space ComplexityMCQ · 1 mark
We have a binary heap on nn elements and wish to insert nn more elements (not necessarily one after another) into this heap. The total time required for this is
Official PYQ2008Programming and Data StructuresBinary Search TreesMCQ · 1 mark
You are given the postorder traversal, PP, of a binary search tree on the nn elements 1,2,…,n1, 2, \dots, n. You have to determine the unique binary search tree that has PP as its postorder traversal. What is the time complexity of the most efficient algorithm for doing this?
Official PYQ2008AlgorithmsShortest Paths (Dijkstra, Bellman-Ford)MCQ · 1 mark
Dijkstra's single source shortest path algorithm when run from vertex aa in the above graph, computes the correct shortest path distance to
Official PYQ2008AlgorithmsAsymptotic Worst Case Time and Space ComplexityMCQ · 1 mark
The subset-sum problem is defined as follows: Given a set SS of nn positive integers and a positive integer WW, determine whether there is a subset of SS whose elements sum to WW. An algorithm QQ solves this problem in O(nW)O(nW) time. Which of the following statements is false?
Official PYQ2008AlgorithmsSearching, Sorting, HashingMCQ · 1 mark
Consider the Quicksort algorithm. Suppose there is a procedure for finding a pivot element which splits the list into two sub-lists each of which contains at least one-fifth of the elements. Let T(n)T(n) be the number of comparisons required to sort nn elements. Then
Official PYQ2008DatabasesFile Organization and Indexing (B and B+ Trees)MCQ · 1 mark
A B-tree of order 44 is built from scratch by 1010 successive insertions. What is the maximum number of node splitting operations that may take place?