OS Question Bank
OS Question Bank
OS Question Bank
b. Bounded operating systems consume fewer system resources because they do not
need to support dynamic expansion.
c. Unbounded operating systems utilize system resources more efficiently due to their
fixed feature set.
a. Data Section
b. Stack
c. Heap
d. Text Section
a. Program Code
d. Accounting Information
a. Operating System
b. Kernel
d. Firmware
5. The process of exchanging information, on the same computer or between
computers over a network is known as:
a. Communication
b. System Calls
c. Networking
d. I/O operations
d. Priority Scheduling
a. Mutex locks are used to maximize parallelism by allowing multiple threads to access
critical regions simultaneously.
b. Mutex locks are employed to introduce delays in accessing critical regions, ensuring fair
resource allocation among threads.
c. Mutex locks are utilized to protect critical regions and prevent race conditions by
allowing only one thread at a time to access them.
d. Mutex locks are primarily used to terminate threads that attempt to access critical
regions concurrently.
10. In which scheduling algorithm does the process with the shortest next CPU burst
time get selected?
c. Priority Scheduling
b. User layer - Kernel layer - System Call Inference layer - Hardware layer
c. Hardware layer - System Call Inference layer - Libraries layer - User Interface layer
d. User layer - Libraries layer - Kernel layer - System Call Inference layer
14. Which statements accurately describe APIs in the context of operating systems?
c. APIs do not provide a higher-level abstraction for accessing OS features and services.
d. APIs define the syntax, semantics, and behavior of functions and data structures that
applications can use to interact with the OS.
b. A program responsible for loading the initial instructions of the operating system into
memory and starting its execution
b. A way for applications to request services or resources from the operating system
c. Interfaces for interaction between applications and the operating system kernel
18. Which of the following are NOT typical steps in operating system debugging?
a. CreateFile()
b. read()
c. write()
d. Sleep()
a. Seconds
b. Milliseconds
c. Microseconds
d. Nanoseconds
Ans. D
23. SJF: Without Arrival Time
Ans. A
Options:
a) I and II
b) II and III
c) III and IV
d) IV and I
Answer:C
Answer: D
Answer: C
Answer: D
Answer: C
Answer:b
In a single processor system which scheduling algorithm results the maximum throughput
a) Shortest Job First
b) Round Robin
c) Longest Job First
d) Highest Response First
Answer: a
Which one of the following is not the goal of the CPU scheduling algorithm
a) Maximizing the burst time
b) Minimizing the response time
C) Minimizing the average waiting time
d) Minimizing the turn-around time
Answer: a
a) I only
b) I and III only
c) II and III only
d) I and II and III
Answer: d
In which situation a currently running process always moves from running to ready state
i) When a higher priority process enters into the ready state
ii) When the running process demands an Input/Output operation
iii) When a new process arrives in the ready state
iv) When the running process gets suspended
v) When a block process resumes to ready state
vi) When time quanta of the running process expires
Options:
a) I and V
b) II and III
c) I and VI
d) III and V
e) III,IV,V and VI
Answer: c
Three processes A,B and C each execute a loop of 50 iterations. In each iteration of the loop,
a process performs a single computation that requires tc CPU milliseconds and then initiates a single
I/O operation that lasts for tio milliseconds. It is assumed that the computer where the processes
execute has sufficient number of I/O devices and the OS of the computer assigns different I/O
devices to each process. Also the scheduling overhead of the OS is negligible. The processes have
the following characteristics
Process ID Arrival Time tc tio
P1 0 100ms 450ms
P2 5 350ms 450ms
P3 10 200ms 250ms
The system is using round robin CPU scheduling with time quanta of 50ms. The time in milliseconds
at which the process C would complete its first I/O operation is
a) 750ms
b) 1000ms
c) 500ms
d) 1250ms
Answer :a
Consider the peterson’s algorithm for mutual exclusion between two concurrent processes K and L.
The program executed by process is shown below.
While(True)
{
Interested[k]=true;
Turn =L
While(X);
Enter critical section,
Perform action
Exit critical section
Interested[k]=False
}
For the program to guarantee mutual exclusion the predicate X in the while loop should be
a) Interested[L]==True and Turn ==L
b) Interested[L]!=True and Turn ==L
c) Interested[k]==True and Turn ==k
d) Interested[k]==True and Turn ==L
Answer:a
Consider three processes P0,P1 and P2, all arriving at time zero, with 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 a shortest remaining compute time first scheduling algorithm and schedules a new
process either when the running process get blocked on I/O or when the running process finishes
its compute burst . Assume that all I/O operation can be overlapped as much as possible. For how
much time the processes have waited for the processor?
a) P0:0, P1:7,P2:15
b) P0:0, P1:5,P2:17
c) P0:2,P1:5,P2:15
d) P0:2,P1:7,P2:17
Answer: b
If the time quanta used in the round robin scheduling policy is more than the maximum time required
to execute any process, then the policy will be
a) The policy will become first come first serve
b) The policy will become priority scheduling
c) The policy will become shortest come first
d) The policy will become shortest remaining first
Answer : a
In a computer system having single processor, has two processes, both are having alternate 10ms
CPU bursts with 90ms I/O bursts. Both the processes are created nearly at the same time. The input
output operation of both processes can proceed in parallel. Which one of the following scheduling
strategies will result in the least CPU utilization (over a long period of time)
a) First come first serve
b) Static priority scheduling with different priorities for the two processes
c) Round Robin with time quanta of 10ms
d) Round robin with time quanta of 5 ms
Answer: d
Each process Pi =1…….13 is coded as follows
While(True)
{
P(mutex)
{critical section}
V(mutex)
}
The code for P14 is identical except that it uses V(mutex) in place of P(mutex). What is the largest
number of processes that can be inside the critical section at any moment.
a) 2
b) 14
c) 1
d) 7
Answer:b
Consider ‘m’ processes sharing the CPU in a round robin fashion. Assuming that each process switch
takes ‘k’ seconds , what must be the quantum size Q such that overhead resulting from process
switching is minimized but at the same time each process is guaranteed to get its turn at the CPU at
least every ‘h’ seconds? (4 Marks)
a) Q≥(h-mk/m-1)
b) Q≤ (h-mk/m-1)
c) Q≤(k-mh/m+1)
d) Q≥(k-mh/m+1)
Answer: b
Consider three processes, all arriving at time zero, with total execution time of 10,20 and 30 units
respectively. Each process spends the first 30% of execution time doing I/O, the next 60% of time
doing computation and the last 10% of time doing I/O again. The operating system uses a shortest
remaining compute time first scheduling algorithm and schedules a new process either when the
running process get blocked on I/O or when the running process finishes its compute burst .
Assume that all I/O operation can be overlapped as much as possible. For what percentage of time
does the CPU remain Idle.
a) 10.64%
b)14.28%
c)89.42%
d)23.07%
Answer : b
Consider the following table of arrival time and burst time for three processes P0,P1 and P2
Process Arrival Time Burst Time
P1 0 9ms
P2 1 4ms
P3 3 5ms
The round robin scheduling algorithm is used with time quanta of 2 ms. What will be the average
turnaround time of the processes.
a)11.5 ms
b)12.4 ms
c)15.3 ms
d)13.6 ms
Answer : d
Consider 3 processes A, B and C to be scheduled as per the SRTF algorithm. The processes ‘A’ is
known to be scheduled first and when ‘A’ has been running for 7 units of time, the process C has
arrived . The process ‘C’ has run for 1 unit of time the process B has arrived and completed running
in 2 units of time. Then what could be the minimum burst time of the processes A and C.
a) 11 and 4
b) 11 and 3
c)12 and 4
d) 10 and 3
Answer: c
Consider the below given table and find out the average waiting time of the processes if highest
response ration algorithm is applied for CPU scheduling.
Options:
a)5.4 ms
b)4.6 ms
c)5.2 ms
d)4.8 ms
Answer :d
In a timeshare operating system, when the time slot assigned to a process is completed, the process
switches from the current state to?
a) Suspended state
b) Terminated state
c) Ready state
d) Blocked state
ANS: C
In real time operating system ____________
a) Process scheduling can be done only once
b) All processes have the same priority
c) Kernel is not required
d) A task must be serviced by its deadline period
ANS: D
ANS: B
The address of the next instruction to be executed by the current process is provided by the
__________
a) CPU registers
b) Program counter
c) Process stack
d) Pipe
ANS: B
Which state of a process defined "The process is waiting for some event to occur (such as an I/O
completion or reception of a signal)"
a) Ready
b) Running
c) Waiting
d) Terminated
ANS: C
To access the services of the operating system, the interface is provided by the ___________
a) Library
b) System calls
c) Assembly instructions
d) API
ANS: B
Which of the following state transitions is not possible?
a) Blocked to running
b) Ready to running
c) Blocked to ready
d) Running to blocked
ANS: A
Which of the following scheduling algorithms is used in real-time systems to ensure that critical tasks
meet their deadlines?
a) First-Come, First-Served (FCFS)
b) Shortest Job Next (SJN)
c) Round Robin (RR)
d) Rate-Monotonic Scheduling (RMS)
Ans: A
Consider the following set of processes, the length of the CPU burst time given in milliseconds.
Process Burst time
P1 6
P2 8
P3 7
P4 3
Assuming the above process being scheduled with the SJF scheduling algorithm.
a) The waiting time for process P1 is 0ms
b) The waiting time for process P1 is 3ms
c) The waiting time for process P1 is 9ms
d) The waiting time for process P1 is 16ms
ANS: B
Once the process is allocated the CPU and is executing, which of several events could occur:
I. The process could issue an I/O request and then be placed in an I/O queue
II. The process could create a new child process and wait for the child’s termination.
III. The process could be removed forcibly from the CPU, as a result of an interrupt, and be put back
in the ready queue.
a) Only 1
b) 1 and 2
c) 1, 2,3
d) 2 and 3
ANS:C
Which of the following state transitions is not possible?
a) Blocked to running
b) Ready to running
c) Blocked to ready
d) Running to blocked
ANS: A
Which of the following scheduling algorithms is used in real-time systems to ensure that critical tasks
meet their deadlines?
a) First-Come, First-Served (FCFS)
b) Shortest Job Next (SJN)
c) Round Robin (RR)
d) Rate-Monotonic Scheduling (RMS)
Ans: A
Consider the following set of processes, the length of the CPU burst time given in milliseconds.
Process Burst time
P1 6
P2 8
P3 7
P4 3
Assuming the above process being scheduled with the SJF scheduling algorithm.
a) The waiting time for process P1 is 0ms
b) The waiting time for process P1 is 3ms
c) The waiting time for process P1 is 9ms
d) The waiting time for process P1 is 16ms
ANS: B
With _____________ only one process can execute at a time; meanwhile all
other process is waiting for the processor. With ______________ more than
one process can be running simultaneously each on a different processor.
a) Multiprocessing, Multiprogramming
b) Multiprogramming, Uni-processing
c) Multiprogramming, Multiprocessing
d) Uni-programming, Multiprocessing
ANS: D
ANS: A
a) A section of code that is critical for the proper functioning of the program
b) A section of code that must be executed atomically by only one process
or thread at a time
c) A section of code that handles error conditions
d) A section of code that performs I/O operations
ANS: B
Consider the set of 6 processes whose arrival time and burst time are given
below:
Process Id Arrival time Burst time
P1 0 7
P2 1 5
P3 2 3
P4 3 1
P5 4 2
P6 5 1
If the CPU scheduling policy is the shortest remaining time first, the average
turnaround time will be………….
a) 7.17
b) 6.17
c) 8.27
d) 5.67
ANS: A
Consider the set of 6 processes whose arrival time and burst time are given
below:
Process Id Arrival time Burst time
P1 5 5
P2 4 6
P3 3 7
P4 1 9
P5 2 2
P6 6 3
If the CPU scheduling policy is Round Robin with time quantum = 3, the
average waiting time is equal to ………..
a) 17
b) 14
c) 15
d) 16
ANS: D
Consider the set of 3 processes whose arrival time and burst time are given
below
If the CPU scheduling policy is SRTF, the average waiting time and average
turnaround time is calculated as
a) 12.33, 10
b) 11.22, 6
c) 12.33, 5
d) 11.22, 10
ANS: C
For process P1, P2, P3, P4, P5 How many time the following function print
“Semaphore”. If Semaphore is initialized by 0?
Do
{
wait (S);
{
While(s<=0);
{
s=s-1;
Print (“Semaphore”);
}
signal(s);
{
s=s+1;
}
}
a) None
b) 2
c) 3
d) 1
Ans: A
What is the mean of the Booting in the operating system?
a) Restarting computer
b) Install the program
c) To scan
d) To turn off
Ans. a
Which one of the following errors will be handle by the operating system?
a) lack of paper in printer
b) connection failure in the network
c) power failure
d) all of the mentioned
Ans. d
A thread shares its resources (like data section, code section, open files,
signals) with ___________
a) other process similar to the one that the thread belongs to
b) other threads that belong to similar processes
c) other threads that belong to the same process
d) all of the mentioned
Ans. b
With _____________ only one process can execute at a time; meanwhile all
other process are waiting for the processor. With ______________ more than
one process can be running simultaneously each on a different processor.
a) Multiprocessing, Multiprogramming
b) Multiprogramming, Uniprocessing
c) Multiprogramming, Multiprocessing
d) Uniprogramming, Multiprocessing
Ans. d
. Which of the following statements are true?
I. Shortest remaining time first scheduling may cause starvation
II. Preemptive scheduling may cause starvation
III. Round robin is better than FCFS in terms of response time
a) I only
b) I and III only
c) II and III only
d) I, II and III
Ans. d
Consider the following set of processes, the length of the CPU burst time
given in milliseconds.
Process Burst time
P1 6
P2 8
P3 7
P4 3
Assuming the above process being scheduled with the SJF scheduling
algorithm.
a) The waiting time for process P1 is 0ms
b) The waiting time for process P1 is 3ms
c) The waiting time for process P1 is 9ms
d) The waiting time for process P1 is 16ms
Ans. b
Mutual exclusion implies that ____________
a) if a process is executing in its critical section, then no other process must
be executing in their critical sections
b) if a process is executing in its critical section, then other processes must be
executing in their critical sections
c) if a process is executing in its critical section, then all the resources of the
system must be blocked until it finishes execution
d) none of the mentioned
Ans. a
Consider a transaction T1 that was committed before the checkpoint. The <T1
commits> record appears in the log before the <checkpoint> record. Any
modifications made by T1 must have been written to the stable storage either
with the checkpoint or before it. Thus at recovery time ____________
a) There is a need to perform an undo operation on T1
b) There is a need to perform a redo operation on T1
c) There is no need to perform an undo and redo operation on T1
d) All of the mentioned
Ans. c
The portion of the process scheduler in an operating system that dispatches
processes is concerned with ____________
a) assigning ready processes to CPU
b) assigning ready processes to waiting queue
c) assigning running processes to blocked queue
d) all of the mentioned
Ans. a
A) 8 B) 12 C) 9 D) 11
Answer A) 8
Consider the set of 5 processes whose arrival time and burst time are given
below-
If the CPU scheduling policy is SJF preemptive, calculate the average waiting
time.
A) 3.8 unit B) 4.4unit C) 4.2 unit D) 3.9 unit
Answer A) 3.8 unit
Consider the set of 6 processes whose arrival time and burst time are given
below-
If the CPU scheduling policy is Round Robin with time quantum = 3, calculate
the average waiting time and average turnaround time.
A) 21.33 unit and 16 unit
B) 22.23 unit and 8.21 unit
C) 19.8 unit and 17.14 unit
D) 19.34 unit and 18.44 unit
Answer (A)
Consider the set of 5 processes whose arrival time and burst time are given
below-
Process Id Arrival time Burst time Priority
P1 0 4 2
P2 1 3 3
P3 2 1 4
P4 3 5 5
P5 4 2 5
Answer: (B)
Process Q:
while (1) {
Y:
print '1';
print '1';
Z:
}
Synchronization statements can be inserted only at points W, X, Y and Z
Which of the following will ensure that the output string never contains a
substring of the form 01^n0 or 10^n1 where n is odd?
(A) P(S) at W, V(S) at X, P(T) at Y, V(T) at Z, S and T initially 1
(B) P(S) at W, V(T) at X, P(T) at Y, V(S) at Z, S and T initially 1
(C) P(S) at W, V(S) at X, P(S) at Y, V(S) at Z, S initially 1
(D) V(S) at W, V(T) at X, P(S) at Y, P(T) at Z, S and T initially 1
Answer: (C)
At a particular time of computation the value of a counting semaphore is 7.
Then 20 P operations and xV operations were completed on this semaphore.
If the new value of semaphore is 5, x will be
a)18
b)22
c)15
d)13
answer 'A'.
Two concurrent processes P1 and P2 use four shared resources R1, R2, R3
and R4, as shown below.
P1 P2
Compute: Use R1; Use R2; Use R3; Use R4; Compute; Use R1; Use R2;
Use R3;. Use R4;
Both processes are started at the same time, and each resource can be
accessed by only one process at a time The following scheduling constraints
exist between the access of resources by the processes:
• P2 must complete use of R1 before P1 gets access to R1
• P1 must complete use of R2 before P2 gets access to R2.
• P2 must complete use of R3 before P1 gets access to R3.
• P1 must complete use of R4 before P2 gets access to R4.
There are no other scheduling constraints between the processes. If only
binary semaphores are used to enforce the above scheduling constraints,
what is the minimum number of binary semaphores needed?
(A) 1
(B) 2
(C) 3
(D) 4
Answer (b)
Suppose we want to synchronize two concurrent processes P and Q using
binary semaphores S and T. The code for the processes P and Q is shown
below.
Process P:
while (1) {
W:
print '0';
print '0';
X:
}
Process Q:
while (1) {
Y:
print '1';
print '1';
Z:
}
Answer: (B)
A. 2
B. 2n
C. 2n
D. 2n-1
In order to avoid deadlock, the correct operators at L1, L2, L3 and L4 are
respectively
a)P(SY), P(SX); P(SX), P(SY)
b)P(SX), P(SY); P(SY), P(SX)
c)P(SX), P(SX); P(SY), P(SY)
d)P(SX), P(SY); P(SX), P(SY)
Correct answer is option 'D'
Consider the following set of process that arrive at time 0, with the length of
CPU burst given in milliseconds. Calculate the average waiting time when the
processes arrive in the following order:
a. P1, P2, P3 P4 P5
Consider the set of 6 processes whose arrival time and burst time are given
below: -
Consider a set of 5 processes whose arrival time. CPU time needed and the
priority are given below
smaller the number, higher the priority. If the CPU scheduling policy FCFS,
What will be the the average waiting time?
Consider a computer system that supports 32-bit physical as well
as virtual addresses. Now since the space of the physical address is the same
size as the virtual address, the OS designers would decide to entirely get rid
of its virtual memory. Which one of these is true in this case
A. It is no longer possible to efficiently implement multi-user support
B. It is possible to make CPU scheduling more efficient now
C. There would no longer be a requirement for hardware support for memory
management
D. It would be possible to make the processor cache organisation more
efficient no
Ans D
Ans B
A. Priority Scheduling
A. On per thread basis, the operating system maintains only CPU register
state
D. On per thread basis, the operating system maintains only scheduling and
accounting information
D. All of these
Each process has a segment of code, called a ____________, in which the process
A. None-critical section
B. Critical section
C. Exit Section
D. Entry Section
Under nonpreemptive scheduling, once the CPU has been allocated to a process, the
A. 1 and 2
B. 1,2,3
C. 2,3,4
D. 1,2,3,4
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.
A. Shortest-Job-First Scheduling
B. Priority Scheduling
D. Round-Robin Scheduling
Consider the set of 3 processes whose arrival time and burst time are
given below
If the CPU scheduling policy is SRTF, the average waiting time and average
turnaround time is calculated as
A. 12.33, 10
B. 11.22, 6
C. 12.33, 5
D. 11.22, 10
Ans c
Consider the following set of processes, the length of the CPU burst time
given in milliseconds.
P0 6
P1 8
P2 7
P3 3
Ans c
Consider the set of 5 processes whose arrival time and burst time are given
below.
If the CPU scheduling policy is Round Robin with time quantum = 2 unit,
average turnaround time is calculated as
A. 8
B. 7.6
C. 8.2
D. 8.6
Ans d
5 If the Disk head is located initially at 32, find the number of disk
moves required with FCFS if the disk queue of I/O blocks requests are 98,
37,14,124,65,67.
Ans D
In a critical section problem, if two processes attempt to enter their critical sections
simultaneously, what issue can occur?
1) Deadlock
2) Race condition
3) Starvation
4) Thrashing
Answer: 2) Race condition
. The switching of the CPU from one process or thread to another is called
____________
1) process switch
2) task switch
3) context switch
4) all of the mentioned
Answer:3) context switch
The processes that are residing in main memory and are ready and waiting to
execute are kept on a list called _____________
1) job queue
2) ready queue
3) execution queue
4) process queue
Answer: 2) Ready queue
To access the services of operating system, the interface is provided by the
___________
a) System calls
b) API
c) Library
d) Assembly instructions
Answer(a) Which one of the following is not true?
a) kernel is the program that constitutes the central core of the operating system
b) kernel is the first part of operating system to load into memory during booting
c) kernel is made of various modules which can not be loaded in running operating
system
d) kernel remains in the memory during the entire computer session.
Answer (c)
The OS X has ____________
a) monolithic kernel
b) hybrid kernel
c) microkernel
d) monolithic kernel with modules
Answer (b)
The systems which allow only one process execution at a time, are called
__________
a) uniprogramming systems
b) uniprocessing systems
c) unitasking systems
d) none of the mentioned
Answer (b)
In operating system, each process has its own __________
a) address space and global variables
b) open files
c) pending alarms, signals and signal handlers
d) all of the mentioned
Answer (d)
The number of processes completed per unit time is known as __________
a) Output
b) Throughput
c) Efficiency
d) Capacity
Answer (b)
Which of the following do not belong to queues for processes?
a) Job Queue
b) PCB queue
c) Device Queue
d) Ready Queue
Answer (b)
What is a medium-term scheduler?
a) It selects which process has to be brought into the ready queue
b) It selects which process has to be executed next and allocates CPU
c) It selects which process to remove from memory by swapping
d) None of the mentioned
Answer (c)
Restricting the child process to a subset of the parent’s resources prevents
any process from __________
a) overloading the system by using a lot of secondary storage
b) under-loading the system by very less CPU utilization
c) overloading the system by creating a lot of sub-processes
d) crashing the system by utilizing multiple resources
Answer (c)
With _____________ only one process can execute at a time; meanwhile all
other process are waiting for the processor. With ______________ more than one
process can be running simultaneously each on a different processor.
a) Multiprocessing, Multiprogramming
b) Multiprogramming, Uniprocessing
c) Multiprogramming, Multiprocessing
d) Uniprogramming, Multiprocessing
Answer (d)
Which of the following scheduling algorithms gives priority to the process with the
smallest execution time?
A) Round Robin
B) Shortest Job Next (SJN)
C) First Come First Serve (FCFS)
D) Priority Scheduling
What is the role of the 'fork' system call in Unix-like operating systems?
A) To create a new process.
B) To terminate the currently running process.
C) To allocate memory for a new process.
D) To change the ownership of a file.
I. P makes a blocking system call to read a block of data from the disk.
II. P tries to access a page that is in the swap space, resulting in a page fault.
III. An interrupt is raised by the disk to deliver data requested by some other process.
IV. A timer interrupt is raised by the hardware.
Answer(B)
A counting semaphore S is initialized to 10. Then, 6 P operations and 4 V operations
are performed on S. What is the final value of S?
A. 0
B. 5
C. 8
D. 3
Answer C
Answer (A)
Question 2: You are designing a CPU scheduler for a system that prioritises
interactive
processes to ensure a responsive user experience. However, you must also ensure
that
batch processing jobs, which are lower in priority compared to interactive processes,
do not
starve. Based on these requirements, which of the following strategies would you
implement
in your CPU scheduling algorithm?
Options:
A. Apply the Shortest Job First (SJF) algorithm, as it offers the lowest average
waiting time
for processes.
B. Utilise the Round Robin (RR) algorithm with a dynamic time quantum, adjusting
the
quantum based on the process type (interactive vs. batch).
C. Implement a Multilevel Feedback Queue (MFQ) scheduling algorithm, where
interactive
processes are placed in a higher-priority queue compared to batch processes, but
batch
processes can gradually increase their priority if they wait too long.
D. Implement Aging with Priority Scheduling, where lower priority processes
gradually
increase their priority over time to prevent starvation.
Ans:
C. Implementing a Multilevel Feedback Queue (MFQ) scheduling algorithm is most
appropriate in this scenario, as it allows for prioritising interactive processes while
ensuring
batch processes are not starved.
D. Implementing Aging with Priority Scheduling is also a viable strategy. It modifies
the
Priority Scheduling algorithm to increase the priority of waiting processes over time,
ensuring
that lower-priority batch jobs do not suffer from starvation
Question3 : You are analysing a system that utilises both multitasking and
multithreading to
optimise performance. Given the following statements, identify which accurately
reflect the
principles and functionalities of multitasking and multithreading in operating systems.
Options:
A. Multitasking allows a single CPU to run multiple processes concurrently by rapidly
switching between them, giving the illusion of parallelism.
B. Multithreading within a single process allows threads to share resources such as
memory
space, which can lead to more efficient use of system resources compared to
multiple
processes.
C. In a multithreaded environment, each thread has its own separate stack, but all
threads
within the same process share the heap space.
D. Multitasking increases the performance of CPU-intensive applications by allowing
multiple
CPUs to execute different threads of the same process simultaneously.
Ans: Correct Answers:
A. True - Multitasking involves the CPU switching context between different
processes or
tasks to give the impression of parallel execution.
B. True - Threads within the same process can share resources like memory, which
can lead
to more efficient resource utilisation.
C. True - In multithreading, each thread has its own stack, but the heap is shared
among all
threads of the process.
Question4: Select the system calls from the list below that would typically be used in
a
Unix-like operating system to manage process control and file operations. Choose all
that
apply.
Options:
A. fork()
B. read()
C. chmod()
D. socket()
E. getpid()
Ans: Correct Answers: A, B, C, E
Scenario: Imagine you are designing a new operating system for a high-performance
computing system that requires efficient management of processes, memory, and I/O
operations. You need to ensure that the operating system can handle multiple tasks
simultaneously, manage memory efficiently to support various applications, and
provide
robust I/O operations management.
Question5: Based on the scenario above, which of the following features should be
incorporated into the design of the new operating system to meet the specified
requirements? Select all that apply.
A. Implement a preemptive multitasking scheduler to allow the operating system to
manage
the execution time of processes efficiently.
B. Use a monolithic kernel to simplify the design and reduce the overhead
associated with
context switching and inter-process communication.
C. Integrate a virtual memory management system to provide a larger address space
to
processes and to support efficient memory utilization.
D. Employ a Round Robin scheduling algorithm with a fixed time quantum for all
processes
to ensure fairness in process execution.
E. Incorporate a Direct Memory Access (DMA) mechanism to allow peripherals to
directly
read from and write to main memory, reducing the CPU's I/O operation load.
Ans: Correct Answers:
A. True - A preemptive multitasking scheduler can efficiently manage process
execution
time, allowing for better multitasking capabilities.
C. True - A virtual memory management system is essential for providing a larger
address
space and for efficient memory utilization, crucial for high-performance computing
systems.
E. True - DMA is important for offloading the CPU from handling all I/O operations,
improving
the system's overall efficiency
Question 6: Identify the components of an operating system that are directly involved
in
managing system memory. Select all that apply.
Options:
A. Memory Manager - Handles the allocation and deallocation of memory blocks to
processes, ensuring efficient memory usage.
B. File System - Organises and manages the storing and retrieval of data on disk
drives.
C. Scheduler - Determines which process will be executed by the processor at any
given
time.
D. Virtual Memory Manager - Manages virtual memory, allowing processes to use
more
memory than physically available by using disk space.
Correct Answers:
A. The Memory Manager is directly responsible for managing the system's memory,
allocating, and deallocating memory as needed.
D. The Virtual Memory Manager is crucial for extending the apparent amount of
physical
memory using disk storage.
Question 9:
Scenario: You are analyzing the performance of a real-time operating system
(RTOS) that is
used to control robotic machinery. The RTOS is designed to handle a high frequency
of
interrupt-driven tasks, which requires efficient context switching to maintain system
responsiveness and task prioritization.
Considering the scenario, which features should the RTOS's context switching
mechanism
possess to ensure optimal performance in handling high-frequency interrupt-driven
tasks?
Select all that apply.
Options:
A. The context switching mechanism should have minimal overhead to reduce the
time
spent in switching between tasks.
B. The RTOS should prioritize tasks based on their urgency and deadlines, not just
on a
first-come, first-served basis.
C. The context switching process should include extensive memory management
steps to
optimize RAM usage.
D. The RTOS should employ a complex scheduling algorithm that considers the
future
computational needs of tasks to optimize context switching.
Ans:
A. True - Minimizing overhead is crucial for an RTOS to quickly switch between
tasks,
especially in a high-frequency interrupt-driven environment.
B. True - Task prioritization based on urgency and deadlines is essential for real-time
responsiveness and system reliability in an RTOS.
Ques 10: Question: Consider the following statements regarding operating systems
and
identify which aren’t correct?
Options:
A. In a microkernel operating system architecture, the microkernel provides minimal
services, including device drivers and file system management.
B. In a monolithic kernel, all operating system services run along with the main
kernel thread
in a single address space, enhancing performance but potentially decreasing system
reliability.
C. Banker's algorithm is used in operating systems to avoid deadlock situations by
ensuring
that a system does not allocate its resources in a manner that can lead to a
deadlock.
D. Virtual memory allows an operating system to use hard disk space to simulate
extra
memory, but it cannot be used to isolate the address spaces of different processes.
Correct Answers:
A. False - In a microkernel architecture, the microkernel does not typically include
services
like device drivers and file system management; these are executed in user space.
D. False - One of the primary functions of virtual memory is to isolate the address
spaces of
different processes, ensuring that they cannot interfere with each other.
ANSWERS
2. d. Text Section
4. b. Kernel
5. a. Communication
8. c. Mutex locks are utilised to protect critical regions and prevent race conditions
by allowing only one thread at a time to access them.
14. b. APIs act as an intermediary layer between user-level applications and system
calls., d. APIs define the syntax, semantics, and behavior of functions and data structures
that applications can use to interact with the OS
19. a. CreateFile(),
d. Sleep()
20. b. Milliseconds,
c. Microseconds