IAE Academy

PAPERS · GATE CS

GATE CSE 2024 Set 2 question paper with solutions

All 65 questions of the GATE 2024 Set 2 Computer Science and Information Technology paper, in order, with the official answer key from IISc Bengaluru.

Download the solved paper (PDF, 2.4 MB)
questions · 100 marks
65questions · 100 marks
official answer key
IISc Bengaluruofficial answer key
question types
32 MCQ · 18 MSQ · 15 NATquestion types

GATE CSE 2024 Set 2 answer key

Official answers to every question of GATE CSE 2024 Set 2
QuestionTypeMarksAnswer
Q.1MCQ1C
Q.2MCQ1A
Q.3MCQ1A
Q.4MCQ1C
Q.5MCQ1B
Q.6MCQ2C
Q.7MCQ2C
Q.8MCQ2D
Q.9MCQ2A
Q.10MCQ2A
Q.11MCQ1C
Q.12MCQ1A
Q.13MCQ1A
Q.14MCQ1B
Q.15MCQ1A
Q.16MCQ1B
Q.17MCQ1B
Q.18MCQ1B
Q.19MCQ1A
Q.20MCQ1A
Q.21MCQ1B
Q.22MCQ1A
Q.23MSQ1B
Q.24MSQ1B, C, D
Q.25MSQ1A, B
Q.26MSQ1A, B
Q.27MSQ1A, C, D
Q.28MSQ1B, C
Q.29MSQ1B, D
Q.30MSQ1B, C
Q.31MSQ1A
Q.32MSQ1C, D
Q.33MSQ1A, B, D
Q.34NAT15
Q.35NAT13
Q.36MCQ2B
Q.37MCQ2B
Q.38MCQ2A
Q.39MCQ2A
Q.40MCQ2A
Q.41MCQ2B
Q.42MCQ2B
Q.43MCQ2A
Q.44MCQ2D
Q.45MCQ2B
Q.46MSQ2B, C
Q.47MSQ2A, B
Q.48MSQ2B, C, D
Q.49MSQ2A, B, D
Q.50MSQ2C, D
Q.51MSQ2D
Q.52MSQ2B, C
Q.53NAT229.50 to 30.50
Q.54NAT24
Q.55NAT2500
Q.56NAT250
Q.57NAT232
Q.58NAT22.9 to 3.1
Q.59NAT29
Q.60NAT22
Q.61NAT234
Q.62NAT215
Q.63NAT24
Q.64NAT21028
Q.65NAT29

