Machine-translated by Google. Questions are authored in English.
Top

GATE CS 2024: Computer Science and Information Technology Session 1

  • Date: 10 February 2024
  • Shift: 1
  • Paper code: CS1
  • Language: English
  • 36 pages
GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 1 of 36
Page 1 of 36
Text of page 1
Computer Science and Information Technology Set 1 (CS1)


General Aptitude (GA)
Q.1 – Q.5 Carry ONE mark Each

 Q.1      If ‘→’ denotes increasing order of intensity, then the meaning of the words

          [dry → arid → parched] is analogous to [diet → fast → ________ ].

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




 (A)      starve


 (B)      reject


 (C)      feast


 (D)      deny




 Q.2      If two distinct non-zero real variables x and y are such that (x + y) is proportional
                                         x
          to (x − y) then the value of
                                        y




 (A)      depends on xy


 (B)      depends only on x and not on y


 (C)      depends only on y and not on x


 (D)      is a constant




                                          Page 1 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 2 of 36
Page 2 of 36
Text of page 2
Computer Science and Information Technology Set 1 (CS1)



 Q.3      Consider the following sample of numbers:

                                       9, 18, 11, 14, 15, 17, 10, 69, 11, 13

          The median of the sample is




 (A)      13.5


 (B)      14


 (C)      11


 (D)      18.7




 Q.4      The number of coins of ₹1, ₹5, and ₹10 denominations that a person has are in the
          ratio 5:3:13. Of the total amount, the percentage of money in ₹5 coins is




 (A)      21%


 (B)           2
          14 7%


 (C)      10%


 (D)      30%




                                              Page 2 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 3 of 36
Page 3 of 36
Text of page 3
Computer Science and Information Technology Set 1 (CS1)



 Q.5      For positive non-zero real variables p and q, if

                                 log (p2 + q 2 ) = log p + log q + 2 log 3 ,

                               p4 +q4
          then, the value of             is
                                p2 q 2




 (A)      79


 (B)      81


 (C)      9


 (D)      83




                                              Page 3 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 4 of 36
Page 4 of 36
Text of page 4
Computer Science and Information Technology Set 1 (CS1)


Q.6 – Q.10 Carry TWO marks Each

 Q.6      In the given text, the blanks are numbered (i)−(iv). Select the best match for all the
          blanks.

                                                        (i)                      (ii)
          Steve was advised to keep his head                    before heading           to bat;
                                          (iii)
          for, while he had a head                 batting, he could only do so with a cool head
                  (iv)
          s              his shoulders.




 (A)          (i) down      (ii) down       (iii) on          (iv) for


 (B)          (i) on        (ii) down       (iii) for         (iv) on


 (C)          (i) down      (ii) out        (iii) for         (iv) on


 (D)          (i) on        (ii) out        (iii) on          (iv) for




                                             Page 4 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 5 of 36
Page 5 of 36
Text of page 5
Computer Science and Information Technology Set 1 (CS1)



 Q.7      A rectangular paper sheet of dimensions 54 cm × 4 cm is taken. The two longer
          edges of the sheet are joined together to create a cylindrical tube. A cube whose
          surface area is equal to the area of the sheet is also taken.

          Then, the ratio of the volume of the cylindrical tube to the volume of the cube is




 (A)      1/π


 (B)      2/π


 (C)      3/π


 (D)      4/π




                                          Page 5 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 6 of 36
Page 6 of 36
Text of page 6
Computer Science and Information Technology Set 1 (CS1)



 Q.8      The pie chart presents the percentage contribution of different macronutrients to a
          typical 2,000 kcal diet of a person.

                                 Macronutrient energy contribution

                                                   Trans
                                                    fat
                                                    5%
                                   Saturated fat
                                       20%                    Carbohydrates
                                                                  35%



                                   Unsaturated fat
                                        20%
                                                           Proteins
                                                             20%




          The typical energy density (kcal/g) of these macronutrients is given in the table.

                        Macronutrient                           Energy density (kcal/g)
                        Carbohydrates                                     4
                        Proteins                                          4
                        Unsaturated fat                                   9
                        Saturated fat                                     9
                        Trans fat                                         9

          The total fat (all three types), in grams, this person consumes is




 (A)      44.4


 (B)      77.8


 (C)      100


 (D)      3,600




                                             Page 6 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 7 of 36
