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 C code segment. int a, b, c = 0; void prtFun(void); main() { static int a = 1; /* Line 1 */ prtFun(); a += 1; prtFun(); printf(“ \n %d %d ”, a, b); } void prtFun(void) { static int a = 2; /* Line 2 */ int b = 1; a += ++b; printf(“ \n %d %d ”, a, b); } What output will be generated by the given code segment if: Line 1 is replaced by …
Consider the following relations and …
For the grammar below, a partial parsing table is also presented along with the grammar. Entries that need to be filled are indicated as and . is the empty string, \$ indicates end of input, and, separates alternate right hand sides of productions. …
A computer has a -, 4-way set associative, write back data cache with block size of . The processor sends addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, valid bits, modified bit and replacement bit. The size of the …
Given the sequence of terms, , the next term is
An automobile plant contracted to buy shock absorbers from two suppliers and . supplies and Y supplies of the shock absorbers. All shock absorbers are subjected to a quality test. The ones that pass the quality test are considered reliable. Of shock absorbers, are reliable. Of shock absorbers, …
Which of the following assertions are CORRECT? P: Adding to each entry in a list adds to the mean of the list Q: Adding to each entry in a list adds to the standard deviation of the list R: Doubling each entry in a list doubles the mean of the list S: Doubling each entry in a list leaves the standard deviation of the list unchanged
A political party orders an arch for the entrance to the ground in which the annual convention is being held. The profile of the arch follows the equation where is the height of the arch in meters. The maximum possible height of the arch is
Wanted Temporary, Part-time persons for the post of Field Interviewer to conduct personal interviews to collect and collate economic data. Requirements: High School-pass, must be available for Day, Evening and Saturday work. Transportation paid, expenses reimbursed. Which one of the following is the best inference from the above advertisement?
Choose the most appropriate alternative from the options given below to complete the following sentence: Suresh’s dog is the one ________ was hurt in the stampede.
Choose the grammatically INCORRECT sentence:
Which one of the following options is the closest in meaning to the word given below? Mitigate
Choose the most appropriate alternative from the options given below to complete the following sentence: Despite several _________ the mission succeeded in its attempt to resolve the conflict.
The cost function for a product in a firm is given by , where is the amount of production. The firm can sell the product at a market price of per unit. The number of units to be produced by the firm such that the profit is maximized is
A computer has a , 4-way set associative, write back data cache with block size of . The processor sends addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, valid bits, modified bit and replacement bit. The number of bits in the tag …
Consider the following relations and …
The height of a tree is defined as the number of edges on the longest path in the tree. The function shown in the pseudo-code below is invoked as height (root) to compute the height of a binary tree rooted at the tree pointer root. int height(treeptr n) { if(n == NULL) return -1; if(n -> left == NULL) if(n -> right == NULL) return 0; else return B1; // …
Consider the following C code segment. int a, b, c = 0; void prtFun(void); main() { static int a = 1; /* Line 1 */ prtFun(); a += 1; prtFun(); printf(“ \n %d %d ”, a, b); } void prtFun(void) { static int a = 2; /* Line 2 */ int b = 1; a += ++b; printf(“ \n %d %d ”, a, b); } What output will be generated by the given code segment?
Consider the set of strings on in which, every substring of symbols has at most two zeros. For example, and are in the language, but is not. All strings of length less than are also in the language. A partially completed DFA that accepts this language is shown below. The missing arcs in the DFA are:
Consider an instance of TCP’s Additive Increase Multiplicative Decrease (AIMD) algorithm where the window size at the start of the slow start phase is MSS and the threshold at the start of the first transmission is MSS. Assume that a timeout occurs during the fifth transmission. Find the congestion window size at the end of the tenth …
