0% found this document useful (0 votes)
346 views47 pages

OS DPPs A4

The document discusses operating systems and provides background information on key concepts. It covers topics like operating system modes (kernel vs user), system calls, process management concepts like multi-programming vs uni-programming, and process states. Multiple choice questions are provided to test understanding of these operating system fundamentals.

Uploaded by

Deep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
346 views47 pages

OS DPPs A4

The document discusses operating systems and provides background information on key concepts. It covers topics like operating system modes (kernel vs user), system calls, process management concepts like multi-programming vs uni-programming, and process states. Multiple choice questions are provided to test understanding of these operating system fundamentals.

Uploaded by

Deep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Operating Systems

Intro & Background DPP 01

[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] (a) (i) – 1, 3 (ii) – 2, 4


4. Consider the following statement: (b) (i) – 2, 4 (ii) – 1, 3
(i) User program gets blocked when fork call is (c) (i) – 1, 2 (ii) – 1, 4
executed. (d) (i) – 3, 4 (ii) – 1, 2
(ii) Dispatch table contains information regarding all
system call. [MCQ]
(iii) Fork system call can execute non-atomically in 8. Program counter holds .
system. (a) Address of previous executed instruction.
Which of the following is/are correct? (b) Address of current executing instruction.
(a) Only (i) is correct. (c) Address of next instruction to be executed.
(b) (i) and (ii) are correct. (d) None of these.
(c) (i) and (iii) are correct.
(d) (ii) and (iii) are correct.
Operating System
DPP 02
Process Management