Page 7 of 36
Text of page 7
Computer Science and Information Technology Set 1 (CS1)



 Q.9      A rectangular paper of 20 cm × 8 cm is folded 3 times. Each fold is made along the
          line of symmetry, which is perpendicular to its long edge. The perimeter of the final
          folded sheet (in cm) is




 (A)      18


 (B)      24


 (C)      20


 (D)      21




 Q.10     The least number of squares to be added in the figure to make AB a line of
          symmetry is




 (A)      6


 (B)      4


 (C)      5


 (D)      7




                                          Page 7 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 8 of 36
Page 8 of 36
Text of page 8
Computer Science and Information Technology Set 1 (CS1)


Q.11 – Q.35 Carry ONE mark Each



 Q.11     Let f: ℝ → ℝ be a function such that f(x) = max{x, x 3 }, x ∈ ℝ , where ℝ is the
          set of all real numbers. The set of all points where f(x) is
          NOT differentiable is




 (A)      {−1, 1, 2}


 (B)      {−2, −1, 1}


 (C)      {0, 1}


 (D)      {−1, 0, 1}




                                                        1 2 3
 Q.12     The product of all eigenvalues of the matrix [4 5 6] is
                                                        7 8 9




 (A)      −1


 (B)      0


 (C)      1


 (D)      2




                                          Page 8 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 9 of 36
Page 9 of 36
Text of page 9
Computer Science and Information Technology Set 1 (CS1)



 Q.13     Consider a system that uses 5 bits for representing signed integers in 2’s complement
          format. In this system, two integers A and B are represented as A=01010 and
          B=11010. Which one of the following operations will result in either an arithmetic
          overflow or an arithmetic underflow?




 (A)      A+B


 (B)      A−B


 (C)      B−A


 (D)      2∗B




 Q.14     Consider a permutation sampled uniformly at random from the set of all
          permutations of {1, 2, 3, ⋯ , n} for some n ≥ 4. Let X be the event that 1 occurs
          before 2 in the permutation, and Y the event that 3 occurs before 4. Which one of
          the following statements is TRUE?




 (A)      The events X and Y are mutually exclusive


 (B)      The events X and Y are independent


 (C)      Either event X or Y must occur


 (D)      Event X is more likely than event Y




                                           Page 9 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 10 of 36
Page 10 of 36
Text of page 10
Computer Science and Information Technology Set 1 (CS1)



 Q.15     Which one of the following statements is FALSE?




          In the cycle stealing mode of DMA, one word of data is transferred between an I/O
 (A)
          device and main memory in a stolen cycle


          For bulk data transfer, the burst mode of DMA has a higher throughput than the
 (B)
          cycle stealing mode


          Programmed I/O mechanism has a better CPU utilization than the interrupt driven
 (C)
          I/O mechanism


          The CPU can start executing an interrupt service routine faster with vectored
 (D)
          interrupts than with non-vectored interrupts




                                         Page 10 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 11 of 36
Page 11 of 36
Text of page 11
Computer Science and Information Technology Set 1 (CS1)



 Q.16     A user starts browsing a webpage hosted at a remote server. The browser opens a
          single TCP connection to fetch the entire webpage from the server. The webpage
          consists of a top-level index page with multiple embedded image objects. Assume
          that all caches (e.g., DNS cache, browser cache) are all initially empty. The
          following packets leave the user’s computer in some order.

              (i)       HTTP GET request for the index page
              (ii)      DNS request to resolve the web server’s name to its IP address
              (iii)     HTTP GET request for an image object
              (iv)      TCP SYN to open a connection to the web server

          Which one of the following is the CORRECT chronological order (earliest in time
          to latest) of the packets leaving the computer ?




 (A)      (iv), (ii), (iii), (i)


 (B)      (ii), (iv), (iii), (i)


 (C)      (ii), (iv), (i), (iii)


 (D)      (iv), (ii), (i), (iii)




 Q.17     Given an integer array of size N, we want to check if the array is sorted (in either
          ascending or descending order). An algorithm solves this problem by making a
          single pass through the array and comparing each element of the array only with its
          adjacent elements. The worst-case time complexity of this algorithm is




 (A)      both Ο(N) and Ω(N)


 (B)      Ο(N) but not Ω(N)


 (C)      Ω(N) but not Ο(N)


 (D)      neither Ο(N) nor Ω(N)


                                           Page 11 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 12 of 36
