The PYQ practice room

GATE CS 2017 Set 2

All 65 solved GATE CS 2017 Set 2 questions in exam order. Open a question, commit to an answer, and learn from the step-by-step solution. One question at a time.

Attempt before revealInstant answer feedbackExplore questions
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.

Questions

65

Paper marks

100

Question formats

2

MCQ · NAT

Revision mode

Self-paced

No timer. Focus on understanding.

Difficulty mixEasy 24Medium 37Hard 4

Explore the questions

65 of 65 questions

General Aptitude (GA)

10
  1. Think it through. Then check your answer.

    Question

    Choose the option with words that are not synonyms.
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  2. Think it through. Then check your answer.

    Question

    Saturn is __________ to be seen on a clear night with the naked eye.
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  3. Think it through. Then check your answer.

    Question

    There are five buildings called V, W, X, Y and Z in a row (not necessarily in that order). V is to the West of W. Z is to the East of X and the West of V. W is to the West of Y. Which is the building in the middle?
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  4. Think it through. Then check your answer.

    Question

    A test has twenty questions worth 100 marks in total. There are two types of questions. Multiple choice questions are worth 3 marks each and essay questions are worth 11 marks each. How many multiple choice questions does the exam have?
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  5. Think it through. Then check your answer.

    Question

    There are 3 red socks, 4 green socks and 3 blue socks. You choose 2 socks. The probability that they are of the same colour is
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  6. Think it through. Then check your answer.

    Question

    “We lived in a culture that denied any merit to literary works, considering them important only when they were handmaidens to something seemingly more urgent – namely ideology. This was a country where all gestures, even the most private, were interpreted in political terms.”
    The author’s belief that ideology is not as important as literature is revealed by the word:
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  7. Think it through. Then check your answer.

    Question

    There are three boxes. One contains apples, another contains oranges and the last one contains both apples and oranges. All three are known to be incorrectly labelled. If you are permitted to open just one box and then pull out and inspect only one fruit, which box would you open to determine the contents of all three boxes?
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  8. Think it through. Then check your answer.

    Question

    XX is a 30 digit number starting with the digit 4 followed by the digit 7. Then the number X3X^3 will have
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  9. Think it through. Then check your answer.

    Question

    The number of roots of ex+0.5x22=0e^x + 0.5x^2 - 2 = 0 in the range [5,5][-5, 5] is
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  10. Think it through. Then check your answer.

    Question

    An air pressure contour line joins locations in a region having the same atmospheric pressure. The following is an air pressure contour plot of a geographical region. Contour lines are shown at 0.050.05 bar intervals in this plot.
    An air pressure contour plot showing regions P, Q, R, and S with varying densities of contour lines.
    If the possibility of a thunderstorm is given by how fast air pressure rises or drops over a region, which of the following regions is most likely to have a thunderstorm?
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page

Computer Science and Information Technology

