Operating Systems
Operating Systems
1.Which one of the following is TRUE for any simple connected undirected graph with
more than 2 vertices?
A. No two vertices have the same degree
B. At least two vertices have the same degree
C. At least three vertices have the same degree
D. All vertices have the same degree
4. Match all items in Group I with correct options from those given in Group 2
Group 1 Group 2
P. Regular expression 1. Syntax analysis
Q. Pushdown automata 2. Code generation
R. Dataflow analysis 3. Lexical analysis
S. Register allocation 4. Code Optimization
Codes:
A. P-4, Q-1, R-2, S-3
B. P-3, Q-1, R-4, S-2
C. P-3, Q-4, R-1, S-2
D. P-2, Q-1, R-4, S-3
6. In the context of modular software design, which one of the following combinations is
desirable?
A. High cohesion and high coupling
B. High cohesion and low coupling
C. Low cohesion and high coupling
D. Low cohesion and low coupling
7. Consider a 4-way set associative cache (initially empty) with total 16 cache blocks.
The main memory consists of 256 blocks and the request for memory blocks is in the
following order: 0,255,1,4,3,8,133,159,216,129,63,8,48,32, 73, 92,155 Which one of the
following memory block will not be in cache if LRU replacement policy is used?
A.3
B. 8
C. 129
D. 216
Which one of the following statements is TRUE if all three processes run concurrently
starting at time t = 0?
A. All processes will finish without any deadlock
B. Only P1 and P2 will be in a deadlock
C. Only P1 and P3 will be in deadlock
D. All three processes will be in deadlock
9. In the following process state transition diagram for a uniprocessor system, assume
that there are always some processes in the ready state:
10. The enter CS ( ) and leave CS( ) functions to implement critical section of a process
are realized using test-and-set instruction as follows:
Voidenter_CS(X)
{
While (test-and-set (X))
}
Voidleave_CS (X)
{
X = 0;
}
In the above solution, X is a memory location associated with the CS and is initialized to
0. Now consider the following statements
I. The above solution to CS problem is deadlock-free
II. The solution is starvation free
III. The processes enter CS in FIFO order
IV. More than one process can enter CS at the same time
Which of the above statements are TRUE?
A. I only
B. I and II
C. II and III
D. IV only
11. A main memory unit with a capacity of 4 megabytes is built using 1M×1-bit DRAM
chips. Each DRAM chip has 1K rows of cells with 1K cells in each row. The time taken
for a single refresh operation is 100 nanoseconds. The time required to perform one
refresh operation on all the cells in the memory unit is
A. 100 nanoseconds
B. 100*210 nanoseconds
C. 100*220 nanoseconds
D. 3200*220 nanoseconds
12. Identify the correct order in which a server process must invoke the function calls
accept, bind, listen, and recv according to UNIX socket APL
A. listen, accept, bind recv
B. bind, listen, accept, recv
C. bind, accept, listen, recv
D. accept, listen, bindrecv
13. Which one of the following statements is NOT correct about HTTP cookies?
A. A cookie is a piece of code that has the potential to compromise the security of an
internet user
B. A cookie gains entry to the user‟s work area through an HTTP header
C. A cookie has an expiry date and time
D. Cookies can be used to track the browsing pattern of a user at a particular site
14. A thread is usually defined as a ‘light weight process’ because an operating system
(OS) maintains smaller data structures for a thread than for a process. In relation to this,
which of the followings is TRUE?
A. On per-thread basis, the OS maintains only CPU register state
B. The OS does not maintain a separate stack for each thread
C. On per-thread basis, the OS does not maintain virtual memory state
D. On per thread basis, the OS maintains only scheduling and accounting information
15. Let the page fault service time be 10ms in a computer with average memory access
time being 20ns. If one page fault is generated for every 106 memory accesses, what is
the effective access time for the memory?
A. 21ns
B. 30ns
C. 23ns
D. 35ns
16. 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
17. Let the time taken to switch between user and kernel modes of execution be t1
while the time taken to switch between two processes be t2. Which of the following is
TRUE?
A. t1 > t2
B. t1 = t2
C. t1 < t2
D. Nothing can be said about the relation between t1 and t2
18. A computer handles several interrupt sources of which the following are relevant for
this question. Interrupt from CPU temperature sensor Interrupt from Mouse Interrupt
from Keyboard Interrupt from Hard Disk
A. Interrupt from Hard Disk
B. Interrupt from Mouse
C. Interrupt from Keyboard
D. Interrupt from CPU temp sensor
19. Consider an arbitrary set of CPU-bound processes with unequal CPU burst lengths
submitted at the same time to a computer system. Which one of the following process
scheduling algorithms would minimize the average waiting time in the ready queue?
A. Shortest remaining time first
B. Round-robin with time quantum less than the shortest CPU burst
C. Uniform random
D. Highest priority first with priority proportional to CPU burst length
20. Consider the following table of arrival time and burst time for three processes P0, P1
and P2.
Process Arrival time Burst Time
P0 0 ms 9 ms
P1 1 ms 4ms
P2 2 ms 9ms
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried
out only at arrival or completion of processes. What is the average waiting time for the
three processes?
A. 5.0 ms
B. 4.33 ms
C. 6.33 ms
D. 7.33 ms
21. Which of the following is NOT a valid deadlock prevention scheme?
(a) Release all resources before requesting a new resource
(b) Number the resources uniquely and never request a lower numbered resource
than the last one requested.
(c) Never request a resource after releasing any resource
(d) Request and all required resources be allocated before execution.
22. Consider a virtual memory system with FIFO page replacement policy. For an
arbitrary page access pattern, increasing the number of page frames in main memory
will
a) Always decrease the number of page faults
b) Always increase the number of page faults
c) Sometimes increase the number of page faults
d) Never affect the number of page faults
27. A multilevel page table is preferred in comparison to a single level page table for
translating virtual address to physical address because
a. It reduces the memory access time to read or write a memory location
b. It helps to reduce the size of page table needed to implement the virtual address
space of a process
c. It is required by the translation lookaside buffer
d. It helps to reduce the number of page faults in page replacement algorithms
30. The kernel of the operating system remains in primary memory (and other
part of the operating system remains in secondary storage) because
a. It is mostly called (used)
b. It manages all interrupt calls
c. It controls all operations in a process
d. It is low level
31. A CPU generally handles an interrupt by executing an interrupt service routine
A. as soon as an interrupt is raised
B. by checking the interrupt register at the end of fetch cycle
C. by checking the interrupt register after finishing the execution of the current
instruction
D. by checking the interrupt register at fixed time intervals
34. A process executes the code fork (); fork (); fork (); The total number of child
processes created is
A. 3
B. 4
C. 7
D. 8
35.In the following Query, which of the following can be placed in the Query's blank
portion to display the salary from highest to lowest amount, and sorting the employs
name alphabetically?
SELECT *
FROM instructor
ORDER BY salary ____, name ___;
38. Which of the following can be considered as the maximum size that is supported by
FAT?
(A) 8GB
(B) 4GB
(C) 4TB
(D) None of the above
41.Which scheduling policy is most suitable for a time shared operating system?
(a) Shortest Job First
(b) Round Robin
(c) First Come First Serve
(d) Elevator
43.A CPU has two modes-privileged and non-privileged. In order to change the mode
from privileged to non-privileged
(a) a hardware interrupt is needed.
(b) a software interrupt is needed.
(c) a privileged instruction (which does not generate an interrupt) is needed.
(d) a non-privileged instruction (which does not generate an interrupt) is needed.
45.Consider three CPU-intensive processes, which require 10, 20 and 30 time units and
arrive at times 0, 2 and 6, respectively. How many context switches are needed if the
operating system implements a shortest remaining time first scheduling algorithm? Do
not count the context switches at time zero and at the end.
(a) 1
(b) 2
(c) 3
(d) 4
46.Consider the following statements about user level threads and kernel level threads.
Which one of the following statements is FALSE?
(A) Context switch time is longer for kernel level threads than for user level threads.
(B) User level threads do not need any hardware support.
(C) Related kernel level threads can be scheduled on different processors in a multi-
processor system.
(D) Blocking one kernel level thread blocks all related threads.
48.Consider the methods used by processes P1 and P2 for accessing their critical
sections whenever needed, as given below. The initial values of shared boolean
variables S1 and S2 are randomly assigned.
49.Three concurrent processes X, Y, and Z execute three different code segments that
access and update certain shared variables. Process X executes the P operation (i.e.,
wait) on semaphores a, b and c; process Y executes the P operation on semaphores b,
c and d; process Z executes the P operation on semaphores c, d, and a before entering
the respective code segments. After completing the execution of its code segment, each
process invokes the V operation (i.e., signal) on its three semaphores. All semaphores
are binary semaphores initialized to one. Which one of the following represents a
deadlock-free order of invoking the P operations by the processes?
51.The process of assigning load addresses to the various parts of the program and
adjusting the code and date in the program to reflect the assigned addresses is called
(a) Assembly
(b) Parsing
(c) Relocation
(d) Symbol resolution
53.In a system with 32 bit virtual addresses and 1KB page size, use of one-level page
tables for virtual to physical address translation is not practical because of
(A) the large amount of internal fragmentation
(B) the large amount of external fragmentation
(C) the large memory overhead in maintaining page tables
(D) the large computation overhead in the translation process
54.A computer has six tape drives, with n processes competing for them. Each process
may need two drives. What is the maximum value of n for the system to be deadlock
free?
(a) 6
(b) 5
(c) 4
(d) 3.
56.Consider a virtual memory system with FIFO page replacement policy. For an
arbitrary page access pattern, increasing the number of page frames in main memory
will
a) Always decrease the number of page faults
b) Always increase the number of page faults
c) Some times increase the number of page faults
d) Never affect the number of page faults
57.Which of the following requires a device driver?
a) Register
b) Cache
c) Main memory
d) Disk
58.The essential content(s) in each entry of a page table is / are
(A) Virtual page number
(B) Page frame number
(C) Both virtual page number and page frame number
(D) Access right information
59.A multilevel page table is preferred in comparison to a single level page table for
translating virtual address to physical address because
(A) It reduces the memory access time to read or write a memory location.
(B) It helps to reduce the size of page table needed to implement the virtual address
space of a process.
(C) It is required by the translation lookaside buffer.
(D) It helps to reduce the number of page faults in page replacement algorithms.
60.Which of the following is NOT true of deadlock prevention and deadlock avoidance
schemes?
(A) In deadlock prevention, the request for resources is always granted if the resulting
state is safe
(B) In deadlock avoidance, the request for resources is always granted if the result
state is safe
(C) Deadlock avoidance is less restrictive than deadlock prevention
(D) Deadlock avoidance requires knowledge of resource requirements a priori
2. A processor uses 36 bit physical addresses and 32 bit virtual addresses, with a
page frame size of 4 Kbytes. Each page table entry is of size 4 bytes. A three level
page table is used for virtual to physical address translation, where the virtual address
is used as follows • Bits 30-31 are used to index into the first level page table • Bits 21-
29 are used to index into the second level page table • Bits 12-20 are used to index
into the third level page table, and • Bits 0-11 are used as offset within the page The
number of bits required for addressing the next level page table (or page frame) in the
page table entry of the first, second and third level page tables are respectively.
a. 20, 20 and 20
b. 24, 24 and 24
c. 24, 24 and 20
d. 25, 25 and 24
3. A virtual memory system uses First In First Out (FIFO) page replacement policy and
allocates a fixed number of frames to a process. Consider the following statements:
P: Increasing the number of page frames allocated to a
process sometimes increases the page fault rate.
Q: Some programs do not exhibit locality of reference.
Which one of the following is TRUE?
5. In the following process state transition diagram for a uniprocessor system, assume
that there are always some processes in the ready state:
6. A main memory unit with a capacity of 4 megabytes is built using 1M×1-bit DRAM
chips. Each DRAM chip has 1K rows of cells with 1K cells in each row. The time taken
for a single refresh operation is 100 nanoseconds. The time required to perform one
refresh operation on all the cells in the memory unit is
A. 100 nanoseconds
B. 100*210 nanoseconds
C. 100*220 nanoseconds
D. 3200*220 nanoseconds
7. Identify the correct order in which a server process must invoke the function calls
accept, bind, listen, and recv according to UNIX socket APL
A. listen, accept, bind recv
B. bind, listen, accept, recv
C. bind, accept, listen, recv
D. accept, listen, bind recv
8. 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
9. Consider the following table of arrival time and burst time for three processes P0, P1
and P2.
Process Arrival time Burst Time
P0 0 ms 9 ms
P1 1 ms 4ms
P2 2 ms 9ms
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried
out only at arrival or completion of processes. What is the average waiting time for the
three processes?
A. 5.0ms
B. 4.33ms
C. 6.33ms
D. 7.33ms
11. A multithreaded program P executes with x number of threads and uses y number
of locks for ensuring mutual exclusion while operating on shared memory locations. All
locks in the program are non-reentrant, i.e., if a thread holds a lock l, then it cannot re-
acquire lock l without releasing it. If a thread is unable to acquire a lock, it blocks until
the lock becomes available. The minimum value of x and the minimum value of y
together for which execution of P can result in a deadlock are:
A. x = 1, y = 2
B. x =2, y=1
C. x = 2,y=2
D. x = 1, y = 1
The completion order of the 3 processes under the policies FCFS and RR2 (round robin
scheduling with CPU quantum of 2 time units) are
A. FCFS: P1, P2, P3 RR2: P1, P2, P3
B. FCFS: P1, P3, P2 RR2: P1, P3, P2
C. FCFS: P1, P2, P3 RR2: P1, P3, P2
D. FCFS: P1, P3, P2 RR2: P1, P2, P3
13. Consider the following schedule for transactions T1, T2 and T3:
T1 T2 T3
Read(X)
Read(Y)
Read(Y)
Write(Y)
Write(X)
Write(X)
Read(X)
Write(X)
Which one of the schedules below is the correct serialization of the above?
A. T1 → T3 → T2
B. T2 → T1 → T3
C. T2 → T3 → T1
D. T3 → T1 → T2
15. The following code segment is executed on a processor which allows only register
operands in its instructions. Each instruction can have almost two source operands and
one destination operand.
Assume that all variables are dead after this code segment
c = a + b;
d = c * a;
e = c + a;
x = c *c;
if (x > a) {
y = a * a;
}
else {
d = d * d;
e = e * e;
}
Suppose the instruction set architecture of the processor has only two registers. The
only allowed compiler optimization is code motion, which moves statements from one
place to another while preserving correctness. What is the minimum number of spills to
memory in the compiled code?
A. 0
B. 1
C. 2
D. 3
16. Let m[0]…m[4] be mutexes (binary semaphores) and P[0] …. P[4] be processes.
Suppose each process P[i] executes the following:
wait (m[i]); wait(m[(i+1) mode 4]);
------
release (m[i]); release (m[(i+1)mod 4]);
This could cause (GATE CS 2000)
(a) Thrashing
(b) Deadlock
(c) Starvation, but not deadlock
(d) None of the above
17. Consider the following table of arrival time and burst time for three
processes P0,P1P0,P1 and P2
Process Arrival Time Burst Time
P0 0 ms 9 ms
P1 1 ms 4 ms
P2 2 ms 9 ms
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried
out only a arrival or completion of processes. What is the average waiting time for the
three processes?
a)5.0ms
b)6.2ms
c)4.5ms
d)6.4ms
18. For the processes listed in the following table, which of the following scheduling schemes will give
the lowest average turnaround time?
A 0 3
B 1 6
D 4 4
E 6 2
a)First Come First Serve
b)Shortest Job First
c)Shortest Remaining Time
d)Round Robin
22. Two processes, P1 and P2, need to access a critical section of code. Consider the
following synchronization construct used by the processes:
23. The following program consists of 3 concurrent processes and 3 binary semaphores.
The semaphores are initialized as S0=1, S1=0, S2=0.
24. An operating system contains 3 user processes each requiring 2 units of resource
R.The minimum number of units of R such that no deadlocks will ever arise is
(a) 3
(b) 5
(c) 4
(d) 6
25. In the index allocation scheme of blocks to a file, the maximum possible size of the
file depends on
(a) the size of the blocks, and the size of the address of the blocks.
(b) the number of blocks used for the index, and the size of the blocks.
(c) the size of the blocks, the number of blocks used for the index, and the size of the
address of the blocks.
(d) None of the above
26. Consider a disk system with 100 cylinders. The requests to access the cylinders
occur in following sequence:
4, 34, 10, 7, 19, 73, 2, 15, 6, 20
Assuming that the head is currently at cylinder 50, what is the time taken to satisfy all
requests if it takes 1ms to move from one cylinder to adjacent one and shortest seek
time first policy is used?
(A) 95ms
(B) 119ms
(C) 233ms
(D) 276ms
27.A system shares 9 tape drives. The current allocation and maximum requirment of
tape drives for three processes are shown below:
The shared variable turn is initialized to zero. Which one of the following is TRUE?
(A) This is a correct two-process synchronization solution.
33.Consider the following proposed solution for the critical section problem. There are n
processes: P0...Pn−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.
while (c[j]);
while (t[j] != 0 && t[j]<=t[i]);
}
Critical Section;
t[i]=0;
Remainder Section;
} while (true);
(A) At most one process can be in the critical section at any time
S1: Random page replacement algorithm (where a page chosen at random is replaced)
suffers from Belady's anomaly
S2: LUR page replacement algorithm sufferes from Belady's anomaly
3. A virtual memory system uses First In First Out (FIFO) page replacement policy and
allocates a fixed number of frames to a process. Consider the following statements:
P: Increasing the number of page frames allocated to a
process sometimes increases the page fault rate.
Q: Some programs do not exhibit locality of reference.
Which one of the following is TRUE?
Which one of the following statements is TRUE if all three processes run concurrently
starting at time t = 0?
A. All processes will finish without any deadlock
B. Only P1 and P2 will be in a deadlock
C. Only P1 and P3 will be in deadlock
D. All three processes will be in deadlock
5. In the following process state transition diagram for a uniprocessor system, assume
that there are always some processes in the ready state:
6. A main memory unit with a capacity of 4 megabytes is built using 1M×1-bit DRAM
chips. Each DRAM chip has 1K rows of cells with 1K cells in each row. The time taken
for a single refresh operation is 100 nanoseconds. The time required to perform one
refresh operation on all the cells in the memory unit is
A. 100 nanoseconds
B. 100*210 nanoseconds
C. 100*220 nanoseconds
D. 3200*220 nanoseconds
7. Identify the correct order in which a server process must invoke the function calls
accept, bind, listen, and recv according to UNIX socket APL
A. listen, accept, bind recv
B. bind, listen, accept, recv
C. bind, accept, listen, recv
D. accept, listen, bind recv
8. 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
9. Consider the following table of arrival time and burst time for three processes P0, P1
and P2.
Process Arrival time Burst Time
P0 0 ms 9 ms
P1 1 ms 4ms
P2 2 ms 9ms
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried
out only at arrival or completion of processes. What is the average waiting time for the
three processes?
A. 5.0ms
B. 4.33ms
C. 6.33ms
D. 7.33ms
11. A multithreaded program P executes with x number of threads and uses y number
of locks for ensuring mutual exclusion while operating on shared memory locations. All
locks in the program are non-reentrant, i.e., if a thread holds a lock l, then it cannot re-
acquire lock l without releasing it. If a thread is unable to acquire a lock, it blocks until
the lock becomes available. The minimum value of x and the minimum value of y
together for which execution of P can result in a deadlock are:
A. x = 1, y = 2
B. x =2, y=1
C. x = 2,y=2
D. x = 1, y = 1
The completion order of the 3 processes under the policies FCFS and RR2 (round robin
scheduling with CPU quantum of 2 time units) are
A. FCFS: P1, P2, P3 RR2: P1, P2, P3
B. FCFS: P1, P3, P2 RR2: P1, P3, P2
C. FCFS: P1, P2, P3 RR2: P1, P3, P2
D. FCFS: P1, P3, P2 RR2: P1, P2, P3
13. Consider the following schedule for transactions T1, T2 and T3:
T1 T2 T3
Read(X)
Read(Y)
Read(Y)
Write(Y)
Write(X)
Write(X)
Read(X)
Write(X)
Which one of the schedules below is the correct serialization of the above?
A. T1 → T3 → T2
B. T2 → T1 → T3
C. T2 → T3 → T1
D. T3 → T1 → T2
15. The following code segment is executed on a processor which allows only register
operands in its instructions. Each instruction can have almost two source operands and
one destination operand.
Assume that all variables are dead after this code segment
c = a + b;
d = c * a;
e = c + a;
x = c *c;
if (x > a) {
y = a * a;
}
else {
d = d * d;
e = e * e;
}
Suppose the instruction set architecture of the processor has only two registers. The
only allowed compiler optimization is code motion, which moves statements from one
place to another while preserving correctness. What is the minimum number of spills to
memory in the compiled code?
A. 0
B. 1
C. 2
D. 3
16. Let m[0]…m[4] be mutexes (binary semaphores) and P[0] …. P[4] be processes.
Suppose each process P[i] executes the following:
wait (m[i]); wait(m[(i+1) mode 4]);
------
P0 0 ms 9 ms
P1 1 ms 4 ms
P2 2 ms 9 ms
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried
out only a arrival or completion of processes. What is the average waiting time for the
three processes?
a)5.0ms
b)6.2ms
c)4.5ms
d)6.4ms
18. For the processes listed in the following table, which of the following scheduling schemes will give
the lowest average turnaround time?
Process Arrival Time Processing Time
A 0 3
B 1 6
D 4 4
E 6 2
a)First Come First Serve
b)Shortest Job First
c)Shortest Remaining Time
d)Round Robin
20. A uni-processor computer system only has two processes, both of which alternate
10 ms CPU bursts with 90 ms I/O bursts. Both the processes were created at nearly the
same time. The I/O of both processes can proceed in parallel. Which of the following
scheduling strategies will result in the least CPU utilization (over a long period of time)
for this system?
(A) First come first served scheduling.
(B) Shortest remaining time first scheduling.
(C) Static priority scheduling with different priorities for the two processes.
(D) Round robin scheduling with a time quantum of 5 ms.
22. Two processes, P1 and P2, need to access a critical section of code. Consider the
following synchronization construct used by the processes:
23. The following program consists of 3 concurrent processes and 3 binary semaphores.
The semaphores are initialized as S0=1, S1=0, S2=0.
24. An operating system contains 3 user processes each requiring 2 units of resource
R.The minimum number of units of R such that no deadlocks will ever arise is
(a) 3
(b) 5
(c) 4
(d) 6
25. In the index allocation scheme of blocks to a file, the maximum possible size of the
file depends on
(a) the size of the blocks, and the size of the address of the blocks.
(b) the number of blocks used for the index, and the size of the blocks.
(c) the size of the blocks, the number of blocks used for the index, and the size of the
address of the blocks.
(d) None of the above
26. Consider a disk system with 100 cylinders. The requests to access the cylinders
occur in following sequence:
4, 34, 10, 7, 19, 73, 2, 15, 6, 20
Assuming that the head is currently at cylinder 50, what is the time taken to satisfy all
requests if it takes 1ms to move from one cylinder to adjacent one and shortest seek
time first policy is used?
(A) 95ms
(B) 119ms
(C) 233ms
(D) 276ms
27.A system shares 9 tape drives. The current allocation and maximum requirment of
tape drives for three processes are shown below:
The shared variable turn is initialized to zero. Which one of the following is TRUE?
(A) This is a correct two-process synchronization solution.
33.Consider the following proposed solution for the critical section problem. There are n
processes: P0...Pn−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.
while (c[j]);
while (t[j] != 0 && t[j]<=t[i]);
}
Critical Section;
t[i]=0;
Remainder Section;
} while (true);
(A) At most one process can be in the critical section at any time
S1: Random page replacement algorithm (where a page chosen at random is replaced)
suffers from Belady's anomaly
S2: LUR page replacement algorithm sufferes from Belady's anomaly
AcquireLock(L){
while (Fetch_And_Add(L,1))
L = 1;
}
ReleaseLock(L){
L = 0;
}
This implementation will --------------
7. A multithreaded program P executes with x number of threads and uses y number of locks for
ensuring mutual exclusion while operating on shared memory locations. All locks in the program
are non-reentrant, i.e., if a thread holds a lock l, then it cannot re-acquire lock l without releasing
it. If a thread is unable to acquire a lock, it blocks until the lock becomes avilable. The minimum
value of x and the minimum value of y together for which execution of P can result in a deadlock
are ____
10. Consider a machine with 64 MB physical memory and a 32-bit virtual address space. If the
page size is 4KB, what is the approximate size of the page table
11. 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 ....................
12. 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 _________.
13. 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.
14. Consider a process executing on an operating system that uses demand paging. The
average time for a memory access in the system is M units if the corressponding memory page
is available in memory, and D units if the memory access causes a page fault. It has been
experimental measured that the average time taken for a memory access in the process is X
units. Which one of the following is the correct expression for the page fault rate experienced by
the process?
15. The following program consists of 3 concurrent processes and 3 binary semaphores. The
semaphores are initialized as S0=1, S1=0, S2=0.
Process P1:
t=10: Finishes
Process P2:
t=0: requests 2 units of R3
t=8: Finishes
Process P3:
t=9: Finishes
Which one of the following statements is TRUE if all three processes run concurrently starting at
time t=0?
17. Consider a storage disk with 4 platters (numbered as 0, 1, 2 and 3), 200 cylinders
(numbered as 0, 1, … , 199), and 256 sectors per track (numbered as 0, 1, … 255). The
following 6 disk requests of the form [sector number, cylinder number, platter number] are
received by the disk controller at the same time: [120, 72, 2], [180, 134, 1], [60, 20, 0], [212, 86,
3], [56, 116, 2], [118, 16, 1] Currently head is positioned at sector number 100 of cylinder 80,
and is moving towards higher cylinder numbers. The average power dissipation in moving the
head over 100 cylinders is 20 milliwatts and for reversing the direction of the head movement
once is 15 milliwatts. Power dissipation associated with rotational latency and switching of head
between different platters is negligible. The total power consumption in milliwatts to satisfy all of
the above disk requests using the Shortest Seek Time First disk scheduling algorithm is ______
.\
18. Consider two processors P1 and P2 executing the same instruction set. Assume that under
identical conditions, for the same input, a program running on P2 takes 25% less time but incurs
20% more CPI (clock cycles per instruction) as compared to the program running on P1. If the
clock frequency of P1 is 1GHz, then the clock frequency of P2 (in GHz) is ________
19. A system uses FIFO policy for page replacement. It has 4 page frames with no pages
loaded to begin with. The system first accesses 100 distinct pages in some order and then
accesses the same 100 pages but now in the reverse order. How many page faults will occur
20. A hard disk system has the following parameters : o Number of tracks = 500 o Number of
sectors/track = 100 o Number of bytes /sector = 500 o Time taken by the head to move from
one track to adjacent track = 1 ms o Rotation speed = 600 rpm. What is the average time taken
for transferring 250 bytes from the disk ?
15.Which of the following is typically a part of the operating system but not the kernel?
a.Graphical User Interface
b.Network Management
c.Device Driver Management
d.Compiler
16. The “Seek “ System call allows the application program to change the value of the file’s
offset so that subsequent read/write is performed from a new position in the file.Which of the
following task will require the use of seek operation:
a.Copying the contents of file A to B
b.Reversing the contents of a file
c.Insert/update/delete at a particular point
d.Finding a particular character in a file