Page 12 of 36
Text of page 12
Computer Science and Information Technology Set 1 (CS1)



 Q.18     Consider the following C program:


          #include <stdio.h>

          int main(){

               int a = 6;

               int b = 0;

               while(a < 10) {

                    a = a / 12 + 1;

                    a += b;}

               printf(”%d”, a);

               return 0;}

          Which one of the following statements is CORRECT?




 (A)      The program prints 9 as output


 (B)      The program prints 10 as output


 (C)      The program gets stuck in an infinite loop


 (D)      The program prints 6 as output




                                         Page 12 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 13 of 36
Page 13 of 36
Text of page 13
Computer Science and Information Technology Set 1 (CS1)



 Q.19     Consider the following C program:


           #include <stdio.h>               void fX(){

           void fX();                         char a;

           int main(){                        if((a=getchar()) != ’\n’)

                fX();                              fX();

                return 0;}                    if(a != ’\n’)

                                                   putchar(a);}




          Assume that the input to the program from the command line is 1234 followed by
          a newline character. Which one of the following statements is CORRECT?




 (A)      The program will not terminate


 (B)      The program will terminate with no output


 (C)      The program will terminate with 4321 as output


 (D)      The program will terminate with 1234 as output




                                         Page 13 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 14 of 36
Page 14 of 36
Text of page 14
Computer Science and Information Technology Set 1 (CS1)



 Q.20     Let S be the specification: "Instructors teach courses. Students register for courses.
          Courses are allocated classrooms. Instructors guide students." Which one of the
          following ER diagrams CORRECTLY represents S?




 (A)      (i)


 (B)      (ii)


 (C)      (iii)


 (D)      (iv)




                                          Page 14 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 15 of 36
Page 15 of 36
Text of page 15
Computer Science and Information Technology Set 1 (CS1)



 Q.21     In a B+ tree, the requirement of at least half-full (50%) node occupancy is relaxed
          for which one of the following cases?




 (A)      Only the root node


 (B)      All leaf nodes


 (C)      All internal nodes


 (D)      Only the leftmost leaf node




 Q.22     Which of the following statements about a relation R in first normal form (1NF)
          is/are TRUE ?




 (A)      R can have a multi-attribute key


 (B)      R cannot have a foreign key


 (C)      R cannot have a composite attribute


 (D)      R cannot have more than one candidate key




                                         Page 15 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 16 of 36
Page 16 of 36
Text of page 16
Computer Science and Information Technology Set 1 (CS1)



 Q.23     Let L1 , L2 be two regular languages and L3 a language which is not regular.
          Which of the following statements is/are always TRUE?




 (A)      L1 = L2 if and only if L1 ∩ ̅̅̅
                                      L2 = φ

 (B)      L1 ∪ L3 is not regular

 (C)      ̅̅̅
          L3 is not regular

 (D)      ̅̅̅
          L1 ∪ ̅̅̅
               L2 is regular




 Q.24     Which of the following statements about threads is/are TRUE?




 (A)      Threads can only be implemented in kernel space


 (B)      Each thread has its own file descriptor table for open files


 (C)      All the threads belonging to a process share a common stack


 (D)      Threads belonging to a process are by default not protected from each other




                                          Page 16 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 17 of 36
Page 17 of 36
Text of page 17
Computer Science and Information Technology Set 1 (CS1)



 Q.25     Which of the following process state transitions is/are NOT possible?




 (A)      Running to Ready


 (B)      Waiting to Running


 (C)      Ready to Waiting


 (D)      Running to Terminated




 Q.26     Which of the following is/are Bottom-Up Parser(s)?




 (A)      Shift-reduce Parser


 (B)      Predictive Parser


 (C)      LL(1) Parser


 (D)      LR Parser




                                         Page 17 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 18 of 36
