The PYQ practice room

GATE CS 2026 Set 2

All 65 solved GATE CS 2026 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

3

MCQ · NAT · MSQ

Revision mode

Self-paced

No timer. Focus on understanding.

Difficulty mixEasy 27Medium 28Hard 10

Explore the questions

65 of 65 questions

General Aptitude (GA)

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

    Question

    Expedite, Hasten, Hurry, __________
    Fill the blank by choosing a word with a meaning similar to that of the words given above.
    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

    A black square PQRS has been cut into two parts. One part of it is shown in Panel I. Which one of the shapes in Panel II is the other part?
    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

    A day can only be cloudy or sunny. The probability of a day being cloudy is 0.50.5, independent of the condition on other days. What is the probability that in any given four days, there will be three cloudy days and one sunny day?
    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

    The values of Stock AA and Stock BB on a particular day are Rs. 5050 and Rs. 8080, respectively. An investor invests Rs. 100100 in Stock AA and Rs. 8080 in Stock BB. He sells all the stocks the next day when the value of Stock AA is Rs. 5555 and Stock BB is Rs. 7070. The profit made by the investor is Rs. ________
    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

    ‘When it is raining, peacocks dance.’
    Based only on this sentence, which one of the following options is necessarily 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

    Water : PP :: Food : QQ
    Choose the PP and QQ combination from the options below to form a meaningful analogy.
    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

    Two tiles are missing in Panel I. Which one of the options in Panel II is the appropriate choice for the missing tiles?
    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

    Figures (i) and (ii) represent intercity highway systems. The black dots represent cities and the line segments between them represent intercity highways.
    A salesperson needs to make a trip. She needs to start from a city, visit each of the remaining cities exactly once, and finally return to the same city from which she started.
    Which one of the following options is then true?
    Two graphs labeled (i) and (ii). Graph (i) is a $4 \times 4$ grid graph. Graph (ii) is a graph with 6 vertices where one vertex has degree 1.
    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 figure in Panel I below is a grid of cells with four rows and four columns. The numbers on the top and on the left represent the number of cells that are to be shaded in that column and row, respectively. Which one of the options shown in Panel II below represents the grid shaded correctly?
    A logic puzzle grid with row constraints 3, 1, 2, 2 and column constraints 2, 2, 2, 2. Panel II shows four candidate grids labeled (i) to (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

    An unbiased six-faced dice whose faces are marked with numbers 1, 2, 3, 4, 5, and 6 is rolled twice in succession and the number on the top face is recorded each time. The probability that the sum of the two recorded numbers is a prime number is ________
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

    The solution stays hidden until you check.
    Open question page

Computer Science & Information Technology (CS2)

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

    Question

    For two different persons xx and yy, the predicate M(x,y)M(x, y) denotes that xx knows yy.
    Consider the following statement.
    There is a person who does not know anyone else, but that person is known by everyone else.
    Which one of the following expressions represents the above statement?
    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 set T represents various traversals over binary tree. The set S represents the order of visiting nodes during a traversal.
    TS
    I:InorderL:left subtree, node, right subtree
    II:PreorderM:node, left subtree, right subtree
    III:PostorderN:left subtree, right subtree, node
    Which one of the following is the correct match from T to S ?
    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 statements is equivalent to the following assertion?
    Turing machine MM decides the language L{0,1}L \subseteq \{0,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

    The probability density function f(x)f(x) of a random variable XX which takes real values isf(x)=132πexp(x218),x(,+)f(x) = \frac{1}{3\sqrt{2\pi}} \exp\left(-\frac{x^2}{18}\right), \quad x \in (-\infty, +\infty)Which one of the following statements is correct about the random variable XX ?
    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

    In the context of DBMS, consider the two sets T and S given below.
    TS
    I: Logical schemaL: Views
    II: Physical schemaM: File organization and indexes
    III: External schemaN: Relations
    Which one of the following is the correct match from T to S ?
    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 following options is not a property of Boolean Algebra?
    Note: ++ is OR operation, .. is AND operation, and ' is NOT operation
    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 C runtime environment, which one of the following is stored in heap?
    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

    Consider the following two statements about interrupt handling mechanisms in a CPU.
    S1: In non-vectored interrupt mechanism, it usually takes more time to start the Interrupt Service Routine (ISR) when compared to that in a vectored interrupt mechanism.
    S2: In daisy-chain interrupt mechanism, the CPU polls all the input devices individually to determine the source of the interrupt.
    Which one of the following options is correct with respect to S1 and S2 ?
    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 three ANSI-C programs, P1, P2, and P3.
    P1
    #include <stdio.h>
    int a=5;
    int main(){ 
     int a=7;
     return(0);
    }
    
    P2
    #include <stdio.h>
    int main(){ 
     int a=5;
     int a=7;
     return(0);
    }
    
    P3
    #include <stdio.h>
    int main(){ 
     int a=5;
     float a=7;
     return(0);
    }
    
    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
  10. Think it through. Then check your answer.

    Question

    Consider concurrent execution of two transactions T1T_1 and T2T_2 in a DBMS, both of which access a data object AA. For these two transactions to not conflict on AA, which one of the following statements must be true?
    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 a file of size 4 million bytes being transferred between two hosts connected via a path consisting of three consecutive links of bandwidth 2 Mbps, 500 kbps, and 1 Mbps, respectively. All processing delays and propagation delays are negligible. Assume that there is no other background traffic over the path and no other additional overhead to transfer the file.
    Which one of the following is the total time (in seconds) to transfer the file?
    Note: 1M=1061\text{M}=10^6, 1k=1031\text{k}=10^3
    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 of the following protocols may need to broadcast some of its messages?
    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

    Which one of the following CPU scheduling algorithms cannot be preemptive?
    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 functions, where nn is a positive integer.n1/3,log(n),log(n!),2log(n)n^{1/3}, \log(n), \log(n!), 2^{\log(n)}Which one of the following options lists the functions in increasing order of asymptotic growth rate?
    Note: Assume the base of log to be 2.
    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

    Which of the following can be recurrence relation(s) corresponding to an algorithm with time complexity Θ(n)\Theta(n)?
    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

    Let RR be a binary relation on the set {1,2,,10}\{1, 2, \dots, 10\}, where (x,y)R(x, y) \in R if the product of xx and yy is square of an integer. Which of the following properties is/are satisfied by RR?
    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

    For a real number aa, let I(a)=11(3x2ax+1)dxI(a) = \int_{-1}^{1} (3x^2 - ax + 1) dx. 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
  18. Think it through. Then check your answer.

    Question

    In a system, numbers are represented using 4-bit two’s complement form. Consider four numbers N1=1011N1 = 1011, N2=1101N2 = 1101, N3=1010N3 = 1010 and N4=1001N4 = 1001 in the system.
    Which of the following operations will result in arithmetic overflow?
    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

    Which of the following grammars is/are ambiguous?
    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

    The keys 5, 28, 19, 15, 26, 33, 12, 17, 10 are inserted into a hash table using the hash function h(k)=kmod9h(k) = k \mod 9. The collisions are resolved by chaining. After all the keys are inserted, the length of the longest chain 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 system of linear equations given below.ax+y=bax + y = b16x+ay=2416x + ay = 24Suppose the values of aa and bb are chosen such that the system of linear equations produce multiple solutions. Then the product of aa and bb 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
  22. Think it through. Then check your answer.

    Question

    Consider an array A=[10,7,8,19,41,35,25,31]A = [10, 7, 8, 19, 41, 35, 25, 31]. Suppose the merge sort algorithm is executed on array AA to sort it in increasing order. The merge sort algorithm will carry out a total of 7 merge operations.
    A merge operation on sorted left array LL and sorted right array RR is said to be void if the output of the merge operation is the elements of array LL followed by the elements of array RR.
    The number of void merge operations among these 7 merge 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
  23. Think it through. Then check your answer.

    Question

    If an IP network uses a subnet mask of 255.255.240.0, the maximum number of IP addresses that can be assigned to network interfaces 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

    The 32-bit IEEE 754 single precision representation of a number is 0xC27100000\text{xC}2710000.
    The number in decimal representation 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
  25. Think it through. Then check your answer.

    Question

    A lexical analyzer uses the following token definitions
    • letter[AZaz]letter \to [A-Za-z]
    • digit[09]digit \to [0-9]
    • idletter(letterdigit)id \to letter (letter \mid digit)^*
    • numberdigit+number \to digit^+
    • ws(blanktabnewline)+ws \to (blank \mid tab \mid newline)^+
    For the string given below,x123mm78y7zzz514A8HAaYcDx1 \quad 23mm \quad 78 \quad y \quad 7z \quad zz5 \quad 14A \quad 8H \quad AaYcDthe number of tokens (excluding wsws) that will be produced by the lexical analyzer 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 complete graph KnK_n with nn vertices (n>4n > 4). Note that multiple spanning trees can be constructed over KnK_n. Each of these spanning trees is represented as a set of edges. The Jaccard coefficient between any two sets is defined as the ratio of the size of the intersection of the two sets to the size of the union of the two sets.
    Which one of the following options gives the lowest possible value for the Jaccard coefficient between any two spanning trees of KnK_n ?
    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

    Let GG be a weighted directed acyclic graph with mm edges and nn vertices. Given GG and a source vertex ss in GG, which one of the following options gives the worst case time complexity of the fastest algorithm to find the lengths of shortest paths from ss to all vertices that are reachable from ss in GG?
    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 an array AA of integers of size nn. The indices of AA run from 1 to nn. An algorithm is to be designed to check whether AA satisfies the condition given below.

    i,j{1,...,n1}\forall i, j \in \{1, ..., n-1\} such that i>j,(A[i+1]A[i])>(A[j+1]A[j])i > j, (A[i+1] - A[i]) > (A[j+1] - A[j]).
    Which one of the following gives the worst case time complexity of the fastest algorithm that can be designed for the problem?
    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 a table TT, where the elements T[i][j],0i,jnT[i][j], 0 \le i, j \le n, represent the cost of the optimal solutions of different subproblems of a problem that is being solved using a dynamic programming algorithm. The recursive formulation to compute the table entries is as follows:T[0][k]=T[k][0]=1for k=0,1,2,...,nT[0][k] = T[k][0] = 1 \quad \text{for } k = 0,1,2, ..., nT[i][j]=2T[i1][j]+3T[i][j1]for 1i,jnT[i][j] = 2T[i-1][j] + 3T[i][j-1] \quad \text{for } 1 \le i, j \le nConsider the following two algorithms to compute entries of TT. Assume that for both the algorithms, for all 0i,jn0 \le i, j \le n, T[i][j]T[i][j] has been initialized to 1.
    Algorithm B1B_1:
    For i = 1, 2, ..., n
        For j = 1, 2, ..., n
            T[i][j] = 2T[i-1][j] + 3T[i][j-1]
    
    Algorithm B2B_2:
    For s = 2, 3, ..., 2n
        For i = 1, 2, ..., n
            For j = 1, 2, ..., n
                If (i + j == s)
                    T[i][j] = 2T[i-1][j] + 3T[i][j-1]
    
    Algorithm Bk,k{1,2}B_k, k \in \{1,2\} is said to be correct if and only if it calculates the correct values of T[i][j]T[i][j], for all 0i,jn0 \le i, j \le n, (as per the recursive formulation) at the end of the execution of the algorithm BkB_k.
    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
  30. Think it through. Then check your answer.

    Question

    Consider the following 4-variable Boolean functionF(A,B,C,D)=Σm(0,1,2,3,8,9,10,11)F(A, B, C, D) = \Sigma m(0, 1, 2, 3, 8, 9, 10, 11)Consider AA as MSB, DD as LSB. Which one of the following options represents the minimal sum of products form for the above function?
    Note: ++ is OR operation, .. is AND operation, ' is NOT operation
    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 canonical LR(0)LR(0) parsing of the grammar below using terminals {a,b,c}\{a, b, c\} and non-terminals {A,B,C,S}\{A, B, C, S\} with SS as the start symbol.
    S → ACB
    AaAϵA \to aA \mid \epsilon
    CcCϵC \to cC \mid \epsilon
    BbBbB \to bB \mid b

    Which one of the following options gives the number of shift-reduce conflicts that will occur in the LR(0)LR(0) ACTION table?
    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

    In the context of schema normalization in relational DBMS, consider a set F of functional dependencies. The set of all functional dependencies implied by F is called the closure of F. To compute the closure of F, Armstrong's Axioms can be applied. Consider X,Y,X, Y, and ZZ as sets of attributes over a relational schema. The three rules of Armstrong's Axioms are described as follows.
    Reflexivity: If YXY \subseteq X, then X → Y
    Augmentation: If X → Y, then XZ → YZ for any ZZ
    Transitivity: If X → Y and Y → Z, then X → Z
    The additional rule of Union is defined as follows.
    Union: If X → Y and X → Z, then X → YZ
    It can be proved that the additional rule of Union is also implied by the three rules of Armstrong's Axioms. Listed below are four combinations of these three rules. Which one of these combinations is both necessary and sufficient for the proof?
    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 the transmission of data bits 110001011 over a link that uses Cyclic Redundancy Check (CRC) code for error detection. If the generator bit pattern is given to be 1001, which one of the following options shows the remainder bit pattern appended to the data bits before transmission?
    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 processor that has 16 general purpose registers and it uses 2-byte instruction format for all its instructions. Variable-sized opcodes are permitted. There are three different types of instructions; M-type, R-type, and C-type. Each M-type instruction has 2 register operands and a 6-bit immediate operand. Each R-type instruction has 3 register operands. Each C-type instruction has a register operand and a 6-bit offset value. If there are 2 unique M-type opcodes and 7 unique R-type opcodes, which one of the following options gives the maximum number of unique opcodes possible for C-type instructions?
    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 control flow graph given below.
    Control flow graph with blocks B1, B2, B3, B4
    Which one of the following options is the set of live variables at the exit point of each basic block?
    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

    An index in a DBMS is said to be dense if an index entry appears for every search-key value in the indexed file. Otherwise it is called a sparse index. Consider the following two statements.
    S1: A hash index must be a dense index
    S2: A B+B^+ tree index can be a sparse index
    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
  37. Think it through. Then check your answer.

    Question

    Consider the following two finite automata D1D_1 and D2D_2.
    Two finite automata D1 and D2. D1 has 3 states with start/final state at top-left. D2 has 3 states with start/final state at left.
    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
  38. Think it through. Then check your answer.

    Question

    Let Σ={a,b,c,d}\Sigma = \{a, b, c, d\} and let L={aibjckdi,j,k,0}L = \{a^i b^j c^k d^\ell \mid i, j, k, \ell \ge 0\}.
    Which of the following constraints ensure(s) that the language LL is context-free?
    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

    Consider a binary search tree (BST) with nn leaf nodes (n>0n > 0). Given any node VV, the key present in the node is denoted as Val(V)Val(V). All the keys present in the given BST are distinct. The keys belong to the set of real numbers.
    For a node VV, let Suc(V)Suc(V) denote the node that is its inorder successor. If a node VV does not have an inorder successor, then Suc(V)Suc(V) is NULLNULL. As there are no duplicates, if Suc(V)Suc(V) is not NULLNULL, then Val(V)<Val(Suc(V))Val(V) < Val(Suc(V)).
    Corresponding to every leaf node LiL_i that has a non-NULL Suc(Li)Suc(L_i), a new key kik_i with the following property is to be inserted into the BST.Val(Li)<ki<Val(Suc(Li))Val(L_i) < k_i < Val(Suc(L_i))Let KK represent the list of all such new keys to be inserted into the BST.
    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

    Consider a stack SS and a queue QQ. Both of them are initially empty and have the capacity to store ten elements each. The elements 1, 2, 3, 4, and 5 arrive one by one, in that order. When an element arrives, it is assigned either to SS (pushed on SS) or to QQ (enqueued to QQ). Once all the five elements are stored, the output is generated in two steps. First, stack S is emptied by popping all elements. Then queue QQ is emptied by dequeueing all elements. The output obtained by following this process is 4 3 1 2 5 .
    Given the output, the objective is to predict whether an element was assigned to SS or QQ.
    Which of the following options is/are possible valid assignment(s) of the elements?
    Note: In the options, the notation xSxS denotes that element xx was assigned to SS and yQyQ denotes that element yy was assigned to QQ.
    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

    Consider three processes P1, P2, and P3 running identical code, as shown in the pseudocode below. A and B are two binary semaphores initialized to 1 and 0, respectively. X is a shared variable initialized to 0. Each line in the pseudocode is executed atomically.
    Pseudocode of P1, P2, and P3
    Wait(A);
    Print(*);
    X = X+1;
    If (X == 2)
    {
        Print($);
        Signal(B);
    }
    Signal(A);
    Wait(B);
    Print(#);
    Signal(B);
    

    Assume that any of the three processes can start to execute first and context switching can happen between these processes at any arbitrary time and in any arbitrary order.
    Which of the following patterns is/are possible to be generated as an outcome of the execution of these three processes?
    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

    Consider a system with a processor and a 4 KB direct mapped cache with block size of 16 bytes. The system has a 16 MB physical memory. Four words P, Q, R, and S are accessed by the processor in the same order 10 times. That is, there are a total of 40 memory references in the sequence P, Q, R, S, P, Q, R, S,…
    Assume that the cache memory is initially empty. The physical addresses of the words are given below (1 word =1 byte).
    P: 0x845B32, Q: 0x845B26, R: 0x845B36, S: 0x846B32
    Which of the following statements is/are true?
    Note: 1K=2101\text{K}=2^{10} and 1M=2201\text{M}=2^{20}
    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

    To keep track of free blocks in a file system, one of the two approaches is generally used – using bitmaps (bit vectors) or using linked lists. Consider that the linked list approach is used to keep track of free blocks in a file system. Assume that the disk size is 16 GB, block size is 2 KB, and block numbers used are 32-bit long. A single pointer of size 4 bytes is used in each block of the list to point to the next block of the list. The number of blocks required to hold the free disk block numbers is ____________. (answer in integer)
    Note: 1K=2101K=2^{10} and 1G=2301G=2^{30}
    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

    A system has a Translation Lookaside Buffer (TLB) that has a reach of 1 MB. TLB reach is defined as the total amount of physical memory that can be accessed through the TLB entries. The paging system uses pages of size 4 KB. The virtual address space is 64 GB and physical address space is 1 GB. If each TLB entry stores a 4-bit process id, page number, frame number, and a 2-bit control field, then the size of the TLB (in bytes) is ___________. (answer in integer)
    Note: 1K=210,1M=220,1G=2301K=2^{10}, 1M=2^{20}, 1G=2^{30}
    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 contiguous allocation of physical memory to processes using variable partitioning scheme. Suppose there are 8 holes in the memory of sizes 20 KB, 4 KB, 25 KB, 18 KB, 7 KB, 9 KB, 15 KB, and 12 KB. Assume that no two holes are adjacent. Two processes P1 of size 16 KB and P2 of size 9 KB arrive in that order, and they are allocated memory using the best-fit technique. After allocating space to P1 and P2, the number of holes of size less than 8 KB is ____________. (answer in integer)
    Note: 1K=2101K=2^{10}
    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 a system with 1 MB physical memory and a word length of 1 byte. The system uses a direct mapped cache, with block numbers starting from 0. The word with physical address 0xA2C28 is mapped to the cache block number 17610176_{10}. The maximum possible size of the cache (in KB) for this configuration is ___________. (answer in integer)
    Note: 1K=2101K=2^{10} and 1M=2201M=2^{20}
    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

    A non-pipelined instruction execution unit that operates at 1.6 GHz clock takes an average of 5 clock cycles to complete the execution of an instruction. To improve the performance, the system was pipelined with a goal of achieving an average throughput of one instruction per clock cycle. However, it could operate only at 1.2 GHz due to pipeline overheads. While executing a program in the pipelined design, 30% of instructions encountered a stall of 2 cycles due to pipeline hazards. The speed-up obtained by the pipelined design over the non-pipelined one for this program is ___________. (rounded off to two decimal places)
    Note: 1G=1091G=10^9
    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 new TCP connection between a sender and a receiver. The receiver advertised window is constant at 48 KB, the maximum segment size (MSS) is 2 KB, and the slow start threshold for TCP congestion control is 16 KB. Assume that there are no timeouts or duplicate acknowledgements. The number of rounds of transmission required for the congestion control algorithm of the TCP connection to reach the congestion avoidance phase is ___________. (answer in integer)
    Note: 1K=2101K=2^{10}
    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 the digital circuit shown below with two input lines AA and BB, two select lines S0S_0 and S1S_1, and an output line YY. The blocks QQ and MM represent active high 2:4 decoder and 4-to-1 multiplexer, respectively. Out of 16 possible input combinations, the number of combinations that produce Y=1Y=1 is ____________. (answer in integer)
    Note: One input combination is an instance of [A B S1 S0][A\ B\ S_1\ S_0].
    Digital circuit diagram showing a 2:4 decoder Q and a 4-to-1 multiplexer M
    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 following ANSI-C program.
    #include <stdio.h>
    int main(){
     int *ptr, a, b, c;
     a=5; b=11; c=20;
     ptr=&a; *ptr=c; ptr=&c;
     a=*(&b); c=*ptr-a;
     printf("%d",c);
     return(0);
    }
    
    The output of this program is ____________. (answer in integer)
    Note: Assume that the program compiles and runs successfully.
    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 ANSI-C function.
    int func(int start, int end){
     int length=end+1-start;
     if((length<1)||(start<0)||(end<0)){ return(0); } 
     if(length%3==0){ 
     return(func(start+1, end));
     } else if(length%3==1){
     return(1+func(start, end-1));
     } else {
     return(func(start+2, end));
     }
    }
    
    The maximum possible value that can be returned from this function is
    ____________. (answer in integer)
    Note: Ignore syntax errors (if any) in the function.
    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

    The determinant of a 4×44 \times 4 matrix AA is 3. The value of the determinant of 2A2A 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
  53. Think it through. Then check your answer.

    Question

    Suppose an unbiased coin is tossed 6 times. Each coin toss is independent of all previous coin tosses. Let E1E_1 be the event that among the second, fourth, and sixth coin tosses, there are at least two heads. Let E2E_2 be the event that among the first, second, third, and fifth coin tosses, there are equal number of heads and tails.
    The conditional probability P(E1E2)P(E_1 \mid E_2) is equal to ____________. (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
  54. Think it through. Then check your answer.

    Question

    Consider a function f:(0,1){0,1}f: (0,1) \rightarrow \{0, 1\} defined as follows.
    For a real number r(0,1)r \in (0,1), f(r)=1f(r) = 1 if the second digit after the decimal point in rr is one of the four digits 2, 3, 6 and 7. Otherwise, f(r)f(r) is equal to 0.
    The number of points in (0,1)(0,1) at which ff is discontinuous 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
  55. Think it through. Then check your answer.

    Question

    It is necessary to design a link-layer protocol between two hosts that are directly connected over a lossless link of length 3000 kilometers. Assume that the link bandwidth is 10810^8 bits per second and that the propagation delay in the link is 5 nanoseconds per meter. Every transmitted data byte is assigned a unique sequence number.
    Let NN be the minimum number of bits needed for the sequence number field in the protocol header such that
    i. the sequence numbers do not wrap around before 60 seconds, and
    ii. the maximum utilization of the link is achieved.
    The value of NN 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