[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

[MCQ] (a) UNIX operating system.


1. The information about a process is maintained in (b) Multiprogramming operating system.
. (c) Uni-programming operating system.
(a) Process Context block which is implemented (d) None of these.
using an Array.
(b) Process Control block which is implemented [MSQ]
using a Stack 5. If the process is in Main memory, then, it can be in
(c) Process Context block which is implemented (a) Ready state
using a Linked list (b) Running state
(d) Process Control block which is implemented (c) Block state
using a Doubly Linked list (d) Suspend state

[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

Calculate the sum of waiting time of process P4 and


[MSQ]
1. Which of the following statements is/are correct average turnaround time using LRTF scheduling
regarding HRRN scheduling algorithm? algorithm? (if burst time of two process is same
(a) It reduces waiting time for longer processes. schedule the process with higher arrival time)
(b) HRRN is preemptive in nature.
(c) HRRN’s response ratio can be calculated as [NAT]
(S + W)/S, where S is the service time and W is 5. Consider the set of 5 processes whose arrival time and
the waiting time. burst time are given below:
(d) HRRN favours job with shorter burst time.
Process Arrival time Burst time
P0 0 4
[MSQ] P1 3 5
2. Consider the below table
P2 4 6
Process Arrival time Burst time P3 5 5
P1 0 7 P4 8 3
P2 2 4 If the CPU scheduling policy is Highest Response
P3 4 1 Ratio Next, X is response ratio of last process
P4 5 4 scheduled, Y is the average turnaround time, and Z is
the average waiting time. Calculate X * Y + Z? (upto 1
Schedule the above processes using SRTF and SJF, decimal point)
and select the correct option from the following.
(a) TAT(SJF) > TAT(SRTF). [MCQ]
(b) Waiting time P4(SJF) > Waiting time P3 (SRTF) 6. Match the following groups.
(c) TAT(SRTF)> TAT(SJF)
Group-I Group-II
(d) Waiting time P2(SRTF)< Waiting time P1(SJF)
A. FCFS 1. Used in time sharing
[NAT] system
3. How many of the following scheduling algorithms may B. SJF 2. Used in real time system
cause starvation? C. Priority scheduling 3. Minimum average
i. First-come-first-serve waiting time
ii. Priority 4. Convoy effect
iii. Shortest process next
iv. Shortest remaining time first (a) A-2, B-1, C-3
(b) A-4, B-3, C-2
[NAT]
4. Consider the following processes: (c) A-2, B-3, C-1
(d) A-4, B-2, C-3
Process Arrival time Burst time
P1 0 5
P2 1 5 [MCQ]
P3 2 5 7. Consider the three processes for a particular system P1,
P2, P3. The arrival time of the processes are 0ms, 5ms
P4 3 5 and 8ms respectively. And the processing times are
15ms, 12ms and 5ms respectively. The three processes
are pre-emptively scheduled on a single-CPU system Process Arrival Time Burst Time
using the shortest remaining processing time first A 0 4
scheduling policy. Which of the following shows the B 2 1
order in which processes are completed? C 4 3
(a) P2, P1, P3 (b) P3, P1, P2 D 5 5
(c) P3, P2, P1 (d) P1, P2, P3
(All time in milliseconds)
[NAT] The average waiting time of processes are
8. Consider the following set of processes with the arrival (ms). (Upto 1 decimal place)
times and burst times. Processes are scheduled using
highest response ratio next.
Operating System
DPP 05
CPU Scheduling
[NAT] [MCQ]
1. Consider the following table 5. Consider the 3 processes, P1, P2 and P3 shown in the
table:
Process P1 P2 P3 P4
Process Arrival Time Burst Time
Arrival Time 0 1 2 3
P1 0 5
Service Time 6 3 1 4 P2 4 7
Find the average turn around time when processes are P3 6 4
scheduled with SRTF. (Upto 2 decimal point) The completion order of the 3 processes under the
policies FCFS and RR2 (round robin scheduling with
[MCQ] CPU quantum of 2-time units) are
2. Consider the following statements: (a) FCFS: P1, P2, P3; RR2: P1, P2, P3
(i) If all jobs arrive at the same point in time, a SJF (b) FCFS: P1, P3, P2; RR2: P1, P3, P2
and an SRTF scheduler will behave the same. (c) FCFS: P1, P2, P3; RR2: P1, P3, P2
(ii) If all jobs arrive at the same point in time and have (d) FCFS: P1, P3, P2; RR2: P1, P2, P3
identical run lengths, a FIFO and a SJF scheduler
will behave the same.
[MSQ]
Which of the following statements is true? 6. Suppose a system has 5 processes A, B, C, D, E all
(a) Only (i) is true. processes are arrived at time 0 and have burst time 4,
(b) Only (ii) is true. 5, 7, 2, 5 respectively. If the time slice for each process
(c) Both (i) and (ii) are true. is 2 unit and each context switch requires one unit of
(d) Both (i) and (ii) are false. time (excluding first and last context switch), then
which of the following statement is correct?
[MCQ] (a) At time 25, Process B is running on the system.
3. Consider the following process table with Arrival and (b) Process E finishes execution at time 31.
Burst time (c) Total CPU overhead activity is 33%.
Process Arrival Time Burst Time (d) Process B finishes its execution before process E
P1 1 2
P2 6 4 [MCQ]
P3 7. In the Round Robin scheduling policy if the time
4 10
P4 quantum used is more than the maximum time required
5 6
to execute any process. Then the policy will .
Average waiting time of these processes by using round (a) Behave same as FCFS.
robin scheduling, where time quantum is 2 unit. (b) Behave same as SJF.
(a) 2.25 (b) 6.25 (c) Behave same as HRRN.
(c) 4.25 (d) 8.25 (d) None of these.

[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] Consider the following statement:


1. What is a compulsory step before using semaphore? (i) The above routine may lead to deadlock.
(a) Deciding final value of semaphore (ii) It is possible for processes x1 and x2 to access
(b) Initialization of semaphore critical section concurrently.
(c) Defining number of operations to be performed
(a) (i) is true and (ii) is false.
(d) All of the above.
(b) (ii) is true (i) is false.
[MCQ] (c) Both (i) and (ii) are true.
2. Consider the following statements, which of the (d) Both (i) and (ii) are false.
following is correct?
(a) Semaphore are atomic in nature and implemented [MCQ]
in user’s mode. 5. Consider the code given below, used by the processes
(b) Semaphore are atomic in nature and implemented x1 and x2 to access critical section.
in kernel mode. The initial value of shared Boolean variable P and Q
(c) Semaphore are non-atomic in nature and are false
implemented in user’s mode. x1 x2
(d) Semaphore are non-atomic in nature and while (P = = Q); while (P! = Q);
implemented in kernel mode. <critical section> <critical section>
P = !(Q); P = Q;
[MCQ] Select the true statements from the following:
3. If a semaphore’s value is “– 3”, then what does (i) Process x2 can go into critical section just after one
magnitude of “– ve” value indicate ? entry by process x1 into its critical section.
(a) Number of successful up operation. (ii) Mutual exclusion is not ensured.
(b) Number of successful down operation. (iii) Process x1 can go into critical section many times
(c) Number of blocked processes. without single entry of x2 into its critical section.
(d) Number of unblocked processes. (iv) None of the above
(a) (i) & (ii)
[MCQ] (b) (ii) & (iii)
4. Processes x1 and x2 uses flag_critical in the following (c) Only (i)
function to achieve mutual exclusion. Assuming (d) (i), (ii), & (iii)
flag_critical is initialized FALSE initially.
get_access [NAT]
{ 6. Consider the two function Pi and Pj that share a
if (flag_critical = = FALSE) variable Q with an initial value ‘3’ execute
{ concurrently:
flag_critical = TRUE;
Critical_section(); Pi() Pj()
{ {
flag_critical = FALSE;
} R = Q * 2: S = Q + 1:
Q = R; Q = S;
}
} }
What are the different possible value for variable Q at Matches:
the end of execution of both process Pi and Pj? A B C
(a) 1 2 3
[MCQ] (b) 3 2 1
7. Match the following statements (c) 2 3 1
(d) 1 3 2
List I List II
A. Critical section 1. Ensuring that only one [NAT]
process can execute C.S. 8. Let S be a binary semaphore variable. Let S = 1
B. Synchronization 2. atomic operation are initially.
used to ensure co- Assume that no blocked processes exist in the system.
operation between The following operations are performed on semaphore
processes. S.
C. Mutual exclusion 3. Section of code that 6 P, 8 V, 12 P, 11 V, 19 P
only one process can The number of blocked processes after executing
access at once. these operations are .
Operating Systems
Process Synchronization/Coordination DPP 08

[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;
} }

void Q(void) void R(void)


{ {
Parbegin Parbegin
4(); 7();
5(); 8();
6(); 9(); (d)
Parend; Parend;
} }

Which of the following output sequences are possible


after the successful completion of P( ) and Q( )?
(a) 1 2 3 4 5 6 7 8 9 (b) 4 1 2 5 3 6 7 9 8
(c) 4 1 5 6 2 4 7 8 9 (d) 9 7 6 1 2 5 6 2 3
[MSQ] [MCQ]
7. Which of the following statement is/are correct? 8. A problem encountered when a process is perpetually
denied for indefinite time from necessary resources
(a) Deadlock is indefinite waiting.
because that resource is currently used by another
(b) Deadlock is infinite waiting. process. Such problem is known as
(c) Starvation is infinite waiting. (a) Deadlock (b) Ageing
(d) Starvation is indefinite waiting. (c) Infinite blocking (d) Starvation
Operating Systems DPP 01
Deadlock
[MSQ] [NAT]
1. Which of the following is not a hardware resource? 6. Consider a system having ‘n’ resources. All these
(a) Semaphore (b) Files resources are shared between four processes P0, P1, P2,
P3 and each process has a demand of 6, 9, 7 and 14
(c) Register (d) CPU
respectively.
What should be the maximum value of ‘n’ in order to
[MCQ] lead the system to deadlock?
2. If a process request is denied by OS and it is blocked
forever, then the process is in .
[MSQ]
(a) Starvation (b) Deadlock 7. Consider the following system state:
(c) Ageing (d) Blocking
Process Allocated Maximum allocation
[MSQ] P1 2 7
3. What are the necessary conditions for deadlock? P2 3 8
(a) Mutual exclusion P3 4 6
(b) Hold and wait
(c) Circular wait There are total 11 resources available, which of the
following sequences will lead system to safe state.
(d) Pre-emption
(a) P1 P2 P3
[MCQ] (b) P1 P3 P2
4. Consider the following statements: (c) P3 P2 P1
(i) Cycle in single instance resource is sufficient and (d) P3 P1 P2
necessary condition for deadlock.
(ii) Cycle in multi-instance resource is necessary and
sufficient condition for deadlock. [NAT]
Which of the following is correct? 8. Consider a system with five processes A, B, C, D and
(a) Only (i) is correct E. The requirements of resources to complete
(b) Only (ii) is correct execution by A, B, C, D and E are 7, 6, 8, 12 and 11
(c) Both (i) and (ii) are correct respectively. Then, what is the minimum number of
resources required to avoid deadlock in such a
(d) Both (i) and (ii) are incorrect
system?
[MSQ]
5. In which deadlock handling strategy, deadlock can [NAT]
never occur? 9. If a system has 8 processes, each process needs
(a) Deadlock avoidance maximum of 4 instances of a resources ‘R’, what is
(b) Deadlock recovery the maximum value of resources, so that the system is
(c) Deadlock removal in deadlock?
(d) Deadlock prevention
Operating Systems
Memory Management DPP 01

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

(a) All (i), (ii) and (iii) are correct.


[MCQ]
(b) (ii) and (iii) are correct. 5. Consider the following statements:
(c) (i) and (iii) are correct.
(i) Next fit may execute faster than first fit.
(d) (i) and (ii) are correct.
(ii) Worst fit suffers from internal fragmentation
Which of the following statements is CORRECT?
[MSQ]
3. Which of the following statements is/are TRUE? (a) Only (i) is correct.
(a) In fixed length partition, each memory partition (b) Only (ii) is correct.
should be of same size. (c) Both (i) and (ii) are correct.
(b) Memory address protection is done with the help (d) None of these
of registers.
(c) Free-space management is done using binary bits. [MCQ]
(d) In fixed-length partition, two program can reside 6. Match the following:
in one partitions.
(i) Fixed (1) Suffers from external fragmentation.
partition (2) suffers from internal fragmentation.
[NAT]
(ii) Variable (3) Flexible degree of multiprogramming.
4. Consider the following diagram representing a
program, blocks connected horizontally are partition (4) Preferred allocation policy is worst fit.
independent modules and blocks connected vertically (5) Preferred allocation policy is best fit.
are dependent modules.
(a) 1-(i), 2-(ii), 3-(i), 4-(ii), 5-(i) (a) P4, P1, P3, 400 KB wait.
(b) 1-(ii), 2-(i), 3-(ii), 4-(ii), 5-(i) (b) P1, P2, P3, 25 KB wait.
(c) 1-(i), 2-(i), 3-(ii), 4-(i), 5-(ii) (c) P4, P2, P3, 400 KB wait.
(d) 1-(ii), 2-(ii), 3-(i), 4-(i), 5-(ii)
(d) P3, P2, P4, 300 KB wait.

[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

Operating Systems DPP 06


Memory Management
[MCQ] [NAT]
1. A computer system has a physical address of 128 bits 6. Consider a virtual memory system with physical
and a page size of 32 KB. Each page table entry memory of 8GB. A page size of 8KB and 46-bit virtual
contains 4 valid and 2 dirty bits along with the address. Assume every page table exactly fits into a
translation bits. If the maximum size of the page table single page. If page table entry size is 4 bytes the how
of a process is 60MB. Calculate the size of logical many levels of page tables would be required?
address space supported by the system (in GB)?
(a) 512 (b) 32 [NAT]
(c) 128 (d) 64 7. Consider the following statements:
I. Overlays are used to increase the size of physical
[NAT] memory.
2. Consider a system with 512 KB page size and each II. The size of virtual memory depends on the size of
page table entry requires 8 bytes. The level of paging main memory.
required to map a 30bit logical address if every page III. Aging is used to keep track of number of times a
table fits into a single page are . page is referenced.
How many of the above are correct statements?
[NAT]
3. A computer system implements a 36 bits virtual [NAT]
address. Page size to 64KB and the size of physical 8. A processor can support a maximum memory of 8 GB,
memory is 34 bits. The approximate size of page table where the memory is word addressable (each word
in the system is MB. [Assume memory is byte consists 4 bytes). The size of address bus of the process
addressable] is at least bits.

[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

[NAT] access time. Then, which of the fallowing relation are


1. Consider the following statements: correct regarding access time.
(i) Paging never suffers from internal fragmentation. (a) x > y = z
(ii) Segmentation never suffers from external (b) x < y = z
fragmentation. (c) x < y < z
(iii) Segmentation may suffer from internal (d) x > y > z
fragmentation.
How many of the above statements are correct? [MCQ]
5. The size of virtual memory is limited by .
[MSQ] (a) Main memory size.
2. Consider the following segment table: (b) Capacity of page table registers.
(c) Logical address space.
Segment No. Base Length (d) Disk size.
0 5519 400
1 2500 15
[MCQ]
2 100 500
6. How many levels of paging is required if it is desired
3 1257 600
to limit page table to 1 page by assuming page size =
4 1859 500
4KB, e = 4B, LA = 64 bits.
Which of the following logical address will generate (a) 1 (b) 2
trap addressing error? (c) 4 (d) 6
(a) 0000110011010
(b) 0010000001111 [NAT]
(c) 0100100101100 7. Consider a system using segmented paging
(d) 1000111110011 architecture, where segment is divided into 16K pages
each of size 4KB and segment table is divided into 8k
[MCQ] pages of each size of 2KB (Byte addressable memory)
3. Virtual memory can be implemented using . PAS is 64MB, then calculate page table size of
(a) Thrashing (b) Segmentation segment (in MB).
(c) Demand paging (d) None of these

[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

[NAT] 10, 2, 7, 4, 9, 10, 4, 7, 3, 2, 4. Which of the statement


1. Given 3 page frames and page references are in the is true with respect to page replacement policies, first
order: in first out (FIFO) and least recently used (LRU)?
2, 3, 4, 5, 2, 3, 6, 2, 3, 4, 5, 6. By using LRU page (a) Page faults in FIFO is more than LRU.
replacement algorithm. The number of page faults will (b) Page faults in LRU is more than FIFO.
occur. (c) Both LRU and FIFO has some number of page
faults .
[MSQ] (d) Page faults in FIFO has 2 more than LRU.
2. Which of the following are virtual memory policies?
(a) Page replacement [MSQ]
(b) Page reduction 6. The Belady’s phenomenon is commonly experienced
(c) Page selection in
(d) Page fault. (a) First in first out
(b) Second chance algorithm
[MCQ] (c) Random page replacement algorithm
3. Suppose there are 4 frames in memory and consider the (d) Least recently used algorithm
following reference string:
A, B, E, D, C, E, F, A, G, E, D, C, A, C, B. [NAT]
Which of the following is correct? 7. Given reference to the following page by a program :
(a) FIFO has less page faults then LRU. 1, 10, 1, 2, 9, 2, 9, 8, 9, 8, 2, 3, 9, 3, 8, 9, 3, 4, 9, 3
(b) LRU has less page faults then FIFO. If the program contains 4 page frames. How many page
(c) Both FIFO and LRU has equal page faults. fault will occur in optimal page replacement policy?
(d) FIFO has 12 page fault.
[NAT]
[NAT] 8. Given 3 pages frames and page references in the order:
4. Consider a system with page fault service time of 158ns 2, 3, 4, 5, 2, 3, 6, 2, 3, 4, 5, 6. By using optimal
and page fault hit ratio is 75%. If memory dues time is page replacement algorithm, the number of pages
faults will be?
10ns then effective memory access time (EMAT) is?

[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

[MCQ] What is the average services time to access a


1. What is cluster in a disk architecture? singledisk blocks form a random location on the
(a) It is a group of one or more sectors on same track. disk?
(b) It is a collection tracks on same cylinder. (a) 15.38 ms (b) 14.28 ms
(c) It is a group of one or more track one same platter. (c) 16. 48 ms (d) 13.18 ms
(d) It is a collection of platter on the disk.
[NAT]
[NAT] 6. A hard disk has 20 surface with 100 tracks for surface
2. Consider the following disk specifications. and 16 sectors per track. The disk transfer rate is 106
Number of platters = 8 bytes/sec, page size is 512 bytes and the process size is
Number of tracks per surface = 512 2048 bytes, and seek time is 25 msec. The disk is
Number of sectors per track = 4096 rotating at 300 rpm. What is the total swap time (in ms)
Sector offset = 15 ? [upto three decimal places]
Calculates the unformatted capacity (in GB)?
[NAT]
[NAT] 7. Consider a typical disk that rotates at 20000 RPM and
3. In a computer system, a disk track can hold 32 sectors has a transfer rate of 32kBps. If the average seek time
each having size of 256 bytes. The relation rate 2000 is 6 msec. and the controller’s transfer time is twice of
rpm. The data rate of disk is KB. the disk transfer time, the average time need to read or
write a 1024 bytes sector of disk is msec. (upto
[MCQ] 1 decimal places)
4. A disk rotates at 7200 RPM. It has 500 sectors of 512
bytes each around the outer cylinder. How long does it [MSQ]
take to read a sector? 8. Two steps performed by operating system to uses a
(a) 14.87  sec. (b) 15.67  sec. disk to hold disk its files are .
(a) partitioning
(c) 13.87  sec. (d) 16.67  sec.
(b) Logical formatting
(c) Caching
[MCQ]
(d) Swapping
5. Consider the following disk specifications:
• A 10 GB disk rotates at 10,000 rpm
• Data transfer rates is 107 bytes/sec.
• Average seek time 8 ms.
• Blocks size is 32 KB.
Operating Systems DPP 02
File System & Device Management
[NAT] serve this request. When 4 ms time is needed to move
1. Consider a disk queue with request for I/O to block on head from one cylinder to another. The C-lock
cylinders 53, 98, 140, 59, 115, 185, 197, 86. The SCAN algorithm is used.
algorithm as used. The head is initially at 100 moving
towards left. The cylinders are numbered from 0 to [MSQ]
199. The total head movement incurred while servicing 6. Choose the correct statements from following
these request is . (a) A record is a collection of related fields that can
be treated as a unit by some application program.
[MCQ] (b) A file is a collection of similar records.
2. Consider the following statements: (c) A database is a collection of non-related data.
S1: Loop instructions cannot be interrupted till they (d) A field is the basic element of data
complete.
S2: Nearest cylinder next disk scheduling strategy
gives the best through put in comparison to first [MCQ]
come first serve scheduling strategy. 7. Each Inode in a file system has 6 direct pointers to disk
S3: Using large file block size in a fixed block size blocks, 4 single-indirect pointers to disk blocks, 3
file system leads poor disk through put. double-indirect pointers to disk blocks and nothing
Which of the above statements are incorrect? else. A disk block is 500 bytes, and a pointer to disk
(a) Only S1 (b) Only S1, S2 and S3 block is of 10 bytes. The entire disk consists
(c) Only S1 and S3 (d) Only S2 17,000,000 bytes at most. Calculate the maximum size
[in byte] of a file in this file system.
[NAT] (a) 3850000 (b) 3853400
3. Consider a disk has 100 numbered from 0 to 99. At (c) 3853200 (d) 3853000
some time the disk arm is at cylinder 40 and there is a
queue of disk access request for cylinder 16, 35, 25, 60,
80, 90 and 20. If Shortest seeks time first (SSTT) is [MCQ]
being used for scheduling disk access, the request for 8. In a UNIX OS, each data block is of 512 bits, each node
cylinder 60 is serviced after servicing the number of has 5 direct data block addresses and three additional
request . addresses. One for single indirect block, one is for
double indirect block and one is for triple indirect
[NAT] block. Each block is addressed with 128-bit. Calculate
4. An unix style I-node has 10 direct pointers and two the total size of a file possible in the file system (in k-
single 5 double and 2 triple Indirect pointers. Disk bits).
block size is of 8 KB, disk block address is 32 bits. The (a) 81.91 to 81.92 (b) 82.91 to 82.92
maximum possible file size is TB. (c) 80.91 to 80.92 (d) None of these

[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

[NAT] What will be the number of child processes/newly


1. Consider the below code segment. Total new process created processes for the above code?
created is
[MCQ]
#include<stdio.h>
3. Match List – I and List – II and select the correct
int main () answer using the code given below:
List – 1 List – II
{ A. Context switching 1. Process creation
int i; B. Degree of multi 2. Dispatcher
programming
for (i=0; i<5, i+=2) C. Message passing 3. Long term scheduler
{ D. Fork() 4. Inter process
communication
switch(i) Codes:
{ A B C D
(a) 3 1 2 4
Case 0: fork(); (b) 2 3 4 1
(c) 1 3 4 2
Case 1: fork(); fork();
(d) 4 2 1 3
Case 2: fork(); fork(); break;
[MCQ]
Case 3: fork(); fork(); fork(); break;
4. To access the services of operating system, the
Case 4: for (j = i, j >= 1, j --) fork(); interface is provided by the
(a) System call
}
(b) API
} (c) Library
(d) Assembly Instructions.
return 0;
} [MCQ]
5. The following program fragment prints the strings
“GATE2023” how many number of times?
main ()
[NAT] {
2. Consider the following code: fork ();
main() fork ();
printf(“GATE2023”\n);
{ }
(a) 1 (b) 2
for(int i = 1, i<= 5; i++)
(c) 4 (d) 8
fork ()
}
[MCQ] S3: kernel – level threads can be scheduled
6. Which of the following scheduling can be done by independently.
thread library? (a) S1 and S3 only
(a) User thread scheduling (b) Only S2
(b) Process Scheduling (c) Only S3
(c) Kernel thread scheduling (d) S2 and S3 only
(d) None of the above.
[MSQ]
9. What are the types of system calls in an operating
[MCQ] system?
7. Consider the following code: (a) Process control, file management
void main() (b) Device management.
{ (c) Communication.
for (int k = 1; k < 5; k++) (d) Information maintenance.
pid[k] = fork();
} [MCQ]
How many child processes created by the above code: 10. Which of the following operations require the
(a) 15 (b) 4 executing code to be operating with Kernal mode?
(c) 32 (d) 16 (a) Performing semaphore ‘P’ operation
(b) Making system call
[MCQ] (c) Disabling interrupt
8. Consider the following statements with respect to user- (d) Both (a) and (c)
level threads and kernel – level threads.
S1: Context switching in kernel level threads is faster
than user level threads.
S2: If one thread of user – level gets blocked, entire
process also gets blocked.

You might also like