Page 18 of 36
Text of page 18
Computer Science and Information Technology Set 1 (CS1)



 Q.27     Let A and B be two events in a probability space with P(A) = 0.3, P(B) = 0.5,
          and P(A ∩ B) = 0.1. Which of the following statements is/are TRUE?




 (A)      The two events A and B are independent


 (B)      P(A ∪ B) = 0.7


 (C)      P(A ∩ B c ) = 0.2, where B c is the complement of the event B


          P(Ac ∩ B c ) = 0.4, where Ac and B c are the complements of the events A and B,
 (D)
          respectively




 Q.28     Consider the circuit shown below where the gates may have propagation delays.
          Assume that all signal transitions occur instantaneously and that wires have no
          delays. Which of the following statements about the circuit is/are CORRECT?




 (A)      With no propagation delays, the output Y is always logic Zero


 (B)      With no propagation delays, the output Y is always logic One


          With propagation delays, the output Y can have a transient logic One after X
 (C)
          transitions from logic Zero to logic One


          With propagation delays, the output Y can have a transient logic Zero after X
 (D)
          transitions from logic One to logic Zero




                                         Page 18 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 19 of 36
Page 19 of 36
Text of page 19
Computer Science and Information Technology Set 1 (CS1)



 Q.29     TCP client P successfully establishes a connection to TCP server Q. Let NP denote
          the sequence number in the SYN sent from P to Q. Let NQ denote the
          acknowledgement number in the SYN ACK from Q to P. Which of the following
          statements is/are CORRECT?




 (A)      The sequence number NP is chosen randomly by P


 (B)      The sequence number NP is always 0 for a new connection


 (C)      The acknowledgement number NQ is equal to NP


 (D)      The acknowledgement number NQ is equal to NP + 1




 Q.30     Consider a 5-stage pipelined processor with Instruction Fetch (IF), Instruction
          Decode (ID), Execute (EX), Memory Access (MEM), and Register Writeback (WB)
          stages. Which of the following statements about forwarding is/are CORRECT?




          In a pipelined execution, forwarding means the result from a source stage of an
 (A)
          earlier instruction is passed on to the destination stage of a later instruction


          In forwarding, data from the output of the MEM stage can be passed on to the
 (B)
          input of the EX stage of the next instruction


 (C)      Forwarding cannot prevent all pipeline stalls


          Forwarding does not require any extra hardware to retrieve the data from the
 (D)
          pipeline stages




                                         Page 19 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 20 of 36
Page 20 of 36
Text of page 20
Computer Science and Information Technology Set 1 (CS1)



 Q.31     Which of the following fields is/are modified in the IP header of a packet going out
          of a network address translation (NAT) device from an internal network to an
          external network?




 (A)      Source IP


 (B)      Destination IP


 (C)      Header Checksum


 (D)      Total Length




 Q.32     Let A and B be non-empty finite sets such that there exist one-to-one and onto
          functions (i) from A to B and (ii) from A × A to A ∪ B. The number of possible
          values of |A| is __________




 Q.33     Consider the operator precedence and associativity rules for the integer arithmetic
          operators given in the table below.

                             Operator      Precedence          Associativity
                                 +         Highest             Left
                                 −         High                Right
                                  ∗        Medium              Right
                                  /        Low                 Right

          The value of the expression 3 + 1 + 5 ∗ 2 / 7 + 2 − 4 − 7 − 6 / 2 as per the
          above rules is __________




                                         Page 20 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 21 of 36
Page 21 of 36
Text of page 21
Computer Science and Information Technology Set 1 (CS1)



 Q.34     The number of spanning trees in a complete graph of 4 vertices labelled A, B, C,
          and D is _________




 Q.35     Consider the following two relations, R(A,B) and S(A,C):



                           R                                              S
                  A                    B                          A               C
                  10                   20                         10              90
                  20                   30                         30              45
                  30                   40                         40              80
                  30                   50
                  50                   95


          The total number of tuples obtained by evaluating the following expression

                                            σB<C (R ⋈R.A=S.A S)
          is _________




                                             Page 21 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 22 of 36
Page 22 of 36
Text of page 22
Computer Science and Information Technology Set 1 (CS1)


