IAE Academy

PAPERS · GATE CS

GATE CSE 2020 question paper with solutions

All 65 questions of the GATE 2020 Computer Science and Information Technology paper, in order, with the official answer key from IIT Delhi.

This paper numbers General Aptitude GA Q.1 to GA Q.10 and the subject questions Q.1 to Q.55: 65 questions in all.

Download the solved paper (PDF, 1.7 MB)
questions · 100 marks
65questions · 100 marks
official answer key
IIT Delhiofficial answer key
question types
42 MCQ · 23 NATquestion types

GATE CSE 2020 answer key

Official answers to every question of GATE CSE 2020
QuestionTypeMarksAnswer
GA Q.1MCQ1D
GA Q.2MCQ1A
GA Q.3MCQ1A
GA Q.4MCQ1D
GA Q.5MCQ1B
GA Q.6MCQ2D
GA Q.7MCQ2C
GA Q.8MCQ2A
GA Q.9MCQ2B
GA Q.10MCQ2C
Q.1MCQ1A
Q.2MCQ1A
Q.3MCQ1C
Q.4MCQ1C
Q.5MCQ1B
Q.6MCQ1C
Q.7MCQ1Marks to all
Q.8MCQ1D
Q.9MCQ1D
Q.10MCQ1C
Q.11MCQ1C
Q.12MCQ1C
Q.13MCQ1A
Q.14MCQ1A
Q.15MCQ1D
Q.16MCQ1C
Q.17NAT10.125
Q.18NAT17
Q.19NAT15
Q.20NAT11034
Q.21NAT113.3, or 13.5
Q.22NAT119
Q.23NAT113
Q.24NAT17
Q.25NAT16
Q.26MCQ2A
Q.27MCQ2C
Q.28MCQ2B
Q.29MCQ2B
Q.30MCQ2B
Q.31MCQ2D
Q.32MCQ2A
Q.33MCQ2B
Q.34MCQ2A
Q.35MCQ2B
Q.36MCQ2A
Q.37MCQ2A
Q.38MCQ2B
Q.39MCQ2C
Q.40MCQ2A
Q.41MCQ2B
Q.42NAT212
Q.43NAT22.15 to 2.18
Q.44NAT214
Q.45NAT20.5
Q.46NAT255
Q.47NAT2511
Q.48NAT281
Q.49NAT299
Q.50NAT25.25
Q.51NAT26
Q.52NAT27
Q.53NAT2154.5 to 155.5
Q.54NAT24
Q.55NAT244

