Operating Systems questions — page 5 of 7

Q50

GATE CS 2016 CS-1Concurrency and SynchronizationMCQ2 marks−2/3 if wrong
Consider the following proposed solution for the critical section problem. There are n processes: P0…Pn−1P_0 \dots P_{n-1}. In the code, function pmax returns an integer not smaller than any of its arguments. For all i, t[i] is initialized to zero.
Code for PiP_i:
do {
    c[i]=1; t[i] = pmax(t[0],...,t[n-1])+1; c[i]=0;
    for every j ≠ i in {0,...,n-1} {
        while (c[j]);
        while (t[j] != 0 && t[j]<=t[i]);
    }
    Critical Section;
    t[i]=0;
    Remainder Section;
} while (true);
Which one of the following is TRUE about the above solution?
Show answer without attempting

Answer: A

Q20

GATE CS 2016 CS-2Memory ManagementMCQ1 mark−1/3 if wrong
In which one of the following page replacement algorithms it is possible for the page fault rate to increase even when the number of allocated frames increases?
Show answer without attempting

Answer: D

Q47

GATE CS 2016 CS-2SchedulingNAT2 marks
Consider the following processes, with the arrival time and the length of the CPU burst given in milliseconds. The scheduling algorithm used is preemptive shortest remaining-time first.
ProcessArrival TimeBurst Time
P1P_1010
P2P_236
P3P_371
P4P_483
The average turn around time of these processes is _________ milliseconds.
Show answer without attempting

Answer: 8.2 to 8.3

Q48

GATE CS 2016 CS-2Concurrency and SynchronizationMCQ2 marks−2/3 if wrong
Consider the following two-process synchronization solution.
Process 0                         Process 1
---------                         ---------
Entry: loop while (turn == 1);    Entry: loop while (turn == 0);
  (critical section)                (critical section)
Exit:  turn = 1;                  Exit:  turn = 0;
The shared variable turn is initialized to zero. Which one of the following is TRUE?
Show answer without attempting

Answer: C

Q49

GATE CS 2016 CS-2Concurrency and SynchronizationNAT2 marks
Consider a non-negative counting semaphore SS. The operation P(S)P(S) decrements SS, and V(S)V(S) increments SS. During an execution, 20 P(S)20\, P(S) operations and 12 V(S)12\, V(S) operations are issued in some order. The largest initial value of SS for which at least one P(S)P(S) operation will remain blocked is _________.
Show answer without attempting

Answer: 7.0

Q50

GATE CS 2016 CS-2File SystemsNAT2 marks
A file system uses an in-memory cache to cache disk blocks. The miss rate of the cache is shown in the figure. The latency to read a block from the cache is 1 ms and to read a block from the disk is 10 ms. Assume that the cost of checking whether a block exists in the cache is negligible. Available cache sizes are in multiples of 10 MB.

The smallest cache size required to ensure an average read latency of less than 6 ms is _________ MB.
Question figure
Show answer without attempting

Answer: 30.0

Q14

GATE CS 2015 CS-3SchedulingMCQ1 mark−1/3 if wrong
The maximum number of processes that can be in Ready state for a computer system with nn CPUs is
Show answer without attempting

Answer: D

Q31

GATE CS 2015 CS-3Concurrency and SynchronizationMCQ1 mark−1/3 if wrong
Two processes XX and YY need to access a critical section. Consider the following synchronization construct used by both the processes

Process X:
/* other code for process X */
while (true)
{
    varP = true;
    while (varQ == true)
    {
        /* Critical Section */
        varP = false;
    }
}
/* other code for process X */
Process Y:
/* other code for process Y */
while (true)
{
    varQ = true;
    while (varP == true)
    {
        /* Critical Section */
        varQ = false;
    }
}
/* other code for process Y */
Here, varP and varQ are shared variables and both are initialized to false. Which one of the following statements is true?
Show answer without attempting

Answer: A

Q45

GATE CS 2015 CS-3DeadlocksMCQ2 marks−2/3 if wrong
Consider the following policies for preventing deadlock in a system with mutually exclusive resources.

I. Processes should acquire all their resources at the beginning of execution. If any resource is not available, all resources acquired so far are released
II. The resources are numbered uniquely, and processes are allowed to request for resources only in increasing resource numbers
III. The resources are numbered uniquely, and processes are allowed to request for resources only in decreasing resource numbers
IV. The resources are numbered uniquely. A process is allowed to request only for a resource with resource number larger than its currently held resources

Which of the above policies can be used for preventing deadlock?
Show answer without attempting

Answer: D

Q57