55
  1. Think it through. Then check your answer.

    Question

    The representation of the value of a 16-bit unsigned integer XX in hexadecimal number system is BCA9. The representation of the value of XX in octal number system is
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  2. Think it through. Then check your answer.

    Question

    Match the following:
    (P)static char var;(i)Sequence of memory locations to store addresses
    (Q)m = malloc(10); m = NULL;(ii)A variable located in data section of memory
    (R)char *ptr[10];(iii)Request to allocate a CPU register to store data
    (S)register int var1;(iv)A lost memory which cannot be freed
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  3. Think it through. Then check your answer.

    Question

    Match the algorithms with their time complexities:
    AlgorithmTime complexity
    (P) Towers of Hanoi with nn disks(i) Θ(n2)\Theta(n^2)
    (Q) Binary search given nn sorted numbers(ii) Θ(nlogn)\Theta(n \log n)
    (R) Heap sort given nn numbers at the worst case(iii) Θ(2n)\Theta(2^n)
    (S) Addition of two n×nn \times n matrices(iv) Θ(logn)\Theta(\log n)
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  4. Think it through. Then check your answer.

    Question

    Let L1,L2L_1, L_2 be any two context-free languages and RR be any regular language. Then which of the following is/are CORRECT?
    I. L1L2L_1 \cup L_2 is context-free.
    II. L1\overline{L_1} is context-free.
    III. L1RL_1 - R is context-free.
    IV. L1L2L_1 \cap L_2 is context-free.
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  5. Think it through. Then check your answer.

    Question

    Match the following according to input (from the left column) to the compiler phase (in the right column) that processes it:
    InputCompiler Phase
    (P) Syntax tree(i) Code generator
    (Q) Character stream(ii) Syntax analyzer
    (R) Intermediate representation(iii) Semantic analyzer
    (S) Token stream(iv) Lexical analyzer
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  6. Think it through. Then check your answer.

    Question

    Which of the following statements about parser is/are CORRECT?
    I. Canonical LR is more powerful than SLR.
    II. SLR is more powerful than LALR.
    III. SLR is more powerful than Canonical LR.
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  7. Think it through. Then check your answer.

    Question

    Which of the following is/are shared by all the threads in a process?
    I. Program counter
    II. Stack
    III. Address space
    IV. Registers
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  8. Think it through. Then check your answer.

    Question

    In a file allocation system, which of the following allocation scheme(s) can be used if no external fragmentation is allowed?
    I. Contiguous
    II. Linked
    III. Indexed
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  9. Think it through. Then check your answer.

    Question

    Consider the following statements about the routing protocols, Routing Information Protocol (RIP) and Open Shortest Path First (OSPF) in an IPv4 network.
    I: RIP uses distance vector routing
    II: RIP packets are sent using UDP
    III: OSPF packets are sent using TCP
    IV: OSPF operation is based on link-state routing
    Which of the statements above are CORRECT?
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  10. Think it through. Then check your answer.

    Question

    If f(x)=Rsin(πx2)+Sf(x) = R \sin \left( \frac{\pi x}{2} \right) + S, f(12)=2f' \left( \frac{1}{2} \right) = \sqrt{2} and 01f(x)dx=2Rπ\int_{0}^{1} f(x) dx = \frac{2R}{\pi}, then the constants RR and SS are, respectively
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  11. Think it through. Then check your answer.

    Question

    Let p,q,rp, q, r denote the statements "It is raining", "It is cold", and "It is pleasant", respectively. Then the statement "It is not raining and it is pleasant, and it is not pleasant only if it is raining and it is cold" is represented by
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  12. Think it through. Then check your answer.

    Question

    Given the following binary number in 32-bit (single precision) IEEE-754 format:
    00111110011011011010000000000000
    The decimal value closest to this floating-point number is
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  13. Think it through. Then check your answer.

    Question

    A circular queue has been implemented using a singly linked list where each node consists of a value and a single pointer pointing to the next node. We maintain exactly two external pointers FRONT and REAR pointing to the front node and the rear node of the queue, respectively. Which of the following statements is/are CORRECT for such a circular queue, so that insertion and deletion operations can be performed in O(1)O(1) TIME?
    I. Next pointer of front node points to the rear node.
    II. Next pointer of rear node points to the front node.
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  14. Think it through. Then check your answer.

    Question

    Consider the following function implemented in C:
    void printxy(int x, int y) {
        int *ptr;
        x = 0;
        ptr = &x;
        y = *ptr;
        *ptr = 1;
        printf("%d, %d", x, y);
    }
    
    The output of invoking printxy(1, 1) is
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  15. Think it through. Then check your answer.

    Question

    The Breadth First Search (BFS) algorithm has been implemented using the queue data structure. Which one of the following is a possible order of visiting the nodes in the graph below?
    An undirected graph with 6 nodes: M, N, O in the top row and R, Q, P in the bottom row. Edges exist between (M,N), (N,O), (R,Q), (Q,P), (M,R), (N,Q), (O,P), (M,Q), and (O,Q).
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  16. Think it through. Then check your answer.

    Question

    Identify the language generated by the following grammar, where SS is the start variable.

    S → XY
    XaXaX \rightarrow aX \mid a
    YaYbϵY \rightarrow aYb \mid \epsilon
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  17. Think it through. Then check your answer.

    Question

    An ER model of a database consists of entity types A and B. These are connected by a relationship R which does not have its own attribute. Under which one of the following conditions, can the relational table for R be merged with that of A?
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  18. Think it through. Then check your answer.

    Question

    Consider socket API on a Linux machine that supports connected UDP sockets. A connected UDP socket is a UDP socket on which connect function has already been called. Which of the following statements is/are CORRECT?
    I. A connected UDP socket can be used to communicate with multiple peers simultaneously.
    II. A process can successfully call connect function again for an already connected UDP socket.
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  19. Think it through. Then check your answer.

    Question

    Consider the following tables T1 and T2.
    T1T2
    PQRS
    2222
    3883
    7332
    5897
    6957
    8572
    98
    In table T1, P is the primary key and Q is the foreign key referencing R in table T2 with on-delete cascade and on-update cascade. In table T2, R is the primary key and S is the foreign key referencing P in table T1 with on-delete set NULL and on-update cascade. In order to delete record (3,8)(3, 8) from table T1, the number of additional records that need to be deleted from table T1 is ________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  20. Think it through. Then check your answer.

    Question

    The maximum number of IPv4 router addresses that can be listed in the record route (RR) option field of an IPv4 header is ________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  21. Think it through. Then check your answer.

    Question

    Consider the set X={a,b,c,d,e}X = \{a, b, c, d, e\} under the partial ordering
    R={(a,a),(a,b),(a,c),(a,d),(a,e),(b,b),(b,c),(b,e),(c,c),(c,e),(d,d),(d,e),(e,e)}R = \{(a, a), (a, b), (a, c), (a, d), (a, e), (b, b), (b, c), (b, e), (c, c), (c, e), (d, d), (d, e), (e, e)\}.
    The Hasse diagram of the partial order (X,R)(X, R) is shown below.
    Hasse diagram of the partial order (X, R)
    The minimum number of ordered pairs that need to be added to RR to make (X,R)(X, R) a lattice is ______.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  22. Think it through. Then check your answer.

    Question

    Let P=[111234323]P = \begin{bmatrix} 1 & 1 & -1 \\ 2 & -3 & 4 \\ 3 & -2 & 3 \end{bmatrix} and Q=[12161265105]Q = \begin{bmatrix} -1 & -2 & -1 \\ 6 & 12 & 6 \\ 5 & 10 & 5 \end{bmatrix} be two matrices.
    Then the rank of P+QP + Q is ________________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  23. Think it through. Then check your answer.

    Question

    GG is an undirected graph with nn vertices and 25 edges such that each vertex of GG has degree at least 3. Then the maximum possible value of nn is ______.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  24. Think it through. Then check your answer.

    Question

    Consider a quadratic equation x213x+36=0x^2 - 13x + 36 = 0 with coefficients in a base bb. The solutions of this equation in the same base bb are x=5x = 5 and x=6x = 6. Then b = ________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  25. Think it through. Then check your answer.

    Question

    The minimum possible number of states of a deterministic finite automaton that accepts the regular language L={w1aw2w1,w2{a,b},w1=2,w23}L = \{w_1 a w_2 \mid w_1, w_2 \in \{a, b\}^*, |w_1| = 2, |w_2| \geq 3\} is ________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  26. Think it through. Then check your answer.

    Question

    P and Q are considering to apply for a job. The probability that P applies for the job is 14\frac{1}{4}, the probability that P applies for the job given that Q applies for the job is 12\frac{1}{2}, and the probability that Q applies for the job given that P applies for the job is 13\frac{1}{3}. Then the probability that P does not apply for the job given that Q does not apply for the job is
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  27. Think it through. Then check your answer.

    Question

    If w,x,y,zw, x, y, z are Boolean variables, then which one of the following is INCORRECT?
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  28. Think it through. Then check your answer.

    Question

    Given f(w,x,y,z)=m(0,1,2,3,7,8,10)+d(5,6,11,15)f(w, x, y, z) = \sum_m(0, 1, 2, 3, 7, 8, 10) + \sum_d(5, 6, 11, 15), where dd represents the don't-care condition in Karnaugh maps. Which of the following is a minimum product-of-sums (POS) form of f(w,x,y,z)f(w, x, y, z)?
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  29. Think it through. Then check your answer.

    Question

    In a two-level cache system, the access times of L1L_1 and L2L_2 caches are 1 and 8 clock cycles, respectively. The miss penalty from the L2L_2 cache to main memory is 18 clock cycles. The miss rate of L1L_1 cache is twice that of L2L_2. The average memory access time (AMAT) of this cache system is 2 cycles. The miss rates of L1L_1 and L2L_2 respectively are:
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  30. Think it through. Then check your answer.

    Question

    Consider the recurrence functionT(n)={2T(n)+1,n>22,0<n2T(n) = \begin{cases} 2T(\sqrt{n}) + 1, & n > 2 \\ 2, & 0 < n \leq 2 \end{cases}Then T(n)T(n) in terms of Θ\Theta notation is
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  31. Think it through. Then check your answer.

    Question

    For any discrete random variable XX, with probability mass function
    P(X=j)=pj,pj0,j{0,...,N}P(X = j) = p_j, p_j \ge 0, j \in \{0,..., N\}, and j=0Npj=1\sum_{j=0}^{N} p_j = 1, define the polynomial function
    gX(z)=j=0Npjzjg_X(z) = \sum_{j=0}^{N} p_j z^j. For a certain discrete random variable YY, there exists a scalar β[0,1]\beta \in [0,1] such that gY(z)=(1β+βz)Ng_Y(z) = (1 - \beta + \beta z)^N. The expectation of YY is
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  32. Think it through. Then check your answer.

    Question

    Consider the following expression grammar G:
    E -> E - T | T
    T -> T + F | F
    F -> (E) | id
    

    Which of the following grammars is not left recursive, but is equivalent to G?
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  33. Think it through. Then check your answer.

    Question

    A system shares 9 tape drives. The current allocation and maximum requirement of tape drives for three processes are shown below:
    ProcessCurrent AllocationMaximum Requirement
    P137
    P216
    P335
    Which of the following best describes current state of the system?
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  34. Think it through. Then check your answer.

    Question

    Consider a binary code that consists of only four valid codewords as given below:
    00000, 01011, 10101, 11110
    Let the minimum Hamming distance of the code be pp and the maximum number of erroneous bits that can be corrected by the code be qq. Then the values of pp and qq are
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  35. Think it through. Then check your answer.

    Question

    Consider two hosts XX and YY, connected by a single direct link of rate 10610^6 bits/sec. The distance between the two hosts is 10,00010,000 km and the propagation speed along the link is 2×1082 \times 10^8 m/sec. Host XX sends a file of 50,00050,000 bytes as one large message to host YY continuously. Let the transmission and propagation delays be pp milliseconds and qq milliseconds, respectively. Then the values of pp and qq are
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  36. Think it through. Then check your answer.

    Question

    The pre-order traversal of a binary search tree is given by 12, 8, 6, 2, 7, 9, 10, 16, 15, 19, 17, 20. Then the post-order traversal of this tree is:
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  37. Think it through. Then check your answer.

    Question

    Consider the C program fragment below which is meant to divide xx by yy using repeated subtractions. The variables x,y,qx, y, q and rr are all unsigned int.
    while (r >= y) {
        r = r - y;
        q = q + 1;
    }
    
    Which of the following conditions on the variables x,y,qx, y, q and rr before the execution of the fragment will ensure that the loop terminates in a state satisfying the condition x==(yq+r)x == (y*q + r)?
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  38. Think it through. Then check your answer.

    Question

    Consider the following C function.
    int fun(int n) {
        int i, j;
        for(i = 1; i <= n; i++) {
            for(j = 1; j < n; j += i) {
                printf(" %d %d", i, j);
            }
        }
    }
    
    Time complexity of fun in terms of Θ\Theta notation is
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  39. Think it through. Then check your answer.

    Question

    Let δ\delta denote the transition function and δ^\hat{\delta} denote the extended transition function of the ϵ\epsilon-NFA whose transition table is given below:
    δ\deltaϵ\epsilonaabb
    q0\rightarrow q_0{q2}\{q_2\}{q1}\{q_1\}{q0}\{q_0\}
    q1q_1{q2}\{q_2\}{q2}\{q_2\}{q3}\{q_3\}
    q2q_2{q0}\{q_0\}\emptyset\emptyset
    q3q_3\emptyset\emptyset{q2}\{q_2\}
    Then δ^(q2,aba)\hat{\delta}(q_2, aba) is
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  40. Think it through. Then check your answer.

    Question

    Consider the following languages.

    L1={app is a prime number}L_1 = \{a^p \mid p \text{ is a prime number}\}
    L2={anbmc2mn0,m0}L_2 = \{a^n b^m c^{2m} \mid n \geq 0, m \geq 0\}
    L3={anbnc2nn0}L_3 = \{a^n b^n c^{2n} \mid n \geq 0\}
    L4={anbnn1}L_4 = \{a^n b^n \mid n \geq 1\}

    Which of the following are CORRECT?
    I. L1L_1 is context-free but not regular.
    II. L2L_2 is not context-free.
    III. L3L_3 is not context-free but recursive.
    IV. L4L_4 is deterministic context-free.
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  41. Think it through. Then check your answer.

    Question

    Let L(R) be the language represented by regular expression RR. Let L(G) be the language generated by a context free grammar GG. Let L(M) be the language accepted by a Turing machine MM. Which of the following decision problems are undecidable?
    I. Given a regular expression RR and a string ww, is wL(R)w \in L(R)?
    II. Given a context-free grammar GG, is L(G)=L(G) = \emptyset?
    III. Given a context-free grammar GG, is L(G)=ΣL(G) = \Sigma^* for some alphabet Σ\Sigma?
    IV. Given a Turing machine MM and a string ww, is wL(M)w \in L(M)?
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  42. Think it through. Then check your answer.

    Question

    The next state table of a 2-bit saturating up-counter is given below.
    Q1Q_1Q0Q_0Q1+Q_1^+Q0+Q_0^+
    0001
    0110
    1011
    1111
    The counter is built as a synchronous sequential circuit using T flip-flops. The expressions for T1T_1 and T0T_0 are
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  43. Think it through. Then check your answer.

    Question

    Consider the following snippet of a C program. Assume that swap(&x, &y) exchanges the contents of x and y.
    int main() {
        int array[] = {3, 5, 1, 4, 6, 2};
        int done = 0;
        int i;
    
        while (done == 0) {
            done = 1;
            for (i=0; i<=4; i++) {
                if (array[i] < array[i+1]) {
                    swap(&array[i], &array[i+1]);
                    done = 0;
                }
            }
            for (i=5; i>=1; i--) {
                if (array[i] > array[i-1]) {
                    swap(&array[i], &array[i-1]);
                    done = 0;
                }
            }
        }
        printf("%d", array[3]);
    }
    
    The output of the program is ________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  44. Think it through. Then check your answer.

    Question

    Two transactions T1T_1 and T2T_2 are given as

    T1:r1(X)w1(X)r1(Y)w1(Y)T_1: r_1(X) w_1(X) r_1(Y) w_1(Y)
    T2:r2(Y)w2(Y)r2(Z)w2(Z)T_2: r_2(Y) w_2(Y) r_2(Z) w_2(Z)

    where ri(V)r_i(V) denotes a read operation by transaction TiT_i on a variable VV and wi(V)w_i(V) denotes a write operation by transaction TiT_i on a variable VV. The total number of conflict serializable schedules that can be formed by T1T_1 and T2T_2 is ________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  45. Think it through. Then check your answer.

    Question

    The read access times and the hit ratios for different caches in a memory hierarchy are as given below.
    CacheRead access time (in nanoseconds)Hit ratio
    I-cache20.8
    D-cache20.9
    L2-cache80.9
    The read access time of main memory is 90 nanoseconds. Assume that the caches use the referred-word-first read policy and the write back policy. Assume that all the caches are direct mapped caches. Assume that the dirty bit is always 0 for all the blocks in the caches. In execution of a program, 60% of memory reads are for instruction fetch and 40% are for memory operand fetch. The average read access time in nanoseconds (up to 2 decimal places) is ________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  46. Think it through. Then check your answer.

    Question

    Consider the following database table named top_scorer.

    top_scorer

    playercountrygoals
    KloseGermany16
    RonaldoBrazil15
    G MüllerGermany14
    FontaineFrance13
    PeléBrazil12
    KlinsmannGermany11
    KocsisHungary11
    BatistutaArgentina10
    CubillasPeru10
    LatoPoland10
    LinekerEngland10
    T MüllerGermany10
    RahnGermany10
    Consider the following SQL query:
    SELECT ta.player FROM top_scorer AS ta
    WHERE ta.goals >ALL (SELECT tb.goals
                         FROM top_scorer AS tb
                         WHERE tb.country = 'Spain')
    AND ta.goals >ANY (SELECT tc.goals
                       FROM top_scorer AS tc
                       WHERE tc.country = 'Germany')
    
    The number of tuples returned by the above SQL query is __________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  47. Think it through. Then check your answer.

    Question

    If the ordinary generating function of a sequence {an}n=0\{a_n\}_{n=0}^\infty is 1+z(1z)3\frac{1+z}{(1-z)^3}, then a3a0a_3 - a_0 is equal to __________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  48. Think it through. Then check your answer.

    Question

    If a random variable XX has a Poisson distribution with mean 5, then the expectation E[(X+2)2]E[(X+2)^2] equals __________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  49. Think it through. Then check your answer.

    Question

    In a B+ tree, if the search-key value is 8 bytes long, the block size is 512 bytes and the block pointer size is 2 bytes, then the maximum order of the B+ tree is ___________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  50. Think it through. Then check your answer.

    Question

    A message is made up entirely of characters from the set X={P,Q,R,S,T}X = \{P, Q, R, S, T\}. The table of probabilities for each of the characters is shown below:
    CharacterProbability
    PP0.22
    QQ0.34
    RR0.17
    SS0.19
    TT0.08
    Total1.00
    If a message of 100 characters over XX is encoded using Huffman coding, then the expected length of the encoded message in bits is ___________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  51. Think it through. Then check your answer.

    Question

    Consider the set of processes with arrival time (in milliseconds), CPU burst time (in milliseconds), and priority (0 is the highest priority) shown below. None of the processes have I/O burst time.
    ProcessArrival TimeBurst TimePriority
    P1P_10112
    P2P_25280
    P3P_31223
    P4P_42101
    P5P_59164
    The average waiting time (in milliseconds) of all the processes using preemptive priority scheduling algorithm is ___________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  52. Think it through. Then check your answer.

    Question

    If the characteristic polynomial of a 3×33 \times 3 matrix MM over R\mathbb{R} (the set of real numbers) is λ34λ2+aλ+30\lambda^3 - 4\lambda^2 + a\lambda + 30, aRa \in \mathbb{R}, and one eigenvalue of MM is 2, then the largest among the absolute values of the eigenvalues of MM is ________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  53. Think it through. Then check your answer.

    Question

    Consider a machine with a byte addressable main memory of 2322^{32} bytes divided into blocks of size 32 bytes. Assume that a direct mapped cache having 512 cache lines is used with this machine. The size of the tag field in bits is ________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  54. Think it through. Then check your answer.

    Question

    Consider the following C Program.
    #include<stdio.h>
    int main() {
        int m = 10;
        int n, n1;
        n = ++m;
        n1 = m++;
        n--;
        --n1;
        n -= n1;
        printf("%d", n);
        return 0;
    }
    
    The output of the program is ________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page
  55. Think it through. Then check your answer.

    Question

    Consider the following C Program.
    #include<stdio.h>
    #include<string.h>
    int main() {
        char* c = "GATECSIT2017";
        char* p = c;
        printf("%d", (int)strlen(c+2[p]-6[p]-1));
        return 0;
    }
    
    The output of the program is ________.
    Your answer

    Enter a number. Decimals, negative values and scientific notation are accepted.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page