General Aptitude Q.1 to Q.10

  1. Q.1MCQ · 1 mark

    If ‘→’ denotes increasing order of intensity, then the meaning of the words [walk → jog → sprint] is analogous to [bothered → ________ → daunted].

    Which one of the given options is appropriate to fill the blank?

    1. (A)

      phased

    2. (B)

      phrased

    3. (C)

      fazed

    4. (D)

      fused

    Official answer: C

  2. Q.2MCQ · 1 mark

    Two wizards try to create a spell using all the four elements, water, air, fire, and earth. For this, they decide to mix all these elements in all possible orders. They also decide to work independently. After trying all possible combination of elements, they conclude that the spell does not work.

    How many attempts does each wizard make before coming to this conclusion, independently?

    1. (A)

      24

    2. (B)

      48

    3. (C)

      16

    4. (D)

      12

    Official answer: A

  3. Q.3MCQ · 1 mark

    In an engineering college of 10,000 students, 1,500 like neither their core branches nor other branches. The number of students who like their core branches is 1/4th of the number of students who like other branches. The number of students who like both their core and other branches is 500.

    The number of students who like their core branches is

    1. (A)

      1,800

    2. (B)

      3,500

    3. (C)

      1,600

    4. (D)

      1,500

    Official answer: A

  4. Q.4MCQ · 1 mark

    For positive non-zero real variables and , if

    then, the value of is

    1. (A)

      1

    2. (B)

      1/2

    3. (C)

      2

    4. (D)

      4

    Official answer: C

  5. Q.5MCQ · 1 mark

    In the sequence 6, 9, 14, x, 30, 41, a possible value of x is

    1. (A)

      25

    2. (B)

      21

    3. (C)

      18

    4. (D)

      20

    Official answer: B

  6. Q.6MCQ · 2 marks

    Sequence the following sentences in a coherent passage.

    P: This fortuitous geological event generated a colossal amount of energy and heat that resulted in the rocks rising to an average height of 4 km across the contact zone.
    Q: Thus, the geophysicists tend to think of the Himalayas as an active geological event rather than as a static geological feature.
    R: The natural process of the cooling of this massive edifice absorbed large quantities of atmospheric carbon dioxide, altering the earth’s atmosphere and making it better suited for life.
    S: Many millennia ago, a breakaway chunk of bedrock from the Antarctic Plate collided with the massive Eurasian Plate.

    1. (A)

      QPSR

    2. (B)

      QSPR

    3. (C)

      SPRQ

    4. (D)

      SRPQ

    Official answer: C

  7. Q.7MCQ · 2 marks

    A person sold two different items at the same price. He made 10% profit in one item, and 10% loss in the other item. In selling these two items, the person made a total of

    1. (A)

      1% profit

    2. (B)

      2% profit

    3. (C)

      1% loss

    4. (D)

      2% loss

    Official answer: C

  8. Q.8MCQ · 2 marks

    The pie charts depict the shares of various power generation technologies in the total electricity generation of a country for the years 2007 and 2023.

    The renewable sources of electricity generation consist of Hydro, Solar and Wind. Assuming that the total electricity generated remains the same from 2007 to 2023, what is the percentage increase in the share of the renewable sources of electricity generation over this period?

    GATE CSE 2024 Set 2 Q.8 as printed in the question paper, with its figureTap to open full size
    1. (A)

      25%

    2. (B)

      50%

    3. (C)

      77.5%

    4. (D)

      62.5%

    Official answer: D

  9. Q.9MCQ · 2 marks

    A cube is to be cut into 8 pieces of equal size and shape. Here, each cut should be straight and it should not stop till it reaches the other end of the cube.

    The minimum number of such cuts required is

    1. (A)

      3

    2. (B)

      4

    3. (C)

      7

    4. (D)

      8

    Official answer: A

  10. Q.10MCQ · 2 marks

    In the 4 × 4 array shown below, each cell of the first three rows has either a cross (X) or a number. The number in a cell represents the count of the immediate neighboring cells (left, right, top, bottom, diagonals) NOT having a cross (X). Given that the last row has no crosses (X), the sum of the four numbers to be filled in the last row is

    GATE CSE 2024 Set 2 Q.10 as printed in the question paper, with its figureTap to open full size
    1. (A)

      11

    2. (B)

      10

    3. (C)

      12

    4. (D)

      9

    Official answer: A