GATE CS 2015 CS-3SchedulingMCQ2 marks−2/3 if wrong
For the processes listed in the following table, which of the following scheduling schemes will give the lowest average turnaround time?
ProcessArrival TimeProcessing Time
A03
B16
C44
D62
Show answer without attempting

Answer: C

Q29

GATE CS 2015 CS-1Memory ManagementNAT1 mark
Consider a system with byte-addressable memory, 32-bit logical addresses, 4 kilobyte page size and page table entries of 4 bytes each. The size of the page table in the system in megabytes is ________.
Show answer without attempting

Answer: 4

Q30

GATE CS 2015 CS-1Concurrency and SynchronizationNAT1 mark
The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently.
P1() {
    C = B - 1;
    B = 2 * C;
}

P2() {
    D = 2 * B;
    B = D - 1;
}
The number of distinct values that B can possibly take after the execution is ________.
Show answer without attempting

Answer: 3

Q52

GATE CS 2015 CS-1SchedulingNAT2 marks
Consider a uniprocessor system executing three tasks T1T_1, T2T_2 and T3T_3, each of which is composed of an infinite sequence of jobs (or instances) which arrive periodically at intervals of 3, 7 and 20 milliseconds, respectively. The priority of each task is the inverse of its period, and the available tasks are scheduled in order of priority, with the highest priority task scheduled first. Each instance of T1T_1, T2T_2 and T3T_3 requires an execution time of 1, 2 and 4 milliseconds, respectively. Given that all tasks initially arrive at the beginning of the 1st millisecond and task preemptions are allowed, the first instance of T3T_3 completes its execution at the end of ________ milliseconds.
Show answer without attempting

Answer: 12

Q54

GATE CS 2015 CS-1File SystemsNAT2 marks
Consider a disk pack with a seek time of 4 milliseconds and rotational speed of 10000 rotations per minute (RPM). It has 600 sectors per track and each sector can store 512 bytes of data. Consider a file stored in the disk. The file contains 2000 sectors. Assume that every sector access necessitates a seek, and the average rotational latency for accessing each sector is half of the time for one complete rotation. The total time (in milliseconds) needed to read the entire file is ________.
Show answer without attempting

Answer: 14020

Q56

GATE CS 2015 CS-1SchedulingNAT2 marks
Suppose the following disk request sequence (track numbers) for a disk with 100 tracks is given: 45, 20, 90, 10, 50, 60, 80, 25, 70. Assume that the initial position of the R/W head is on track 50. The additional distance that will be traversed by the R/W head when the Shortest Seek Time First (SSTF) algorithm is used compared to the SCAN (Elevator) algorithm (assuming that SCAN algorithm moves towards 100 when it starts execution) is ________ tracks.
Show answer without attempting

Answer: 10

Q57

GATE CS 2015 CS-1Memory ManagementMCQ2 marks−2/3 if wrong
Consider a main memory with five page frames and the following sequence of page references: 3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3, 6, 2, 1, 3. Which one of the following is true with respect to page replacement policies First In First Out (FIFO) and Least Recently Used (LRU)?
Show answer without attempting

Answer: A

Q19

GATE CS 2015 CS-2Memory ManagementNAT1 mark
A computer system implements a 40-bit virtual address, page size of 8 kilobytes, and a 128-entry translation look-aside buffer (TLB) organized into 32 sets each having four ways. Assume that the TLB tag does not store any process id. The minimum length of the TLB tag in bits is __________.
Show answer without attempting

Answer: 22

Q30

GATE CS 2015 CS-2DeadlocksMCQ1 mark−1/3 if wrong
A system has 6 identical resources and NN processes competing for them. Each process can request atmost 2 resources. Which one of the following values of NN could lead to a deadlock?
Show answer without attempting

Answer: D

Q41

GATE CS 2015 CS-2Memory ManagementMCQ2 marks−2/3 if wrong
Consider six memory partitions of sizes 200 KB, 400 KB, 600 KB, 500 KB, 300 KB and 250 KB, where KB refers to kilobyte. These partitions need to be allotted to four processes of sizes 357 KB, 210 KB, 468 KB and 491 KB in that order. If the best fit algorithm is used, which partitions are NOT allotted to any process?
Show answer without attempting

Answer: A

Q42

GATE CS 2015 CS-2File SystemsNAT2 marks
Consider a typical disk that rotates at 15000 rotations per minute (RPM) and has a transfer rate of 50×10650 \times 10^6 bytes/sec. If the average seek time of the disk is twice the average rotational delay and the controller's transfer time is 10 times the disk transfer time, the average time (in milliseconds) to read or write a 512-byte sector of the disk is _____________.
Show answer without attempting

Answer: 6.1 to 6.2

0/200 correct0 marks

Related topics in GATE CS