GATE CS — Computer Science & IT 2015 Previous year paper

GATE CS 2015 — Previous Year Questions

  • 24Questions
  • 38Total marks
  • 72Minutes

The questions from the GATE 2015 Computer Science paper that are in the W3Colleges verified bank. This is a partial paper, not the full 65-question original — import the complete paper to fill it out.

Start timed test Practice without timer

The timed run lasts 72 minutes and is held on the server.

Questions

GATE CS 2015

Question 1

MCQ 1 marks · −0.33 Algorithms

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

Answers and explanations are free — they just need an account.

Question 2

MCQ 2 marks · −0.66 Algorithms

Consider the following array of elements:

<89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100>

The minimum number of interchanges needed to convert it into a max-heap is

Answers and explanations are free — they just need an account.

Question 3

MCQ 1 marks · −0.33 Compiler Design

Match the following:

List-IList-II
(P) Lexical analysis(i) Leftmost derivation
(Q) Top down parsing(ii) Type checking
(R) Semantic analysis(iii) Regular expressions
(S) Runtime environments(iv) Activation records

Answers and explanations are free — they just need an account.

Question 4

NAT 2 marks · no negative Computer Networks

Consider a network connecting two systems located 8000 km apart. The bandwidth of the network is \(500 \times 10^{6}\) bits per second. The propagation speed of the media is \(4 \times 10^{6}\) meters per second. It is needed to design a Go-Back-N sliding window protocol for this network. The average packet size is \(10^{7}\) bits. The network is to be used to its full capacity. Assume that processing delays at nodes are negligible. Then, the minimum size in bits of the sequence number field has to be ________.

Answers and explanations are free — they just need an account.

Question 5

Consider a machine with a byte addressable main memory of \(2^{20}\) bytes, block size of 16 bytes and a direct mapped cache having \(2^{12}\) cache lines. Let the addresses of two consecutive bytes in main memory be \((\text{E}201\text{F})_{16}\) and \((\text{E}2020)_{16}\). What are the tag and cache line address (in hex) for main memory address \((\text{E}201\text{F})_{16}\)?

Answers and explanations are free — they just need an account.

Question 6

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 \((0100)_{16}\) and it grows upward. The stack pointer (SP) points to the top element of the stack. The current value of SP is \((016\text{E})_{16}\). 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 \((5\text{F}\text{A}0)_{16}\). After execution of the CALL instruction, the value of the stack pointer is

Answers and explanations are free — they just need an account.

Question 7

NAT 1 marks · no negative Databases

Consider a B+ tree in which the search key is 12 bytes long, block size is 1024 bytes, record pointer is 10 bytes long and the block pointer is 8 bytes long. The maximum number of keys that can be accommodated in each non-leaf node of the tree is ______.

Answers and explanations are free — they just need an account.

Question 8

MCQ 2 marks · −0.66 Databases

Consider two relations \(R_1(A, B)\) with the tuples \((1, 5), (3, 7)\) and \(R_2(A, C) = (1, 7), (4, 9)\). Assume that \(R(A, B, C)\) is the full natural outer join of \(R_1\) and \(R_2\). Consider the following tuples of the form \((A, B, C)\):

\(a = (1, 5, \text{null})\), \(b = (1, \text{null}, 7)\), \(c = (3, \text{null}, 9)\), \(d = (4, 7, \text{null})\), \(e = (1, 5, 7)\), \(f = (3, 7, \text{null})\), \(g = (4, \text{null}, 9)\)

Which one of the following statements is correct?

Answers and explanations are free — they just need an account.

Question 9

MCQ 2 marks · −0.66 Databases

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?

Answers and explanations are free — they just need an account.

Question 10

MCQ 1 marks · −0.33 Digital Logic

Consider a 4-bit Johnson counter with an initial value of 0000. The counting sequence of this counter is:

Answers and explanations are free — they just need an account.

Question 11

NAT 2 marks · no negative Digital Logic

The total number of prime implicants of the function \(f(w,x,y,z) = \sum m(0,\,2,\,4,\,5,\,6,\,10)\) is _______ .

Answers and explanations are free — they just need an account.

Question 12

MCQ 1 marks · −0.33 Discrete Mathematics

In a connected graph, a bridge is an edge whose removal disconnects the graph. Which one of the following statements is TRUE?

Answers and explanations are free — they just need an account.

Question 14

MCQ 1 marks · −0.33 Discrete Mathematics

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?

Answers and explanations are free — they just need an account.

Question 16

NAT 2 marks · no negative Engineering Mathematics

The probability that a given positive integer lying between 1 and 100 (both inclusive) is NOT divisible by 2, 3 or 5 is ______.

Answers and explanations are free — they just need an account.

Question 17

MCQ 1 marks · −0.33 General Aptitude

Choose the word that best fills the blank in the sentence below.

The principal presented the chief guest with a ________, as token of appreciation.

Answers and explanations are free — they just need an account.

Question 18

MCQ 2 marks · −0.66 General Aptitude

If \(\log(P) = \frac{1}{2}\log(Q) = \frac{1}{3}\log(R)\), then which one of the following options is TRUE?

Answers and explanations are free — they just need an account.

Question 19

MCQ 2 marks · −0.66 General Aptitude

In a triangle \(PQR\), \(PS\) is the angle bisector of \(\angle QPR\) and \(\angle QPS = 60^\circ\), where \(S\) lies on \(QR\). If \(PQ = r\) and \(PR = q\), what is the length of \(PS\)?

Answers and explanations are free — they just need an account.

Question 20

NAT 2 marks · no negative Probability and Statistics

Suppose \(X_i\) for \(i=1,2,3\) are independent and identically distributed random variables whose probability mass functions are \(\Pr[X_i=0]=\Pr[X_i=1]=1/2\) for \(i=1,2,3\). Define another random variable \(Y=X_1X_2\oplus X_3\), where \(\oplus\) denotes XOR. Then \(\Pr[Y=0\mid X_3=0]=\) ______.

Answers and explanations are free — they just need an account.

Question 21

NAT 2 marks · no negative Programming and Data Structures

Consider the following function written in C:

int f(int n) {
    static int i = 1;
    if (n >= 5) return n;
    n = n + i;
    i++;
    return f(n);
}

The value returned by f(1) is ______.

Answers and explanations are free — they just need an account.

Question 22

MCQ 2 marks · −0.66 Programming and Data Structures

Consider a max-heap stored in an array using the usual level-order (breadth-first) representation:

40, 30, 20, 10, 15, 16, 17, 8, 4

The value 35 is now inserted into this heap. After the insertion, the array representing the heap is:

Answers and explanations are free — they just need an account.

Question 23

MCQ 2 marks · −0.66 Theory of Computation

Let \(L\) be the language represented by the regular expression \(\Sigma^*0011\Sigma^*\), where \(\Sigma = \{0,1\}\). What is the minimum number of states in a DFA that recognizes \(\bar{L}\) (complement of \(L\))?

Answers and explanations are free — they just need an account.

Question 24

NAT 1 marks · no negative Theory of Computation

The number of states in the minimal deterministic finite automaton corresponding to the regular expression \((0+1)^*(10)\) is ______.

Answers and explanations are free — they just need an account.