Q.36 – Q.65 Carry TWO marks Each



          Consider a network path P—Q—R between nodes P and R via router Q. Node P
 Q.36
          sends a file of size 106 bytes to R via this path by splitting the file into chunks of
          103 bytes each. Node P sends these chunks one after the other without any wait time
          between the successive chunk transmissions. Assume that the size of extra headers
          added to these chunks is negligible, and that the chunk size is less than the MTU.

          Each of the links P—Q and Q—R has a bandwidth of 106 bits/sec, and negligible
          propagation latency. Router Q immediately transmits every packet it receives from
          P to R, with negligible processing and queueing delays. Router Q can
          simultaneously receive on link P—Q and transmit on link Q—R.

          Assume P starts transmitting the chunks at time t = 0.
          Which one of the following options gives the time (in seconds, rounded off to 3
          decimal places) at which R receives all the chunks of the file?




 (A)      8.000


 (B)      8.008


 (C)      15.992


 (D)      16.000




                                         Page 22 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 23 of 36
Page 23 of 36
Text of page 23
Computer Science and Information Technology Set 1 (CS1)



 Q.37     Consider the following syntax-directed definition (SDD).



                  S → DHTU         { S. val = D. val + H. val + T. val + U. val; }

                  D → "M"D1        { D. val = 5 + D1 . val; }

                     D→ε           { D. val = −5; }

                   H → "L"H1       { H. val = 5 ∗ 10 + H1 . val; }

                     H→ε           { H. val = −10; }

                   T → "C"T1       { T. val = 5 ∗ 100 + T1 . val; }

                     T→ε           { T. val = −5; }

                    U → "K"        { U. val = 5; }


          Given "MMLK" as the input, which one of the following options is the CORRECT
          value computed by the SDD (in the attribute S. val)?


 (A)      45


 (B)      50


 (C)      55


 (D)      65




                                          Page 23 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 24 of 36
Page 24 of 36
Text of page 24
Computer Science and Information Technology Set 1 (CS1)



 Q.38     Consider the following grammar G, with S as the start symbol. The grammar G has
          three incomplete productions denoted by (1), (2), and (3).

                                         S → daT | (1)
                                         T → aS | bT | (2)
                                         R → (3) | ε

          The set of terminals is {a, b, c, d, f}. The FIRST and FOLLOW sets of the different
          non-terminals are as follows.

                   FIRST(S) = {c, d, f}, FIRST(T) = {a, b, ε}, FIRST(R) = {c, ε}

                   FOLLOW(S) = FOLLOW(T) = {c, f, $}, FOLLOW(R) = {f}

          Which one of the following options CORRECTLY fills in the incomplete
          productions?




 (A)       (1) S → Rf      (2) T → ε    (3) R → cTR


 (B)       (1) S → fR      (2) T → ε    (3) R → cTR


 (C)       (1) S → fR      (2) T → cT   (3) R → cR


 (D)       (1) S → Rf      (2) T → cT   (3) R → cR




                                          Page 24 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 25 of 36
Page 25 of 36
Text of page 25
Computer Science and Information Technology Set 1 (CS1)



 Q.39     Consider the following pseudo-code.

                    L1:         t1 = −1
                    L2:         t2 = 0
                    L3:         t3 = 0
                    L4:         t4 = 4 ∗ t3
                    L5:         t5 = 4 ∗ t2
                    L6:         t6 = t5 ∗ M
                    L7:         t7 = t4 + t6
                    L8:         t8 = a[t7]
                    L9:         if t8 <= max goto L11
                    L10:        t1 = t8
                    L11:        t3 = t3 + 1
                    L12:        if t3 < M goto L4
                    L13:        t2 = t2 + 1
                    L14:        if t2 < N goto L3
                    L15:        max = t1

          Which one of the following options CORRECTLY specifies the number of basic
          blocks and the number of instructions in the largest basic block, respectively ?




 (A)      6 and 6


 (B)      6 and 7


 (C)      7 and 7


 (D)      7 and 6




                                          Page 25 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 26 of 36
