Question 1

Suppose a disk has 201 cylinders, numbered from 0 to 200. At some time the disk arm is at cylinder 100, and there is a queue of disk access requests for cylinders 30, 85, 90, 100, 105, 110, 135 and 145. If Shortest-Seek Time First (SSTF) is being used for scheduling the disk access, the request for cylinder 90 is serviced after servicing ____________ number of requests.


     Correct answer is :3

     Solution :
      Request for cylinder is served after serving 3 requests (100,105 and 110)

  •   Question 2

    Which one of the following is FALSE?

    A : User level threads are not scheduled by the kernel.
    B : When a user level thread is blocked, all other threads of its process are blocked.
    C : Context switching between user level threads is faster than context switching between kernel level threads
    D : Kernel level threads cannot share the code segment.


     Correct answer is :D

     Solution :
      User threads are supported above the kernel and a managed without kernel support. The thread function library to implement user level threads usually runs on top of the system in user mode. Thus these threads with in a process are invisible to the operating system. Since the kernel is unaware of the existence of such threads; when one user level thread is blocked in the kernel all other threads of its process are blocked. So options (A) and (B) are true
    (C) Kernel-level threads require a context switch, which involves changing a large set of processor registers that define the current memory map and permissions. It also evicts some or all of the processor cache. User-level threads just require a small amount of bookkeeping within one kernel thread or process.

  •   Question 3

    An operating system uses the Banker’s algorithm for deadlock avoidance when managing the allocation of three resource types X, Y, and Z to three processes P0, P1, and P2. The table given below presents the current system state. Here, the Allocation matrix shows the current number of resources of each type allocated to each process and the Max matrix shows the maximum number of resources of each type required by each process during its execution.
    There are 3 units of type X, 2 units of type Y and 2 units of type Z still available. The system is currently in a safe state. Consider the following independent requests for additional resources in the current state:
    REQ1: P0 requests 0 units of X, 0 units of Y and 2 units of Z
    REQ2: P1 requests 2 units of X, 0 units of Y and 0 units of Z
    Which one of the following is TRUE?

    A : Only REQ1 can be permitted.
    B : Only REQ2 can be permitted.
    C : Both REQ1 and REQ2 can be permitted.
    D : Neither REQ1 and REQ2 can be permitted.


     Correct answer is :B

  •   Question 4

    Consider the following set of processes that need to be scheduled on a single CPU. All the times are given in milliseconds
    Using the shortest remaining time first scheduling algorithm, the average process turnaround time (in msec) is ____________________.
    Process Name      Arrival Time      Execution Time
        A                  0                  6
        B                  3                  2
        c                  5                  4
        D                  7                  6
        E                  10                 3


     Correct answer is :7.2

     Solution :
      Average turn around time = (8-0)+(5-3)+(12-5)+(21-7)+(15-10)/5 = 36/5 = 7.2ms

  •   Question 5

    Assume that there are 3 page frames which are initially empty. If the page reference string 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is ___________


     Correct answer is :7

  •   Question 6

    A FAT (file allocation table) based file system is being used and the total overhead of each entry in the FAT is 4 bytes in size. Given a 100 x 106 bytes disk on which the file system is stored and data block size is 103 bytes, the maximum size of a file that can be stored on this disk in units of 106 bytes is ____________.


     Correct answer is :99.55 - 99.65

     Solution :
      Number of entries in the FAT = Disk Capacity/Block size = 108/103 = 105
    Total space consumed by FAT = 105 * 4 B = 0.4 * 106 B
    Maximum size of file that can be stored = 100 * 106 – 0.4 * 106 = 99.6 * 106 B 
    Answer: 99.6

  •   Question 7

    Consider the procedure below for the Producer-Consumer problem which uses semaphores. Which one of the following is TRUE?

    A : The producer will be able to add an item to the buffer, but the consumer can never consume it.
    B : The consumer will remove no more than one item from the buffer.
    C : Deadlock occurs if the consumer succeeds in acquiring semaphore s when the buffer is empty.
    D : The starting value for the semaphore n must be 1 and not 0 for deadlock-free operation.


     Correct answer is :C

     Solution :
      when buffer is empty n=0 and s=1 and if a Consumer comes he makes s=0 and got stuck at n=0 wait. Now if a producer comes it gets stuck at Semwait(s) as s=0.

  •   Question 8

    Three processes A, B and C each execute a loop of 100 iterations. In each iteration of the loop, a process performs a single computation that requires tc CPU milliseconds and then initiates a single I/O operation that lasts for tio milliseconds. It is assumed that the computer where the processes execute has sufficient number of I/O devices and the OS of the computer assigns different I/O devices to each process. Also, the scheduling overhead of the OS is negligible. The processes have the following characteristics:
    The processes A, B, and C are started at times 0, 5 and 10 milliseconds respectively, in a pure time sharing system (round robin scheduling) that uses a time slice of 50 milliseconds. The time in milliseconds at which process C would complete its first I/O operation is ___________.


     Correct answer is :1000

     Solution :
      There are three processes A, B and C that run in round robin manner with time slice of 50 ms. Processes atart at 0, 5 and 10 miliseconds. The processes are executed in below order A, B, C, A 50 + 50 + 50 + 50 (200 ms passed) Now A has completed 100 ms of computations and goes for I/O now B, C, B, C, B, C 50 + 50 + 50 + 50 + 50 + 50 (300 ms passed) C goes for i/o at 500ms and it needs 500ms to finish the IO. So C would complete its first IO at 1000 ms

  •   Question 9

    A computer has twenty physical page frames which contain pages numbered 101 through 120. Now a program accesses the pages numbered 1, 2, …, 100 in that order, and repeats the access sequence THRICE. Which one of the following page replacement policies experiences the same number of page faults as the optimal page replacement policy for this program?

    A : Least-recently-used
    B : First-in-first-out
    C : Last-in-first-out
    D : Most-recently-used


     Correct answer is :D

     Solution :
      Page reference string for the program will be:-
    1, 2, 3, 4, ------------100, 1, 2, 3, 4, ------------100, 1, 2, 3, 4, ------------100,
    The current status of 20 frames shows page numbers from 101 to 120.
    So there would be 300 page faults in total (each access 100 page faults).
    The first 20 accesses to pages from 1 to 20 would definitely cause page fault. When 21st is accessed, there is another page fault. The page swapped out would be 20 because 20 is going to be accessed farthest in future. When 22nd is accessed, 21st is going to go out as it is going to be the farthest in future. The above optimal page replacement algorithm actually works as most recently used in this case.

  •   Question 10

    A system uses 3 page frames for storing process pages in main memory. It uses the Least Recently Used (LRU) page replacement policy. Assume that all the page frames are initially empty. What is the total number of page faults that will occur while processing the page reference string given below?
    4, 7, 6, 1, 7, 6, 1, 2, 7, 2


     Correct answer is :6

  •   Question 11

    A system contains three programs and each requires three tape units for its operation. The minimum number of tape units which the system must have such that deadlocks never arise is _________.


     Correct answer is :7

  •   Question 12

    An operating system uses shortest remaining time first scheduling algorithm for pre-emptive scheduling of processes. Consider the following set of processes with their arrival times and CPU burst times (in milliseconds). The average waiting time (in milliseconds) of the processes is _________.


     Correct answer is :5.5

     Solution :
      Average waiting time = 15 + 0 +3+4 / 4 =5.5

  •   Question 13

    Consider a paging hardware with a TLB. Assume that the entire page table and all the pages are in the physical memory. It takes 10 milliseconds to search the TLB and 80 milliseconds to access the physical memory. If the TLB hit ratio is 0.6, the effective memory access time (in milliseconds) is _________.


     Correct answer is :122

    TOTAL = 13
    CORRECT / TOTAL = /13