The PYQ practice room

GATE CS 2026 Set 1

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

Revision mode

Self-paced

No timer. Focus on understanding.

Difficulty mixEasy 14Medium 40Hard 11

Explore the questions

65 of 65 questions

General Aptitude (GA)

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

    Question

    The antonym of the word protagonist is ________.
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

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

    Question

    The figure shows two 4-tile patterns.

    Either one or both of the patterns can be used any number of times and in any orientation to construct a new pattern. Which one of the options below cannot be constructed by using only these two 4-tile patterns assuming there are no overlaps among them?
    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

    Consider a knock-out women’s badminton singles tournament where there are no ties. The loser in each game is eliminated from the tournament. Every player plays until she is defeated or remains the last undefeated player. The last undefeated player is declared the winner of the tournament. If there are 64 players in the beginning of the tournament, how many games should be played in total to declare the winner of the tournament?
    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 student needs to enroll for a minimum of 60 credits. A student cannot enroll for more than 70 credits. The credits are divided amongst project and three distinct sets of courses namely, core courses, specialization courses, and elective courses. It is compulsory for a student to enroll for exactly 15 credits of core courses and exactly 20 credits of project. In addition, a student has to enroll for a minimum of 10 credits of specialization courses. The maximum credits of elective courses that a student can enroll for is ______
    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 the teacher is in the room, all students stand silently.’
    If the above statement is true, which one of the following statements is not 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

    Combinatorics deals with problems involving counting. For example, “How many distinct arrangements of N distinct objects in M spaces on a circle are possible?” is a typical problem in combinatorics. This kind of counting is sometimes used in the modeling of several physical phenomena. Often, in such models, the different combinatorial possibilities are assigned probability values. Assigning probabilities enables the computation of the average values of physical quantities.
    Consider the following statements:
    P: Combinatorics is always invoked in the modeling of physical phenomena.
    Q: Modeling some physical phenomena involves assigning probabilities to combinatorial possibilities in order to compute average values of physical quantities.
    Based on the passage above, what can be inferred about statements P and Q?
    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 Panel I of the figure below, the front view and top view of a structure are shown. Which one of the 3D structures shown in Panel II possesses the views shown in Panel I?
    Panel I shows Front and Top views. Panel II shows four 3D structures 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
  8. Think it through. Then check your answer.

    Question

    For positive real numbers SS and KK, the function HK(S)H_K(S) is defined as:HK(S)=max(SK,0)H_K(S) = \max(S - K, 0)The max function is defined as:max(a,b)={a,when a>bb,when ab\max(a, b) = \begin{cases} a, & \text{when } a > b \\ b, & \text{when } a \leq b \end{cases}The graph below shows the plot of a function N(S) versus SS.
    N(S) can be expressed as _____.

    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

    In the 2020 summer Olympics’ Javelin throw finals, Neeraj Chopra exhibited a spectacular performance to win the gold medal. The silver medal was won by Jakub Vadlejch and the bronze medal was won by Vitezlav Vesely. There were six rounds of throws with each athlete having one throw per round. The best of all the throws of each athlete is considered for the medal. Following were the observations about the throws:
    i. The first and second rounds were dominated by Neeraj Chopra with a gold medal performance in his second throw, while the other two athletes did not have any medal winning throws in these rounds.
    ii. The throws in the last round by both Jakub Vadlejch and Vitezlav Vesely were fouls and were not considered for scoring.
    iii. After four rounds, Vitezlav Vesely was in the second position and could not improve upon his best throw in the succeeding rounds.
    iv. In the fourth round, the throw by Jakub Vadlejch was the best in that round.
    In which round did Vitezlav Vesely have his best throw?
    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 number appearing in the second roll is an integer multiple of the number appearing in the first roll 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 (CS1)

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

    Question

    An urn contains one red ball and one blue ball. At each step, a ball is picked uniformly at random from the urn, and this ball together with another ball of the same color is put back in the urn. The probability that there are equal number of red and blue balls after two steps is
    Your answer

    Choose one option, then check your answer.

    Restoring your progress…

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

    Question

    Consider 4×44 \times 4 matrices with their elements from {0,1}\{0, 1\}. The number of such matrices with even number of 1s in every row and every column is
    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

    For n>1n > 1, the maximum multiplicity of any eigenvalue of an n×nn \times n matrix with elements from R\mathbb{R} is
    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

    Match each addressing mode in List I with a data element or an element of a data structure (in a high-level language) in List II:
    List IList II
    P. Immediate1. Element of an array
    Q. Indirect2. Pointer
    R. Base with index3. Element of a record
    S. Base with offset/displacement4. Constant
    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

    Consider a processor P whose instruction set architecture is the load-store architecture. The instruction format is such that the first operand of any instruction is the destination operand.
    Which one of the following sequences of instructions corresponds to the high-level language statement Z = X + Y ?
    Note: X, Y, and Z are memory operands. R0, R1, and R2 are registers.
    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 dependencies among the register operands of different instructions can cause a data hazard in a pipelined processor?
    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 the following recurrence relations:
    For all n>1n > 1,T1(n)=4T1(n2)+T2(n)T_1(n) = 4T_1\left(\frac{n}{2}\right) + T_2(n)T2(n)=5T2(n4)+Θ(log2n)T_2(n) = 5T_2\left(\frac{n}{4}\right) + \Theta(\log_2 n)Assume that for all n1,T1(n)=1n \le 1, T_1(n) = 1 and T2(n)=1T_2(n) = 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
  8. Think it through. Then check your answer.

    Question

    With respect to a TCP connection between a client and a server, 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
  9. Think it through. Then check your answer.

    Question

    Which of the following statements is/are true with respect to the interaction of a web browser with a web server using HTTP 1.1?
    Your answer

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

    Let n>1n > 1. Consider an n×nn \times n matrix MM with its elements from R\mathbb{R}. Let the vector (0,1,0,0,,0)Rn(0, 1, 0, 0, \dots, 0) \in \mathbb{R}^n be in the null space of MM.
    Which of the following options is/are always correct?
    Your answer

    Select all that apply, 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 Boolean expression of a function FF :F(P,Q)=(Pˉ+Q)(PˉQ)F(P, Q) = (\bar{P} + Q) \oplus (\bar{P} Q)Which of the following expressions is/are equivalent to FF ?
    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 8-bit signed integers X,YX, Y and ZZ represented using the sign-magnitude form. The binary representations of XX and YY are as follows:X:10110100Y:01001100X: 10110100 \quad Y: 01001100Which of the following operations to compute ZZ result(s) in an 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
  13. Think it through. Then check your answer.

    Question

    Let nn be an odd number greater than 100. Consider a binary minheap with nn elements stored in an array PP whose index starts from 1.
    Which of the following indices of PP do/does NOT correspond to any leaf node of the minheap?
    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

    Consider a hash table P[0,1,,10]P[0, 1, \dots, 10] that is initially empty. The hash table is maintained using open addressing with linear probing. The hash function used is h(x)=(x+7)mod11h(x) = (x + 7) \mod 11.
    Consider the following sequence of insertions performed on PP:1,13,22,15,11,241, 13, 22, 15, 11, 24Which of the following positions in the hash table is/are empty after these insertions are performed?
    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

    Consider the following grammar where SS is the start symbol, and aa and bb are terminal symbols.SaSbSbSϵS \rightarrow aSbS \mid bS \mid \epsilonWhich 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
  16. Think it through. Then check your answer.

    Question

    Let MM be a nondeterministic finite automaton (NFA) with 6 states over a finite alphabet.
    Which of the following options CANNOT be the number of states in the minimal deterministic finite automaton (DFA) that is equivalent to MM?
    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

    Consider the following C statements:
    Which of the following options 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
  18. Think it through. Then check your answer.

    Question

    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

    With respect to deadlocks in an operating system, which of the following statements 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
  20. Think it through. Then check your answer.

    Question

    Let P,Q,RP, Q, R and SS be the attributes of a relation in a relational schema. Let XYX \longrightarrow Y indicate functional dependency in the context of a relational database, where X,Y{P,Q,R,S}X, Y \subseteq \{P, Q, R, S\}.
    Which of the following options is/are always true?
    Your answer

    Select all that apply, then check your answer.

    Restoring your progress…

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

    Question

    In the context of relational database normalization, 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
  22. Think it through. Then check your answer.

    Question

    Consider the function f:RRf: \mathbb{R} \to \mathbb{R} defined as follows:f(x)={c1exc2loge(1x),if x>03otherwisef(x) = \begin{cases} c_1 e^x - c_2 \log_e \left(\frac{1}{x}\right), & \text{if } x > 0 \\ 3 & \text{otherwise} \end{cases}where c1,c2Rc_1, c_2 \in \mathbb{R}.
    If ff is continuous at x=0x = 0, then c1+c2=_________c_1 + c_2 = \_\_\_\_\_\_\_\_\_. (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
  23. Think it through. Then check your answer.

    Question

    The height of a binary tree is the number of edges in the longest path from the root to a leaf in the tree. The maximum possible height of a full binary tree with 23 nodes 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

    Consider the following program in C:
    #include <stdio.h>
    void func(int i, int j) {
     if(i < j) {
      int i = 0;
      while (i < 10) {
       j += 2;
       i++;
      }
     }
     printf("%d", i);
    }
    int main() {
     int i = 9, j = 10;
     func(i, j);
     return 0;
    }
    
    The output of the 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
  25. Think it through. Then check your answer.

    Question

    Consider a system consisting of kk instances of a resource RR, being shared by 5 processes. Assume that each process requires a maximum of two instances of resource RR and a process can request or release only one instance at a time. Further, a process can request the second instance of the resource only after acquiring the first instance.
    The minimum value of kk for the system to be deadlock-free 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 the real valued variables X,YX, Y and ZZ represented using the IEEE 754 single-precision floating-point format. The binary representations of XX and YY in hexadecimal notation are as follows:X:35C00000Y:34A00000X: 35C00000 \qquad Y: 34A00000Let Z=X+YZ = X + Y.
    Which one of the following is the binary representation of ZZ, in hexadecimal notation?
    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 a 2-bit saturating up/down counter that performs the saturating up count when the input PP is 0, and the saturating down count when PP is 1. The Next State table of the counter is as shown. The counter is built as a synchronous sequential circuit using D flip-flops.
    Input PPCurrent State Q1Q_1 Q0Q_0Next State Q1+Q_1^+ Q0+Q_0^+
    00 00 1
    00 11 0
    01 01 1
    01 11 1
    10 00 0
    10 10 0
    11 00 1
    11 11 0
    Which one of the following options corresponds to the expressions for the inputs of the D flip-flops, D1D_1 and D0D_0?
    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

    The size of the physical address space of a processor is 2322^{32} bytes. The capacity of a cache memory unit is 2232^{23} bytes. The cache block size is 128 bytes. The cache memory unit can be built as a direct mapped cache or as a KK-way set-associative cache, where K=2LK = 2^L and L{1,2,3}L \in \{1, 2, 3\}. Let the length of the TAG field be MM bits for the direct mapped cache, and NN bits for the set-associative cache.
    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
  29. Think it through. Then check your answer.

    Question

    Consider the following code snippet in C language that computes the number of nodes in a non-empty singly linked list pointed to by the pointer variable head.
    struct node{
     int elt;
     struct node *next;
    };
    
    int getListSize (struct node *head)
    {
     if( **E1** ) return 1;
     return **E2**;
    }
    
    Which one of the following options gives the correct replacements for the expressions E1 and E2?
    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

    Let PP be the set of all integers from 1 to 15. Consider any order of insertion of the elements of PP into a binary search tree that creates a complete binary tree.
    Which one of the following elements can NEVER be the third element that is inserted?
    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 G(V, E) be an undirected, edge-weighted graph with integer weights. The weight of a path is the sum of the weights of the edges in that path. The length of a path is the number of edges in that path.
    Let sVs \in V be a vertex in GG. For every uVu \in V and for every k0k \ge 0, let dk(u)d_k(u) denote the weight of a shortest path (in terms of weight) from ss to uu of length at most kk. If there is no path from ss to uu of length at most kk, then dk(u)=d_k(u) = \infty.
    Consider the statements:
    S1: For every k0k \ge 0 and uVu \in V, dk+1(u)dk(u)d_{k+1}(u) \le d_k(u).
    S2: For every (u,v)E(u, v) \in E, if (u,v)(u, v) is part of a shortest path (in terms of weight) from ss to vv, then for every k0k \ge 0, dk(u)dk(v)d_k(u) \le d_k(v).
    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
  32. Think it through. Then check your answer.

    Question

    Consider the control flow graph shown in the figure.
    Control flow graph with basic blocks B1 to B5
    Which one of the following options correctly lists the set of redundant expressions (common subexpressions) in the basic blocks B4 and B5?
    Note: All the variables are integers.
    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 relational database schema with two relations R(P, Q) and S(X, Y).
    Let E={uvwu,vRv,wS}E = \{\langle u \rangle \mid \exists v \exists w \langle u, v \rangle \in R \wedge \langle v, w \rangle \in S\} be a tuple relational calculus expression.
    Which one of the following relational algebraic expressions is equivalent to EE?
    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 TCP sender successfully establishes a connection with a TCP receiver and starts the transmission of segments. The TCP congestion control mechanism's slow-start threshold is set to 10000 segments. Assume that the round-trip time is fixed at 1 millisecond. Assume that the sender always has data to send, the segments are numbered from 1, and no segment is lost. Let tt denote the time (in milliseconds) at which the transmission of segment number 2000 starts.
    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
  35. Think it through. Then check your answer.

    Question

    Consider the implementation of sliding window protocol over a lossless link, with a window size of WW frames, where each frame is of size 1000 bits (including header). The bandwidth of the link is 100 kbps (1k=1031\text{k} = 10^3) and the one-way propagation delay is 100 milliseconds. Assume that processing times at the sender and receiver are zero and the transmission time of acknowledgements is also zero. Which one of the following options gives the minimum size of WW (in number of frames) required to achieve 100% link utilization?
    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 f:RRf: \mathbb{R} \rightarrow \mathbb{R} be defined as follows:f(x)=(x2x)(xx2)f(x) = \left(\frac{|x|}{2} - x\right)\left(x - \frac{|x|}{2}\right)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
  37. Think it through. Then check your answer.

    Question

    Let G(V, E) be a simple, undirected graph. A vertex cover of GG is a subset VVV' \subseteq V such that for every (u,v)E(u, v) \in E, uVu \in V' or vVv \in V'. Let the size of the smallest vertex cover in GG be kk. Let SS be any vertex cover of size kk.
    For a vertex vVv \in V, which of the following constraints will always ensure that vSv \in S?
    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

    Consider a Boolean function FF with the following minterm expression:F(P,Q,R,S)=m(1,2,3,4,5,7,10,12,13,14)F(P, Q, R, S) = \sum m(1, 2, 3, 4, 5, 7, 10, 12, 13, 14)Which of the following options is/are the minimal sum-of-products expression(s) of FF?
    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

    Let G(V, E) be a simple, undirected, edge-weighted graph with unique edge weights. Which of the following statements about the minimum spanning trees (MST) of GG 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 the following pseudocode for depth-first search (DFS) algorithm which takes a directed graph G(V, E) as input, where d[v]d[v] and f[v]f[v] are the discovery time and finishing time, respectively, of the vertex vVv \in V.
    DFS(G):
        unmark all v ∈ V
        t ← 0
        for each v ∈ V
            if v is unmarked
                t ← Explore(G, v, t)
            end if
        end for
    
    Explore(G, v, t):
        mark v
        t ← t + 1
        d[v] ← t
        for each (v, w) ∈ E
            if w is unmarked
                t ← Explore(G, w, t)
            end if
        end for
        t ← t + 1
        f[v] ← t
        return t
    
    Suppose that the input directed graph G(V, E) is a directed acyclic graph (DAG).
    For an edge (u,v)E(u, v) \in E, which of the following options will NEVER be correct?
    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 L1L_1 and L2L_2 be two languages over a finite alphabet, such that L1L2L_1 \cap L_2 and L2L_2 are regular languages.
    Which of the following statements is/are always true?
    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 the following context-free grammar GG.SabaABAbbaAaaBBAbbBabaaBaBbab\begin{aligned} S &\rightarrow abaABAbba \\ A &\rightarrow aaBBAb \mid bBabaa \\ B &\rightarrow aBb \mid ab \end{aligned}In the above grammar, SS is the start symbol, aa and bb are terminal symbols, and AA and BB are non-terminal symbols.
    Let L(G) be the language generated by the grammar GG. For a string sL(G)s \in L(G), let n1(s)n_1(s) be the number of aa’s in ss and n2(s)n_2(s) be the number of bb’s in ss.
    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
  43. Think it through. Then check your answer.

    Question

    Consider the following two syntax-directed definitions SDD1 and SDD2 for type declarations.DD is the start symbol, and intint, floatfloat and idid are the three terminals. The non-terminal V1V_1 is the same as VV and the non-terminal D1D_1 is the same as DD. Here, the subscript is used to differentiate the grammar symbols on the two sides of a production. The function putput updates the symbol table with the type information for an identifier.
    Let P and Q be the languages specified by grammars G1 and G2, respectively.
    Which of the following statements is/are true?

    SDD1

    Grammar (G1)Semantic Rules
    D → T VD.type=T.typeD.type = T.type
    V.type=T.typeV.type = T.type
    TintT \rightarrow intT.type=intT.type = int
    TfloatT \rightarrow floatT.type=floatT.type = float
    VV1,idV \rightarrow V_1, idV1.type=V.typeV_1.type = V.type
    put(id.entry,V.type)put(id.entry, V.type)
    VidV \rightarrow idput(id.entry,V.type)put(id.entry, V.type)

    SDD2

    Grammar (G2)Semantic Rules
    DD1,idD \rightarrow D_1, idD.type=D1.typeD.type = D_1.type
    put(id.entry,D1.type)put(id.entry, D_1.type)
    DTidD \rightarrow T idD.type=T.typeD.type = T.type
    put(id.entry,T.type)put(id.entry, T.type)
    TintT \rightarrow intT.type=intT.type = int
    TfloatT \rightarrow floatT.type=floatT.type = float
    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 a system that has a cache memory unit and a memory management unit (MMU). The address input to the cache memory is a physical address. The MMU has a translation lookaside buffer (TLB). Assume that when a page is evicted from the main memory, the corresponding blocks in the cache are marked as invalid.
    For a given memory reference, which of the following sequences of events can NEVER happen?
    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

    An undirected, unweighted, simple graph G(V, E) is said to be 2-colorable if there exists a function c:V{0,1}c: V \to \{0, 1\} such that for every (u,v)E,c(u)c(v)(u, v) \in E, c(u) \neq c(v).
    Which of the following statements about 2-colorable graphs 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

    An ISP having an address block 202.16.0.0/15202.16.0.0/15 assigns a block of 6000 IP addresses to a client, using the classless internet domain routing (CIDR) super-netting approach. Which of the following address blocks can be assigned by the ISP?
    Your answer

    Select all that apply, then check your answer.

    Restoring your progress…

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

    Question

    Let GG be an undirected graph, which is a path on 8 vertices. The number of matchings in GG 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
  48. Think it through. Then check your answer.

    Question

    Let XX be a random variable which takes values in the set {1,2,3,4,5,6,7,8}\{1, 2, 3, 4, 5, 6, 7, 8\}.
    Further, Pr(X=1)=Pr(X=2)=Pr(X=5)=Pr(X=7)=16Pr(X = 1) = Pr(X = 2) = Pr(X = 5) = Pr(X = 7) = \frac{1}{6} and
    Pr(X=3)=Pr(X=4)=Pr(X=6)=Pr(X=8)=112Pr(X = 3) = Pr(X = 4) = Pr(X = 6) = Pr(X = 8) = \frac{1}{12}.
    The expected value of XX, denoted by E[X]E[X], is equal to ___________. (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
  49. Think it through. Then check your answer.

    Question

    Consider a hard disk with a rotational speed of 1500015000 rpm. The time to move the read/write head from a track to its adjacent track is 11 millisecond. Initially, the head is on track 00. The number of sectors per track is 400400. The sector size is 10241024 bytes. It is necessary to transfer data from 1010 randomly located sectors in each of the following tracks in the order: 5,125, 12 and 77.
    The total time for the data transfer (in milliseconds) from the hard disk 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
  50. Think it through. Then check your answer.

    Question

    The EX stage of a pipelined processor performs the memory read operations for LOAD instructions, and the operations for the arithmetic and logic instructions. Let tEXt_{EX} denote the time taken by the EX stage to perform the operation for an instruction. For each instruction type, the values of tEXt_{EX} and MM (the number of instructions of that type in a sequence of 100 instructions for a program P), are given in the table below.
    InstructiontEXt_{EX} in nanosecondsMM
    LOAD1.815
    IMUL1.510
    IDIV2.55
    FADD1.710
    FSUB1.75
    FMUL2.815
    FDIV3.25
    All other instructionsLess than 1.035
    The duration of the pipeline clock cycle is 1 nanosecond. Assume that the latch time for the interstage buffers in the pipeline is negligible. When program P is executed, the number of clock cycles for which the pipeline is stalled due to structural hazards in the EX stage 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
  51. Think it through. Then check your answer.

    Question

    Consider the recursive functions represented by the following code segment:
    int bar(int n){
     if (n == 1) return 0;
     else return 1 + bar(n/2);
    }
    
    int foo(int n){
     if (n == 1) return 1;
     else return 1 + foo(bar(n));
    }
    
    The smallest positive integer nn for which foo(n) returns 5 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 following sequence corresponds to the preorder traversal of a binary search tree TT:
    50, 25, 13, 40, 30, 47, 75, 60, 70, 80, 77
    The position of the element 60 in the postorder traversal of TT is ______. (answer in integer)
    Note: The position begins with 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
  53. Think it through. Then check your answer.

    Question

    Consider the following program snippet. Assume that the program compiles and runs successfully. Further, assume that the fork() system call is always successful in creating a process.
    int main () {
     int i; 
     for (i = 0; i < 3; i++){
       if (fork() == 0){
         continue;
       }
       break;
     }
     printf("Hello!");
     return 0;
    }
    
    The total number of times that the printf statement gets executed 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
  54. Think it through. Then check your answer.

    Question

    Consider a CPU that has to execute two types of processes. The first type, Actuators (A), requires a CPU burst of 6 seconds. The second type, Controllers (C), requires a CPU burst of 8 seconds. A new process of type A arrives at time t=10,20,30,40, and 50t = 10, 20, 30, 40, \text{ and } 50 (in seconds). Similarly, a new process of type C arrives at time t=11,22,33,44, and 55t = 11, 22, 33, 44, \text{ and } 55 (in seconds). The CPU scheduling policy is First Come First Serve (FCFS). The first process of type A starts running at t=10t = 10 seconds. The average waiting time (in seconds) for the 10 processes 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
  55. Think it through. Then check your answer.

    Question

    Consider a relational database schema with a relation R(A, B, C, D). If {A,B}\{A, B\} and {A,C}\{A, C\} are the only two candidate keys of the relation RR, then the number of superkeys of relation RR 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