GATE 2015 (Session 2) CS Mock Test
1 of this paper's 65 questions are not in our question bank yet. They show as "Not available" and are left out of your score, which is out of 99 marks.
General Instructions
- The test lasts 180 minutes. The timer above the question shows the time left, and the test is submitted automatically when it reaches zero.
- The question palette shows the status of each question:
1 You have not visited the question yet. 2 You have not answered the question. 3 You have answered the question. It will be evaluated. 4 You have not answered the question but marked it for review. 5 You have answered the question and marked it for review. It will also be evaluated. - Save & Next saves your answer and moves to the next question. Mark for Review & Next saves it, marks it for review and moves on. Clicking a number in the palette moves to that question without saving the current answer.
- MCQ: one correct option; a wrong answer costs 1/3 of the marks for a 1-mark question and 2/3 for a 2-mark one. MSQ: one or more correct options, all of them needed; no negative marks. NAT: type a number with the on-screen keypad; no negative marks.
- A scientific calculator, like the one in GATE, opens from the calculator icon next to the timer.
- Your answers are kept in this browser only. If you close the page, you can resume until the time runs out.
ⓘ Tick the box above to start.
Question No. 1
We __________ our friends's birthday and we _________ how to make it up to him.
Choose the statement where underlined word is used correctly.
A generic term that includes various items of clothing such as a skirt, a pair of trousers and a shirt is
Based on the given statements, select the most appropriate option to solve the given question.
What will be the total weight of 10 poles each of same weight?
Statements:
(I) One fourth of the weight of a pole is 5 Kg.
(II) The total weight of these poles is 160 kg more than the total weight of two poles.
What will be the total weight of 10 poles each of same weight?
Statements:
(I) One fourth of the weight of a pole is 5 Kg.
(II) The total weight of these poles is 160 kg more than the total weight of two poles.
Consider a function . The value of at which the function attains a maximum, and the maximum value of the function are:
Out of the following four sentences, select the most suitable sentence with respect to grammar and usage:
In a triangle is the angle bisector of . What is the length of ?
If p, q, r, s are distinct integers such that:
Also a function
Also the same operations are valid with two variable functions of the form
What is the value of ?
Also a function
Also the same operations are valid with two variable functions of the form
What is the value of ?
If the list of letters is an arithmetic sequence, which of the following are also in arithmetic sequence?
I.
II.
III.
I.
II.
III.
Four branches of a company are located at M, N, O, and P. M is north of N at a distance of 4 km; P is south of O at a distance of 2 km; N is southeast of O by 1 km. What is the distance between M and P in km?
Consider the following two statements.
S1: If a candidate is known to be corrupt, then he will not be elected
S2: If a candidate is kind, he will be elected
Which one of the following statements follows from S1 and S2 as per sound inference rules of logic?
S1: If a candidate is known to be corrupt, then he will not be elected
S2: If a candidate is kind, he will be elected
Which one of the following statements follows from S1 and S2 as per sound inference rules of logic?
The cardinality of the power set of { 0, 1, 2,..., 10 } is _________.
Let R be the relation on the set of positive integers such that aRb if and only if a and b are distinct and have a common divisor other than 1. Which one of the following statements about R is true?
The number of divisors of 2100 is _____ .
The larger of the two eigenvalues of the matrix is _______.
An unordered list contains n distinct elements. The number of comparisons to find an element in this list that is neither maximum nor minimum is
The minimum number of JK flip-flops required to construct a synchronous counter with the count sequence (0,0,1,1,2,2,3,3,0,0,...) is __________ .
Assume that for a certain processor, a read request takes 50 nanoseconds on a cache miss and 5 nanoseconds on a cache hit. Suppose while running a program, it was observed that 80% of the processor's read requests result in a cache hit. The average read access time in nanoseconds is __________.
A computer system implements a 40-bit virtual address, page size of 8 kilobytes, and a 128-entry translation look-aside buffer (TLB) organized into 32 sets each having four ways. Assume that the TLB tag does not store any process id. The minimum length of the TLB tag in bits is _________.
Consider the following statements.
I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?
I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?
Consider the following function written in the C programming language.
void foo(char *a){
if ( *a && *a != ' '){
foo(a+1);
putchar(*a);
}
} The output of the above function on input isConsider a complete binary tree where the left and the right subtrees of the root are max-heaps. The lower bound for the number of operations to convert the tree to a heap is
A binary tree T has 20 leaves. The number of nodes in T having two children is _______.
Consider the following C function.
int fun(int n){
int x=1,k;
if (n==1) return x;
for (k=1; k < n; ++k)
x = x + fun(k) * fun(n-k);
return x;
} The return value of fun(5) is ________.A software requirements specification (SRS) document should avoid discussing which one of the following?
Consider two decision problems such that reduces in polynomial time to 3-SAT and 3-SAT reduces in polynomial time to . Then which one of the following is consistent with the above statement?
Match the following:
In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the following is TRUE?
Consider the basic COCOMO model where is the effort applied in person-months, is the development time in chronological months, is the estimated number of delivered lines of code (in thousands) and have their usual meanings. The basic COCOMO equations are of the form
This question is not in our question bank yet, so it is left out of your score. Move on to the next question.
Consider the following transaction involving two bank accounts x and y.
read(x); x:=x-50; write(x); read(y); y:=y+50; write(y)
The constraint that the sum of the accounts x and y should remain constant is that of
read(x); x:=x-50; write(x); read(y); y:=y+50; write(y)
The constraint that the sum of the accounts x and y should remain constant is that of
With reference to the B+ tree index of order 1 shown below, the minimum number of nodes (including the Root node) that must be fetched in order to satisfy the following query:
"Get all records with a search key greater than or equal to 7 and less than 15"
is ____________.
"Get all records with a search key greater than or equal to 7 and less than 15"
is ____________.
Identify the correct order in which a server process must invoke the function calls accept, bind, listen, and recv according to UNIx socket API.
A link has a transmission speed of bits/sec. It uses data packets of size 1000 bytes each. Assume that the acknowledgment has negligible transmission delay, and that its propagation delay is the same as the data propagation delay. Also assume that the processing delays at nodes are negligible. The efficiency of the stop-and-wait protocol in this setup is exactly 25%. The value of the one-way propagation delay (in milliseconds) is ________.
Which one of the following statements is NOT correct about HTTP cookies?
Consider the following routing table at an IP router:
For each IP address in Group I identify the correct choice of the next hop from Group II using the entries from the routing table above.
For each IP address in Group I identify the correct choice of the next hop from Group II using the entries from the routing table above.
Host A sends a UDP datagram containing 8880 bytes of user data to host B over an Ethernet LAN. Ethernet frames may carry data up to 1500 bytes (i.e. MTU=1500 bytes). Size of UDP header is 8 bytes and size of IP header is 20 bytes. There is no option field in IP header. How many total number of IP fragments will be transmitted and what will be the contents of offset field in the last fragment?
Assume that the bandwidth for a TCP connection is 1048560 bits/sec. Let be the value of RTT in milliseconds (rounded off to the nearest integer) after which the TCP window scale option is needed. Let be the maximum possible window size with window scale option. Then the values of and are
Consider a simple checkpointing protocol and the following set of operations in the log.
(start, T4); (write, T4, y, 2, 3); (start, T1); (commit, T4); (write, T1, z, 5, 7);
(checkpoint);
(start, T2); (write, T2, x, 1, 9); (commit, T2); (start, T3), (write, T3, z, 7, 2);
If a crash happens now and the system tries to recover using both undo and redo operations, what are the contents of the undo list and the redo list?
(start, T4); (write, T4, y, 2, 3); (start, T1); (commit, T4); (write, T1, z, 5, 7);
(checkpoint);
(start, T2); (write, T2, x, 1, 9); (commit, T2); (start, T3), (write, T3, z, 7, 2);
If a crash happens now and the system tries to recover using both undo and redo operations, what are the contents of the undo list and the redo list?
Consider two relations R1(A,B) with the tuples (1,5), (3,7) and R2(A,C) = (1,7), (4,9). Assume that R(A,B,C) is the full natural outer join of R1 and R2. Consider the following tuples of the form (A,B,C): a = (1,5,null), b = (1,null,7), c = (3, null, 9), d = (4,7,null), e = (1,5,7), f = (3,7,null), g = (4,null,9). Which one of the following statements is correct?
Consider six memory partitions of sizes 200 KB, 400 KB, 600 KB, 500 KB, 300 KB and 250 KB, where KB refers to kilobyte. These partitions need to be allotted to four processes of sizes 357 KB, 210 KB, 468 KB and 491 KB in that order. If the best fit algorithm is used, which partitions are NOT allotted to any process?
Consider a typical disk that rotates at 15000 rotations per minute (RPM) and has a transfer rate of 50x bytes/sec. If the average seek time of the disk is twice the average rotational delay and the controller's transfer time is 10 times the disk transfer time, the average time (in milliseconds) to read or write a 512-byte sector of the disk is ______.
A computer system implements 8 kilobyte pages and a 32-bit physical address space. Each page table entry contains a valid bit, a dirty bit, three permission bits, and the translation. If the maximum size of the page table of a process is 24 megabytes, the length of the virtual address supported by the system is _____ bits.
Consider the intermediate code given below.
(1) i = 1
(2) j = 1
(3) t1 = 5 * i
(4) t2 = t1 + j
(5) t3 = 4 * t2
(6) t4 = t3
(7) a[t4] = -1
(8) j = j + 1
(9) if j5 goto (3)
(10) i=i+1
(11) if i5 goto (2)
The number of nodes and edges in the control-flow-graph constructed for the above code, respectively, are
(1) i = 1
(2) j = 1
(3) t1 = 5 * i
(4) t2 = t1 + j
(5) t3 = 4 * t2
(6) t4 = t3
(7) a[t4] = -1
(8) j = j + 1
(9) if j5 goto (3)
(10) i=i+1
(11) if i5 goto (2)
The number of nodes and edges in the control-flow-graph constructed for the above code, respectively, are
The number of states in the minimal deterministic finite automaton corresponding to the regular expression (0+1)*(10) is __________.
Which of the following languages is/are regular?
is the reverse of string w
is the reverse of string w
Given below are some algorithms, and some algorithm design paradigms.
Match the above algorithms on the left to the corresponding design paradigm they follow.
Match the above algorithms on the left to the corresponding design paradigm they follow.
A Young tableau is a 2D array of integers increasing from left to right and from top to bottom. Any unfilled entries are marked with , and hence there cannot be any entry to the right of, or below a . The following Young tableau consists of unique entries.
When an element is removed from a Young tableau, other elements should be moved into its place so that the resulting table is still a Young tableau (unfilled entries may be filled in with a ). The minimum number of entries (other than 1) to be shifted, to remove 1 from the given Young tableau is _______.
When an element is removed from a Young tableau, other elements should be moved into its place so that the resulting table is still a Young tableau (unfilled entries may be filled in with a ). The minimum number of entries (other than 1) to be shifted, to remove 1 from the given Young tableau is _______.
Suppose you are provided with the following function declaration in the C programming language.
int partition(int a[ ], int n);
The function treats the first element of a[] as a pivot, and rearranges the array so that all elements less than or equal to the pivot is in the left part of the array, and all elements greater than the pivot is in the right part. In addition, it moves the pivot so that the pivot is the last element of the left part. The return value is the number of elements in the left part.
The following partially given function in the C programming language is used to find the smallest element in an array a[ ] of size n using the partition function. We assume
The missing argument lists are respectively
int partition(int a[ ], int n);
The function treats the first element of a[] as a pivot, and rearranges the array so that all elements less than or equal to the pivot is in the left part of the array, and all elements greater than the pivot is in the right part. In addition, it moves the pivot so that the pivot is the last element of the left part. The return value is the number of elements in the left part.
The following partially given function in the C programming language is used to find the smallest element in an array a[ ] of size n using the partition function. We assume
int kth_smallest(int a[], int n, int k)
{
int left_end = partition(a,n);
if ( left_end+1 == k ){
return a[left_end];
}
if ( left_end+1 > k ){
return kth_smallest( ________ );
} else {
return kth_smallest( ________ );
}
} The missing argument lists are respectively
Which one of the following hash functions on integers will distribute keys most uniformly over 10 buckets numbered 0 to 9 for i ranging from 0 to 2020?
The secant method is used to find the root of an equation f(x)=0. It is started from two distinct estimates and for the root. It is an iterative procedure involving linear interpolation to a root. The iteration stops if is very small and then is the solution. The procedure is given below. Observe that there is an expression which is missing and is marked by ?. Which is the suitable expression that is to be put in place of ? so that it follows all steps of the secant method?
Consider the C program below.
#include <stdio.h>
int *A, stkTop;
int stkFunc(int opcode, int val)
{
static int size=0, stkTop=0;
switch (opcode) {
case -1: size = val; break;
case 0: if (stkTop < size) A[stkTop++] = val; break;
default: if (stkTop) return A[--stkTop];
}
return -1;
}
int main()
{
int B[20]; A = B; stkTop = -1;
stkFunc (-1, 10);
stkFunc ( 0, 5);
stkFunc ( 0, 10);
printf ("%d\n", stkFunc(1, 0) + stkFunc(1, 0));
} The value printed by the above program is __________.Consider the sequence of machine instructions given below:
MUL R5, R0, R1
DIV R6, R2, R3
ADD R7, R5, R6
SUB R8, R7, R4
In the above sequence, R0 to R8 are general purpose registers. In the instructions shown, the first register stores the result of the operation performed on the second and the third registers. This sequence of instructions is to be executed in a pipelined instruction processor with the following 4 stages: (1) Instruction Fetch and Decode (IF), (2) Operand Fetch (OF), (3) Perform Operation (PO) and (4) Write back the result (WB). The IF, OF and WB stages take 1 clock cycle each for any instruction. The PO stage takes 1 clock cycle for ADD or SUB instruction, 3 clock cycles for MUL instruction and 5 clock cycles for DIV instruction. The pipelined processor uses operand forwarding from the PO stage to the OF stage.
The number of clock cycles taken for the execution of the above sequence of instructions is ___________.
MUL R5, R0, R1
DIV R6, R2, R3
ADD R7, R5, R6
SUB R8, R7, R4
In the above sequence, R0 to R8 are general purpose registers. In the instructions shown, the first register stores the result of the operation performed on the second and the third registers. This sequence of instructions is to be executed in a pipelined instruction processor with the following 4 stages: (1) Instruction Fetch and Decode (IF), (2) Operand Fetch (OF), (3) Perform Operation (PO) and (4) Write back the result (WB). The IF, OF and WB stages take 1 clock cycle each for any instruction. The PO stage takes 1 clock cycle for ADD or SUB instruction, 3 clock cycles for MUL instruction and 5 clock cycles for DIV instruction. The pipelined processor uses operand forwarding from the PO stage to the OF stage.
The number of clock cycles taken for the execution of the above sequence of instructions is ___________.
Consider a processor with byte-addressable memory. Assume that all registers, including Program Counter (PC) and Program Status Word (PSW), are of size 2 bytes. A stack in the main memory is implemented from memory location and it grows upward. The stack pointer (SP) points to the top element of the stack. The current value of SP is . The CALL instruction is of two words, the first word is the op-code and the second word is the starting address of the subroutine (one word = 2 bytes). The CALL instruction is implemented as follows:
Store the current value of PC in the stack
Store the value of PSW register in the stack
Load the starting address of the subroutine in PC
The content of PC just before the fetch of a CALL instruction is . After execution of the CALL instruction, the value of the stack pointer is
Store the current value of PC in the stack
Store the value of PSW register in the stack
Load the starting address of the subroutine in PC
The content of PC just before the fetch of a CALL instruction is . After execution of the CALL instruction, the value of the stack pointer is
The number of min-terms after minimizing the following Boolean expression is _________.
Let and A denote the area of the region bounded by f(x) and the x-axis, when x varies from -1 to 1. Which of the following statements is/are TRUE?
I) f is continuous in [-1,1]
II) f is not bounded in [-1,1]
III) A is nonzero and finite
I) f is continuous in [-1,1]
II) f is not bounded in [-1,1]
III) A is nonzero and finite
Perform the following operations on the matrix .
(i) Add the third row to the second row
(ii) Subtract the third column from the first column.
The determinant of the resultant matrix is___________.
(i) Add the third row to the second row
(ii) Subtract the third column from the first column.
The determinant of the resultant matrix is___________.
The number of onto functions (surjective functions) from set x={1,2,3,4} to set Y={a,b,c} is __________.
Let X and Y denote the sets containing 2 and 20 distinct objects respectively and F denote the set of all possible functions defined from X to Y. Let f be randomly chosen from F. The probability of f being one-to-one is ________.
Consider the alphabet ={0, 1}, the null/empty string and the sets of strings generated by the corresponding non-terminals of a regular grammar. are related as follows.
Which one of the following choices precisely represents the strings in ?
Which one of the following choices precisely represents the strings in ?
A graph is self-complementary if it is isomorphic to its complement. For all self-complementary graphs on n vertices, n is
In a connected graph, a bridge is an edge whose removal disconnects a graph. Which one of the following statements is true?
Which one of the following well formed formulae is a tautology?
Which one of the following assertions concerning code inspection and code walkthrough is true?
A half adder is implemented with XOR and AND gates. A full adder is implemented with two half adders and one OR gate. The propagation delay of an XOR gate is twice that of an AND/OR gate. The propagation delay of an AND/OR gate is 1.2 microseconds. A 4-bit ripple-carry binary adder is implemented by using four full adders. The total propagation time of this 4-bit binary adder in microseconds is____________.
GATE 2015 (Session 2) CS Mock Test: your result
Question-wise review
The timer is still running. Close this window to return to the questions.
The timer is still running while you read the paper.
Submit the test?
You cannot change your answers after submitting.