Question 1

The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently.The number of distinct values that B can possibly take after the execution is


     Correct answer is :3

     Solution :
      If we execute P2 process after P1 process, then B = 3
    If we execute P1 process after P2 process, then B = 4
    If we did preemption between P1 & P2 processes, then B = 2 (Preemption have done from P1 to P2) or B = 3 (Preemption have done from P2 to P1). So, among 2 & 3 values, only one value will be saved in B. So, total no. of distinct values that B can possibly take after the execution is 3.

  •   Question 2

    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 ___________.


     Correct answer is :4

     Solution :
      Given LA = 32 bits
    LAS = 232 = 448 & Page size = 4 kB
    # of pages = LAS/PS = 44GB/4KB = G/K = 220 = 1m
    Sie of page table entry = 4 byte
    Page table size = 4B×1m = 4 mB

  •   Question 3

    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 _________.


     Correct answer is :14020

     Solution :
      Given Seek time = 4ms
    60s -> 10000 rotations
    60/10000 = 6ms <- 1 rotation
    Rotational latency=1/2* 6ms =3ms
    1track-> 600sectors
    6ms <- 600 sectors (1 rotation means 600 sectors (or) 1 track)
    1 sector -> 6ms/600 = 0.01ms
    2000 sector -> 2000 (0.01) = 20 ms
    total time needed to read the entire file is
    = 2000 (4+3) +20 =8000+6000+20 = 14020 ms

  •   Question 4

    Consider a uniprocessor system executing three tasks T1, T2 and T3, 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 T1, T2 and T3 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 T3 completes its execution at the end of ______________ milliseconds.


     Correct answer is :13

     Solution :
      According to the given data, we can get this Gantt chart.

  •   Question 5

    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.


     Correct answer is :10

  •   Question 6

    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)?

    A : Both incur the same number of page faults
    B : FIFO incurs 2 more page faults than LRU
    C : LRU incurs 2 more page faults than FIFO
    D : FIFO incurs 1 more page faults than LRU


     Correct answer is :A

     Solution :
      LRU : no of page faults = 9
    FIFO : no of page faults = 9

  •   Question 7

    A system has 6 identical resources and N processes competing for them. Each process can request atmost 2 resources. Which one of the following values of N could lead to a deadlock?


     Correct answer is :NO OPTION

     Solution :
      it might be a wring question

  •   Question 8

    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 _________.


     Correct answer is :22

     Solution :
      tag =22bit ,set offset=5bit , word offset = 13bit.

  •   Question 9

    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, 210KB, 468 KB and 491 KB in that order. If the best fit algorithm is used, which partitions are NOT allotted to any process?

    A : 200KB and 300 KB
    B : 200KB and 250 KB
    C : 250KB and 300 KB
    D : 300KB and 400 KB


     Correct answer is :A

     Solution :
      375 KB fits into 400KB block
    210 KB fits into 250KB block
    468KB fits into 500KB block
    491 KB fits into 600KB block
    Therefore partition 200KB and 300KB are NOT allotted to any process.

  •   Question 10

    Consider a typical disk that rotates at 15000 rotations per minute (RPM) and has a transfer rate of 50*106 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 _____________.


     Correct answer is :6.1

     Solution :
      60sec -> 15000 rotations
    60/15000 = 4ms <- 1 rotation
    Average rotational delay = 1/2 *4=2ms
    As per question, average seek time= 2* Avg.rotational delay = 2*2 =4ms
    Disk transfer time : 1sec ->50 * 106 => 0.01ms = 512/(50 *106) <- 512 bytes
    As per Question, controller?s transfer time is = 10 * 0.01 ms = 0.1ms
    Avg time = 4ms +0.1ms+2ms = 6.1ms

  •   Question 11

    A computer system implements 8 kilobyte pages and a +32-bit physical address space. Each page table entry contains a valid bit, a dirty bit, three permission bits, and the translation. If the maximum size of the page table of a process is 24 megabytes, the length of the virtual address supported by the system is _________ bits.


     Correct answer is :36

     Solution :
      Given Page size = 8kb
    PAS = 32 – bit
    No.of frames 2 frames=PAS/PS = 232/213 = 219 frames
    So, it is given that each page table entry contains a valid bit, a dirty bit, 3 permission bits. =>5 bits are reserved.
    It means one entry requires 19 + 5 = 24 bits
    Page Table size = n × e
    24*220*3 = n*24
    n=(24*220*8)/24 = 223 pages.
    Length of the virtual address = 23+13=36 bits

  •   Question 12

    The maximum number of processes that can be in Ready state for a computer system with n CPUs is

    A : n
    B : n2
    C : 2n
    D : Independent of n


     Correct answer is :D

     Solution :
      Number of processes which are in running processes will be atmost n as there are n processors. Maximum number of processes that will be in ready state is independent of number of processors.

  •   Question 13

    Two processes X and Y need to access a critical section. Consider the following synchronization construct used by both the processes.
    Here, varP and varQ are shared variables and both are initialized to false. Which one of the following statements is true?

    A : The proposed solution prevents deadlock but fails to guarantee mutual exclusion
    B : The proposed solution guarantees mutual exclusion but fails to prevent deadlock
    C : The proposed solution guarantees mutual exclusion and prevents deadlock
    D : The proposed solution fails to prevent deadlock and fails to guarantee mutual exclusion


     Correct answer is :A

     Solution :
      Var P = Var Q = FALSE Initially.
    Assume that, process X is willing to enter into critical section. So it makes ar V P = True, then if processor switches to process Y, then process Y can enter into critical section.
    After entering into the critical section, then if processor switches to process X, then process X also can enter into the critical section.
    It is clearly showing that both are in critical section at a time which leads to “failing to guarantee material exclusion”
    To ent

  •   Question 14

    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 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.
    When of the above policies can be used for preventing deadlock?

    A : Any one of I and III but not II or IV
    B : Any one of I, III, and IV but not II
    C : Any one of II and III but not I or IV
    D : Any one of I, II, III, and IV


     Correct answer is :D

     Solution :
      For deadlock prevention we need to dissatisfy any of the necessary condition for deadlock
    1. For hold and wait if we r disatisfy it can be hold or wait for hold …before process start os assign all resources. While executing if process making new resource request it has to release all its assign resources that is waiting for release resources
    2. If we r dissatisfy circular wait condition suppose there r five resources uniquely numbered r1 to r5 and there five processes p1 to p5 suppose p2

  •   Question 15

    For the processes listed in the following table, which of the following scheduling schemes will the lowest average turnaround time?
    ProcessArrival TimeProcessing time

    A : Fir Come First Serve
    B : Non-preemptive Shortest Job First
    C : Shortest Remaining Time
    D : Round Robin with Quantum value two


     Correct answer is :C

     Solution :
      FCFS TAT=7.25
    SJF TAT=6.75
    SRTF TAT=6.25
    Round Robin TAT=8.25

    TOTAL = 15
    CORRECT / TOTAL = /15