Quiz
Quiz
Q2: For _______ to reach a safe state, it must keep more information about the
state of processes.
Q4: m’ processes share ‘n’ resources of the same type. The maximum need of
each process doesn’t exceed ‘n’ and the sum of all their maximum needs is always
less than m+n. In this setup, deadlock ____________
Q5: 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?
● 6
● 5 Correct
● 4
● 3
Explanation: In the case when we gave 1 drive to 1 process then our total processes
would be 6, but in this case, deadlock would occur as every process would hold one
drive and would await another drive which would be held by another process, so when
we reduced 1 process our system would be deadlock-free.As a result, n is maximum at 6
minus 1.
Q7: Every time a request for allocation cannot be granted immediately, the
detection algorithm is invoked. This will help identify ____________
Q9: The entry of all the PCBs of the current processes is in __________
● Process Register
● Program Counter
● Process Table Correct
● Process Unit
Explanation: The Process Table contains information about all PCBs involved in the
current processes. Process Table contains information about all processes created by
OS along with their PIDs.
Q11: When a single thread of control is active, the process is able to _______
Explanation: A single thread of control allows the process to perform only one task at a
time. In the case of multi-core, multiple threads can be run simultaneously and can
perform multiple tasks at a time.
● Code
● Stack
● Bootstrap program Correct
● Data
Explanation:Process Control Blocks (PCBs) are memory blocks that contain
information about processes, such as Process State, Program Counter, CPU Register,
etc. Task Control Block is another name for Process Control Block. A bootstrap
program is a program that runs when a computer or system is booted or rebooted.
Explanation: The state of a process is defined by its active state. During execution, the
state of the process can change. As far as the state of the process is concerned, it is
New, Ready, Running, Wait, Terminated.
Q15: In an operating system, each process is assigned its operating system calls
Explanation: Operating systems have address spaces for code, data, stack and heap
segments, or sections, which are unique to each process. The processes also come
with a list of opened files, alarms, and signal handlers.
● CPU registers
● Program counter Correct
● Process stack
● Pipe
Explanation:By reading the Program Counter, we can find out what instructions are to
be executed by the process next. Every instruction is accompanied by an increment in
the Program Counter - the address of the following instruction. A program counter
indicates the address where the CPU should fetch instructions from.
● normal exit
● fatal error
● killed by another process
● all of the mentioned Correct
Explanation: Processes can be killed naturally when they complete their tasks; in
addition, they can also be killed by another process, or by force. As soon as the task is
completed without any errors, the process will exit normally. It may terminate
abnormally if an error occurs while it is running. Another process can kill or terminate
the process forcefully.
Explanation: This is caused by the fact that process A is waiting for one resource and
holding another (blocking resource). During the same time, another process B is
requesting blocking a resource, which is already being held by another process A.
Process B waits until the occupied resource is released by process A.
● CPU registers
● Program counter CORRECT
● Process stack
● Pipe
Explanation: Using the Program Counter, a process can determine precisely what
instruction the next process of the current process will execute. In the Program Counter,
every time an instruction has executed the address of the subsequent instruction is
incremented by CPU fetches and executes instructions at the address specified by the
Program Counter.
Q21:In which of the following scheduling algorithm new processes are added to
the tail of the ready queue. The CPU scheduler picks the first process from the
ready queue, sets a timer to interrupt after 1 time quantum, and dispatches the
process.
● Shortest-Job-First Scheduling
● Priority Scheduling
● First-Come, First-Served Scheduling
● Round-Robin Scheduling
Explanation : A small unit of time, called a time quantum or time slice, is defined. A
time quantum is generally from 10 to 100 milliseconds in length.
Q22. Using Priority Scheduling algorithm, find the average waiting time for the
following set of processes given with their priorities in the order:
P1 10 3
P2 1 1
P3 2 4
P4 1 5
P5 5 2
● 8 milliseconds
● 8.2 milliseconds
● 7.75 milliseconds
● 3 milliseconds
Explanation :
0 1 6 16 18 20
41 / 5 = 8.2m.s.
Q23. Another measure is the time from the submission of a request until the first
response is produced. This measure is called______
● Throughput
● Waiting Time
● Turnaround time
● Response time
Explanation: it is the time it takes to start responding, not the time it takes to output the
response.
Q24. ______Is the sum of the periods spent waiting in the ready queue.
● Throughput
P2
P5
P1
P3
P4
● Waiting time
● Turnaround time
● Response time
Explanation: The CPU-scheduling algorithm does not affect the amount of time during
which a process executes or does I/O. It affects only the amount of time that a process
spends waiting in the ready queue. Waiting time is the sum of the periods spent
waiting in the ready queue.
Q25. Which one of the following can not be scheduled by the kernel?
Explanation: User level threads are managed by thread library and the kernel is
unaware of them.
Explanation : The processes with higher priority should be carried out first, whereas jobs
with equal priorities are carried out on a round-robin or FCFS basis. Priority depends
upon memory requirements, time requirements, etc.
● 2
● 3
● 4
● 5
Explanation: There are mainly two types of multiprocessors i.e. symmetric and
asymmetric multiprocessors.
● Zero
● One
● Two
● multiple
Explanation: Most computer systems are single processor systems i.e they only have
one processor
● Symmetric Multiprocessors
● Singleton Multiprocessors
● Asymmetric Multiprocessors
● Both A and B
● Priority scheduling
● Round Robin Scheduling
● Shortest Job First
● FCFS
Q33. In a system using single processor, a new process arrives at the rate of six
processes per minute and each such process requires seven seconds of service
time. What is the CPU utilization?
● 70%
● 30%
● 60%
● 64%
= 70%
● Hard real time OS has less jitter than soft real time OS
● Hard real time OS has more jitter than soft real time OS
● Hard real time OS has equal jitter as soft real time OS
● None of the above
Explanation: Jitter is the variation / displacement between the signals or data being sent.
Hard real operating systems deal with more sensitive systems which require strict time
deadlines like engine control systems, satellite launching systems etc while soft real
operating systems do not require strict timing constraints and a bit delay is permissible,
like mobile phones, online database systems. So hard real operating systems require
minimised jitter.
● 13 units
● 14 units
● 15 units
● 16 units
Explanation: Let the processes be p0, p1, and p2. These processes will be executed in
the following order.
p2 p1 p2 p1 p2 p0 p1 p2 p0 p1 p2
0 4 5 6 7 8 9 10 11 12 13 14
Turn around time of a process is the total time between submission of the process and
its completion.
Q36. Consider three CPU intensive processes P1, P2, P3 which require 20, 10 and
30 units of time, arrive at times 1, 3 and 7 respectively. Suppose operating system
is implementing Shortest Remaining Time first (preemptive scheduling) algorithm,
then _____ context switches are required (suppose context switch at the
beginning of Ready queue and at the end of Ready queue are not counted).
● 3
● 2
● 4
● 5
Explanation:
There are 3 context switch.
Q37. Which of the following is not an optimization criterion in the design of a CPU
scheduling algorithm?
Explanation: P represents Wait and V represents Signal. P operation will decrease the
value by 1 every time and V operation will increase the value by 1 every time.
Q39. Consider three processes, all arriving at time zero, with a total execution time
of 10, 20, and 30 units, respectively. Each process spends the first 20% of
execution time doing I/O, the next 70% of time doing computation, and the last
10% of time doing I/O again. The operating system uses the shortest remaining
compute time first scheduling algorithm and schedules a new process either when
the running process gets blocked on I/O or when the running process finishes its
compute burst. Assume that all I/O operations can be overlapped as much as
possible. For what percentage of time does the CPU remain idle?
● 0%
● 10.6%
● 30.0%
● 89.4%
Explanation: Let three processes be p0, p1, and p2. Their execution time is 10, 20, and
30 respectively. p0 spends the first 2 time units in I/O, 7 units of CPU time, and finally 1
unit in I/O. p1 spends first 4 units in I/O, 14 units of CPU time and finally 2 units in I/O. p2
spends first 6 units in I/O, 21 units of CPU time and finally 3 units in I/O.
idle p0 p1 p2 idle
0 2 9 23 44 47
Idle time = 2 + 3 = 5
● 1
● 2
● 3
● 4
Explanation: Let three processes be P0, P1, and P2 with arrival times 0, 2, and 6
respectively and CPU burst times 10, 20, and 30 respectively. At time 0, P0 is the only
available process so it runs. At time 2, P1 arrives, but P0 has the shortest remaining
time, so it continues. At time 6, P2 arrives, but P0 has the shortest remaining time, so it
continues. At time 10, P1 is scheduled as it is the shortest remaining time process. At
time 30, P2 is scheduled. Only two context switches are needed. P0 to P1 and P1 to P2.
Q41. Which of the following process scheduling algorithm may lead to starvation.
● FIFO
● Round Robin
● Shortest Job Next
● None of the above
Explanation: Shortest job next may lead to process starvation for processes that will
require a long time to complete if short processes are continually added.
Q42.If the quantum time of round robin algorithm is very large, then it is equivalent
to:
Q43. Which of the following is FALSE about SJF (Shortest Job First Scheduling)?
● Only S1
● Only S2
● Both S1 and S2
● Neither S1 nor S2
Explanation:
1. Both SJF and Shortest Remaining time first algorithms may cause starvation.
Consider a situation when long process is there in ready queue and shorter processes
keep coming.
2. SJF is optimal in terms of average waiting time for a given set of processes, but
problems with SJF is how to know/predict time of next job
Explanation: For each specific problem, the efficient algorithms could be different ones.
Hence, the most optimal algorithm can’t be determined.
Explanation: Since both p and q don’t need additional resources, they both can finish
and release Xp + Xq resources without asking for any additional resource. If the
resources released by p and q are sufficient for another process waiting for Yk
resources, then system is not approaching deadlock.
Q46. 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?
Explanation: Turnaround time is the total time taken by the process between starting and
the completion and waiting time is the time for which process is ready to run but not
executed by CPU scheduler. As we know, in all CPU Scheduling algorithms, shortest job
first is optimal i.ie. it gives minimum turn round time, minimum average waiting time and
high throughput and the most important thing is that shortest remaining time first is the
pre-emptive version of shortest job first. shortest remaining time first scheduling
algorithm may lead to starvation because If the short processes are added to the cpu
scheduler continuously then the currently running process will never be able to execute
as they will get pre-empted but here all the processes are arrived at same time so there
will be no issue such as starvation. So, the answer is Shortest remaining time first, which
is answer (A).
Q47. Which of the following disk strategies is likely to give the best throughput?
Explanation: Nearest cylinder next is also known as shortest seek time first and in this
algorithm many pages can be accessed in less amount of time. So throughput will be
high so this is optimal algorithm.
A. First-come-first-served
B. Round Robin
C. Priority
D. Shortest process next
E. Shortest remaining time first
● A, C and E
● C, D and E
● B, D and E
● B, C and D
Explanation:
1.In First Come First Serve(FCFS) if a process with a very large Burst Time
comes before other processes, the other process will have to wait for a long
time but it is clear that other process will definitely get their chance to execute,
so it will not suffer from starvation.
2.In Round Robin there is a fixed time quant and every process will get their
chance to be executed, so no starvation is here.
3.In Priority based scheduling if higher priority process keep on coming then
low priority process will suffer from starvation.
4.In Shortest Job First(SJF) if process with short process time keep on coming
continuously then process with higher burst time will do wait and suffer from
starvation.
5.In Shortest remaining time first(SRTF) process with shortest burst time will
execute first because of this process with high burst time may suffer from
starvation. So, option (C) is correct.
Q49.With round robin scheduling algorithm in a time shared system ____________
● using very large time slices converts it into First come First served scheduling
algorithm
● using very small time slices converts it into First come First served scheduling
algorithm
● using extremely small time slices increases performance
● using very small time slices converts it into Shortest Job First algorithm
Explanation: In a time sharing system, each user needs to get a share of the Cup at
regular intervals.
Explanation: The larger the CPU burst, the lower the priority.
Explanation: If another process requests that resource (non – shareable resource), the
requesting process must be delayed until the resource has been released.
● must exist
● must not exist
● may exist
● none of the mentioned
Explanation: They do not require mutually exclusive access, and hence cannot be
involved in a deadlock
Q57. To ensure that the hold and wait condition never occurs in the system, it
must be ensured that ____________
Explanation: c – A process may request some resources and use them. Before it can
can request any additional resources, however it must release all the resources that it is
currently allocated.
Explanation: Resource allocation states are used to maintain the availability of the
already and current available resources.
Q59. What is CPU scheduling ?
● FIFO
● Round robin
● Shortest job next
● None of the above
Explanation: Shortest job next may lead to process starvation for processes which will
require a long time to complete if short processes are continually added.
Q62. The maximum number of processes that can be in ready state for a computer
system with n CPUs is-
● n
● n^2
● 2n
● Independent of n
Q63. Which of the following is False about shortest time first scheduling ?
● only S1
● only S2
● both S1 and S2
● neither S1 nor S2
Explanation: 1. Both SJF and shortest Remaining time first algorithms may cause
starvation. Consider a situation when long process is there in ready
queue and shorter processes keep coming.
2. SJF is optimal in terms of average waiting time for a given set of processes, but
problems with SJF is how to know/predict time of next job.
Q64. Assume every process requires 3 seconds of sevice time in a system with
single processor. If new processes are arriving at the rate of 10 processes per
minute, then estimate the fraction of time CPU is busy in system?
● 20%
● 30%
● 50%
● 60%
Explanation:
10 processes → 1 min
Each process → 3 sec service time 3/6 * 100 = 50% of the time the CPU is busy.
Q65. Which module gives control of the CPU to the process selected by the short
term scheduler?
● Dispatcher
● Interrupt
● scheduler
● None of the mentioned
Q66.The process that are residing in main memory and are ready and waiting to
execute are kept on a list called __________
● Job queue
● Ready queue
● Execution queue
● Process queue
Q68. Which scheduling algorithm allocates the CPU first to the process that
requests the CPU first?
Q70.In priority scheduling algorithm, when a process arrives at the ready queue,
its priority is compared with the priority of ______?
● All process
● Currently running process
● Parent process
● Init process
● Non-preemptive scheduling
● Preemptive scheduling
● All of the above
● None of above
Q78. Which of the following algorithms tends to minimize the process flow time?