Computer Science and Information Technology Q.11 to Q.65

  1. Q.11MCQ · 1 mark

    Consider a computer with a 4 MHz processor. Its DMA controller can transfer 8 bytes in 1 cycle from a device to main memory through cycle stealing at regular intervals. Which one of the following is the data transfer rate (in bits per second) of the DMA controller if 1% of the processor cycles are used for DMA?

    1. (A)

      2,56,000

    2. (B)

      3,200

    3. (C)

      25,60,000

    4. (D)

      32,000

    Official answer: C

  2. Q.12MCQ · 1 mark

    Let and be the following propositions:

    : Fail grade can be given.

    : Student scores more than 50% marks.

    Consider the statement: "Fail grade cannot be given when student scores more than 50% marks."

    Which one of the following is the CORRECT representation of the above statement in propositional logic?

    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: A

  3. Q.13MCQ · 1 mark

    Consider the following C program. Assume parameters to a function are evaluated from right to left.

    #include <stdio.h>
    
    int g(int p) { printf("%d", p); return p; }
    int h(int q) { printf("%d", q); return q; }
    
    void f(int x, int y) {
      g(x);
      h(y);
    }
    
    int main() {
      f(g(10),h(20));
    }

    Which one of the following options is the CORRECT output of the above C program?

    1. (A)

      20101020

    2. (B)

      10202010

    3. (C)

      20102010

    4. (D)

      10201020

    Official answer: A

  4. Q.14MCQ · 1 mark

    The format of a single-precision floating-point number as per the IEEE 754 standard is: Sign (1 bit), Exponent (8 bits), Mantissa (23 bits). Choose the largest floating-point number among the following options.

    GATE CSE 2024 Set 2 Q.14 as printed in the question paper, with its figureTap to open full size
    1. (A)

      Figure — Sign 0, Exponent 0111 1111, Mantissa 1111 1111 1111 1111 1111 111

    2. (B)

      Figure — Sign 0, Exponent 1111 1110, Mantissa 1111 1111 1111 1111 1111 111

    3. (C)

      Figure — Sign 0, Exponent 1111 1111, Mantissa 1111 1111 1111 1111 1111 111

    4. (D)

      Figure — Sign 0, Exponent 0111 1111, Mantissa 0000 0000 0000 0000 0000 000

    Official answer: B

  5. Q.15MCQ · 1 mark

    Let be the recurrence relation defined as follows:

    Which one of the following statements is TRUE?

    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: A

  6. Q.16MCQ · 1 mark

    Let be a continuous function from to such that

    Which one of the following options is the CORRECT value of ?

    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: B

  7. Q.17MCQ · 1 mark

    Let be the adjacency matrix of a simple undirected graph . Suppose is its own inverse. Which one of the following statements is always TRUE?

    1. (A)

      is a cycle

    2. (B)

      is a perfect matching

    3. (C)

      is a complete graph

    4. (D)

      There is no such graph

    Official answer: B

  8. Q.18MCQ · 1 mark

    When six unbiased dice are rolled simultaneously, the probability of getting all distinct numbers (i.e., 1, 2, 3, 4, 5, and 6) is

    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: B

  9. Q.19MCQ · 1 mark

    Once the DBMS informs the user that a transaction has been successfully completed, its effect should persist even if the system crashes before all its changes are reflected on disk. This property is called

    1. (A)

      durability

    2. (B)

      atomicity

    3. (C)

      consistency

    4. (D)

      isolation

    Official answer: A

  10. Q.20MCQ · 1 mark

    In the context of owner and weak entity sets in the ER (Entity-Relationship) data model, which one of the following statements is TRUE?

    1. (A)

      The weak entity set MUST have total participation in the identifying relationship

    2. (B)

      The owner entity set MUST have total participation in the identifying relationship

    3. (C)

      Both weak and owner entity sets MUST have total participation in the identifying relationship

    4. (D)

      Neither weak entity set nor owner entity set MUST have total participation in the identifying relationship

    Official answer: A

  11. Q.21MCQ · 1 mark

    Consider the following two sets:

    Set X: P. Lexical Analyzer; Q. Syntax Analyzer; R. Intermediate Code Generator; S. Code Optimizer
    Set Y: 1. Abstract Syntax Tree; 2. Token; 3. Parse Tree; 4. Constant Folding

    Which one of the following options is the CORRECT match from Set X to Set Y ?

    1. (A)

      P – 4; Q – 1; R – 3; S – 2

    2. (B)

      P – 2; Q – 3; R – 1; S – 4

    3. (C)

      P – 2; Q – 1; R – 3; S – 4

    4. (D)

      P – 4; Q – 3; R – 2; S – 1

    Official answer: B

  12. Q.22MCQ · 1 mark

    Which one of the following regular expressions is equivalent to the language accepted by the DFA given below?

    GATE CSE 2024 Set 2 Q.22 as printed in the question paper, with its figureTap to open full size
    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: A

  13. Q.23MSQ · 1 mark

    Node X has a TCP connection open to node Y. The packets from X to Y go through an intermediate IP router R. Ethernet switch S is the first switch on the network path between X and R. Consider a packet sent from X to Y over this connection.

    Which of the following statements is/are TRUE about the destination IP and MAC addresses on this packet at the time it leaves X?

    1. (A)

      The destination IP address is the IP address of R

    2. (B)

      The destination IP address is the IP address of Y

    3. (C)

      The destination MAC address is the MAC address of S

    4. (D)

      The destination MAC address is the MAC address of Y

    Official answer: B

  14. Q.24MSQ · 1 mark

    Which of the following tasks is/are the responsibility/responsibilities of the memory management unit (MMU) in a system with paging-based memory management?

    1. (A)

      Allocate a new page table for a newly created process

    2. (B)

      Translate a virtual address to a physical address using the page table

    3. (C)

      Raise a trap when a virtual address is not found in the page table

    4. (D)

      Raise a trap when a process tries to write to a page marked with read-only permission in the page table

    Official answer: B, C, D

  15. Q.25MSQ · 1 mark

    Consider a process P running on a CPU. Which one or more of the following events will always trigger a context switch by the OS that results in process P moving to a non-running state (e.g., ready, blocked)?

    1. (A)

      P makes a blocking system call to read a block of data from the disk

    2. (B)

      P tries to access a page that is in the swap space, triggering a page fault

    3. (C)

      An interrupt is raised by the disk to deliver data requested by some other process

    4. (D)

      A timer interrupt is raised by the hardware

    Official answer: A, B

  16. Q.26MSQ · 1 mark

    Which of the following file organizations is/are I/O efficient for the scan operation in DBMS?

    1. (A)

      Sorted

    2. (B)

      Heap

    3. (C)

      Unclustered tree index

    4. (D)

      Unclustered hash index

    Official answer: A, B

  17. Q.27MSQ · 1 mark

    Which of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?

    1. (A)

      2PL permits only serializable schedules

    2. (B)

      With 2PL, a transaction always locks the data item being read or written just before every operation and always releases the lock just after the operation

    3. (C)

      With 2PL, once a lock is released on any data item inside a transaction, no more locks on any data item can be obtained inside that transaction

    4. (D)

      A deadlock is possible with 2PL

    Official answer: A, C, D

  18. Q.28MSQ · 1 mark

    Which of the following statements about IPv4 fragmentation is/are TRUE?

    1. (A)

      The fragmentation of an IP datagram is performed only at the source of the datagram

    2. (B)

      The fragmentation of an IP datagram is performed at any IP router which finds that the size of the datagram to be transmitted exceeds the MTU

    3. (C)

      The reassembly of fragments is performed only at the destination of the datagram

    4. (D)

      The reassembly of fragments is performed at all intermediate routers along the path from the source to the destination

    Official answer: B, C

  19. Q.29MSQ · 1 mark

    Which of the following statements is/are FALSE?

    1. (A)

      An attribute grammar is a syntax-directed definition (SDD) in which the functions in the semantic rules have no side effects

    2. (B)

      The attributes in a L-attributed definition cannot always be evaluated in a depth-first order

    3. (C)

      Synthesized attributes can be evaluated by a bottom-up parser as the input is parsed

    4. (D)

      All L-attributed definitions based on LR(1) grammar can be evaluated using a bottom-up parsing strategy

    Official answer: B, D

  20. Q.30MSQ · 1 mark

    For a Boolean variable , which of the following statements is/are FALSE?

    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: B, C

  21. Q.31MSQ · 1 mark

    An instruction format has the following structure:

    Instruction Number: Opcode destination reg, source reg-1, source reg-2

    Consider the following sequence of instructions to be executed in a pipelined processor:

    I1: DIV R3, R1, R2
    I2: SUB R5, R3, R4
    I3: ADD R3, R5, R6
    I4: MUL R7, R3, R8

    Which of the following statements is/are TRUE?

    1. (A)

      There is a RAW dependency on R3 between I1 and I2

    2. (B)

      There is a WAR dependency on R3 between I1 and I3

    3. (C)

      There is a RAW dependency on R3 between I2 and I3

    4. (D)

      There is a WAW dependency on R3 between I3 and I4

    Official answer: A

  22. Q.32MSQ · 1 mark

    Which of the following fields of an IP header is/are always modified by any router before it forwards the IP packet?

    1. (A)

      Source IP Address

    2. (B)

      Protocol

    3. (C)

      Time to Live (TTL)

    4. (D)

      Header Checksum

    Official answer: C, D

  23. Q.33MSQ · 1 mark

    Consider the following C function definition.

    int fX(char *a){
        char *b = a;
        while(*b)
            b++;
        return b - a;}

    Which of the following statements is/are TRUE?

    1. (A)

      The function call fX("abcd") will always return a value

    2. (B)

      Assuming a character array c is declared as char c[] = "abcd" in main(), the function call fX(c) will always return a value

    3. (C)

      The code of the function will not compile

    4. (D)

      Assuming a character pointer c is declared as char *c = "abcd" in main(), the function call fX(c) will always return a value

    Official answer: A, B, D

  24. Q.34NAT · 1 mark

    Let be the partial order defined on the set as follows

    The number of total orders on that contain is __________

    Official answer: 5

  25. Q.35NAT · 1 mark

    Let be an array containing integer values. The distance of is defined as the minimum number of elements in that must be replaced with another integer so that the resulting array is sorted in non-decreasing order. The distance of the array is ____________.

    Official answer: 3

  26. Q.36MCQ · 2 marks

    What is the output of the following C program?

    #include <stdio.h>
    int main() {
        double a[2]={20.0, 25.0}, *p, *q;
        p = a;
        q = p + 1;
        printf("%d,%d", (int)(q - p), (int)(*q - *p));
        return 0;
    }
    1. (A)

      4,8

    2. (B)

      1,5

    3. (C)

      8,5

    4. (D)

      1,8

    Official answer: B

  27. Q.37MCQ · 2 marks

    Consider a single processor system with four processes A, B, C, and D, represented as given below, where for each process the first value is its arrival time, and the second value is its CPU burst time.

    A (0, 10), B (2, 6), C (4, 3), and D (6, 7).

    Which one of the following options gives the average waiting times when preemptive Shortest Remaining Time First (SRTF) and Non-Preemptive Shortest Job First (NP-SJF) CPU scheduling algorithms are applied to the processes?

    1. (A)

      SRTF = 6, NP-SJF = 7

    2. (B)

      SRTF = 6, NP-SJF = 7.5

    3. (C)

      SRTF = 7, NP-SJF = 7.5

    4. (D)

      SRTF = 7, NP-SJF = 8.5

    Official answer: B

  28. Q.38MCQ · 2 marks

    Which one of the following CIDR prefixes exactly represents the range of IP addresses 10.12.2.0 to 10.12.3.255?

    1. (A)

      10.12.2.0/23

    2. (B)

      10.12.2.0/24

    3. (C)

      10.12.0.0/22

    4. (D)

      10.12.2.0/22

    Official answer: A

  29. Q.39MCQ · 2 marks

    You are given a set of distinct integers. A binary search tree is created by inserting all elements of one by one, starting with an empty tree. The tree follows the convention that, at each node, all values stored in the left subtree of the node are smaller than the value stored at the node. You are not aware of the sequence in which these values were inserted into , and you do not have access to .

    Which one of the following statements is TRUE?

    1. (A)

      Inorder traversal of can be determined from

    2. (B)

      Root node of can be determined from

    3. (C)

      Preorder traversal of can be determined from

    4. (D)

      Postorder traversal of can be determined from

    Official answer: A

  30. Q.40MCQ · 2 marks

    Consider the following context-free grammar where the start symbol is and the set of terminals is .



    The following is a partially-filled LL(1) parsing table (rows S, A, B; columns a, b, c, d, $).

    Which one of the following options represents the CORRECT combination for the numbered cells in the parsing table?

    Note: In the options, "blank" denotes that the corresponding cell is empty.

    GATE CSE 2024 Set 2 Q.40 as printed in the question paper, with its figureTap to open full size
    1. (A)

      (1) S -> AaAb (2) S -> BbBa (3) A -> epsilon (4) B -> epsilon

    2. (B)

      (1) S -> BbBa (2) S -> AaAb (3) A -> epsilon (4) B -> epsilon

    3. (C)

      (1) S -> AaAb (2) S -> BbBa (3) blank (4) blank

    4. (D)

      (1) S -> BbBa (2) S -> AaAb (3) blank (4) blank

    Official answer: A

  31. Q.41MCQ · 2 marks

    Let be the 5-state NFA with -transitions shown in the diagram below. Which one of the following regular expressions represents the language accepted by ?

    GATE CSE 2024 Set 2 Q.41 as printed in the question paper, with its figureTap to open full size
    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: B

  32. Q.42MCQ · 2 marks

    Consider an array X that contains n positive integers. A subarray of X is defined to be a sequence of array locations with consecutive indices.

    The C code snippet given below has been written to compute the length of the longest subarray of X that contains at most two distinct integers. The code has two missing expressions labelled (P) and (Q).

    int first=0, second=0, len1=0, len2=0, maxlen=0;
    for (int i=0; i < n; i++) {
      if (X[i] == first) {
        len2++; len1++;
      } else if (X[i] == second) {
        len2++;
        len1 = (P) ;
        second = first;
      } else {
        len2 = (Q) ;
        len1 = 1; second = first;
      }
      if (len2 > maxlen) {
        maxlen = len2;
      }
      first = X[i];
    }

    Which one of the following options gives the CORRECT missing expressions?

    (Hint: At the end of the i-th iteration, the value of len1 is the length of the longest subarray ending with X[i] that contains all equal values, and len2 is the length of the longest subarray ending with X[i] that contains at most two distinct values.)

    1. (A)

      (P) len1+1 (Q) len2+1

    2. (B)

      (P) 1 (Q) len1+1

    3. (C)

      (P) 1 (Q) len2+1

    4. (D)

      (P) len2+1 (Q) len1+1

    Official answer: B

  33. Q.43MCQ · 2 marks

    Consider the following expression: . The following sequence shows the list of triples representing the given expression, with entries missing for triples (1), (3), and (6).

    Which one of the following options fills in the missing entries CORRECTLY?

    GATE CSE 2024 Set 2 Q.43 as printed in the question paper, with its figureTap to open full size
    1. (A)

      (1) =[] s i; (3) * (0) (2); (6) []= x i

    2. (B)

      (1) []= s i; (3) - (0) (2); (6) =[] x (5)

    3. (C)

      (1) =[] s i; (3) * (0) (2); (6) []= x (5)

    4. (D)

      (1) []= s i; (3) - (0) (2); (6) =[] x i

    Official answer: A

  34. Q.44MCQ · 2 marks

    Let and be random variables, not necessarily independent, that take real values in the interval . Let and let the mean values of be , respectively. Which one of the following statements is TRUE?

    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: D

  35. Q.45MCQ · 2 marks

    The relation schema, Person(pid, city), describes the city of residence for every person uniquely identified by pid (pid is underlined, the key). The following relational algebra operators are available: selection, projection, cross product, and rename.

    To find the list of cities where at least 3 persons reside, using the above operators, the minimum number of cross product operations that must be used is

    1. (A)

      1

    2. (B)

      2

    3. (C)

      3

    4. (D)

      4

    Official answer: B

  36. Q.46MSQ · 2 marks

    Consider a multi-threaded program with two threads T1 and T2. The threads share two semaphores: s1 (initialized to 1) and s2 (initialized to 0). The threads also share a global variable x (initialized to 0). The threads execute the code shown below.

    // code of T1
    wait(s1);
    x = x+1;
    print(x);
    wait(s2);
    signal(s1);
    // code of T2
    wait(s1);
    x = x+1;
    print(x);
    signal(s2);
    signal(s1);

    Which of the following outcomes is/are possible when threads T1 and T2 execute concurrently?

    GATE CSE 2024 Set 2 Q.46 as printed in the question paper, with its figureTap to open full size
    1. (A)

      T1 runs first and prints 1, T2 runs next and prints 2

    2. (B)

      T2 runs first and prints 1, T1 runs next and prints 2

    3. (C)

      T1 runs first and prints 1, T2 does not print anything (deadlock)

    4. (D)

      T2 runs first and prints 1, T1 does not print anything (deadlock)

    Official answer: B, C

  37. Q.47MSQ · 2 marks

    Let be an matrix over the set of all real numbers . Let be a matrix obtained from by swapping two rows. Which of the following statements is/are TRUE?

    1. (A)

      The determinant of is the negative of the determinant of

    2. (B)

      If is invertible, then is also invertible

    3. (C)

      If is symmetric, then is also symmetric

    4. (D)

      If the trace of is zero, then the trace of is also zero

    Official answer: A, B

  38. Q.48MSQ · 2 marks

    Let S1 and S2 be two stacks. S1 has capacity of 4 elements. S2 has capacity of 2 elements. S1 already has 4 elements: 100, 200, 300, and 400, whereas S2 is empty, as shown below.

    Stack S1 (bottom to top): 100, 200, 300, 400 (Top)
    Stack S2: empty (capacity 2)

    Only the following three operations are available:

    PushToS2: Pop the top element from S1 and push it on S2.
    PushToS1: Pop the top element from S2 and push it on S1.
    GenerateOutput: Pop the top element from S1 and output it to the user.

    Note that the pop operation is not allowed on an empty stack and the push operation is not allowed on a full stack.

    Which of the following output sequences can be generated by using the above operations?

    GATE CSE 2024 Set 2 Q.48 as printed in the question paper, with its figureTap to open full size
    1. (A)

      100, 200, 400, 300

    2. (B)

      200, 300, 400, 100

    3. (C)

      400, 200, 100, 300

    4. (D)

      300, 200, 400, 100

    Official answer: B, C, D

  39. Q.49MSQ · 2 marks

    Which of the following is/are EQUAL to 224 in radix-5 (i.e., base-5) notation?

    1. (A)

      64 in radix-10

    2. (B)

      100 in radix-8

    3. (C)

      50 in radix-16

    4. (D)

      121 in radix-7

    Official answer: A, B, D

  40. Q.50MSQ · 2 marks

    Consider 4-variable functions expressed in sum-of-minterms form as given below.

    With respect to the circuit given above, which of the following options is/are CORRECT?

    GATE CSE 2024 Set 2 Q.50 as printed in the question paper, with its figureTap to open full size
    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: C, D

  41. Q.51MSQ · 2 marks

    Let be an undirected connected graph in which every edge has a positive integer weight. Suppose that every spanning tree in has even weight. Which of the following statements is/are TRUE for every such graph ?

    1. (A)

      All edges in have even weight

    2. (B)

      All edges in have even weight OR all edges in have odd weight

    3. (C)

      In each cycle in , all edges in have even weight

    4. (D)

      In each cycle in , either all edges in have even weight OR all edges in have odd weight

    Official answer: D

  42. Q.52MSQ · 2 marks

    Consider a context-free grammar with the following 3 rules.

    Let . Let denote the number of times occur in , respectively. Which of the following statements is/are TRUE?

    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: B, C

  43. Q.53NAT · 2 marks

    Consider a disk with the following specifications: rotation speed of 6000 RPM, average seek time of 5 milliseconds, 500 sectors/track, 512-byte sectors. A file has content stored in 3000 sectors located randomly on the disk. Assuming average rotational latency, the total time (in seconds, rounded off to 2 decimal places) to read the entire file from the disk is ________

    Official answer: 29.50 to 30.50

  44. Q.54NAT · 2 marks

    Consider a TCP connection operating at a point of time with the congestion window of size 12 MSS (Maximum Segment Size), when a timeout occurs due to packet loss. Assuming that all the segments transmitted in the next two RTTs (Round Trip Time) are acknowledged correctly, the congestion window size (in MSS) during the third RTT will be ______

    Official answer: 4

  45. Q.55NAT · 2 marks

    Consider an Ethernet segment with a transmission speed of bits/sec and a maximum segment length of 500 meters. If the speed of propagation of the signal in the medium is meters/sec, then the minimum frame size (in bits) required for collision detection is ______

    Official answer: 500

  46. Q.56NAT · 2 marks

    A functional dependency is termed as a useful functional dependency if and only if it satisfies all the following three conditions:
    - is not the empty set.
    - is not the empty set.
    - Intersection of and is the empty set.

    For a relation with 4 attributes, the total number of possible useful functional dependencies is ________

    Official answer: 50

  47. Q.57NAT · 2 marks

    A processor with 16 general purpose registers uses a 32-bit instruction format. The instruction format consists of an opcode field, an addressing mode field, two register operand fields, and a 16-bit scalar field. If 8 addressing modes are to be supported, the maximum number of unique opcodes possible for every addressing mode is ____

    Official answer: 32

  48. Q.58NAT · 2 marks

    A non-pipelined instruction execution unit operating at 2 GHz takes an average of 6 cycles to execute an instruction of a program P. The unit is then redesigned to operate on a 5-stage pipeline at 2 GHz. Assume that the ideal throughput of the pipelined unit is 1 instruction per cycle. In the execution of program P, 20% instructions incur an average of 2 cycles stall due to data hazards and 20% instructions incur an average of 3 cycles stall due to control hazards. The speedup (rounded off to one decimal place) obtained by the pipelined design over the non-pipelined design is ____________

    Official answer: 2.9 to 3.1

  49. Q.59NAT · 2 marks

    The number of distinct minimum-weight spanning trees of the following graph is ____.

    Graph description: Vertices a, b, c, d, e, f, g. Edges and weights:
    - a-b: 1
    - a-f: 1
    - a-g: 2
    - b-c: 3
    - b-g: 2
    - c-g: 2
    - c-d: 1
    - g-f: 2
    - g-e: 2
    - g-d: 2
    - f-e: 3
    - e-d: 1

    GATE CSE 2024 Set 2 Q.59 as printed in the question paper, with its figureTap to open full size

    Official answer: 9

  50. Q.60NAT · 2 marks

    The chromatic number of a graph is the minimum number of colours used in a proper colouring of the graph. The chromatic number of the following graph is ______.

    GATE CSE 2024 Set 2 Q.60 as printed in the question paper, with its figureTap to open full size

    Official answer: 2

  51. Q.61NAT · 2 marks

    A processor uses a 32-bit instruction format and supports byte-addressable memory access. The ISA of the processor has 150 distinct instructions. The instructions are equally divided into two types, namely R-type and I-type, whose formats are shown below.

    R-type Instruction Format (32 bits total, fields left to right):
    | OPCODE | UNUSED | DST Register | SRC Register1 | SRC Register 2 |

    I-type Instruction Format (32 bits total, fields left to right):
    | OPCODE | DST Register | SRC Register | # Immediate value/address |

    In the OPCODE, 1 bit is used to distinguish between I-type and R-type instructions and the remaining bits indicate the operation. The processor has 50 architectural registers, and all register fields in the instructions are of equal size.

    Let be the number of bits used to encode the UNUSED field, be the number of bits used to encode the OPCODE field, and be the number of bits used to encode the immediate value/address field. The value of is ______ (answer in integer).

    GATE CSE 2024 Set 2 Q.61 as printed in the question paper, with its figureTap to open full size

    Official answer: 34

  52. Q.62NAT · 2 marks

    Let be the language represented by the regular expression and , where denotes the length of string . The number of strings in which are also in is ______.

    Official answer: 15

  53. Q.63NAT · 2 marks

    Let be the group of integers with addition modulo as the group operation. The number of elements in the group that are their own inverses is

    Official answer: 4

  54. Q.64NAT · 2 marks

    Consider a 32-bit system with 4 KB page size and page table entries of size 4 bytes each. Assume 1 KB = 2^10 bytes. The OS uses a 2-level page table for memory management, with the page table containing an outer page directory and an inner page table. The OS allocates a page for the outer page directory upon process creation. The OS uses demand paging when allocating memory for the inner page table, i.e., a page of the inner page table is allocated only if it contains at least one valid page table entry.

    An active process in this system accesses 2000 unique pages during its execution, and none of the pages are swapped out to disk. After it completes the page accesses, let X denote the minimum and Y denote the maximum number of pages across the two levels of the page table of the process.

    The value of X+Y is ________

    Official answer: 1028

  55. Q.65NAT · 2 marks

    Consider the following augmented grammar, which is to be parsed with a SLR parser. The set of terminals is {a, b, c, d, #, @}




    Let . The number of items in the set is ______

    Official answer: 9