General Aptitude GA Q.1 to Q.10

  1. GA Q.1MCQ · 1 mark

    Raman is confident of speaking English ______ six months as he has been practising regularly ______ the last three weeks.

    1. (A)

      during, for

    2. (B)

      for, since

    3. (C)

      for, in

    4. (D)

      within, for

    Official answer: D

  2. GA Q.2MCQ · 1 mark

    His knowledge of the subject was excellent but his classroom performance was ______.

    1. (A)

      extremely poor

    2. (B)

      good

    3. (C)

      desirable

    4. (D)

      praiseworthy

    Official answer: A

  3. GA Q.3MCQ · 1 mark

    Select the word that fits the analogy:

    Cook : Cook :: Fly : ______

    1. (A)

      Flyer

    2. (B)

      Flying

    3. (C)

      Flew

    4. (D)

      Flighter

    Official answer: A

  4. GA Q.4MCQ · 1 mark

    The dawn of the 21st century witnessed the melting glaciers oscillating between giving too much and too little to billions of people who depend on them for fresh water. The UN climate report estimates that without deep cuts to man-made emissions, at least 30% of the northern hemisphere's surface permafrost could melt by the end of the century. Given this situation of imminent global exodus of billions of people displaced by rising seas, nation-states need to rethink their carbon footprint for political concerns, if not for environmental ones.

    Which one of the following statements can be inferred from the given passage?

    1. (A)

      Nation-states do not have environmental concerns.

    2. (B)

      Nation-states are responsible for providing fresh water to billions of people.

    3. (C)

      Billions of people are responsible for man-made emissions.

    4. (D)

      Billions of people are affected by melting glaciers.

    Official answer: D

  5. GA Q.5MCQ · 1 mark

    There are multiple routes to reach from node 1 to node 2, as shown in the network.

    The cost of travel on an edge between two nodes is given in rupees. Nodes 'a', 'b', 'c', 'd', 'e', and 'f' are toll booths. The toll price at toll booths marked 'a' and 'e' is Rs. 200, and is Rs. 100 for the other toll booths. Which is the cheapest route from node 1 to node 2?

    GATE CSE 2020 GA Q.5 as printed in the question paper, with its figureTap to open full size
    1. (A)

      1-a-c-2

    2. (B)

      1-f-b-2

    3. (C)

      1-b-2

    4. (D)

      1-f-e-2

    Official answer: B

  6. GA Q.6MCQ · 2 marks

    Goods and Services Tax (GST) is an indirect tax introduced in India in 2017 that is imposed on the supply of goods and services, and it subsumes all indirect taxes except few. It is a destination-based tax imposed on goods and services used, and it is not imposed at the point of origin from where goods come. GST also has a few components specific to state governments, central government and Union Territories (UTs).

    Which one of the following statements can be inferred from the given passage?

    1. (A)

      GST is imposed on the production of goods and services.

    2. (B)

      GST includes all indirect taxes.

    3. (C)

      GST does not have a component specific to UT.

    4. (D)

      GST is imposed at the point of usage of goods and services.

    Official answer: D

  7. GA Q.7MCQ · 2 marks

    If P = 3, R = 27, T = 243, then Q + S = ______.

    1. (A)

      40

    2. (B)

      80

    3. (C)

      90

    4. (D)

      110

    Official answer: C

  8. GA Q.8MCQ · 2 marks

    The figure below shows an annular ring with outer and inner radii as b and a, respectively. The annular space has been painted in the form of blue colour circles touching the outer and inner periphery of annular space. If maximum n number of circles can be painted, then the unpainted area available in annular space is ______.

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

    2. (B)

    3. (C)

    4. (D)

    Official answer: A

  9. GA Q.9MCQ · 2 marks

    Two straight lines are drawn perpendicular to each other in X-Y plane. If and are the acute angles the straight lines make with the X-axis, then is ______.

    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: B

  10. GA Q.10MCQ · 2 marks

    The total revenue of a company during 2014-2018 is shown in the bar graph. If the total expenditure of the company in each year is 500 million rupees, then the aggregate profit or loss (in percentage) on the total expenditure of the company during 2014-2018 is ______.

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

      16.67 % profit

    2. (B)

      16.67 % loss

    3. (C)

      20 % profit

    4. (D)

      20 % loss

    Official answer: C

