PREVIOUS YEAR SOLVED PAPERS - GATE 2020

61. Consider the following C functions.

Gate2020 cs

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

Note – Numerical Type question

  • Option : A
  • Explanation :
    PP(3, 4) = _____
    PP function:
    Gate2020 cs
    Len = tob(b, arr)
    tob functions:
    Gate2020 cs
    i = 0 4 > 0, (with b = 4)
    if (4 % 2) False, so else gets executed
    So, arr[0] = 0,
    if t b = b/2
    i = 1 2 > 0 (with b = 2)
    if (2 % 2) false
    So, else gets executed ⇒ arr [1] = 0, i = i + t b = b/2
    i = 2 1 > 0 (with b = 1)
    if (1 % 2) True arr [2] = 1 i + 1, b = b/2
    i = 30 > 0 (with b = 0) false
    return I, returns ‘3’ to len, in PP function.
    In PP function: len = 3
    For loop.
    i = 0i = 1i = 2
    ex = 3 x 3ex = 9 x 3tot = t * t *ex
    = 9= 81= 1 * 81 = 81
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


62. Consider the following C functions.

Gate2020 cs

The return value of fun2(5) is _______.

Note – Numerical Type question

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


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

ProcessesP1P2P3P4
Burst time (in ms)8724
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 t0 2 decimal places) is ……………...

Note – Numerical Type question

  • Option : A
  • Explanation :
    Average turnaround time
    P1 = 21, P2 = 13, P3 = 2, P4 = 6
    Avg = (21+13+2+6)/4 = 42/4 = 10.5
    Gate2020 cs
    Average turnaround time
    P1 = 18, P2 = 21, P3 = 10, P4 = 14
    Avg = (18+21+10+14)/4 = 63/4 = 15.75
    Difference = 15.75 – 10.5 = 5.25
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


64. Consider a database implemented using B+ tree for file indexing and installed a disk drive with block size of 4 KB. The size of the search key is 12 bytes and 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 ______.

  • Option : A
  • Explanation :
    No. of records = 106
    Block size = 8 KB
    Search key = 13 bytes
    Block pointer size = 8 bytes
    Balancing factor of index file = [Block size /(search key + Block pointer)]
    = [4KB/(12+8)] = [212/20]
    Balancing Factor of index file =204
    Gate2020 cs
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


65. 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 advert 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 = 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 acknowledgments processed is _______.

  • Option : B
  • Explanation :
    TCP connections at t = 0
    1MSS = 2KB Threshold = 32KB (slow start)
    RTT = 6ms. Then how big packet it (packet size) may deliver after t + 60 ms
    Gate2020 cs
    1 RTT = 6 ms
    ⇒ 10 RTT = 60 ms
    t + 60 = 0 + 60 = 60 ms
    At 60 ms, CWND = 22 MSS
    1 MSS = 2KB
    ⇒ 22 MSS = 22 × 22 = 44 KB
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


Related Quiz.
GATE 2020