The PYQ practice room

GATE CS 2025 Set 1

All 65 solved GATE CS 2025 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 25Medium 36Hard 4

Explore the questions

65 of 65 questions

General Aptitude (GA)

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

    Question

    Ravi had ________ younger brother who taught at ___________ university. He was widely regarded as ___________ honorable man.
    Select the option with the correct sequence of articles to fill in the blanks.
    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

    The CEO’s decision to downsize the workforce was considered myopic because it sacrificed long-term stability to accommodate short-term gains.
    Select the most appropriate option that can replace the word “myopic” without changing the meaning of the sentence.
    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

    The average marks obtained by a class in an examination were calculated as 30.830.8. However, while checking the marks entered, the teacher found that the marks of one student were entered incorrectly as 2424 instead of 4242. After correcting the marks, the average becomes 31.431.4. How many students does the class have?
    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 relationships among PP, QQ, RR, SS, and TT:
    • PP is the brother of QQ.
    • SS is the daughter of QQ.
    • TT is the sister of SS.
    • RR is the mother of QQ.
    The following statements are made based on the relationships given above.
    (1) RR is the grandmother of SS.
    (2) PP is the uncle of SS and TT.
    (3) RR has only one son.
    (4) QQ has only one daughter.
    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
  5. Think it through. Then check your answer.

    Question

    According to the map shown in the figure, which one of the following statements is correct?
    A campus map showing buildings like Library, Physics Lab, Hostels, Classrooms, Canteen, Hospital, and Chemistry Lab relative to 1st Main Road and 5th Cross Road, with a compass indicator.
    Note: The figure shown is representative.
    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

    “I put the brown paper in my pocket along with the chalks, and possibly other things. I suppose every one must have reflected how primeval and how poetical are the things that one carries in one’s pocket: the pocket-knife, for instance the type of all human tools, the infant of the sword. Once I planned to write a book of poems entirely about the things in my pocket. But I found it would be too long: and the age of the great epics is past.”
    (From G.K. Chesterton’s “A Piece of Chalk”)
    Based only on the information provided in the above passage, which one of the following statements is true?
    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

    In the diagram, the lines QRQR and STST are parallel to each other. The shortest distance between these two lines is half the shortest distance between the point PP and line QRQR. What is the ratio of the area of the triangle PSTPST to the area of the trapezium SQRTSQRT?
    Note: The figure shown is representative.
    Triangle PQR with a line segment ST parallel to QR, forming a smaller triangle PST and a trapezium SQRT.
    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

    A fair six-faced dice, with the faces labelled ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, and ‘6’, is rolled thrice. What is the probability of rolling ‘6’ exactly once?
    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

    A square paper, shown in figure (I), is folded along the dotted lines as shown in the figures (II) and (III). Then a few cuts are made as shown in figure (IV). Which one of the following patterns will be obtained when the paper is unfolded?
    Note: The figures shown are representative.
    Sequence of paper folding (I, II, III) and cutting (IV).
    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

    A shop has 4 distinct flavors of ice-cream. One can purchase any number of scoops of any flavor. The order in which the scoops are purchased is inconsequential.
    If one wants to purchase 3 scoops of ice-cream, in how many ways can one make that purchase?
    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

    Suppose a 55-bit message is transmitted from a source to a destination through a noisy channel. The probability that a bit of the message gets flipped during transmission is 0.010.01. Flipping of each bit is independent of one another. The probability that the message is delivered error-free to the destination is ______ . (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
  12. Think it through. Then check your answer.

    Question

    Suppose a message of size 1500015000 bytes is transmitted from a source to a destination using IPv4 protocol via two routers as shown in the figure. Each router has a defined maximum transmission unit (MTU) as shown in the figure, including IP header. The number of fragments that will be delivered to the destination is ________ . (Answer in integer)
    A network diagram showing a Source connected to Router-1 with MTU=5000 bytes, which is connected to Router-2 with MTU=3000 bytes, which is finally connected to the Destination.

    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
  13. Think it through. Then check your answer.

    Question

    Consider a probability distribution given by the density function P(x)P(x).P(x)={Cx2,for 1x40,for x<1 or x>4P(x) = \begin{cases} Cx^2, & \text{for } 1 \leq x \leq 4 \\ 0, & \text{for } x < 1 \text{ or } x > 4 \end{cases}The probability that xx lies between 22 and 33, i.e., P(2x3)P(2 \leq x \leq 3) is __________. (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
  14. Think it through. Then check your answer.

    Question

    Consider a finite state machine (FSM) with one input XX and one output ff, represented by the given state transition table. The minimum number of states required to realize this FSM is ________. (Answer in integer)
    A state transition table with columns for Present state (A to H), Next state for X=0 and X=1, and Output f for X=0 and X=1.

    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
  15. Think it through. Then check your answer.

    Question

    Consider the given sequential circuit designed using DD-Flip-flops. The circuit is initialized with some value (initial state). The number of distinct states the circuit will go through before returning back to the initial state is _________ . (Answer in integer)
    A sequential circuit diagram showing four D-flip-flops (D0, D1, D2, D3) connected in a twisted ring configuration where the inverted output of the last flip-flop is fed back to the input of the first.

    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
  16. Think it through. Then check your answer.

    Question

    Consider the following C program:
    #include <stdio.h>
    int gate (int n) {
        int d, t, newnum, turn;
        newnum = turn = 0; t=1;
        while (n>=t) t *= 10;
        t /=10;
        while (t>0) {
            d = n/t;
            n = n%t;
            t /= 10;
            if (turn) newnum = 10*newnum + d;
            turn = (turn + 1) % 2;
        }
        return newnum;
    }
    int main () {
        printf ("%d", gate(14362));
        return 0;
    }
    
    The value printed by the given C program is _______ . (Answer in 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

Computer Science and Information Technology (CS1)

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

    Question

    Suppose a program is running on a non-pipelined single processor computer system. The computer is connected to an external device that can interrupt the processor asynchronously. The processor needs to execute the interrupt service routine (ISR) to serve this interrupt. The following steps (not necessarily in order) are taken by the processor when the interrupt arrives:
    (i) The processor saves the content of the program counter.
    (ii) The program counter is loaded with the start address of the ISR.
    (iii) The processor finishes the present instruction.
    Which ONE of the following is the CORRECT sequence of steps?
    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 statements is FALSE regarding the symbol table?
    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

    Which ONE of the following techniques used in compiler code optimization uses live variable analysis?
    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 a demand paging memory management system with 32-bit logical address, 20-bit physical address, and page size of 2048 bytes. Assuming that the memory is byte addressable, what is the maximum number of entries in the page table?
    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

    A schedule of three database transactions T1,T2T_1, T_2, and T3T_3 is shown. Ri(A)R_i(A) and Wi(A)W_i(A) denote read and write of data item AA by transaction Ti,i=1,2,3T_i, i = 1,2,3. The transaction T1T_1 aborts at the end. Which other transaction(s) will be required to be rolled back?R1(X)W1(Y)R2(X)R2(Y)R3(Y)ABORT(T1)R_1(X) W_1(Y) R_2(X) R_2(Y) R_3(Y) ABORT(T_1)
    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

    Identify the ONE CORRECT matching between the OSI layers and their corresponding functionalities as shown.
    OSI LayersFunctionalities
    (a)Network layer(I)Packet routing
    (b)Transport layer(II)Framing and error handling
    (c)Datalink layer(III)Host to host communication
    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

    g()g(\cdot) is a function from AA to BB, f()f(\cdot) is a function from BB to CC, and their composition defined as f(g())f(g(\cdot)) is a mapping from AA to CC.
    If f()f(\cdot) and f(g())f(g(\cdot)) are onto (surjective) functions, which ONE of the following is TRUE about the function g()g(\cdot)?
    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

    Let GG be any undirected graph with positive edge weights, and TT be a minimum spanning tree of GG. For any two vertices, uu and vv, let d1(u,v)d_1(u, v) and d2(u,v)d_2(u, v) be the shortest distances between uu and vv in GG and TT, respectively. Which ONE of the options is CORRECT for all possible G,T,uG, T, u and vv?
    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 context-free grammar GG, where S,AS, A, and BB are the variables (non-terminals), aa and bb are the terminal symbols, SS is the start variable, and the rules of GG are described as:SaaBAbbAaaABbbB\begin{aligned} S &\to aaB \mid Abb \\ A &\to a \mid aA \\ B &\to b \mid bB \end{aligned}Which ONE of the languages L(G) is accepted by GG?
    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

    Consider the following recurrence relation:T(n)=2T(n1)+n2n for n>0,T(0)=1.T(n) = 2T(n - 1) + n 2^n \text{ for } n > 0, T(0) = 1.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
  11. Think it through. Then check your answer.

    Question

    Consider the following B+B^+ tree with 5 nodes, in which a node can store at most 3 key values. The value 23 is now inserted in the B+B^+ tree. Which of the following options(s) 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
  12. Think it through. Then check your answer.

    Question

    Consider the 3-way handshaking protocol for TCP connection establishment. Let the three packets exchanged during the connection establishment be denoted as P1P1, P2P2, and P3P3, in order. Which of the following option(s) is/are TRUE with respect to TCP header flags that are set in the packets?
    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

    Consider the given system of linear equations for variables xx and yy, where kk is a real-valued constant. Which of the following option(s) is/are CORRECT?x+ky=1kx+y=1\begin{aligned} x + ky &= 1 \\ kx + y &= -1 \end{aligned}
    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

    Let XX be a 3-variable Boolean function that produces output as '1' when at least two of the input variables are '1'. Which of the following statement(s) is/are CORRECT, where a,b,c,d,ea, b, c, d, e are Boolean variables?
    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

    The number 6-6 can be represented as 10101010 in 4-bit 2's complement representation. Which of the following is/are CORRECT 2's complement representation(s) of 6-6?
    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

    Which of the following statement(s) is/are TRUE for any binary search tree (BST) having nn distinct integers?
    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

    A partial data path of a processor is given in the figure, where RA, RB, and RZ are 32-bit registers. Which option(s) is/are CORRECT related to arithmetic operations using the data path as shown?
    A partial data path diagram showing registers RA and RB connected to multiplexers Mux_A and Mux_B respectively. Each multiplexer also takes a 32-bit immediate value as input. The outputs of Mux_A and Mux_B are fed into an ALU, whose output is stored in register RZ.

    Your answer

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

    A regular language LL is accepted by a non-deterministic finite automaton (NFA) with nn states. Which of the following statement(s) is/are FALSE?
    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

    Suppose in a multiprogramming environment, the following C program segment is executed. A process goes into I/O queue whenever an I/O related operation is performed. Assume that there will always be a context switch whenever a process requests for an I/O, and also whenever the process returns from an I/O. The number of times the process will enter the ready queue during its lifetime (not counting the time the process enters the ready queue when it is run initially) is _______. (Answer in integer)
    int main()
    {
        int x=0,i=0;
        scanf("%d", &x);
        for(i=0; i<20; i++)
        {
            x = x+20;
            printf("%d\n",x);
        }
        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
  20. Think it through. Then check your answer.

    Question

    Let SS be the set of all ternary strings defined over the alphabet {a,b,c}\{a, b, c\}. Consider all strings in SS that contain at least one occurrence of two consecutive symbols, that is, “aa”, “bb” or “cc”. The number of such strings of length 5 that are possible is _______. (Answer in 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
  21. Think it through. Then check your answer.

    Question

    Consider the given function f(x)f(x).f(x)={ax+bfor x<1x3+x2+1for x1f(x) = \begin{cases} ax + b & \text{for } x < 1 \\ x^3 + x^2 + 1 & \text{for } x \geq 1 \end{cases}If the function is differentiable everywhere, the value of bb must be ________. (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
  22. Think it through. Then check your answer.

    Question

    A box contains 5 coins: 4 regular coins and 1 fake coin. When a regular coin is tossed, the probability P(head)=0.5P(\text{head}) = 0.5 and for a fake coin, P(head)=1P(\text{head}) = 1. You pick a coin at random and toss it twice, and get two heads. The probability that the coin you have chosen is the fake coin is _______. (rounded off to two 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
  23. Think it through. Then check your answer.

    Question

    The pseudocode of a function fun()fun() is given below:
    fun(int A[0,...,n-1]){
        for i=0 to n-2
            for j=0 to n-i-2
                if (A[j]>A[j+1])
                    then swap A[j] and A[j+1]
    }
    
    Let A[0,,29]A[0, \dots, 29] be an array storing 3030 distinct integers in descending order. The number of swap operations that will be performed, if the function fun()fun() is called with A[0,,29]A[0, \dots, 29] as argument, is __________. (Answer in 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
  24. Think it through. Then check your answer.

    Question


    #include <stdio.h>
    void foo(int *p, int x) {
        *p=x;
    }
    int main() {
        int *z;
        int a = 20, b = 25;
        z = &a;
        foo(z,b);
        printf("%d",a);
        return 0;
    }
    
    The output of the given C program is __________. (Answer in 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
  25. Think it through. Then check your answer.

    Question

    The height of any rooted tree is defined as the maximum number of edges in the path from the root node to any leaf node.
    Suppose a Min-Heap TT stores 32 keys. The height of TT is _____________ . (Answer in 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
  26. Think it through. Then check your answer.

    Question

    Consider a memory system with 1M1\text{M} bytes of main memory and 16K16\text{K} bytes of cache memory. Assume that the processor generates 2020-bit memory address, and the cache block size is 1616 bytes. If the cache uses direct mapping, how many bits will be required to store all the tagtag values? [Assume memory is byte addressable, 1K=2101\text{K}=2^{10}, 1M=2201\text{M}=2^{20}.]
    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

    A processor has 6464 general-purpose registers and 5050 distinct instruction types. An instruction is encoded in 3232-bits. What is the maximum number of bits that can be used to store the immediate operand for the given instruction?

    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

    A computer has two processors, M1M_1 and M2M_2. Four processes P1,P2,P3,P4P_1, P_2, P_3, P_4 with CPU bursts of 20,16,25,20, 16, 25, and 1010 milliseconds, respectively, arrive at the same time and these are the only processes in the system. The scheduler uses non-preemptive priority scheduling, with priorities decided as follows:
    • M1M_1 uses priority of execution for the processes as, P1>P3>P2>P4P_1 > P_3 > P_2 > P_4, i.e., P1P_1 and P4P_4 have highest and lowest priorities, respectively.
    • M2M_2 uses priority of execution for the processes as, P2>P3>P4>P1P_2 > P_3 > P_4 > P_1, i.e., P2P_2 and P1P_1 have highest and lowest priorities, respectively.
    A process PiP_i is scheduled to a processor MkM_k, if the processor is free and no other process PjP_j is waiting with higher priority. At any given point of time, a process can be allocated to any one of the free processors without violating the execution priority rules. Ignore the context switch time. What will be the average waiting time of the processes in milliseconds?
    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 two relations describing teamsteams and playersplayers in a sports league:
    • teams(tid,tname)teams(tid, tname): tid,tnametid, tname are team-id and team-name, respectively
    • players(pid,pname,tid)players(pid, pname, tid): pid,pname,pid, pname, and tidtid denote player-id, player name and the team-id of the player, respectively
    Which ONE of the following tuple relational calculus queries returns the name of the players who play for the team having tnametname as 'MI'?
    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

    A packet with the destination IP address 145.36.109.70145.36.109.70 arrives at a router whose routing table is shown. Which interface will the packet be forwarded to?
    Subnet AddressSubnet Mask (in CIDR Notation)Interface
    145.36.0.0/16E1
    145.36.128.0/17E2
    145.36.64.0/18E3
    145.36.255.0/24E4
    Default--E5
    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

    Let AA be a 2×22 \times 2 matrix as given.A=[1111]A = \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}What are the eigenvalues of the matrix A13A^{13} ?
    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 four variable Boolean function in sum-of-product formF(b3,b2,b1,b0)=(0,2,4,8,10,11,12).F(b_3, b_2, b_1, b_0) = \sum(0, 2, 4, 8, 10, 11, 12).where the value of the function is computed by considering b3b2b1b0b_3b_2b_1b_0 as a 4-bit binary number, where b3b_3 denotes the most significant bit and b0b_0 denotes the least significant bit. Note that there are no don't care terms. Which ONE of the following options is the CORRECT minimized Boolean expression for FF?
    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

    Let G(V, E) be an undirected and unweighted graph with 100 vertices. Let d(u,v)d(u, v) denote the number of edges in a shortest path between vertices uu and vv in VV. Let the maximum value of d(u,v),u,vVd(u, v), u, v \in V such that uvu \neq v, be 30. Let TT be any breadth-first-search tree of GG. Which ONE of the given options is CORRECT for every such graph GG?
    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 the following two languages over the alphabet {a,b}\{a, b\}:L1={αβαα{a,b}+ AND β{a,b}+}L_1 = \{ \alpha \beta \alpha \mid \alpha \in \{a, b\}^+ \text{ AND } \beta \in \{a, b\}^+ \}L2={αβαα{a}+ AND β{a,b}+}L_2 = \{ \alpha \beta \alpha \mid \alpha \in \{a\}^+ \text{ AND } \beta \in \{a, b\}^+ \}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
  35. Think it through. Then check your answer.

    Question

    Consider the following two languages over the alphabet {a,b,c}\{a, b, c\}, where mm and nn are natural numbers.L1={ambmcm+nm,n1}L_1 = \{ a^m b^m c^{m+n} \mid m, n \ge 1 \}L2={ambncm+nm,n1}L_2 = \{ a^m b^n c^{m+n} \mid m, n \ge 1 \}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
  36. Think it through. Then check your answer.

    Question

    Which of the following statement(s) is/are TRUE while computing FirstFirst and FollowFollow during top down parsing by a compiler?
    Your answer

    Select all that apply, 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 a relational schema team(name,city,owner)team(name, city, owner), with functional dependencies {namecity,nameowner}\{name \rightarrow city, name \rightarrow owner\}.
    The relation teamteam is decomposed into two relations, t1(name,city)t1(name, city) and t2(name,owner)t2(name, owner). Which of the following statement(s) 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
  38. Think it through. Then check your answer.

    Question

    Which of the following predicate logic formulae/formula is/are CORRECT representation(s) of the statement: “Everyone has exactly one mother”?
    The meanings of the predicates used are:
    • mother(y,x)mother(y, x): yy is the mother of xx
    • noteq(x,y)noteq(x, y): xx and yy are not equal
    Your answer

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

    A={0,1,2,3,}A = \{0, 1, 2, 3, \dots \} is the set of non-negative integers. Let F\mathcal{F} be the set of functions from AA to itself. For any two functions, f1,f2Ff_1, f_2 \in \mathcal{F}, we define(f1f2)(n)=f1(n)+f2(n)(f_1 \odot f_2)(n) = f_1(n) + f_2(n)for every number nn in AA. Which of the following is/are CORRECT about the mathematical structure (F,)(\mathcal{F}, \odot)?
    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

    Consider the following deterministic finite automaton (DFA) defined over the alphabet, Σ={a,b}\Sigma = \{a, b\}. Identify which of the following language(s) is/are accepted by the given DFA.
    A DFA with four states. The start state has a self-loop on 'a' and goes to the second state on 'b'. The second state has a self-loop on 'b' and goes to the third state on 'a'. The third state goes back to the first state on 'a' and to the fourth (final) state on 'b'. The fourth state has a self-loop on 'a' and goes back to the second state on 'b'.
    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

    A disk of size 512M512\text{M} bytes is divided into blocks of 64K64\text{K} bytes. A file is stored in the disk using linked allocation. In linked allocation, each data block reserves 44 bytes to store the pointer to the next data block. The link part of the last data block contains a NULL pointer (also of 44 bytes). Suppose a file of 1M1\text{M} bytes needs to be stored in the disk. Assume, 1K=2101\text{K} = 2^{10} and 1M=2201\text{M} = 2^{20}. The amount of space in bytes that will be wasted due to internal fragmentation 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
  42. Think it through. Then check your answer.

    Question

    Refer to the given 3-address code sequence. This code sequence is split into basic blocks. The number of basic blocks 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
  43. Think it through. Then check your answer.

    Question

    A computer has a memory hierarchy consisting of two-level cache (L1 and L2) and a main memory. If the processor needs to access data from memory, it first looks into L1 cache. If the data is not found in L1 cache, it goes to L2 cache. If it fails to get the data from L2 cache, it goes to main memory, where the data is definitely available. Hit rates and access times of various memory units are shown in the figure. The average memory access time in nanoseconds (nsns) is ________. (rounded off to two decimal places)
    Memory hierarchy diagram showing Processor, L1 cache, L2 cache, and Main Memory with their respective hit rates and access times
    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

    In optimal page replacement algorithm, information about all future page references is available to the operating system (OS). A modification of the optimal page replacement algorithm is as follows:
    The OS correctly predicts only up to next 4 page references (including the current page) at the time of allocating a frame to a page.
    A process accesses the pages in the following order of page numbers:1,3,2,4,2,3,1,2,4,3,1,4.1, 3, 2, 4, 2, 3, 1, 2, 4, 3, 1, 4.If the system has three memory frames that are initially empty, the number of page faults that will occur during execution of the process is ________ . (Answer in 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
  45. Think it through. Then check your answer.

    Question

    Consider the following database tables of a sports league.
    player(pid,pname,age)
    coach(cid,cname)
    team(tid,tname,city,cid)
    members(pid,tid)
    An instance of the table and an SQL query are given.
    player
    pidpnameage
    1Jasprit31
    2Atharva24
    3Ishan26
    4Axar30
    coach
    cidcname
    101Ricky
    102Mark
    103Trevor
    team
    tidtnamecitycid
    10MIMumbai102
    20DCDelhi101
    30PKMohali103
    members
    pidtid
    110
    230
    310
    420
    SELECT MIN(P.age)
    FROM player P
    WHERE P.pid IN (
        SELECT M.pid
        FROM team T, coach C, members M
        WHERE C.cname = 'Mark'
        AND T.cid = C.cid 
        AND M.tid = T.tid 
        )
    
    The value returned by the given SQL query is ______ . (Answer in 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
  46. Think it through. Then check your answer.

    Question


    #include <stdio.h>
    int foo(int S[],int size){
     if(size == 0) return 0;
     if(size == 1) return 1;
     if(S[0] != S[1]) return 1+foo(S+1,size-1);
     return foo(S+1,size-1);
    }
    int main(){
     int A[]={0,1,2,2,2,0,0,1,1};
     printf("%d",foo(A,9));
     return 0;
    }
    
    
    The value printed by the given C program is _______ . (Answer in 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
  47. Think it through. Then check your answer.

    Question

    Let LIST be a datatype for an implementation of linked list defined as follows:
    typedef struct list {
     int data;
     struct list *next;
    } LIST;
    
    Suppose a program has created two linked lists, L1 and L2, whose contents are given in the figure below (code for creating L1 and L2 is not provided here). L1 contains 9 nodes, and L2 contains 7 nodes.
    Diagram showing two linked lists L1 and L2. L1: 1 -> 7 -> 12 -> 3 -> 9 -> 5 -> 11 -> 15 -> 8. L2: 1 -> 11 -> 6 -> 9 -> 15 -> 12 -> 4.
    Consider the following C program segment that modifies the list L1. The number of nodes that will be there in L1 after the execution of the code segment is ________ . (Answer in integer)
    int find (int query, LIST *list) {
        while (list != NULL) {
            if(list->data == query) return 1;
            list = list->next;
        }
        return 0;
    }
    int main () {
        ... ... ...
        ptr1=L1; ptr2=L2;
        while (ptr1->next != NULL) {
            query = ptr1->next->data;
            if (find (query, L2))
                ptr1->next = ptr1->next->next;
            else ptr1 = ptr1->next;
        }
        ... ... ...
        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
  48. Think it through. Then check your answer.

    Question

    The maximum value of xx such that the edge between the nodes B and C is included in every minimum spanning tree of the given graph is _________ . (answer in integer)
    A weighted undirected graph with four nodes A, B, C, and D. The edges and their weights are: AB=7, AD=6, AC=1, BD=3, BC=x, and CD=8.
    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 double hashing scheme, h1(k)=k(mod11)h_1(k) = k \pmod{11} and h2(k)=1+(k(mod7))h_2(k) = 1 + (k \pmod 7) are the auxiliary hash functions. The size mm of the hash table is 11. The hash function for the ii-th probe in the open address table is [h1(k)+ih2(k)](modm)[h_1(k) + i \cdot h_2(k)] \pmod m. The following keys are inserted in the given order: 63, 50, 25, 79, 67, 24.
    The slot at which key 24 gets stored is ___________. (Answer in 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