Computer Science and Information Technology Q.1 to Q.55

  1. Q.1MCQ · 1 mark

    Consider the functions
    I.
    II.
    III.
    Which of the above functions is/are increasing everywhere in ?

    1. (A)

      III only

    2. (B)

      II only

    3. (C)

      II and III only

    4. (D)

      I and III only

    Official answer: A

  2. Q.2MCQ · 1 mark

    For parameters and , both of which are , , and .

    Then is

    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: A

  3. Q.3MCQ · 1 mark

    Consider the following statements.

    I. Daisy chaining is used to assign priorities in attending interrupts.

    II. When a device raises a vectored interrupt, the CPU does polling to identify the source of interrupt.

    III. In polling, the CPU periodically checks the status bits to know if any device needs its attention.

    IV. During DMA, both the CPU and DMA controller can be bus masters at the same time.

    Which of the above statements is/are TRUE?

    1. (A)

      I and II only

    2. (B)

      I and IV only

    3. (C)

      I and III only

    4. (D)

      III only

    Official answer: C

  4. Q.4MCQ · 1 mark

    Consider the following data path diagram.

    Consider an instruction: R0 ← R1 + R2. The following steps are used to execute it over the given data path. Assume that PC is incremented appropriately. The subscripts r and w indicate read and write operations, respectively.

    1. R2r, TEMP1r, ALUadd, TEMP2w
    2. R1r, TEMP1w
    3. PCr, MARw, MEMr
    4. TEMP2r, R0w
    5. MDRr, IRw

    Which one of the following is the correct order of execution of the above steps?

    GATE CSE 2020 Q.4 as printed in the question paper, with its figureTap to open full size
    1. (A)

      2, 1, 4, 5, 3

    2. (B)

      1, 2, 4, 3, 5

    3. (C)

      3, 5, 2, 1, 4

    4. (D)

      3, 5, 1, 2, 4

    Official answer: C

  5. Q.5MCQ · 1 mark

    The preorder traversal of a binary search tree is 15, 10, 12, 11, 20, 18, 16, 19.
    Which one of the following is the postorder traversal of the tree?

    1. (A)

      10, 11, 12, 15, 16, 18, 19, 20

    2. (B)

      11, 12, 10, 16, 19, 18, 20, 15

    3. (C)

      20, 19, 18, 16, 15, 12, 11, 10

    4. (D)

      19, 16, 18, 20, 11, 12, 10, 15

    Official answer: B

  6. Q.6MCQ · 1 mark

    What is the worst case time complexity of inserting n² elements into an AVL-tree with n elements initially?

    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: C

  7. Q.7MCQ · 1 mark

    Which one of the following regular expressions represents the set of all binary strings with an odd number of 1's?

    1. (A)

      ((0 + 1)*1(0 + 1)*1)10

    2. (B)

      (0*10*10*)*0*1

    3. (C)

      10*(0*10*10*)*

    4. (D)

      (0*10*10*)10

    Official answer: Marks to all

  8. Q.8MCQ · 1 mark

    Consider the following statements.
    I. If is regular, then both and must be regular.
    II. The class of regular languages is closed under infinite union.
    Which of the above statements is/are TRUE?

    1. (A)

      I only

    2. (B)

      II only

    3. (C)

      Both I and II

    4. (D)

      Neither I nor II

    Official answer: D

  9. Q.9MCQ · 1 mark

    Consider the following statements.

    I. Symbol table is accessed only during lexical analysis and syntax analysis.
    II. Compilers for programming languages that support recursion necessarily need heap storage for memory allocation in the run-time environment.
    III. Errors violating the condition 'any variable must be declared before its use' are detected during syntax analysis.

    Which of the above statements is/are TRUE?

    1. (A)

      I only

    2. (B)

      I and III only

    3. (C)

      II only

    4. (D)

      None of I, II, and III

    Official answer: D

  10. Q.10MCQ · 1 mark

    Consider the language and the following statements.

    I. is deterministic context-free.

    II. is context-free but not deterministic context-free.

    III. is not LL() for any .

    Which of the above statements is/are TRUE?

    1. (A)

      I only

    2. (B)

      II only

    3. (C)

      I and III only

    4. (D)

      III only

    Official answer: C

  11. Q.11MCQ · 1 mark

    Consider allocation of memory to a new process. Assume that none of the existing holes in the memory will exactly fit the process's memory requirement. Hence, a new hole of smaller size will be created if allocation is made in any of the existing holes. Which one of the following statements is TRUE?

    1. (A)

      The hole created by first fit is always larger than the hole created by next fit.

    2. (B)

      The hole created by worst fit is always larger than the hole created by first fit.

    3. (C)

      The hole created by best fit is never larger than the hole created by first fit.

    4. (D)

      The hole created by next fit is never larger than the hole created by best fit.

    Official answer: C

  12. Q.12MCQ · 1 mark

    Consider the following statements about process state transitions for a system using preemptive scheduling.

    I. A running process can move to ready state.
    II. A ready process can move to running state.
    III. A blocked process can move to running state.
    IV. A blocked process can move to ready state.

    Which of the above statements are TRUE?

    1. (A)

      I, II, and III only

    2. (B)

      II and III only

    3. (C)

      I, II, and IV only

    4. (D)

      I, II, III, and IV

    Official answer: C

  13. Q.13MCQ · 1 mark

    Consider a relational database containing the following schemas.

    Catalogue (primary key: sno, pno):

    Suppliers (primary key: sno):

    Parts (primary key: pno):

    The primary key of each table is indicated by underlining the constituent fields.

    SELECT s.sno, s.sname
    FROM   Suppliers s, Catalogue c
    WHERE  s.sno = c.sno AND
           cost > (SELECT AVG (cost)
                   FROM Catalogue
                   WHERE pno = 'P4'
                   GROUP BY pno);

    The number of rows returned by the above SQL query is

    GATE CSE 2020 Q.13 as printed in the question paper, with its figureTap to open full size
    1. (A)

      4

    2. (B)

      5

    3. (C)

      0

    4. (D)

      2

    Official answer: A

  14. Q.14MCQ · 1 mark

    Which one of the following is used to represent the supporting many-one relationships of a weak entity set in an entity-relationship diagram?

    1. (A)

      Diamonds with double/bold border

    2. (B)

      Rectangles with double/bold border

    3. (C)

      Ovals with double/bold border

    4. (D)

      Ovals that contain underlined identifiers

    Official answer: A

  15. Q.15MCQ · 1 mark

    Consider the following statements about the functionality of an IP based router.
    I. A router does not modify the IP packets during forwarding.
    II. It is not necessary for a router to implement any routing protocol.
    III. A router should reassemble IP fragments if the MTU of the outgoing link is larger than the size of the incoming IP packet.
    Which of the above statements is/are TRUE?

    1. (A)

      I and II only

    2. (B)

      I only

    3. (C)

      II and III only

    4. (D)

      II only

    Official answer: D

  16. Q.16MCQ · 1 mark

    What is the worst case time complexity of inserting n elements into an empty linked list, if the linked list needs to be maintained in sorted order?

    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: C

  17. Q.17NAT · 1 mark

    Let be the set of all binary relations on the set . Suppose a relation is chosen from at random. The probability that the chosen relation is reflexive (round off to 3 decimal places) is ______.

    Official answer: 0.125

  18. Q.18NAT · 1 mark

    Let be a group of 35 elements. Then the largest possible size of a subgroup of other than itself is ______.

    Official answer: 7

  19. Q.19NAT · 1 mark

    A multiplexer is placed between a group of 32 registers and an accumulator to regulate data movement such that at any given point in time the content of only one register will move to the accumulator. The minimum number of select lines needed for the multiplexer is ______.

    Official answer: 5

  20. Q.20NAT · 1 mark

    If there are m input lines and n output lines for a decoder that is used to uniquely address a byte addressable 1 KB RAM, then the minimum value of m + n is ____.

    Official answer: 1034

  21. Q.21NAT · 1 mark

    A direct mapped cache memory of 1 MB has a block size of 256 bytes. The cache has an access time of 3 ns and a hit rate of 94%. During a cache miss, it takes 20 ns to bring the first word of a block from the main memory, while each subsequent word takes 5 ns. The word size is 64 bits. The average memory access time in ns (round off to 1 decimal place) is ____.

    Official answer: 13.3, or 13.5

  22. Q.22NAT · 1 mark

    Consider the following C program.

    #include <stdio.h>
    int main() {
        int a[4][5]={{1, 2, 3, 4, 5},
                     {6, 7, 8, 9, 10},
                     {11, 12, 13, 14, 15},
                     {16, 17, 18 , 19, 20}};
        printf("%d\n", *(*(a+**a+2)+3));
        return (0);
    }

    The output of the program is ____________.

    Official answer: 19

  23. Q.23NAT · 1 mark

    Consider a double hashing scheme in which the primary hash function is , and the secondary hash function is . Assume that the table size is 23. Then the address returned by probe 1 in the probe sequence (assume that the probe sequence begins at probe 0) for key value is ____.

    Official answer: 13

  24. Q.24NAT · 1 mark

    Consider the following grammar.


    The number of reduction steps taken by a bottom-up parser while accepting the string aaadbbb is ____.

    Official answer: 7

  25. Q.25NAT · 1 mark

    Assume that you have made a request for a web page through your web browser to a web server. Initially the browser cache is empty. Further, the browser is configured to send HTTP requests in non-persistent mode. The web page contains text and five very small images. The minimum number of TCP connections required to display the web page completely in your browser is ________.

    Official answer: 6

  26. Q.26MCQ · 2 marks

    Which of the following languages are undecidable? Note that indicates encoding of the Turing machine .

    1. (A)

      , , and only

    2. (B)

      and only

    3. (C)

      and only

    4. (D)

      , , and only

    Official answer: A

  27. Q.27MCQ · 2 marks

    Let and be two matrices over real numbers. Let and denote the rank and determinant of a matrix , respectively. Consider the following statements.

    I.

    II.

    III.

    IV.

    Which of the above statements are TRUE?

    1. (A)

      I and II only

    2. (B)

      I and IV only

    3. (C)

      II and III only

    4. (D)

      III and IV only

    Official answer: C

  28. Q.28MCQ · 2 marks

    Consider the Boolean function . Which one of the following minterm lists represents the circuit given above?

    GATE CSE 2020 Q.28 as printed in the question paper, with its figureTap to open full size
    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: B

  29. Q.29MCQ · 2 marks

    Consider three registers R1, R2, and R3 that store numbers in IEEE-754 single precision floating point format. Assume that R1 and R2 contain the values (in hexadecimal notation) 0x42200000 and 0xC1200000, respectively.

    If , what is the value stored in R3?

    1. (A)

      0x40800000

    2. (B)

      0xC0800000

    3. (C)

      0x83400000

    4. (D)

      0xC8500000

    Official answer: B

  30. Q.30MCQ · 2 marks

    A computer system with a word length of 32 bits has a 16 MB byte-addressable main memory and a 64 KB, 4-way set associative cache memory with a block size of 256 bytes. Consider the following four physical addresses represented in hexadecimal notation.

    Which one of the following is TRUE?

    1. (A)

      A1 and A4 are mapped to different cache sets.

    2. (B)

      A2 and A3 are mapped to the same cache set.

    3. (C)

      A3 and A4 are mapped to the same cache set.

    4. (D)

      A1 and A3 are mapped to the same cache set.

    Official answer: B

  31. Q.31MCQ · 2 marks

    Let be a weighted undirected graph and let be a Minimum Spanning Tree (MST) of maintained using adjacency lists. Suppose a new weighted edge is added to . The worst case time complexity of determining if is still an MST of the resultant graph is

    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: D

  32. Q.32MCQ · 2 marks

    Consider the following languages.


    Which one of the following is TRUE?

    1. (A)

      is regular and is context-free.

    2. (B)

      is context-free but not regular and is context-free.

    3. (C)

      Neither nor is context-free.

    4. (D)

      is context-free but is not context-free.

    Official answer: A

  33. Q.33MCQ · 2 marks

    Consider the productions A → PQ and A → XY. Each of the five non-terminals A, P, Q, X, and Y has two attributes: s is a synthesized attribute, and i is an inherited attribute. Consider the following rules.

    Rule 1: P.i = A.i + 2, Q.i = P.i + A.i, and A.s = P.s + Q.s

    Rule 2: X.i = A.i + Y.s and Y.i = X.s + A.i

    Which one of the following is TRUE?

    1. (A)

      Both Rule 1 and Rule 2 are L-attributed.

    2. (B)

      Only Rule 1 is L-attributed.

    3. (C)

      Only Rule 2 is L-attributed.

    4. (D)

      Neither Rule 1 nor Rule 2 is L-attributed.

    Official answer: B

  34. Q.34MCQ · 2 marks

    Each of a set of processes executes the following code using two semaphores a and b initialized to 1 and 0, respectively. Assume that count is a shared variable initialized to 0 and not used in CODE SECTION P.

    CODE SECTION P
    
    wait(a); count=count+1;
    if (count==n) signal(b);
    signal(a); wait(b); signal(b);
    
    CODE SECTION Q

    What does the code achieve?

    1. (A)

      It ensures that no process executes CODE SECTION Q before every process has finished CODE SECTION P.

    2. (B)

      It ensures that at most two processes are in CODE SECTION Q at any time.

    3. (C)

      It ensures that all processes execute CODE SECTION P mutually exclusively.

    4. (D)

      It ensures that at most processes are in CODE SECTION P at any time.

    Official answer: A

  35. Q.35MCQ · 2 marks

    Consider the following five disk access requests of the form (request id, cylinder number) that are present in the disk scheduler queue at a given time.

    (P, 155), (Q, 85), (R, 110), (S, 30), (T, 115)

    Assume the head is positioned at cylinder 100. The scheduler follows Shortest Seek Time First scheduling to service the requests.

    Which one of the following statements is FALSE?

    1. (A)

      T is serviced before P.

    2. (B)

      Q is serviced after S, but before T.

    3. (C)

      The head reverses its direction of movement between servicing of Q and P.

    4. (D)

      R is serviced before P.

    Official answer: B

  36. Q.36MCQ · 2 marks

    Consider a relational table that is in 3NF, but not in BCNF. Which one of the following statements is TRUE?

    1. (A)

      has a nontrivial functional dependency , where is not a superkey and is a prime attribute.

    2. (B)

      has a nontrivial functional dependency , where is not a superkey and is a non-prime attribute and is not a proper subset of any key.

    3. (C)

      has a nontrivial functional dependency , where is not a superkey and is a non-prime attribute and is a proper subset of some key.

    4. (D)

      A cell in holds a set instead of an atomic value.

    Official answer: A

  37. Q.37MCQ · 2 marks

    Consider a schedule of transactions and (columns are time slots, left to right):

    Here, stands for "Read(X)" and stands for "Write(X)". Which one of the following schedules is conflict equivalent to the above schedule?

    GATE CSE 2020 Q.37 as printed in the question paper, with its figureTap to open full size
    1. (A)

      Figure — T2 runs RB, WB, RD first (T1 empty). Then T1 runs RA, RC, WD, WB while T2 is idle. Then T2 runs WC, then T1 Commit, then T2 Commit.

    2. (B)

      Figure — T1 runs RA, RC, WD, WB first (T2 idle). Then T2 runs RB, WB, RD, WC. Then T1 Commit, then T2 Commit.

    3. (C)

      Figure — T1 runs RA, RC, WD, then T2 runs RB, WB, RD, then T1 runs WB, then T2 runs WC, then T1 Commit, then T2 Commit.

    4. (D)

      Figure — T2 runs RB, WB, RD, WC first (T1 idle). Then T1 runs RA, RC, WD, WB, Commit, then T2 Commit.

    Official answer: A

  38. Q.38MCQ · 2 marks

    An organization requires a range of IP addresses to assign one to each of its 1500 computers. The organization has approached an Internet Service Provider (ISP) for this task. The ISP uses CIDR and serves the requests from the available IP address space 202.61.0.0/17. The ISP wants to assign an address space to the organization which will minimize the number of routing entries in the ISP's router using route aggregation. Which of the following address spaces are potential candidates from which the ISP can allot any one to the organization?

    I. 202.61.84.0/21
    II. 202.61.104.0/21
    III. 202.61.64.0/21
    IV. 202.61.144.0/21

    1. (A)

      I and II only

    2. (B)

      II and III only

    3. (C)

      III and IV only

    4. (D)

      I and IV only

    Official answer: B

  39. Q.39MCQ · 2 marks

    Which one of the following predicate formulae is NOT logically valid?

    Note that is a predicate formula without any free occurrence of .

    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: C

  40. Q.40MCQ · 2 marks

    Let be a directed, weighted graph with weight function .

    For some function , for each edge , define as

    Which one of the options completes the following sentence so that it is TRUE?

    "The shortest paths in under are shortest paths under too, ___."

    1. (A)

      for every

    2. (B)

      if and only if , is positive

    3. (C)

      if and only if , is negative

    4. (D)

      if and only if is the distance from to in the graph obtained by adding a new vertex to and edges of zero weight from to every vertex of

    Official answer: A

  41. Q.41MCQ · 2 marks

    In a balanced binary search tree with elements, what is the worst case time complexity of reporting all elements in range ? Assume that the number of reported elements is .

    1. (A)

    2. (B)

    3. (C)

    4. (D)

    Official answer: B

  42. Q.42NAT · 2 marks

    The number of permutations of the characters in LILAC so that no character appears in its original position, if the two L's are indistinguishable, is ______.

    Official answer: 12

  43. Q.43NAT · 2 marks

    Consider a non-pipelined processor operating at 2.5 GHz. It takes 5 clock cycles to complete an instruction. You are going to make a 5-stage pipeline out of this processor. Overheads associated with pipelining force you to operate the pipelined processor at 2 GHz. In a given program, assume that 30% are memory instructions, 60% are ALU instructions and the rest are branch instructions. 5% of the memory instructions cause stalls of 50 clock cycles each due to cache misses and 50% of the branch instructions cause stalls of 2 cycles each. Assume that there are no stalls associated with the execution of ALU instructions. For this program, the speedup achieved by the pipelined processor over the non-pipelined processor (round off to 2 decimal places) is ____.

    Official answer: 2.15 to 2.18

  44. Q.44NAT · 2 marks

    A processor has 64 registers and uses 16-bit instruction format. It has two types of instructions: I-type and R-type. Each I-type instruction contains an opcode, a register name, and a 4-bit immediate value. Each R-type instruction contains an opcode and two register names. If there are 8 distinct I-type opcodes, then the maximum number of distinct R-type opcodes is ____.

    Official answer: 14

  45. Q.45NAT · 2 marks

    For , let be a non-zero vector. Suppose that is chosen uniformly at random from . Then, the probability that is an odd number is ____.

    Official answer: 0.5

  46. Q.46NAT · 2 marks

    Consider the following C functions.

    int fun1(int n) {
      static int i = 0;
      if (n > 0) {
        ++i;
        fun1(n-1);
      }
      return(i);
    }
    int fun2(int n) {
      static int i = 0;
      if (n > 0) {
        i = i + fun1(n);
        fun2(n-1);
      }
      return(i);
    }

    The return value of fun2(5) is ______.

    Official answer: 55

  47. Q.47NAT · 2 marks

    Consider the array representation of a binary min-heap containing 1023 elements. The minimum number of comparisons required to find the maximum in the heap is ____.

    Official answer: 511

  48. Q.48NAT · 2 marks

    Consider the following C functions.

    int tob(int b, int* arr) {
        int i;
        for (i=0; b>0; i++) {
            if (b%2) arr[i]=1;
            else     arr[i]=0;
            b = b/2;
        }
        return (i);
    }
    int pp(int a, int b) {
        int arr[20];
        int i, tot = 1, ex, len;
        ex = a;
        len = tob(b,arr);
        for (i=0; i<len; i++) {
            if (arr[i]==1)
                tot = tot * ex;
            ex = ex * ex;
        }
        return (tot);
    }

    The value returned by pp(3,4) is ________.

    Official answer: 81

  49. Q.49NAT · 2 marks

    Consider a graph , where , , and weight of the edge is . The weight of minimum spanning tree of is ____________.

    Official answer: 99

  50. Q.50NAT · 2 marks

    Consider the following set of processes, assumed to have arrived at time 0. Consider the CPU scheduling algorithms Shortest Job First (SJF) and Round Robin (RR). For RR, assume that the processes are scheduled in the order .

    If the time quantum for RR is 4 ms, then the absolute value of the difference between the average turnaround times (in ms) of SJF and RR (round off to 2 decimal places) is ______.

    Official answer: 5.25

  51. Q.51NAT · 2 marks

    Consider the following language.

    The minimum number of states in a DFA that accepts is ______.

    Official answer: 6

  52. Q.52NAT · 2 marks

    Graph is obtained by adding vertex to and making adjacent to every vertex of . The minimum number of colours required to edge-colour is ____.

    Official answer: 7

  53. Q.53NAT · 2 marks

    Consider a paging system that uses 1-level page table residing in main memory and a TLB for address translation. Each main memory access takes 100 ns and TLB lookup takes 20 ns. Each page transfer to/from the disk takes 5000 ns. Assume that the TLB hit ratio is 95%, page fault rate is 10%. Assume that for 20% of the total page faults, a dirty page has to be written back to disk before the required page is read in from disk. TLB update time is negligible. The average memory access time in ns (round off to 1 decimal places) is ______.

    Official answer: 154.5 to 155.5

  54. Q.54NAT · 2 marks

    Consider a database implemented using B+ tree for file indexing and installed on a disk drive with block size of 4 KB. The size of search key is 12 bytes and the size of tree/disk pointer is 8 bytes. Assume that the database has one million records. Also assume that no node of the B+ tree and no records are present initially in main memory. Consider that each record fits into one disk block. The minimum number of disk accesses required to retrieve any record in the database is ______.

    Official answer: 4

  55. Q.55NAT · 2 marks

    Consider a TCP connection between a client and a server with the following specifications: the round trip time is 6 ms, the size of the receiver advertised window is 50 KB, slow-start threshold at the client is 32 KB, and the maximum segment size is 2 KB. The connection is established at time t = 0. Assume that there are no timeouts and errors during transmission. Then the size of the congestion window (in KB) at time t + 60 ms after all acknowledgements are processed is ______.

    Official answer: 44