OS DPPs A4
OS DPPs A4
[MCQ] [MCQ]
1. Consider the following statements: 5. Throughput is .
(i) Operating system implementation has (a) Executing multiple programs in memory.
architectural constraints. (b) Total number of programs completed per unit
(ii) Operating system is a set of utilities. time.
Which of the following is true? (c) Total number of programs loaded into main
(a) Only (i) is correct. memory.
(b) Only (ii) is correct. (d) None of the above.
(c) Both (i) and (ii) are correct.
(d) Neither (i) nor (ii) are correct [MCQ]
6. Pre-emptive processes have .
[MCQ] (a) Forceful deallocation.
2. Operating system working on strict deadlines are (b) Better response time.
. (c) Both (a) and (b).
(a) Time-sharing OS. (d) None of the above.
(b) Real-time OS.
(c) Network operating system. [MCQ]
(d) Centralized OS. 7. Consider the following statements:
(i) Non-preemptive process can lead to starvation.
[MCQ] (ii) Non-preemptive process has good response time.
3. What is/must be the primary goal for hard real time (iii) Non-preemptive process can release CPU
operating system? voluntarily.
(a) Robustness. Which of the following is correct?
(b) Reliability. (a) (i) and (ii) are correct.
(c) Efficiency. (b) (ii) and (iii) are correct.
(d) Convenience. (c) (i) and (iii) are correct.
(d) All (i), (ii) and (iii) are correct.
[MSQ]
4. Which of the following statement is/are correct? [MSQ]
(a) During Booting, OS is loaded into disk from main 8. Function of operating system includes .
memory. (a) Resource Management.
(b) The area of memory where OS is stored, is known (b) Reliability.
as system area. (c) Security.
(c) Uni-programming can load and execute a single (d) Control over system performance
program in memory.
(d) Uni-programming suffers from idleness of CPU.
Operating Systems
Intro & Background DPP 02
[MSQ] [MCQ]
1. Which of the following are allowed in kernel mode 5. Consider the following statements:
only? (i) Pre-defined functions start executing in kernel
(a) Enabling / Disabling interrupts. mode.
(b) Reading the system’s time. (ii) User-defined functions start executing in user
(c) Context switching. mode.
(d) Clear the memory. Which of the following is correct?
(a) Only (i) is correct.
[MSQ] (b) Only (ii) is correct.
2. Which of the following is/are correct? (c) Both (i) and (ii) are correct.
(a) To switch from kernel mode to user mode, the (d) Both (i) and (ii) are incorrect.
mode bit should be changed to 1.
(b) To switch from kernel mode to user mode, the [NAT]
mode bit should be changed to 0. 6. Consider the following program:
(c) To switch from user mode to kernel mode, the main()
mode bit should be changed to 1. {
(d) To switch from user mode to kernel mode, the fork()
mode bit should be changed to 0. fork()
fork()
[MCQ] printf(“GATE “2023”);
3. Match the following: return 0;
(i) User mode 1) Atomic }
(ii) Kernel mode 2) Mode bit 0 How many times GATE 2023 will get printed?
3) Privileged
4) Preemptive [MCQ]
(a) (i) – 2, 3; (ii) – 1, 4 7. Mode bit is present in .
(b) (i) – 2, 1; (ii) – 3, 4 (a) Main Memory
(c) (i) – 2, 1, 4; (ii) – 3 (b) Disk
(d) (i) – 4; (ii) – 1, 2, 3 (c) Cache
(d) Register
[MCQ]
4. System call is used to access . [MCQ]
(a) Application functionality. 8. At system boot time, the hardware starts in .
(b) I/O functionality. (a) Kernel mode
(c) Operating system functionality. (b) User mode
(d) None of these. (c) Operating mode
(d) Disk mode
Operating System
Process Management DPP 01
[MCQ] [MSQ]
1. Consider the following statements: 5. Which of the following is/are correct?
(i) In Uni-programming, CPU can run only one (a) Changing mode from user to kernel need an
program at a time. interrupt.
(ii) In Multi-programming, CPU can run multiple (b) Changing mode from kernel to user needs an
program at a time. interrupt.
Which of the following is correct? (c) ISR (Interrupt Service Routine) is responsible for
(a) (i) is correct (ii) is incorrect. mode shifting (user to kernel)
(b) (i) is incorrect (ii) is correct. (d) ISR (Interrupt Service Routine) is responsible for
(c) Both (i) and (ii) are correct. changing the mode kernel to user.
(d) Both (i) and (ii) are incorrect.
[MCQ]
[MSQ] 6. Consider the following statements:
2. Which of the following is/are incorrect? (i) Static data have fixed size and memory allocated
(a) Multiprogramming enhances CPU throughput. during run-time.
(b) Non-preemptive processes may have forceful (ii) Dynamic data have different size and memory
deallocation. allocated during load-time.
(c) Non-preemptive multiprogramming is equivalent Which of the following is/are correct?
to uni-programming. (a) Only (i) is correct.
(d) Multiprogramming is of two types preemptive and (b) Only (ii) is correct.
non-preemptive. (c) Both (i) and (ii) are correct.
(d) Both (i) and (ii) are incorrect.
[MCQ]
3. (Fork) system call is converted by compiler and also [MCQ]
know as . 7. Match the following
(a) Supervisory call. (i) Program 1. Active entity
(b) Privileged instruction. (ii) Process 2. Resides in main memory
(c) Software interrupt instruction. 3. Passive entity
(d) All of the above. 4. Resides in disk
[MCQ]
1. Consider the following statements: [MCQ]
(i) Program when utilizing computer’s resources is 5. Runtime stack contains of function calls.
known as process. (a) Code
(ii) A program performing, I/O operation is (b) Activation record
considered as a process. (c) Dynamic data
Which of the following is correct? (d) Instructions
(a) Only (i) is correct.
(b) Only (ii) is correct. [NAT]
(c) Both (i) and (ii) are correct. 6. How many of the following operations can be
(d) Both (i) and (ii) are incorrect. performed on a process?
(i) Creation
[MSQ] (ii) Dispatch
2. Which of the following is/are correct? (iii) Execute
(a) A process is an instance of a program. (iv) Block
(b) A program loaded into main memory but it is not (v) Terminate
running currently is known as process.
(c) Program is created from a process. [MSQ]
(d) Process is created from a program. 7. Which of the following is/are correct?
(a) A suspended process resides in memory.
[MCQ] (b) A blocked process resides in memory.
3. Match the following:
(c) A suspended process resides on disk.
(i) Context switching 1. Dispatcher
(d) A blocked process resides on disk.
(ii) Message passing 2. Long term Scheduler
(iii) Degree of 3. Process creation
multiprogramming [MCQ]
(iv) Fork() 4. Inter process 8. Information stored inside a process control block is
communication known as of process.
Select the correct code from the following: (a) Schedule
(a) (i)- 4, (ii)- 1, (iii)- 2, (iv)- 3 (b) Details
(b) (i)- 4, (ii)- 1, (iii)- 3, (iv)- 2 (c) Context.
(c) (i)- 1, (ii)- 4, (iii)- 3, (iv)- 2 (d) Data
(d) (i)- 1, (ii)- 4, (iii)- 2, (iv)- 3
[MCQ]
4. The memory area where all instructions of a program
is stored is known as .
(a) Heap (b) Program Block
(c) Code section (d) Instruction space.
Operating System
Process Management DPP 03
[MSQ] [MCQ]
2. Consider a computer with a CPU and N processes, 6. If a process is suspended from Running state, it is
which of the following is correct regarding the moved to .
processes:
(a) Ready state in main memory.
(a) There can be maximum of N processes in the
(b) Block state in secondary memory.
block state.
(c) Suspend ready state in main memory.
(b) There can be maximum of N processes in the
(d) Suspend ready state in secondary memory.
ready state.
(c) There can be atmost 1 process in the running state.
(d) There can be atmost N processes in the running [MSQ]
state. 7. Which of the following scheduling queues are present
on the disk?
[MCQ] (a) Ready queue
3. If “Dispatch” operation is performed on the process, (b) Block queue
which transition is possible from the following? (c) Suspend queue
(a) Running to Ready (d) Input queue
(b) Ready to Running
(c) Blocked to Ready
[MSQ]
(d) Running to Blocked. 8. Which of the following process state transition/
transitions is/are present in multi-programming OS but
[MCQ] not in uni-programming OS?
4. The given process state transition diagram represents: (a) Running to Exit
(b) Ready to Running
(c) Block to Ready
(d) Running to Ready
Operating System
Process Management DPP 04
[MCQ] [MCQ]
1. Long term scheduler operates on . 6. Which scheduler plays important role in “swapping”?
(a) Input queue (b) Job queue (a) Long term scheduler
(c) Ready queue (d) Device queue (b) Medium term scheduler
(c) Short term scheduler
[MSQ] (d) None of these
2. Which of the following scheduler works between disk
and main memory? [MSQ]
(a) Long term scheduler 7. , is the time when process first enters into ready
(b) Medium term scheduler queue.
(c) Short term scheduler (a) Submission time.
(d) CPU scheduler (b) Arrival time
(c) Dispatch time
[MCQ] (d) Load time
3. The time spent by a process inside a CPU is known as
.
[MCQ]
(a) Waiting time
8. If n is the total time spent by a process since its arrival
(b) Turnaround time
till its completion, and s amount of time process spent
(c) Completion time within CPU, it also requires to perform some input-
(d) Burst time output activity and there the process spent x amount of
time. Which of the following is correct expression for
[MCQ] the total time spent by process in Ready queue?
4. Context switching is done by . (a) s – (n+ x) (b) x + (s- n)
(a) Operator (b) Scheduler (c) n + (s- x) (d) n – (s+ x)
(c) Dispatcher (d) Loader
[NAT]
5. Consider a system with 5 CPU’s and 20 processes.
Suppose X is the maximum number of processes that
can be in the running state, Y is the minimum number
of processes in the ready state, Z is the maximum
number of processes in the block state. Calculate X +
Y*Z?
Operating System
DPP 01
CPU Scheduling
[MCQ] [MSQ]
1. Process can complete its execution from 5. Which of the following statements are CORRECT
(a) Ready state (b) Running state regarding process state transition diagram?
(c) Block State (d) All of the above (a) A process can move from ready to suspend
blocked state.
[MCQ] (b) A blocked process can move to suspend ready
2. Consider a system with n number of processes, s is time state.
when each process terminates, and t is the time each (c) A blocked process can move to running state.
process arrives to the ready queue. What will be the (d) A running process can move to blocked state.
average time for n processes to complete their
execution? [NAT]
n ti si n
ni ti 6. Consider the following processes, with their
(a) (b) respective arrival time and burst times:
i 1 n i 1 s
n si ni n
si ti Processes Arrival Time Burst Time
(c) (d) P1 3 4
i 1 t i 1 n P2 5 6
P3 2 5
[MSQ] P4 0 3
3. Which of the following statement is/ are INCORRECT
regarding total number of schedules if the system has Calculate the average turnaround time of all the
n number of processes? processes scheduled using First come first serve
(a) Total number of schedules possible in non- algorithm. [Upto two decimal places]
preemptive system are n.
Note: Scheduling overhead is negligible
(b) Total number of schedules possible in non-
preemptive system are n2.
(c) Total number of schedules possible in preemptive
system are n2. [NAT]
(d) Total number of schedules possible in non- 7. Consider the following processes, with their
preemptive system are n!. respective arrival time and burst times:
Processes Arrival Time Burst Time
[NAT] P1 2 5
4. Consider a system with three non-preemptive P2 5 4
processes, first process arrives at time unit 4 and P3 4 6
executes for 12 ms, while first process was executing P4 0 4
second process arrives at time 6 with burst time 8 ms
Calculate the sum of average waiting time and
and third process arrives at time 19 with burst time 8
ms. Assume X is the schedule length of the above average turn around time of all the processes
system and Y is the amount of time CPU is idle and scheduled using First come first serve algorithm .
waiting for processes, calculate X + Y? [Upto two decimal places]
Note: CPU time started at 0. Note: Scheduling overhead is negligible
Operating System DPP 02
CPU Scheduling
[MCQ] What does the average turnaround time for these
processes with the shortest remaining process time first
1. Consider arrival time and execution time for the
(SRTF) algorithm? (If burst time is matching them
following processes.
follow lowest arrival time and round-off up to 1
Process Arrival time Burst time decimal).
P0 2 5
P1 7 9 [MCQ]
P2 8 3 4. Five jobs are waiting to be run. Their expected running
P3 10 4 time are 12, 5, 7, 3 and “X”. Which of the following
Assume, each context switch requires 1ms of time order will minimize the average completion time using
(excluding first and last context switch), then calculate the shortest job first (SJF)?
the sum of schedule length, turnaround time of P3, and (a) 3, X, 5, 7, 12
waiting time for P1 using SRTF algorithm? (b) 3, 5, X, 7, 12
(a) 39 (b) 34 (c) 3, 5, 7, X, 12
(c) 40 (d) 25 (d) 3, 5, 7, 12, X
[NAT] [NAT]
2. Consider arrival time and execution time for the 5. Consider a pre-emptive SJF scheduling technique
following processes that need to be scheduled on a followed by three processes P1, P2, P3. All these 3
single CPU. processes arrive at time t = 0 and their total execution
Process Arrival time Burst time time is 30, 40, and 50 units respectively. Each process
spends the first 10% of execution doing I/O, 80% of
P0 1 4
CPU and the rest 10% doing I/O operation.
P1 6 3 What will be the CPU idle % time to execute all
P2 7 9 processes?
P3 5 5 (Assume a uniprocessor and all I/O operations can be
overlapped, round off upto 2 decimal).
Assume X is the total number of contexts switching
and Y is the throughput of the system using SJF [MCQ]
scheduling algorithm then find the value of (X + Y)? 6. Consider the following processes:
(Exclude start and end context switching and round-off
up to 2 decimal). Process Arrival time Burst time
P0 3 2
[NAT] P1 6 3
3. Consider the following set of processes with the arrival P2 12 3
times and the CPU burst times given in milliseconds: P3 5 2
Process Arrival time Burst time P4 25 4
P0 0 4 What is the throughput using the first come first
P1 2 3 serve(FCFS) algorithm, where scheduling overhead
P2 3 4 requires 2 unit (excluding first and last context
P3 5 5 switch)?
P4 1 2 (a) 0.16 (b) 0.17
(c) 0.18 (d) 0.28
Operating System DPP 03
CPU Scheduling
[MCQ] Process Arrival time Burst time
1. Consider the following statements: P0 0 3
(i) SJF is the most optimal algorithm among all other P1 2 5
scheduling algorithms. P2 3 4
(ii) SRTF is practically non-implementable because it P3 4 2
is pre-emptive in nature. P4 6 1
(iii) SJF is practically implementable because of it’s P5 6 2
non-premptive nature.
Which of the following is CORRECT? What is the sum of throughput of the system and
average waiting time if SRTF Scheduling is used?
(a) Only (i) and (ii).
(upto 2 decimal )
(b) Only (ii) and (iii).
(c) All (i), (ii), and (iii).
(d) None of these.
[MCQ]
[MCQ] 5. Consider the given process table:
2. Consider the set of processes. Process Arrival time Burst time
Process Arrival time Burst time P0 6 8
A 2 3 P1 0 6
B 4 17 P2 2 4
C 2 4 P3 3 6
D 1 2 P4 4 1
E 7 5 P5 5 2
Consider the context switching overhead of 1 unit.
Assume that the processes are scheduled using the non- What is the percentage of CPU overhead activity while
pre-emptive Shortest Job First(SJF) algorithm. What using SRTF scheduling for the processes given in the
are the average turnaround time and average waiting above table? Include the context switching to load the
time? first process, and save the last process.
(a) 13.5, 5.25 (b) 10.0, 3.8 (a) 20.5% (b) 23.5%
(c) 12.2, 5.6 (d) 8.75, 4.25
(c) 25% (d) 27.6%
[MCQ]
3. A Scheduler that selects partially executed processes [MSQ]
from a secondary storage device is called . 6. Which of the following statement(s) is/are correct in
(a) Medium-term scheduler. the context of CPU scheduling?
(b) Short term scheduler. (a) Turnaround time includes waiting time.
(c) Long Term scheduler. (b) SRTF can be used even when the CPU time
required by each of the processes is not known
(d) None of these. apriori.
(c) Implementing preemptive scheduling may need
[NAT]
hardware support.
4. Consider arrival time and execution time for the
following processes that need to be scheduled on a (d) The goal is to only maximize CPU utilization
single CPU. and minimize throughput.
[NAT] [MCQ]
7. Consider the following five processes, with their arrival 8. Which of the following scheduler can control degree of
times and execution times given in milliseconds. multiprogramming?
(a) Medium-term scheduler.
Process Arrival time Burst time
(b) Short term scheduler.
P0 1 3
(c) Long Term scheduler.
P1 0 2
(d) None of these.
P2 4 4
P3 3 6
P4 6 2
Using Non‐pre-emptive Shortest Job First, what will
be the average waiting time? [upto 1 decimal point]
Operating System DPP 04
CPU Scheduling
[MCQ] [MCQ]
4. Which of the following scheduling algorithm is better 8. Which of the following scheduling algorithm treat
than others in forms of response time. every process equally?
(a) SJF (Shortest job first) (a) Shortest Job First
(b) SRTF (Shortest remaining time first) (b) Shortest remaining Time first (SRTF)
(c) FCFS (First come first serve) (c) Longest remaining Time first (LRTF)
(d) RR (Round Robin) (d) Round Robin
Operating Systems
DPP 01
Process Synchronization/ Coordination
[MCQ] [MSQ]
1. Consider the following statements: 5. What are the limitations of Single- Ready queue?
(a) All processes have to use same scheduling
S1: If all jobs have identical run lengths, a RR scheduler technique.
provides better average turnaround time than FIFO. (b) Lots of searching time required to select single
S2: With a MLFQ scheduler, high priority jobs have process.
longer time-slices than low priority jobs. (c) Multiple processes cannot run simultaneously.
(d) In a single-ready queue only single process can
Which of the following is true? reside.
(a) Only S1
(b) Only S2 [MSQ]
(c) Both S1 and S2 6. Which of the following is/are correct regarding
(d) None of these MLQ(Multi-level queue) scheduling?
(a) Some processes may suffer from starvation.
[MCQ] (b) Processes are divided into categories and
2. Suppose there is a system operating upon round-robin scheduled on different ready queue.
scheduling, If e denotes time that is been needed to do (c) Multiple scheduling algorithms can be
a process switch and if w denotes round-robin time implemented simultaneously.
quantum and if n denotes average time that a process (d) It has minimal scheduling overhead.
is required to run. Then what will be the CPU
efficiency under following circumstances. If round- [MCQ]
robin time quantum is greater than the average time i.e. 7. Which process can be affected by other processes
(w > n). executing in the system?
(a) n (a) cooperating process
(b) 1/(n + e) (b) child process
(c) n/(n + e) (c) parent process
(d) None of these (d) independent process
[NAT] [MSQ]
3. A process spends 20% of its execution time waiting for 8. A race condition
completion of I/O operation. If there are 8 processes in (a) Occurs when two threads enter critical section at
memory at once, then the probability of CPU time the same time.
utilized is %. (Assume all I/O operations are (b) Occurs when one thread is in critical section and
overlapped). (Upto 2 decimal places) another thread cannot access critical section.
(c) Occurs when two threads access a shared variable
at the same time.
[NAT] (d) None of these
4. Considering the exponential average behavior used to
predict the next CPU burst. If α = 0.70 and τ0 = 30 ms
and previous (T0 , T1, T2, T3) runs were as 10, 12, 15,
20. The predicted value of τ4
Operating System
DPP 02
Process Synchronization/Coordination
[MCQ] P1 P2
1. Intra Process–communication is . { {
(a) Two processes within same system sharing int x; int p;
resources. int y; int y;
(b) Two entities within same process communicating y = x + 1; y = p – 1;
with each other. x + 1; p – 1;
(c) Two variables of two processes communicating } }
with each other. What is the shared variable in both processes?
(d) None of these. (a) x (b) y
(c) p (d) all of these
[MSQ] [MCQ]
2. In IPC, synchronization is required to eliminate . 6. Critical section is .
(a) Inconsistency (a) Part of the program which does not access shared
(b) Deadlock resource.
(c) Progress (b) Complex part of program which cannot be
(d) Data-loss translated by complier.
(c) Such section will always cause deadlock.
(d) Part of the program where shared resources are
[MCQ] accessed.
3. Consider the following statements:
(i) User mode execution is non-atomic. [NAT]
(ii) User process can be preempted after completion 7. Consider the following code of producer consumer
of any instruction. problem:
Which of the following correct? # define N 1000
(a) Only (i) is correct int Buffer [N]
(b) Only (ii) is correct int count = 0
(c) Both (i) and (ii) are correct void producer (void)
(d) None of these {
int itemp, in = 0;
[MSQ] while (1)
4. Preemption during execution can lead to . {
(a) Inconsistency itemp = Produce_item();
(b) Correct result while (count = = N);
(c) Data loss Buffer[in] = itemp;
(d) Incorrect result in= (in + 1) % N;
count = count +1;
[MCQ] }
5. Consider the snippet following two processes:
void consumer (void) }
{ How many variables from the above code belong to
int itemc, out = 0; critical section?
while (1) [MSQ]
{ 8. Necessary condition for synchronization problems to
while (count = =0); occur in Inter–process communication environment are
itemc = Buffer [out]; (a) Critical section
out = (out + 1) % N; (b) Non-critical section
count = count – 1; (c) Race condition
process_item(itemc); (d) Preemption
}
Operating System DPP 03
Process Synchronization/Coordination
[MSQ]
1. Producer Consumer problem has . Which of the given condition are satisfied by the above
(a) Competition (b) Co-operation code?
(c) Inconsistency (d) Data loss (a) Mutual exclusion and progress
(b) Mutual exclusion
(c) Progress
[MCQ]
(d) No mutual exclusion
2. Purpose of “entry section” in synchronization
mechanism is. [MCQ]
(a) To allow all processes to access shared resource 6. If Bounded waiting condition is not satisfied, it can
concurrently. cause.
(b) To allow one process at a time to enter into critical (a) Inconsistency (b) Data-loss
section. (c) Starvation (d) Deadlock
(c) To indicate the program is started
(d) None of these [MSQ]
7. Which of the following is/are incorrect?
(a) Process cannot be pre-empted from CS.
[MSQ] (b) Process can enter CS without going into entry
3. What are the requirements of critical section problem? section.
(a) Mutual exclusion (b) Bounded waiting (c) Process can complete/leave CS without going
(c) Deadlock (d) Consistency into exit section.
(d) Process can be preempted from entry, exit and
[MCQ] critical section.
4. Mutual exclusion is .
(a) Any number of process can enter into critical [NAT]
8. How many of the following are software type solution
section if it is free.
for synchronization?
(b) No process present in Non-CS should block the (i) Lock variable (ii) Monitor
other process from entering into CS. (iii) Peterson’s solution (iv) Semaphore
(c) No two process may be simultaneously present in (v) Test and set Lock (vi)Strict algorithm
CS. instruction set.
(d) None of these. (vii) Swap
[MCQ] [NAT]
5. Consider two processes. 9. Consider the following program segments for two
different processes (P1 & P2) executing concurrently;
Process X Process Y
‘a’ & ‘b’ are not shared variables, ‘x’ is shared and
while(true){ while (true){ starts at '0'.
x = l; y = 1; P1 P2
while(y= =l){ while (x = =1){ for (a = 1; a< =4; ++a) for (b =1; b< =4;++b)
// critical section // critical section x = x +1; x = x + 1;
x = 0; x = 0; If P1 and P2 execute only once and concurrently, then
} } the final minimum possible value of x is .
} }
Assume x and y shared variables and initialized to 0.
Operating System
Process synchronization / Coordination DPP-04
[MCQ] [MCQ]
1. Consider the following program: 3. Match the following:
Bool Lock = False; 1) TSL (i) Mutual exclusion
void Process (int i) 2) SWAP (ii) Progress
{ (iii) Bounded waiting
while(1) Which of the following option is correct?
{ (a) 1 – (i); 2 – (ii); 2 – (iii)
< Non-critical section > (b) 1 – (ii); 1 – (iii); 2 – (ii)
while(TSL(&Lock)= = True) (c) 1 – (i); 2 – (i); 2 – (ii)
< Critical Section > (d) 1 – (iii); 2 – (i); 1 – (i)
Lock = False;
} [MSQ]
} 4. Which of the following is/are correct?
Which of the following are correct regarding given (a) TSL has busy waiting and wastes CPU cycle.
code? (b) TSL suffers from priority - inversion.
(a) It guarantees mutual exclusion but not progress. (c) SWAP has busy waiting and utilizes CPU cycle
(b) It gurantees mutual exclusion and progress but not efficiently.
bounded waiting. (d) SWAP suffer from priority-inversion.
(c) It guarantees progress but not mutual exclusion.
(d) It guarantees progress and bounded waiting but [MCQ]
not guarantees mutual exclusion. 5. Priority inversion problem can be solved by .
(a) Preemption.
[MSQ] (b) Priority Inheritance
2. Which of the following is/are correct regarding (c) Preemption followed by priority exchange.
“SWAP”? (d) No solution, and priority inversion problem can
(a) It is a software-based synchronization cause deadlock.
mechanism.
(b) It is atomic instruction. [MCQ]
(c) It is based on “Lock Key” mechanism. 6. Consider the following program of producer from
(d) It is non-privileged instruction. producer-consumer problem implemented using
sleep() and wakeup ().
void Producer(void)
{ Y = if(count = = 1) wakeup(consumer);
int itemp, in = 0; (d) X = if(count = = N) wakeup(consumer);
while(1) Y = if(count = = 1) sleep();
{
itemp = Produce.item(); [MCQ]
X; 7. Operations performed on semaphores are .
Buffer [in] = itemp; (a) Wait and signal
in = (in + 1) % N; (b) Sleep and wakeup
Count = Count + 1; (c) Increment and decrement
Y (d) All of the above.
}
} [MSQ]
What will be the value of X and Y respectively? 8. Which of the following are the types of semaphore?
(a) X = if(count = = 1) sleep(); (a) Binary
T = if(count = = N) wakeup(consumer); (b) Bounded
(b) X = if(count = = N) sleep(); (c) Counting
Y = if(count = = N -1) wakeup(consumer); (d) Incremental
(c) X = if(count = = N) sleep();
Operating Systems
DPP 05
Process Synchronization/Coordination
[MCQ] (d) Peterson’s algorithm is a solution for atleast 2
1. Choose the hardware type solution for the processes.
synchronization problem from the following
(a) Lock variables [MCQ]
(b) Strict alteration 5. Which of the following is correct regarding solution to
(c) Peterson’s solution synchronization problem:
(d) Test and set instructions (a) Test and set is a 2-process, software based
solution.
[NAT] (b) Lock variable is a 2-process, hardware based
2. Consider the following two-process synchronization solution.
solution (c) Strict alteration is a 2-process, hardware based
X Y solution
while (turn = = 1); while (turn = = 1); (d) None of these.
C.S C.S
turn =1; turn =1; [MSQ]
6. Choose the characteristics for test and set
The shared variable turn is initialized to zero. Then synchronization solution.
the number of incorrect statements about above (a) It ensures mutual exclusion.
solution is/are? (b) It is deadlock free.
(I) It violates mutual exclusion. (c) It does not guarantee bounded wait.
(II) It violates progress. (d) It may cause starvation.
(III) It violates bounded wait.
[MCQ]
[MSQ] 7. For a implementing synchronization for atleast 2
3. The software type solution: strict alteration satisfies processes (that should satisfy mutual exclusion,
which of the following? progress and bounded wait), which algorithm is best
(a) Mutual exclusion recommended?
(b) Progress (a) Decker’s algorithm
(c) Bounded wait (b) Strict alteration
(d) All of the above (c) Peterson’s solution
(d) None of the above
[MSQ]
4. Choose the correct statements regarding peterson’s [MSQ]
algorithm from the following 8. Which of the following is/are OS based
(a) Peterson’s algorithm satisfies only mutual synchronization mechanism?
exclusion but not progress. (a) Sleep() and wakeup( )
(b) Peterson’s algorithm is a solution for 2 (b) Wait() and signal()
processes. (c) Monitor
(c) Peterson’s algorithm satisfies mutual exclusion, (d) Swap
progress and bounded wait.
Operating Systems DPP 06
Process Synchronization/Coordination
[NAT] (a) 19 (b) 18
1. A counting semaphore S is initialized to 2 then (c) 16 (d) 20
following sequence of operation are performed over S.
VVVP VPPPVPPVPVVP [MCQ]
What will be the value of S after operations? 4. A counting semaphore is initialized to 5. Then, 15 P
operations and 20 signal operations are performed on
[MSQ] S. What will be the final value of S?
2. Recall the readers-writers problem. Consider the (a) 0 (b) 20
following solution to this problem.
(c) 5 (d) 10
Writer
Wait (wrt);
........ [MSQ]
5. Which of the following condition must be satisfied in
writing is performed
the classical reader-writer problem?
..........
(a) Only one writer may write a file at a time.
Signal (wrt);
(b) Only one reader may read a file at a time.
Reader
(c) If a reader is reading a file, no writer may write to
wait (mutex);
it.
readcount = readcount + 1;
(d) Any number of the reader can read at a time.
if readcount = 1 then wait (wrt);
signal (mutex);
......... [MCQ]
6. A thread that is blocked on a semaphore is awakened
Reading is performed
when another thread:
.........
(a) Tries to block the same semaphore
wait (mutex);
(b) Tries to decrement a semaphores value ≤ 0.
readcount = readcount – 1;
(c) Tries to increment the semaphore value ≥ 0.
if readcount = 0 then signal (wrt);
(d) None of these
signal (mutex);
Which of the following is/are correct reading above
solution? [MSQ]
(a) Multiple readers can read together 7. The strict alternation .
(a) Does not guarantee bounded waiting
(b) The reader are not starved of access because of
(b) Does not guarantee progress.
priority of the writers and vice versa.
(c) Does not guarantee Mutual exclusion
(c) A writer gets exclusive access, i.e., while a writer
(d) All of these
is writing. No one can write or read.
(d) Deadlock is possible.
[MCQ]
8. The bounded buffer problem is also known as
[MCQ]
(a) Readers – writing problem
3. At a particular time of computation, the value of a
counting semaphore is 9. Then 20 P operation and xV (b) Producer – consumer problem
(c) Dining – Philospher problem
operations were completed on this semaphore. If the
(d) None of these
final value of the semaphore is 5, x will be?
Operating Systems
Process Synchronization/Coordination DPP 07
[MCQ] [MCQ]
1. In dining philosopher’s problem, deadlock can occur 4. Consider the following instructions:
when I1: a = b + c;
(a) Two philosopher’s pick there left fork and get
I2: d = e * f;
preempted before picking right fork.
(b) Two philosopher’s sitting in front of each other I3: k = a + d;
pick there left fork and then right fork. I4: l = k + m;
(c) Four philosophers are sitting and doing nothing. Which of the following is correct precedence graph for
(d) All philosopher’s pick there left fork and the above instructions?
preempted before picking right fork.
[MCQ]
2. Consider the following code:
# define N 6
void p (int i) (a)
{
while (1)
{
T(i);
T_f(i);
T_f((i + 1)%N);
x(i) (b)
p_f(i);
p_f((i + 1)%N);
}
}
T is a think function, T_f is a take fork function, x is a
eat function, p_f is a put fork function, and i represents
the philosopher. Which of the following is true about
above code?
(a) Prevents Deadlock but has starvation. (c)
(b) Has deadlock but do not have starvation.
(c) Has deadlock and starvation both.
(d) Do not have deadlock and starvation.
[NAT]
3. How many of the following instructions can run
(d)
independently?
I1: p = q * r;
I2: q = p + z;
I3: l = m + k;
I4: n = a + b;
I5: m = z + s;
[MSQ] [NAT]
5. Solve the following code by co-begin and co-end 7. Consider the following concurrent program, how many
x = 4; levels are there in it’s precedence graph?
co-begin S1:
x = x + 5; Parbegin
x = x + 6; begin;
co-end; S2; S3;
What could be the possible final value of x? end;
(a) 5 (b) 9 begin
(c) 10 (d) 15 S4;
begin
[MCQ] S5; S6;
6. Busy waiting is . end;
(a) When a process polling on a variable. Parbegin
(b) When a process periodically checks a variable. S7
(c) When a process issues an interrupt. begin
(d) When a process continuously checks a variable. S8; S9
end;
Parend;
end;
Parend;
S10
Operating Systems DPP 09
Process Synchronization/Coordination
[MCQ] [NAT]
1. Which of the following can prevent deadlock in dining 5. Consider the following precedence graph:
philosopher’s problem?
(a) Allow at most four philosophers’ to be sitting
simultaneously at the table.
(b) Allow a philosopher to pick up chopsticks only if
both chopsticks are available (to do this, they must
pick them up in a critical section). How many nodes are dependent?
(c) An odd-numbered philosopher picks up first left
chopstick and then right chopstick, whereas an [MCQ]
even-numbered philosopher picks up right 6. Consider the following code by begin and end
chopstick and then left chopstick.
a=3
(d) All of the above.
b=4
[MSQ] begin:
2. Dining philosopher problem is . b=a*b
(a) Solution to producer-consumer problem. a=a*b
(b) Example of concurrency-control problem. end;
(c) Application of semaphore. What could be the possible final values of a, b?
(d) Classical IPC problem.
(a) a:{12}; b:{12}
(b) a:{12}; b:{12, 24}
[MSQ]
3. Which of the following statements is/are correct? (c) a:{12, 24}; b:{12}
(a) Concurrency is about doing multiple things at (d) a:{12, 36}; b:{12}
once.
(b) Concurrency is about dealing with multiple [MCQ]
things at once. 7. How many of the following statements is/are not
(c) Parallelism is about doing multiple things at once. independent?
(d) Parallelism is about dealing with multiple things I1: a = b + c
at once. I2: c = d * e
I3: e = a * g
[MSQ] I4: g = e + m
4. Which of the following condition must be satisfy if two
I5: m = m + f
statements are concurrent/independent?
(a) Atleast one shared variable should be present. [NAT]
(b) No shared variable should present. 8. Consider a counting semaphore variable ‘X’, following
(c) Output of one statement should serve as input to are the semaphore operations performed 20P, 6V, 8V,
other statement. 7P, 12P, 16V. What will be the largest initial value of
(d) Output of one statement should not serve as input ‘X’ to keep 2 processes in suspended list?
to other statement.
Operating Systems
Process Synchronization/Coordination DPP 10
[MSQ] [MSQ]
1. Consider the following concurrent program: 3. Consider the given precedence graph:
begin
S1;
S2;
Parbegin
S3;
S4;
S5;
Parend;
S6;
end;
Which of the following statement is correct about
above program?
(a) S1, S2, S3, S4, S5 run sequentially.
(b) S3, S4, S5 run concurrently.
(c) S1, S2, S6 run concurrently. Which of the following represent correct concurrent
(d) S1, S2, S6 run sequentially. program of above precedence graph?
(a) S1; (b) S1;
[NAT]
Parbegin; Parbegin
2. Consider the following concurrent program
S3; begin
S1;
Parbegin begin S2;
begin S7; Parbegin
S2; S4; S6;
S3; Parbegin S5;
S4; S2; Parend;
end;
Parbegin end;
S5;
S6; S8;
S6;
S5; begin
begin
S7; Parend; S4;
S8; S8; S7;
S9; Parend; end;
end; end; S3;
S10; Parend; Parend;
Parend; S9; S9;
S11;
After S1 how many statements will start concurrently?
(c) S1; (d) S1; [MCQ]
Parbegin Parbegin 5. Deadlock is
begin begin (a) Starvation
S2; S4; (b) Blocking a process for defined time
Parbegin S7; (c) Infinite waiting
S6; S2; (d) Utilization of CPU
S5; Parbegin
Parend; S6; [MCQ]
S8; S5; 6. Which of the following graph represents deadlock?
end; Parend; (a)
S3; S8;
begin; S3;
S4; Parend;
S7; S9;
end;
Parend;
S9;
[MSQ] (b)
4. Consider the following program
main() void P(void)
{ {
Parbegin Parbegin
P(); 1();
Q(); 2();
R(); 3(); (c)
Parend; Parend;
} }
[MCQ] [MCQ]
1. According to abstract view of memory, memory is 6. An operating system uses the Banker’s algorithm for
. deadlock avoidance. There are three types of resource
(a) Non-linear three-dimensional array. A, B, and C allocated to three processes P0, P1, P2. The
(b) Linear three-dimensional array. below table represents the current system state.
(c) Non-linear one-dimensional array of words. Allocation Max
(d) Linear one-dimensional array of words. A B C A B C
P0 1 1 3 7 4 8
[MCQ] P1 5 6 2 7 8 4
2. What is smallest addressable unit in a memory? P2 3 2 1 4 5 2
(a) 1 Bit (b) 1 Byte
(c) 210 byte (d) 22 bit There are 2 units of each resource still available. The
system is in safe state. Consider the following
[NAT] independent requests for additional resources in current
3. If there are total 16 words in memory and each word state.
has a size of 8 bytes. How many bits of address is Request 1: P0 request 2 units of A, 0 units of B,
required to refer one word? 1 units of C.
Request 2: P1 request 2 units of A, 0 units of B,
[NAT] 2 units of C.
4. Consider the following statements: Which one of the following is TRUE?
(i) If there is a memory of size 32 KW, then number (a) Request 1 can be granted, Request 2 cannot.
of bits required to address one word is x.
(b) Request 2 can be granted, Request 1 cannot.
(ii) If number of bits required to address a memory are
18 bits, then the memory capacity is y KW. (c) Both Request 1 and Request 2 can be granted.
Calculate x * y? (d) Neither of Request 1 and Request 2 can be
granted.
[NAT]
5. How many of the following are functions of memory [MCQ]
manager? 7. Request of any process should be granted iff the
(i) Memory allocation resulting state is safe otherwise it is denied, this is
known as .
(ii) Protection
(a) Resource -Allocation Algorithm
(iii) Fragmentation
(b) Resource -Access Algorithm
(iv) Address Translation
(c) Resource- Request Algorithm
(v) Manage the execution of larger program in smaller
memory area. (d) None of these
[MCQ] [MSQ]
8. Which of the following are deadlock prevention 10. Consider which of the following statements is/are
schemes? correct regarding deadlock?
(a) If a system is in unsafe state, the process may
(a) Each process request resources either in only complete its execution without entering a
increasing order or in only decreasing order. deadlock state.
(b) Whenever a process requests a resources, it does (b) If a process releases all its resources before
not hold any other resources. requesting new resource, then deadlock and
(c) If a process is holding some resources and starvation both are possible.
request another resources that cannot be (c) Deadlock avoidance is less restrictive than
deadlock prevention.
immediately allocated to it, all resources being
held are pre-empted. (d) In deadlock avoidance, the request for resources
is always granted if the resulting state is safe.
(d) All of these
[MCQ]
[MCQ] 11. For mutual exclusion to prevail in the system .
9. Consider the following system.
(a) The processor must be a uniprocessor rather than
a multiprocessor.
(b) There must be at least one resource in a sharable
mode.
(c) At least one resource must be held in a non-
sharable mode.
(d) All of the these.
Which of the following Statement is/are correct.
(a) The system in unsafe state.
(b) The system in safe state.
(c) Data missing
(d) Deadlock will take place
Operating Systems
Memory Management DPP 02
[MCQ] [NAT]
1. Drawback of static loading is . 5. Consider a memory with the capacity of 32MB, how
(a) Ineffective utilization of memory. many bits are required to address this memory?
(b) Requires more time
(c) Need to load data before execution [MSQ]
(d) None of these 6. Suppose 28 bits required to address a memory space,
what would be the capacity of memory?
[MCQ] (a) 256 MB (b) 4096 Mb
2. Loading of modules of the program on demand is (c) 512 MB (d) 2048 Mb
known as .
(a) Static loading (b) Access loading [MCQ]
(c) Dynamic loading (d) Page loading 7. Given are memory capacity (N) along with number of
bits required to address that memory (n).
[MSQ] Match them correctly
3. Dynamic link libraries are . N n
(a) Libraries that are linked with application during (A) 16 MB (i) 15 bits
loading (B) 32 KB (ii) 16 bits
(b) Libraries that are linked with application after (C) 8 GB (iii) 24 bits
compilation. (D) 64 KB (iv) 33 bits
(c) Libraries that are linked with application before (a) A – (ii); B – (i); C – (iii); D – (iv)
execution (b) A – (iii); B – (i); C – (iv); D – (ii)
(d) Libraries that are linked with the application at run (c) A – (iii); B – (ii); C – (iv); D – (i)
time on demand (d) A – (ii); B – (iv); C – (iii); D – (i)
[MCQ]
4. Which of the following are address binding?
(a) Link time binding
(b) Compile time binding
(c) Load time binding
(d) Dynamic time binding
Operating Systems
Memory Management DPP 03
[MCQ]
1. Which of the following are contiguous allocation
technique in memory management?
(a) Paging
(b) Overlays
(c) Segmentation
(d) Buddy system
Memory requirement of each block is as follows:
Root: 10 KB
[MCQ]
A: 5 KB F: 9 KB K: 7 KB
2. Consider the following statements:
B: 6 KB G: 6 KB L: 4 KB
(i) Overlaying is only possible when program can be
divided into independent modules. C: 4 KB H: 2 KB M: 5 KB
D: 9 KB I: 7 KB N: 8 KB
(ii) Overlaying is needed when process is larger than
amount of memory allocated to it. E: 8 KB J: 3 KB O: 6 KB
(iii) Overlaying requires special support from What is the minimum amount of memory (in KB) is
operating system and performed in kernel mode. sufficient to execute this program using overlay’s when
Which of the following is correct? routine loading also needs 20 KB of space?
[MCQ] [NAT]
7. Given memory partitions in order as: 8. Consider a five memory partitions of size 100 KB, 200
KB, 300 KB, 450 KB, and 600 KB. The partitions are
P1: 200 KB; P2: 400 KB; P3: 150 KB; P4: 500 KB. How
required to be allotted to six processes of size 180 KB,
would worst fit algorithm place processes (in order)
50 KB, 210 KB, 30 KB, and 80 KB. Calculate the
requiring size 215 KB, 300 KB, 25 KB, 400 KB.
memory wastage using best-fit algorithm?
Note: The space left after filling a partition is not used
by any process.
Operating Systems DPP 04
Memory Management
[MSQ] [MCQ]
1. Problem of external fragmentation can be resolved by 6. Consider the following graphical representation of
. program here horizontally connected blocks are
(a) Compaction independent modules and blocks connected vertically
(b) Overlay are dependent modules.
(c) Paging
(d) Non-contiguous allocation
[NAT]
2. Consider a memory system having six partitions 400
K, 200 K, 300 K, 250 K, 100 K and 500 K. There are
four process of size 289 K, 458 K, 200 K, 300 K.
What is the total size of unallocated partitions using Memory requirement of each block is as follows:
best fit allocation policy (in K)? A : 10KB E: 5KB
B : 5KB F: 10KB
[MCQ] C : 3KB G: 3KB
3. Compaction is possible with address binding. D: 2KB H: 4KB
(a) Static address binding I : 6KB
(b) Dynamic address binding Which of the following memory space is sufficient
(c) Load time address binding enough to execute the given program using overlays?
(d) Compile time address binding
(a) 48 KB (b) 25KB
(c) 50KB (d) 24KB
[MCQ]
4. Given five memory partitions of 200 K, 600 K, 300 K,
[MCQ]
400 K, 700 K, (in order), how would the first-fit, best-
7. A computer has 1000K of main memory. The jobs
fit and worst-fit algorithms place process of 312 K, 517
arrive and finish the following sequence.
K, 212 K, and 526 K, (in order)? Which algorithm
Job1 needs 100 K arrives
makes the most efficient use of memory?
Note: Space left after filling a partition is not used by Job2 needs 250 K arrives
any process. Job3 needs 400 K arrives
(a) First fit Job1 finishes
(b) Best fit Job4 needs 40 K arrives
(c) Worst fit Job5 needs 250 K arrives
(d) All perform almost same. Job6 needs 60 K arrives
Which of the following allocation policy perform
[NAT] efficiently?
5. Consider a memory system with five partitions: 200 (a) First fit
K, 250 K, 500 K, 600 K and 300 K (in order). There (b) Next fit
are some process request of size 200 K, 350 K, 30 K, (c) Both will perform same
25 K, 100 K (in order). How much memory space will (d) None of these
remain unused because of internal fragmentation if
first-fit allocation policy is used?
Operating Systems
Memory Management DPP 05
[NAT] [MCQ]
1. Consider a paging system with a 256MB logical 5. Consider the following statements:
address space. How many bits of logical address will S1: In paging, logical address space is divided into
be required corresponding to given LAS? fixed partitions called “pages”.
S2: In paging, physical address space is divided into
[NAT] fixed partition called “frames”
2. Consider a paging with 12 bits of logical address and Which of the following is correct?
each page is of size 2KB. Calculate the number of (a) Only S1 is true
pages in this system? (b) Only S2 is true
(c) Both S1 as S2 are true
[MSQ] (d) Both S1 and S2 are false
3. Consider a system with 22 bits of logical address and
12 bits of page offset. Calculate logical address space, [MCQ]
the number of pages, and page size respectively. Which 6. Consider a system with 32-bit logical address, page
of the following is correct? size of 32KB and page table entry (PTE) size is 8 Bytes.
(a) 4MB, 4KB, 1K How many pages are there in logical address space?
(b) 8MB, 2KB, 2K (a) 217 (b) 219
(c) 4096KB, 4KB, 1K (c) 220 (d) none
(d) 4096MB, 4MB, 2K
[MCQ]
[MCQ] 7. Which of the memory allocation scheme suffers from
4. Which among the following is not an operation of external fragmentation?
paging hardware? (a) Paging (b) Swapping
(a) Page fault repair (c) Segmentation (d) none
(b) Memory protection
(c) Address translation [MCQ]
(d) none 8. There are half as many holes as processes, the S be the
average size of process and xS be the average size of
holes. Then the total memory M is estimated using
if there are total n process in the system.
x x
(a) nS 1 (b) nS 1
2 2
n nS
(c) xS + (d) x
[MCQ] [MSQ]
4. If page size is 4096 Bytes, in a paging system. A 9. Which of the following statement is/are correct
process needs 20 frames. What is the maximum regarding paging?
possible internal fragmentation size . (a) Paging helps solve the issue external
(a) 4096 byts fragmentation
(b) 4095 Bytes (b) Page size has no impact on internal fragmentation
(c) 2048 Bytes (c) Paging incurs memory overheads.
(d) No internal fragmentation (d) Multi-level paging is necessary to support pages
of different sizes.
[MCQ]
5. Consider a virtual address space of eight pages of 2048 [MCQ]
words each mapped onto a physical memory of 32 10. What is basic objective of hierarchical paging?
frames. How many bits are there in the logical address. (a) Reduce Internal fragmentation.
(a) 13 (b) 14 (b) Reduce External fragmentation.
(c) 10 (d) 11 (c) To reduce context -switch overhead.
(d) Reduce page table size overhead in memory.
Operating Systems
DPP 07
Memory Management
[MCQ]
1. The page table register should be mode of ? [NAT]
(a) Very high-speed logic 6. A demand paging system takes 240 time units to
(b) Secondary memory. service a page fault and 300 time units to replace a dirty
(c) Large memory space. page. Main memory access time is 20 time units. The
(d) Very low speed logic. probability of page fault is 0.4. In case of a page fault
the probability of page being dirty is 0.06. The average
[MCQ] access time time units.
2. Consider a system implementing paging hardware with
a TLB. Assume the entire page table and all the pages [MCQ]
are in the physical memory. The effective memory 7. Consider a 32 bit machine where four-level paging
access time is 400 msec. with TLB hit ratio 0.6 and scheme is used. If the TLB hit ratio is 90% and it takes
search time of TLB is 20 msec, the main memory 30 nsec to search the TLB and main memory access
access time is (in msec.) time is 100 nsec so, what is the effective memory
(a) 275 msec. (b) 271.43 msec. access time in nanoseconds?
(c) 120.5 msec. (d) 240 msec. (a) 115 nsec. (b) 160 nsec.
(c) 170 nsec. (d) 180 nsec.
[MCQ]
3. Consider a 2 level paging system with TLB support. [MCQ]
The page table has divided into 4 K pages each of size 8. A processor uses 36 bit physical address and 32 bit
8K words. If the physical address space has 64 M virtual addresses, with a page frame size of 4 Kbytes.
words which divided into 8 K frames. TLB access time Each page table entry is of size 4 bytes. A three-level
is 20 nsec. and main memory access time is 300nsec. page table is used for virtual to physical address
The CPU finds 126 page reference in the TLB out of translation, where the virtual address is used as
total reference of 180. Then what is the effective follows:
memory access time? • Bits 30 –31 are used to index into the first level page
(a) 545 nsec. (b) 440 nsec. table.
(c) 420 nsec. (d) 500 nsec. • Bits 21 – 29 are used to index into the 2nd level
page table.
[NAT] • Bits 12 – 20 are used to index into the 3rd level
4. Consider on operating system having 32 bits virtual page table.
address space and 32 MB physical memory. If page • Bits 0 — 11 are used as offset within the page.
size is 8KB. What is the approximate size of the page The number of bits required for addressing the next
table in MB? level page table(or page frame) in the page table entry
of the first, second and third level page tables are
[NAT] respectively
5. Consider a system using paging hardware with a TLB (a) 20,20,20 (b) 24,24,24
to reduce EMAT. Assume that the entire page table and (c) 24,24,20 (d) 25,25,24
all the pages are in the physical memory. It take 30
millisec to search the TLB and 110 millisec to access
the physical memory. If the TLB hit ratio is 0.6, the
EMAT (in millisec) is .
Operating Systems
Memory Management DPP 08
[MCQ]
4. If x is TLB or cache access time, y is main memory
access time, and z is page fault service time or disk
Operating Systems
Memory Management DPP 09
[MCQ]
5. Consider a main memory with five page frames and the
following sequence of page references are 4, 9, 3, 4,
Operating Systems
Memory Management DPP 10
[MCQ] [NAT]
1. A 32-bit address system, used a paged virtual memory; 4. Consider a system with 3 frames and using LRU page
the page size is 2KBytes. What is the virtual page and replacement policy for the following page reference
the offset in the page (in decimal) for the virtual string.
address 0x00030f40 respectively? 32 3 4 1 4 2 4 1 2
(a) 95, 2008 (b) 97, 1856 What will be effective memory access time if time for
(c) 94, 1732 (d) 98, 2112 accessing TLB is 30 ns and for accessing main memory
is 90 ns.
[MCQ]
2. Suppose, we have a page-reference string for a process
[MCQ]
with x frames (initially all empty). The page-reference
5. When will a page fault occur?
string has length s, and y distinct page number occur on
(a) When process tries to access a page which was not
it, then,
in CPU.
(i) What is the maximum number of page fault?
(b) When process tries to access a page which was not
(ii) What is the minimum number of page fault?
in disk.
(a) (i) – x (ii) – y
(c) When process tries to access a page which was not
(b) (i) – y (ii) – x
in main memory.
(c) (i) – s (ii) – y
(d) None of these.
(d) (i) – s (ii) – x
[NAT]
3. If MRU is used as page replacement policy in the
system, and there are initially four-page frames for the
following string of page reference.
4 2 5 1 3 5 6 2 3 2 3 4 5 2 3
What will be the value of page fault by page hits.
Operating Systems
Memory Management DPP 11
[MCQ] [MCQ]
1. Consider the following virtual addresses: 5. If the size of working set window (Δ) for a set of pages
784, 224, 634, 734, 546, 978, 444, 299, 712, 526 is 4. The following is the page reference string:
If the page size is 150 bytes, then the reference string 5, 4, 3, 1, 5, 4, 5, 3, 4, 5
will be. What could be the minimum page demand of process
(a) 7, 2, 6, 7, 5, 9, 4, 2, 7, 5 at any time?
(b) 7, 2, 6, 5, 9, 4, 6, 5 (a) 4 (b) 3
(c) 6, 1, 3, 4, 5, 9, 7, 6 (c) 2 (d) 1
(d) 5, 1, 4, 3, 6, 2, 1, 4, 3
[MSQ]
[NAT] 6. Which of the following technique is/are used to handle
2. Consider the following virtual addresses: thrashing and make system thrashing free?
709, 540, 612, 311, 456, 908, 806, 708, 580, 250, 412, (a) Decreasing page fault frequency
If the page size of 200B, then what be the sum of length (b) working set model
of corresponding reference string and number of (c) Compaction
unique pages in the reference string. (d) Page replacement policy
[MCQ] [MCQ]
3. Excessive paging activity results in . 7. Working set (t, k) at an instant of time t is
(a) Compaction (b) Thrashing (a) The set of k reference with high frequency
(c) Segmentation (d) Paging (b) The set of k future reference that the OS will make
in next t unit of terms.
[MSQ] (c) The k set of page that have been reference in the
4. Which of the following statements are correct? last t time units.
(a) High thrashing can lead to deadlock. (d) None of these
(b) Lack of frames in main memory causes thrashing.
(c) Increasing memory frames can reduce page faults.
(d) High degree of multi programming can cause poor
throughput.
Operating Systems
File System & Device Management DPP 01
[NAT]
5. Consider a disk queue with request sequence 125, 85,
46, 74, 80, 112, 21, 53, 140, the initial position of head
is at 50 and it is moving towards right. The cylinder are
number 0 to 150. Calculate the total time required to
Operating Systems
System Calls and Threads DPP 01