Page 26 of 36
Text of page 26
Computer Science and Information Technology Set 1 (CS1)



 Q.40     Consider the following two threads T1 and T2 that update two shared variables
          a and b. Assume that initially a = b = 1. Though context switching between
          threads can happen at any time, each statement of T1 or T2 is executed atomically
          without interruption.


                                 T1                                  T2

                          a = a + 1;                            b = 2 * b;
                          b = b + 1;                            a = 2 * a;

          Which one of the following options lists all the possible combinations of values of
          a and b after both T1 and T2 finish execution?




 (A)       (a = 4, b = 4); (a = 3, b = 3); (a = 4, b = 3)


 (B)       (a = 3, b = 4); (a = 4, b = 3); (a = 3, b = 3)


 (C)       (a = 4, b = 4); (a = 4, b = 3); (a = 3, b = 4)


 (D)       (a = 2, b = 2); (a = 2, b = 3); (a = 3, b = 4)




 Q.41     An array [82, 101, 90, 11, 111, 75, 33, 131, 44, 93] is heapified. Which one of the
          following options represents the first three elements in the heapified array?




 (A)       82, 90, 101


 (B)       82, 11, 93


 (C)       131, 11, 93


 (D)       131, 111, 90




                                         Page 26 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 27 of 36
Page 27 of 36
Text of page 27
Computer Science and Information Technology Set 1 (CS1)



 Q.42     Consider the following recurrence relation:

                                       T(n) = {√nT(√n) + n for n ≥ 1,
                                                     1    for n = 1.
          Which one of the following options is CORRECT?




 (A)       T(n) = Θ(n log log n)


 (B)       T(n) = Θ(n log n)


 (C)       T(n) = Θ(n2 log n)


 (D)       T(n) = Θ(n2 log log n)




 Q.43     Consider a binary min-heap containing 105 distinct elements. Let k be the index (in
          the underlying array) of the maximum element stored in the heap. The number of
          possible values of k is




 (A)      53


 (B)      52


 (C)      27


 (D)      1




                                             Page 27 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 28 of 36
Page 28 of 36
Text of page 28
Computer Science and Information Technology Set 1 (CS1)



 Q.44     The symbol → indicates functional dependency in the context of a relational
          database. Which of the following options is/are TRUE?




 (A)       (X, Y) → (Z, W) implies X → (Z, W)


 (B)       (X, Y) → (Z, W) implies (X, Y) → Z


 (C)       ((X, Y) → Z and W → Y) implies (X, W) → Z


 (D)       (X → Y and Y → Z) implies X → Z




 Q.45     Let G be a directed graph and T a depth first search (DFS) spanning tree in G that
          is rooted at a vertex v. Suppose T is also a breadth first search (BFS) tree in G,
          rooted at v. Which of the following statements is/are TRUE for every such graph G
          and tree T ?




 (A)      There are no back-edges in G with respect to the tree T


 (B)      There are no cross-edges in G with respect to the tree T


 (C)      There are no forward-edges in G with respect to the tree T


 (D)      The only edges in G are the edges in T




                                         Page 28 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 29 of 36
Page 29 of 36
Text of page 29
Computer Science and Information Technology Set 1 (CS1)



 Q.46     Consider the following read-write schedule S over three transactions
          T1 , T2 , and T3 , where the subscripts in the schedule indicate transaction IDs:

                      S: r1 (z); w1 (z); r2 (x); r3 (y); w3 (y); r2 (y); w2 (x); w2 (y);

          Which of the following transaction schedules is/are conflict equivalent to S ?




 (A)      T1 T2 T3


 (B)      T1 T3 T2


 (C)      T3 T2 T1


 (D)      T3 T1 T2




 Q.47     Consider a Boolean expression given by F(X, Y, Z) = ∑(3,5,6,7).

          Which of the following statements is/are CORRECT?




 (A)      F(X, Y, Z) = Π(0,1,2,4)


 (B)      F(X, Y, Z) = XY + YZ + XZ


 (C)      F(X, Y, Z) is independent of input Y


 (D)      F(X, Y, Z) is independent of input X




                                           Page 29 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 30 of 36
Page 30 of 36
Text of page 30
Computer Science and Information Technology Set 1 (CS1)



 Q.48     Consider the following C function definition.

                   int f(int x, int y) {
                     for (int i=0; i<y; i++) {
                       x=x+x+y;
                     }
                     return x;
                   }
          Which of the following statements is/are TRUE about the above function?




 (A)      If the inputs are x=20, y=10, then the return value is greater than 220


 (B)      If the inputs are x=20, y=20, then the return value is greater than 220


 (C)      If the inputs are x=20, y=10, then the return value is less than 210


 (D)      If the inputs are x=10, y=20, then the return value is greater than 220




 Q.49     Let A be any n × m matrix, where m > n. Which of the following statements is/are
          TRUE about the system of linear equations Ax = 0 ?




 (A)      There exist at least m − n linearly independent solutions to this system


          There exist m − n linearly independent vectors such that every solution is a linear
 (B)
          combination of these vectors


 (C)      There exists a non-zero solution in which at least m − n variables are 0


 (D)      There exists a solution in which at least n variables are non-zero




                                         Page 30 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 31 of 36
Page 31 of 36
Text of page 31
Computer Science and Information Technology Set 1 (CS1)



 Q.50     Consider the 5-state DFA M accepting the language L(M) ⊂ (0 + 1)∗ shown
          below. For any string w ∈ (0 + 1)∗ let n0 (w) be the number of 0′ s in w and
          n1 (w) be the number of 1′s in w .




          Which of the following statements is/are FALSE?


 (A)      States 2 and 4 are distinguishable in M


 (B)      States 3 and 4 are distinguishable in M


 (C)      States 2 and 5 are distinguishable in M


 (D)      Any string w with n0 (w) = n1 (w) is in L(M)




                                         Page 31 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 32 of 36
Page 32 of 36
Text of page 32
Computer Science and Information Technology Set 1 (CS1)



 Q.51     The chromatic number of a graph is the minimum number of colours used in a
          proper colouring of the graph. Let G be any graph with n vertices and chromatic
          number k. Which of the following statements is/are always TRUE?




 (A)      G contains a complete subgraph with k vertices


 (B)      G contains an independent set of size at least n/k


 (C)      G contains at least k(k − 1)/2 edges


 (D)      G contains a vertex of degree at least k




 Q.52     Consider the operators ◊ and □ defined by a ◊ b = a + 2b, a□b = ab, for positive
          integers. Which of the following statements is/are TRUE?




 (A)      Operator ◊ obeys the associative law


 (B)      Operator □ obeys the associative law


 (C)      Operator ◊ over the operator □ obeys the distributive law


 (D)      Operator □ over the operator ◊ obeys the distributive law




                                         Page 32 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 33 of 36
Page 33 of 36
Text of page 33
Computer Science and Information Technology Set 1 (CS1)



 Q.53     Consider two set-associative cache memory architectures: WBC, which uses the
          write back policy, and WTC, which uses the write through policy. Both of them use
          the LRU (Least Recently Used) block replacement policy. The cache memory is
          connected to the main memory. Which of the following statements is/are TRUE?




 (A)      A read miss in WBC never evicts a dirty block


          A read miss in WTC never triggers a write back operation of a cache block to
 (B)
          main memory


 (C)      A write hit in WBC can modify the value of the dirty bit of a cache block


          A write miss in WTC always writes the victim cache block to main memory
 (D)
          before loading the missed block to the cache




 Q.54     Consider a 512 GB hard disk with 32 storage surfaces. There are 4096 sectors per
          track and each sector holds 1024 bytes of data. The number of cylinders in the hard
          disk is _________




 Q.55     The baseline execution time of a program on a 2 GHz single core machine is
          100 nanoseconds (ns). The code corresponding to 90% of the execution time can be
          fully parallelized. The overhead for using an additional core is 10 ns when running
          on a multicore system. Assume that all cores in the multicore system run their share
          of the parallelized code for an equal amount of time.

          The number of cores that minimize the execution time of the program is ________




 Q.56     A given program has 25% load/store instructions. Suppose the ideal CPI (cycles per
          instruction) without any memory stalls is 2. The program exhibits 2% miss rate on
          instruction cache and 8% miss rate on data cache. The miss penalty is 100 cycles.
          The speedup (rounded off to two decimal places) achieved with a perfect cache (i.e.,
          with NO data or instruction cache misses) is _________


                                         Page 33 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 34 of 36
Page 34 of 36
Text of page 34
Computer Science and Information Technology Set 1 (CS1)



 Q.57     Consider the following code snippet using the fork() and wait() system calls.
          Assume that the code compiles and runs correctly, and that the system calls run
          successfully without any errors.

                   int x = 3;
                   while(x > 0) {
                     fork();
                     printf("hello");
                     wait(NULL);
                     x--;
                   }

          The total number of times the printf statement is executed is _______




 Q.58     Consider the entries shown below in the forwarding table of an IP router. Each entry
          consists of an IP prefix and the corresponding next hop router for packets whose
          destination IP address matches the prefix. The notation “/N” in a prefix indicates a
          subnet mask with the most significant N bits set to 1.

                                   Prefix               Next hop router
                                   10.1.1.0/24                R1
                                   10.1.1.128/25              R2
                                   10.1.1.64/26               R3
                                   10.1.1.192/26              R4

          This router forwards 20 packets each to 5 hosts. The IP addresses of the hosts are
          10.1.1.16, 10.1.1.72, 10.1.1.132, 10.1.1.191, and 10.1.1.205 . The number of
          packets forwarded via the next hop router R2 is _______




 Q.59     Let G = (V, Σ, S, P) be a context-free grammar in Chomsky Normal Form with
          Σ = {a, b, c} and V containing 10 variable symbols including the start
          symbol S. The string w = a30 b 30 c 30 is derivable from S. The number of steps
          (application of rules) in the derivation S →∗ w is _________




                                            Page 34 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 35 of 36
Page 35 of 36
Text of page 35
Computer Science and Information Technology Set 1 (CS1)



 Q.60     The number of edges present in the forest generated by the DFS traversal of an
          undirected graph G with 100 vertices is 40. The number of connected components
          in G is _________




 Q.61     Consider the following two regular expressions over the alphabet {0,1}:

                  r = 0∗ + 1∗

                  s = 01∗ + 10∗

          The total number of strings of length less than or equal to 5, which are
          neither in r nor in s, is _________




 Q.62     Consider a memory management system that uses a page size of 2 KB. Assume that
          both the physical and virtual addresses start from 0. Assume that the pages 0, 1, 2,
          and 3 are stored in the page frames 1, 3, 2, and 0, respectively. The physical address
          (in decimal format) corresponding to the virtual address 2500 (in decimal format)
          is _________




 Q.63     A bag contains 10 red balls and 15 blue balls. Two balls are drawn randomly without
          replacement. Given that the first ball drawn is red, the probability (rounded off to 3
          decimal places) that both balls drawn are red is _________




                                         Page 35 of 36
Organizing Institute: IISc Bengaluru

GATE CS 2024 question paper, GATE 2024, Computer Science and Information Technology Session 1, page 36 of 36
Page 36 of 36
Text of page 36
Computer Science and Information Technology Set 1 (CS1)



 Q.64     Consider a digital logic circuit consisting of three 2-to-1 multiplexers M1, M2, and
          M3 as shown below. X1 and X2 are inputs of M1. X3 and X4 are inputs of M2.
          A, B, and C are select lines of M1, M2, and M3, respectively.


                                       X1   0
                                                      Q1

                                       X2   1 M1

                                                 S1
                                                                0
                                                  A                      Y
                                                                    M3
                                                                1

                                                                    S3

                                       X3   0
                                                                    C
                                                      Q2
                                                 M2
                                       X4   1

                                                 S2


                                                  B


          For an instance of inputs X1=1, X2=1, X3=0, and X4=0, the number of
          combinations of A, B, C that give the output Y=1 is _________




 Q.65     Consider sending an IP datagram of size 1420 bytes (including 20 bytes of IP
          header) from a sender to a receiver over a path of two links with a router between
          them. The first link (sender to router) has an MTU (Maximum Transmission Unit)
          size of 542 bytes, while the second link (router to receiver) has an MTU size of 360
          bytes. The number of fragments that would be delivered at the receiver is ________




                                                Page 36 of 36
Organizing Institute: IISc Bengaluru

Page 1 of 36

Source: GATE. Question paper published by GATE.