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 solution to the producer-consumer synchronization problem. The shared buffer size is . Three semaphores , and are defined with respective initial values of and . Semaphore denotes the number of available slots in the buffer, for the consumer to read from. Semaphore …
Consider the unsigned 8-bit fixed point binary number representation, below, where the position of the primary point is between and . Assume is the most significant bit. Some of the decimal numbers listed below cannot be represented exactly in the …
Consider the following C code. Assume that unsigned long int type length is bits. unsigned long int fun(unsigned long int n) { unsigned long int i, j=0, sum = 0; for( i=n; i>1; i=i/2) j++; for( ; j>1; j=j/2) sum++; return sum; } The value returned when we call fun with the input is:
Let be a simple undirected graph. Let be a depth first search tree of . Let be a breadth first search tree of . Consider the following statements. No edge of is a cross edge with respect to . (A cross edge in is between two nodes neither of which is an ancestor of the other in ). For every edge …
#include<stdio.h> void fun1(char* s1, char* s2){ char* temp; temp = s1; s1 = s2; s2 = temp; } void fun2(char** s1, char** s2){ char* temp; temp = *s1; *s1 = *s2; *s2 = temp; } int main(){ char *str1="Hi", *str2 = "Bye"; fun1(str1, str2); printf("%s %s", str1, str2); fun2(&str1, &str2); printf("%s %s", str1, str2); return 0; } The output of the …
Assume that multiplying a matrix of dimension with another matrix of dimension requires scalar multiplications. Computing the product of matrices can be done by parenthesizing in different ways. Define as an explicitly computed pair for a given …
Consider a long-lived session with an end-to-end bandwidth of bits-per-second The session starts with a sequence number of . The minimum time (in seconds, rounded to the closet integer) before this sequence number can be used again is _________.
Consider the first-order logic sentence where is a quantifier-free first-order logic formula using only predicate symbols, and possibly equality, but no function symbols. …
Let be the set of natural numbers. Consider the following sets, Set of Rational numbers (positive and negative) Set of functions from to Set of functions from to Set of finite subsets of Which of the above sets are countable?
Consider a system with processes that share instances of the same resource type. Each process can request a maximum of instances. Resources can be requested and releases only one at a time. The largest value of that will always avoid deadlock is ___
Consider a matrix P whose only eigenvectors are the multiples of . Consider the following statements. P does not have an inverse P has a repeated eigenvalue P cannot be diagonalized Which one of the following options is correct?
Consider the sequential circuit shown in the figure, where both flip-flops used are positive edge-triggered flip-flops. The number of states in the state transition diagram of this circuit that have a transition back to the same state on some value of "in" is ____
A wide main memory unit with a capacity of is built using DRAM chips. The number of rows of memory cells in the DRAM chip is . The time taken to perform one refresh operation is . The refresh period is The percentage …
The postorder traversal of a binary tree is . The inorder traversal of the same tree is . The height of a tree is the length of the longest path from the root to any leaf. The height of the binary tree above is _____
Let be a finite group on elements. The size of a largest possible proper subgroup of is _____
The chromatic number of the following graph is _____
Consider the following program: #include<stdio.h> int counter=0; int calc (int a, int b) { int c; counter++; if(b==3) return (a*a*a); else { c = calc(a, b/3); return (c*c*c); } } int main() { calc(4, 81); printf("%d", counter); } The output of this program is ______.
Consider a matrix where . Note that denotes the transpose of . The largest eigenvalue of is ____
The value of correct to three decimal places (assuming that ) is ____
Two people, and , decide to independently roll two identical dice, each with faces, numbered to . The person with the lower number wins. In case of a tie, they roll the dice repeatedly until there is no tie. Define a trial as a throw of the dice by and Assume that all numbers on each dice are equi-probable and …
