The PYQ practice room

GATE CS 2023 Set 1

All 65 solved GATE CS 2023 Set 1 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

3

MCQ · NAT · MSQ

Revision mode

Self-paced

No timer. Focus on understanding.

Difficulty mixEasy 30Medium 29Hard 6

Explore the questions

65 of 65 questions

General Aptitude (GA)

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

    Question

    We reached the station late, and _______ missed the train.
    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

    Kind : _______ : : Often : Frequently
    (By word meaning)
    1. A.
      Mean
    2. B.
      Type
    3. C.
      Cruel
    4. D.
      Kindly

    Answer checking is unavailable for this question. You can review the published solution without a score.

    Open question page
  3. Think it through. Then check your answer.

    Question

    A series of natural numbers F1,F2,F3,F4,F5,F6,F7,F_1, F_2, F_3, F_4, F_5, F_6, F_7, \dots obeys Fn+1=Fn+Fn1F_{n+1} = F_n + F_{n-1} for all integers n2n \geq 2.
    If F6=37F_6 = 37, and F7=60F_7 = 60, then what is F1F_1?
    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 survey for a certain year found that 90%90\% of pregnant women received medical care at least once before giving birth. Of these women, 60%60\% received medical care from doctors, while 40%40\% received medical care from other healthcare providers.
    Given this information, which one of the following statements can be inferred with certainty?
    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

    Looking at the surface of a smooth 3-dimensional object from the outside, which one of the following options is TRUE?
    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

    The country of Zombieland is in distress since more than 75%75\% of its working population is suffering from serious health issues. Studies conducted by competent health experts concluded that a complete lack of physical exercise among its working population was one of the leading causes of their health issues. As one of the measures to address the problem, the Government of Zombieland has decided to provide monetary incentives to those who ride bicycles to work.
    Based only on the information provided above, which one of the following statements can be logically inferred with certainty?
    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

    Consider two functions of time (tt),f(t)=0.01t2f(t) = 0.01 t^2g(t)=4tg(t) = 4twhere 0<t<0 < t < \infty.
    Now consider the following two statements:
    (i) For some t>0t > 0, g(t)>f(t)g(t) > f(t).
    (ii) There exists a TT, such that f(t)>g(t)f(t) > g(t) for all t>Tt > T.
    Which one of the following options is TRUE?
    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

    Which one of the following sentence sequences creates a coherent narrative?
    (i) Once on the terrace, on her way to her small room in the corner, she notices the man right away.
    (ii) She begins to pant by the time she has climbed all the stairs.
    (iii) Mina has bought vegetables and rice at the market, so her bags are heavy.
    (iv) He was leaning against the parapet, watching the traffic below.
    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

    f(x)f(x) and g(y)g(y) are functions of xx and yy, respectively, and f(x)=g(y)f(x) = g(y) for all real values of xx and yy. Which one of the following options is necessarily TRUE for all xx and yy?
    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

    Which one of the options best describes the transformation of the 2-dimensional figure P to Q, and then to R, as shown?
    A sequence of transformations of a star-shaped figure labeled P, Q, and R. Operation 1 transforms P to Q, and Operation 2 transforms Q to R.
    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 (CS)

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

    Question

    Consider the following statements regarding the front-end and back-end of a compiler.
    S1: The front-end includes phases that are independent of the target hardware.
    S2: The back-end includes phases that are specific to the target hardware.
    S3: The back-end includes phases that are specific to the programming language used in the source code.
    Identify the CORRECT option.
    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

    Which one of the following sequences when stored in an array at locations A[1],,A[10]A[1], \dots, A[10] forms a max-heap?
    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

    Let SLLdel be a function that deletes a node in a singly-linked list given a pointer to the node and a pointer to the head of the list. Similarly, let DLLdel be another function that deletes a node in a doubly-linked list given a pointer to the node and a pointer to the head of the list.
    Let nn denote the number of nodes in each of the linked lists. Which one of the following choices is TRUE about the worst-case time complexity of SLLdel and DLLdel?
    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

    Consider the Deterministic Finite-state Automaton (DFA) A\mathcal{A} shown below. The DFA runs on the alphabet {0,1}\{0, 1\}, and has the set of states {s,p,q,r}\{s, p, q, r\}, with ss being the start state and pp being the only final state.
    A DFA with four states s, p, q, r. s is the start state. p is the final state. Transitions: s to p on 1, s to r on 0. p has a self-loop on 0 and goes to q on 1. q goes to p on 1 and to r on 0. r has a self-loop on 0,1.
    Which one of the following regular expressions correctly describes the language accepted by A\mathcal{A}?
    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

    The Lucas sequence LnL_n is defined by the recurrence relation:Ln=Ln1+Ln2, for n3,L_n = L_{n-1} + L_{n-2}, \text{ for } n \geq 3,with L1=1L_1 = 1 and L2=3L_2 = 3.
    Which one of the options given is TRUE?
    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 one of the options given below refers to the degree (or arity) of a relation in relational database systems?
    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

    Suppose two hosts are connected by a point-to-point link and they are configured to use Stop-and-Wait protocol for reliable data transfer. Identify in which one of the following scenarios, the utilization of the link is the lowest.
    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

    LetA=[1234412334122341]A = \begin{bmatrix} 1 & 2 & 3 & 4 \\ 4 & 1 & 2 & 3 \\ 3 & 4 & 1 & 2 \\ 2 & 3 & 4 & 1 \end{bmatrix}andB=[3412412312342341].B = \begin{bmatrix} 3 & 4 & 1 & 2 \\ 4 & 1 & 2 & 3 \\ 1 & 2 & 3 & 4 \\ 2 & 3 & 4 & 1 \end{bmatrix}.Let det(A)\det(A) and det(B)\det(B) denote the determinants of the matrices AA and BB, respectively.
    Which one of the options given below is TRUE?
    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 definition of a lexical token id for an identifier in a programming language, using extended regular expressions:
    letter \rightarrow [A-Za-z]
    digit \rightarrow [0-9]
    id \rightarrow letter (letter | digit)^*.
    Which one of the following Non-deterministic Finite-state Automata with ϵ\epsilon-transitions accepts the set of valid identifiers? (A double-circle denotes a final state)
    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 algorithm has to store several keys generated by an adversary in a hash table. The adversary is malicious who tries to maximize the number of collisions. Let kk be the number of keys, mm be the number of slots in the hash table, and k>mk > m.
    Which one of the following is the best hashing strategy to counteract the adversary?
    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

    The output of a 2-input multiplexer is connected back to one of its inputs as shown in the figure.
    Match the functional equivalence of this circuit to one of the following options.
    A 2-input multiplexer with inputs 0 and 1, select line S, and output Q. Output Q is fed back to input 0. Input 1 and select line S are connected to external signals.

    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

    Which one or more of the following need to be saved on a context switch from one thread (T1T_1) of a process to another thread (T2T_2) of the same process?
    Your answer

    Select all that apply, 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

    Which one or more of the following options guarantee that a computer system will transition from user mode to kernel mode?
    Your answer

    Select all that apply, 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

    Which of the following statements is/are CORRECT?
    Your answer

    Select all that apply, 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

    Which of the following statements is/are INCORRECT about the OSPF (Open Shortest Path First) routing protocol used in the Internet?
    Your answer

    Select all that apply, 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

    Geetha has a conjecture about integers, which is of the formx(P(x)    yQ(x,y)),\forall x (P(x) \implies \exists y Q(x, y)),where PP is a statement about integers, and QQ is a statement about pairs of integers. Which of the following (one or more) option(s) would imply Geetha’s conjecture?
    Your answer

    Select all that apply, 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

    Which one or more of the following CPU scheduling algorithms can potentially cause starvation?
    1. A.
      First-in First-Out
    2. B.
      Round Robin
    3. C.
      Priority Scheduling
    4. D.
      Shortest Job First

    Answer checking is unavailable for this question. You can review the published solution without a score.

    Open question page
  18. Think it through. Then check your answer.

    Question

    Letf(x)=x3+15x233x36f(x) = x^3 + 15x^2 - 33x - 36be a real-valued function.
    Which of the following statements is/are TRUE?
    Your answer

    Select all that apply, 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

    Let ff and gg be functions of natural numbers given by f(n)=nf(n) = n and g(n)=n2g(n) = n^2. Which of the following statements is/are TRUE?
    Your answer

    Select all that apply, then check your answer.

    Restoring your progress…

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

    Question

    Let AA be the adjacency matrix of the graph with vertices {1, 2, 3, 4, 5}.
    Directed graph with 5 vertices. Vertex 3 and 4 have self-loops. Edges exist from 5 to 3, 5 to 4, 3 to 2, 4 to 2, and 2 to 1.
    Let λ1,λ2,λ3,λ4\lambda_1, \lambda_2, \lambda_3, \lambda_4, and λ5\lambda_5 be the five eigenvalues of AA. Note that these eigenvalues need not be distinct.
    The value of λ1+λ2+λ3+λ4+λ5=________\lambda_1 + \lambda_2 + \lambda_3 + \lambda_4 + \lambda_5 = \_\_\_\_\_\_\_\_.
    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

    The value of the definite integral332211(4x2yz3)dzdydx\int_{-3}^{3} \int_{-2}^{2} \int_{-1}^{1} (4x^2y - z^3) \, dz \, dy \, dxis ________. (Rounded off to the nearest integer)
    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

    A particular number is written as 132 in radix-4 representation. The same number in radix-5 representation 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

    Consider a 3-stage pipelined processor having a delay of 10 ns (nanoseconds), 20 ns, and 14 ns, for the first, second, and the third stages, respectively. Assume that there is no other delay and the processor does not suffer from any pipeline hazards. Also assume that one instruction is fetched every cycle.
    The total execution time for executing 100 instructions on this processor is ________ ns.
    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

    A keyboard connected to a computer is used at a rate of 1 keystroke per second. The computer system polls the keyboard every 10 ms (milli seconds) to check for a keystroke and consumes 100 μ\mu s (micro seconds) for each poll. If it is determined after polling that a key has been pressed, the system consumes an additional 200 μ\mu s to process the keystroke. Let T1T_1 denote the fraction of a second spent in polling and processing a keystroke.
    In an alternative implementation, the system uses interrupts instead of polling. An interrupt is raised for every keystroke. It takes a total of 1 ms for servicing an interrupt and processing a keystroke. Let T2T_2 denote the fraction of a second spent in servicing the interrupt and processing a keystroke.
    The ratio T1T2\frac{T_1}{T_2} is ________. (Rounded off to one decimal place)
    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 integer value printed by the ANSI-C program given below is ________.
    #include<stdio.h>
    int funcp(){
        static int x = 1;
        x++;
        return x;
    }
    int main(){
        int x,y;
        x = funcp();
        y = funcp()+x;
        printf("%d\n", (x+y));
        return 0;
    }
    
    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

    Consider the following program:
    int main()
    {
        f1();
        f2(2);
        f3();
        return(0);
    }
    int f1()
    {
        return(1);
    }
    int f2(int X)
    {
        f3();
        if (X==1)
            return f1();
        else
            return (X*f2(X-1));
    }
    int f3()
    {
        return(5);
    }
    
    Which one of the following options represents the activation tree corresponding to the main function?
    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

    Consider the control flow graph shown.
    Which one of the following choices correctly lists the set of live variables at the exit point of each basic block?
    Control flow graph with basic blocks B1, B2, B3, B4 and an EXIT node. B1 contains i = m - 1, j = n, a = 10. B2 contains i = i + 1, j = j - 1. B3 contains a = 20. B4 contains i = a + 1. There are edges from ENTRY to B1, B1 to B2, B2 to B3, B2 to B4, B3 to B4, B4 to B2, B4 to EXIT, and a self-loop on B2.

    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

    Consider the two functions incr and decr shown below.
    incr(){
      wait(s);
      X = X+1;
      signal(s);
    }
    

    decr(){
      wait(s);
      X = X-1;
      signal(s);
    }
    
    There are 5 threads each invoking incr once, and 3 threads each invoking decr once, on the same shared variable XX. The initial value of XX is 10.
    Suppose there are two implementations of the semaphore ss, as follows:
    I-1: ss is a binary semaphore initialized to 1.
    I-2: ss is a counting semaphore initialized to 2.
    Let V1V1, V2V2 be the values of XX at the end of execution of all the threads with implementations I-1, I-2, respectively.
    Which one of the following choices corresponds to the minimum possible values of V1V1, V2V2, respectively?
    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

    Consider the context-free grammar GG belowSaSbXXaXXbab\begin{aligned} S &\rightarrow aSb \mid X \\ X &\rightarrow aX \mid Xb \mid a \mid b \end{aligned}where SS and XX are non-terminals, and aa and bb are terminal symbols. The starting non-terminal is SS.
    Which one of the following statements is CORRECT?
    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 pushdown automaton (PDA) PP below, which runs on the input alphabet {a,b}\{a, b\}, has stack alphabet {,A}\{\perp, A\}, and has three states {s,p,q}\{s, p, q\}, with ss being the start state. A transition from state uu to state vv, labelled c/X/γc/X/\gamma, where cc is an input symbol or ϵ\epsilon, XX is a stack symbol, and γ\gamma is a string of stack symbols, represents the fact that in state uu, the PDA can read cc from the input, with XX on the top of its stack, pop XX from the stack, push in the string γ\gamma on the stack, and go to state vv. In the initial configuration, the stack has only the symbol \perp in it. The PDA accepts by empty stack.
    PDA state transition diagram
    Which one of the following options correctly describes the language accepted by PP?
    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

    Consider the given C-code and its corresponding assembly code, with a few operands U1–U4 being unknown. Some useful information as well as the semantics of each unique assembly instruction is annotated as inline comments in the code. The memory is byte-addressable.
    //C-code
    int a[10], b[10], i;
    // int is 32-bit
    for (i=0; i<10;i++)
        a[i] = b[i] * 8;
    
    ;assembly-code (; indicates comments)
    ;r1-r5 are 32-bit integer registers
    ;initialize r1=0, r2=10
    ;initialize r3, r4 with base address of a, b
    L01: jeq r1, r2, end ;if(r1==r2) goto end
    L02: lw r5, 0(r4)    ;r5 <- Memory[r4+0]
    L03: shl r5, r5, U1  ;r5 <- r5 << U1
    L04: sw r5, 0(r3)    ;Memory[r3+0] <- r5
    L05: add r3, r3, U2  ;r3 <- r3+U2
    L06: add r4, r4, U3
    L07: add r1, r1, 1
    L08: jmp U4          ;goto U4
    L09: end
    
    Which one of the following options is a CORRECT replacement for operands in the position (U1, U2, U3, U4) in the above assembly code?
    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

    A 4 kilobyte (KB) byte-addressable memory is realized using four 1 KB memory blocks. Two input address lines (IA4 and IA3) are connected to the chip select (CS) port of these memory blocks through a decoder as shown in the figure. The remaining ten input address lines from IA11–IA0 are connected to the address port of these blocks. The chip select (CS) is active high.
    Memory organization circuit diagram with decoder and four 1KB blocks
    The input memory addresses (IA11–IA0), in decimal, for the starting locations (Addr=0) of each block (indicated as X1, X2, X3, X4 in the figure) are among the options given below. Which one of the following options is CORRECT?
    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

    Consider a sequential digital circuit consisting of TT flip-flops and DD flip-flops as shown in the figure. CLKIN is the clock input to the circuit. At the beginning, Q1Q_1, Q2Q_2 and Q3Q_3 have values 0, 1 and 1, respectively.
    Sequential digital circuit with T and D flip-flops
    Which one of the given values of (Q1Q_1, Q2Q_2, Q3Q_3) can NEVER be obtained with this digital circuit?
    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

    A Boolean digital circuit is composed using two 4-input multiplexers (M1 and M2) and one 2-input multiplexer (M3) as shown in the figure. X0X7X_0–X_7 are the inputs of the multiplexers M1 and M2 and could be connected to either 0 or 1. The select lines of the multiplexers are connected to Boolean variables AA, BB and CC as shown.
    Boolean digital circuit with multiplexers
    Which one of the following set of values of (X0,X1,X2,X3,X4,X5,X6,X7)(X_0, X_1, X_2, X_3, X_4, X_5, X_6, X_7) will realise the Boolean function A+A.C+A.B.C\overline{A} + \overline{A}.\overline{C} + A.\overline{B}.C?
    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 the IEEE-754 single precision floating point numbers P=0xC1800000P=0xC1800000 and Q=0x3F5C2EF4Q=0x3F5C2EF4. Which one of the following corresponds to the product of these numbers (i.e., P×QP \times Q), represented in the IEEE-754 single precision format?
    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

    Let AA be a priority queue for maintaining a set of elements. Suppose AA is implemented using a max-heap data structure. The operation EXTRACT-MAX(AA) extracts and deletes the maximum element from AA. The operation INSERT(A,keyA, key) inserts a new element keykey in AA. The properties of a max-heap are preserved at the end of each of these operations.
    When AA contains nn elements, which one of the following statements about the worst case running time of these two operations is TRUE?
    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 function foo and the binary tree shown.
    typedef struct node {
        int val;
        struct node *left, *right;
    } node;
    
    int foo(node *p) {
        int retval;
        if (p == NULL)
            return 0;
        else {
            retval = p->val + foo(p->left) + foo(p->right);
            printf("%d ", retval);
            return retval;
        }
    }
    
    A binary tree with root 10. Left child is 5, right child is 11. 5 has left child 3 and right child 8. 11 has right child 13.
    When foo is called with a pointer to the root node of the given binary tree, what will it print?
    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

    Let U={1,2,,n}U = \{1, 2, \dots, n\}, where nn is a large positive integer greater than 1000. Let kk be a positive integer less than nn. Let A,BA, B be subsets of UU with A=B=k|A| = |B| = k and AB=A \cap B = \emptyset. We say that a permutation of UU separates AA from BB if one of the following is true.
    • All members of AA appear in the permutation before any of the members of BB.
    • All members of BB appear in the permutation before any of the members of AA.
    How many permutations of UU separate AA from BB?
    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 f:ABf : A \to B be an onto (or surjective) function, where AA and BB are nonempty sets. Define an equivalence relation \sim on the set AA asa1a2 if f(a1)=f(a2),a_1 \sim a_2 \text{ if } f(a_1) = f(a_2),where a1,a2Aa_1, a_2 \in A. Let E={[x]:xA}\mathcal{E} = \{[x] : x \in A\} be the set of all the equivalence classes under \sim. Define a new mapping F:EBF : \mathcal{E} \to B asF([x])=f(x), for all the equivalence classes [x] in E.F([x]) = f(x), \text{ for all the equivalence classes } [x] \text{ in } \mathcal{E}.Which of the following statements is/are TRUE?
    Your answer

    Select all that apply, 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

    Suppose you are asked to design a new reliable byte-stream transport protocol like TCP. This protocol, named myTCP, runs over a 100 Mbps network with Round Trip Time of 150 milliseconds and the maximum segment lifetime of 2 minutes.
    Which of the following is/are valid lengths of the Sequence Number field in the myTCP header?
    Your answer

    Select all that apply, 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 XX be a set and 2X2^X denote the powerset of XX.
    Define a binary operation Δ\Delta on 2X2^X as follows:AΔB=(AB)(BA).A \Delta B = (A - B) \cup (B - A) .Let H=(2X,Δ)H = (2^X, \Delta). Which of the following statements about HH is/are correct?
    Your answer

    Select all that apply, 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

    Suppose in a web browser, you click on the www.gate-2023.in URL. The browser cache is empty. The IP address for this URL is not cached in your local host, so a DNS lookup is triggered (by the local DNS server deployed on your local host) over the 3-tier DNS hierarchy in an iterative mode. No resource records are cached anywhere across all DNS servers.
    Let RTTRTT denote the round trip time between your local host and DNS servers in the DNS hierarchy. The round trip time between the local host and the web server hosting www.gate-2023.in is also equal to RTTRTT. The HTML file associated with the URL is small enough to have negligible transmission time and negligible rendering time by your web browser, which references 10 equally small objects on the same web server.
    Which of the following statements is/are CORRECT about the minimum elapsed time between clicking on the URL and your browser fully rendering it?
    Your answer

    Select all that apply, 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 a random experiment where two fair coins are tossed. Let AA be the event that denotes HEAD on both the throws, BB be the event that denotes HEAD on the first throw, and CC be the event that denotes HEAD on the second throw.
    Which of the following statements is/are TRUE?
    Your answer

    Select all that apply, then check your answer.

    Restoring your progress…

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

    Question

    Consider functions Function_1 and Function_2 expressed in pseudocode as follows:
    Function 1
    while n > 1 do
        for i = 1 to n do
            x = x + 1;
        end for
        n = floor(n/2);
    end while
    
    Function 2
    for i = 1 to 100 * n do
        x = x + 1;
    end for
    
    Let f1(n)f_1(n) and f2(n)f_2(n) denote the number of times the statement "x=x+1x = x + 1" is executed in Function_1 and Function_2, respectively.
    Which of the following statements is/are TRUE?
    Your answer

    Select all that apply, then check your answer.

    Restoring your progress…

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

    Question

    Let GG be a simple, finite, undirected graph with vertex set {v1,,vn}\{v_1, \dots, v_n\}. Let Δ(G)\Delta(G) denote the maximum degree of GG and let N={1,2,}\mathbb{N} = \{1, 2, \dots\} denote the set of all possible colors. Color the vertices of GG using the following greedy strategy:
    for i = 1, ..., n
        color(v_i) ← min{j ∈ N : no neighbour of v_i is colored j}
    
    Which of the following statements is/are TRUE?
    Your answer

    Select all that apply, then check your answer.

    Restoring your progress…

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

    Question

    Let U={1,2,3}U = \{1, 2, 3\}. Let 2U2^U denote the powerset of UU. Consider an undirected graph GG whose vertex set is 2U2^U. For any A,B2UA, B \in 2^U, (A,B)(A, B) is an edge in GG if and only if (i) ABA \neq B, and (ii) either ABA \subsetneq B or BAB \subsetneq A. For any vertex AA in GG, the set of all possible orderings in which the vertices of GG can be visited in a Breadth First Search (BFS) starting from AA is denoted by B(A)\mathcal{B}(A).
    If \emptyset denotes the empty set, then the cardinality of B()\mathcal{B}(\emptyset) 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

    Consider the following two-dimensional array D in the C programming language, which is stored in row-major order:
    int D[128][128];
    
    Demand paging is used for allocating memory and each physical page frame holds 512 elements of the array D. The Least Recently Used (LRU) page-replacement policy is used by the operating system. A total of 30 physical page frames are allocated to a process which executes the following code snippet:
    for (int i = 0; i < 128; i++)
        for (int j = 0; j < 128; j++)
            D[j][i] *= 10;
    
    The number of page faults generated during the execution of this code snippet 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
  48. Think it through. Then check your answer.

    Question

    Consider a computer system with 57-bit virtual addressing using multi-level tree-structured page tables with L levels for virtual to physical address translation. The page size is 4 KB (1 KB = 1024 B) and a page table entry at any of the levels occupies 8 bytes.
    The value of L 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
  49. Think it through. Then check your answer.

    Question

    Consider a sequence aa of elements a0=1,a1=5,a2=7,a3=8,a4=9,a_0 = 1, a_1 = 5, a_2 = 7, a_3 = 8, a_4 = 9, and a5=2a_5 = 2. The following operations are performed on a stack SS and a queue QQ, both of which are initially empty.
    I: push the elements of aa from a0a_0 to a5a_5 in that order into SS.
    II: enqueue the elements of aa from a0a_0 to a5a_5 in that order into QQ.
    III: pop an element from SS.
    IV: dequeue an element from QQ.
    V: pop an element from SS.
    VI: dequeue an element from QQ.
    VII: dequeue an element from QQ and push the same element into SS.
    VIII: Repeat operation VII three times.
    IX: pop an element from SS.
    X: pop an element from SS.
    The top element of SS after executing the above operations 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

    Consider the syntax directed translation given by the following grammar and semantic rules. Here N,I,FN, I, F and BB are non-terminals. NN is the starting non-terminal, and #,0\#, \mathbf{0} and 1\mathbf{1} are lexical tokens corresponding to input letters "#", "0" and "1", respectively. X.valX.val denotes the synthesized attribute (a numeric value) associated with a non-terminal XX. I1I_1 and F1F_1 denote occurrences of II and FF on the right hand side of a production, respectively. For the tokens 0\mathbf{0} and 1\mathbf{1}, 0.val=0\mathbf{0}.val = 0 and 1.val=1\mathbf{1}.val = 1.
    The value computed by the translation scheme for the input string10#01110\#011is _______. (Rounded off to three decimal places)
    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 following table named Student in a relational database. The primary key of this table is rollNum.
    rollNumnamegendermarks
    1NamanM62
    2AliyaF70
    3AliyaF80
    4JamesM82
    5SwatiF65
    The SQL query below is executed on this database.
    SELECT *
    FROM Student
    WHERE gender = 'F' AND
    marks > 65;
    
    The number of rows returned by the 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
  52. Think it through. Then check your answer.

    Question

    Consider a database of fixed-length records, stored as an ordered file. The database has 25,000 records, with each record being 100 bytes, of which the primary key occupies 15 bytes. The data file is block-aligned in that each data record is fully contained within a block. The database is indexed by a primary index file, which is also stored as a block-aligned ordered file. The figure below depicts this indexing scheme.
    A diagram showing the relationship between an Index File and a Data File. The Index File contains blocks with 'Block Anchor Primary Key' and 'Block Pointer'. The Data File contains blocks with 'Primary Key (15 Bytes)' and 'Other Fields (85 Bytes)'. Arrows show pointers from the Index File to the start of blocks in the Data File.
    Suppose the block size of the file system is 1024 bytes, and a pointer to a block occupies 5 bytes. The system uses binary search on the index file to search for a record with a given key. You may assume that a binary search on an index file of bb blocks takes log2b\lceil \log_2 b \rceil block accesses in the worst case.
    Given a key, the number of block accesses required to identify the block in the data file that may contain a record with the key, in the worst case, 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 the language LL over the alphabet {0,1}\{0, 1\}, given below:L={w{0,1}w does not contain three or more consecutive 1’s}L = \{w \in \{0, 1\}^* \mid w \text{ does not contain three or more consecutive 1's}\}The minimum number of states in a Deterministic Finite-State Automaton (DFA) for LL 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

    An 8-way set associative cache of size 64 KB64\text{ KB} (1 KB=1024 bytes1\text{ KB} = 1024\text{ bytes}) is used in a system with 32-bit address. The address is sub-divided into TAG, INDEX, and BLOCK OFFSET.
    The number of bits in the TAG 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

    The forwarding table of a router is shown below.
    Subnet NumberSubnet MaskInterface ID
    200.150.0.0255.255.0.01
    200.150.64.0255.255.224.02
    200.150.68.0255.255.255.03
    200.150.68.64255.255.255.2244
    Default0
    A packet addressed to a destination address 200.150.68.118 arrives at the router. It will be forwarded to the interface with ID __________.
    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