WorksheetsOperating Systems Worksheet
Total questions: 150
Worksheet time: 1hrs 15mins
Which of the following is an incorrect statement?
Operating system is a program that runs on the computer even if it is turned off.
Mainframe operating system and operating system for embedded devices are same in terms of functionalities and services provided to the users.
Operating system is a program that acts as a resource allocator.
Ubuntu and Fedora are Linux operating systems.
Which of the following is not a hardware component of computer system architecture?
Word processor
Secondary storage devices
Processor
Main memory
Which of the following is wrong about Operating System?
Ensures unfair resource usage
Maximizes resource utilization
Handles and resolves simultaneous and conflicting resource requests
Manages all resources
Which of the following is correct about Operations of OS?
Antivirus is an OS Utility.
Device drivers are software that perform memory allocation for processes.
Full form of CLI is Command Line Integration.
GUI stands for Graphical User Intuition.
Which hardware component is bypassed in Direct Memory Access (DMA)?
CPU
I/O devices
DMA controller
Main memory
Which of the following is false about Device Controller?
Device controller is a part of the cache memory.
Device Controller manages a specific type of hardware device.
Device Controller bridges the gap between the hardware device and the OS.
Device Controller is a hardware component.
Which of the following is not correct about interrupts?
Addresses of all ISRs are stored on the system stack.
IVT stands for Interrupt Vector Table.
When an I/O operation completes, the processor is informed via an interrupt.
ISR stands for Interrupt Service Routine.
Which of the following is correct about dual mode of operations?
Kernel mode is also called supervisor mode.
User mode has mode bit value of 2.
ISRs are executed in user mode.
Kernel mode has mode bit value of 1.
Disk scheduling is part of which OS service?
Storage management
Protection and security
Process management
Memory management
Which of the following is false about a single processor system?
System reliability is high.
Multiple processes can be present in the main memory simultaneously.
System throughput is not very high.
Only one process can be executed at a time.
Job pool is present in:
Secondary storage
Cache memory
Main memory
Disk controller
Which of the following is true regarding multitasking system?
Response time is low.
There is little scope of user interaction.
The system does not switch among the various processes/tasks.
Multiple processes are never present in the main memory simultaneously.
Which of the following is true for a multiprocessor system?
Each processor of a multiprocessor system has its own cache memory.
Main memory is not shared by the processors.
Peripheral devices are not shared among processors.
Multiprocessor systems have very low reliability.
Which of the following is true for multicore systems?
Two or more computing cores are present on a single processor chip.
Exactly four computing cores are always present on a single processor chip.
Exactly two computing cores are always present on a single processor chip.
Exactly three computing cores are always present on a single processor chip.
Which of the following is false?
Peer-to-peer systems do not involve any communication network.
Peer-to-peer systems are distributed systems.
There is no server in peer-to-peer systems.
Clustered system provides high availability.
Which of the following is false?
Web browser is a system program.
A single OS is not suitable for all types of computing systems that we encounter.
OS acts as an intermediary between the users and the hardware of the computer.
Main memory is part of the computer system architecture.
Which of the following computing systems is not meant for individual usage?
Mainframe computer
Personal computer
Mobile phone
Tablet
During interrupt handling, the content of the program counter of the interrupted program is saved on the system stack because:
once interrupt handling is completed, the execution of the interrupted program needs to be resumed.
the interrupt service routine needs to be examined
the interrupted program can be terminated once the interrupt has been handled.
the interrupt service routine is to be located
Which of the following statements is true?
Multiprogramming is possible in both single processor systems and multiprocessor systems.
Multiprogramming is possible only in multiprocessor systems.
Multiprogramming is not possible in single processor systems.
Multiprogramming is neither possible in single processor systems nor in multiprocessor systems.
Suppose you have a multitasking system having four processors and a main memory capable of holding ten processes. Which of the following is true?
A user of this multitasking system can interact with ten executing processes simultaneously.
A user of this multitasking system will always be able to interact with only four executing processes simultaneously.
A user of this multitasking system will always be able to interact with less than four executing processes simultaneously.
A user of this multitasking system has no scope of interacting with any of the executing processes.
Choose the false statement.
In GUI, we need to remember complex commands.
In CLI, we can have faster access and operation.
In GUI, shortcuts are provided.
In CLI, we can use scripts to automate repetitive tasks.
Which of the following is correct about Graphical User Interface?
It is also called a desktop environment.
Elements are not represented using any icons.
It is not at all user friendly.
Each and every action requires the user to enter a command.
Which of the following is not a valid shell?
MemeShell
KornShell
Bourne Again Shell
Bourne Shell
Which of the following statements about system calls and APIs is correct?
Accessing system calls via APIs reduces the cognitive load of programmers.
System calls are executed in user mode.
When a user program requires an OS service, first a system call is invoked which in turn invokes an API function.
An API function never returns a value.
Which of the following types of system calls is primarily used for handling processes?
Process management system calls
File management system calls
Information maintenance system calls
Device management system calls
Which command would you use to display some text on the console?
echo
sudo
du
cal
Which command is used to display the contents of a file on the console?
cat
diff
rm
cp
What is the effect of the following command on the file example.txt: chmod 754 example.txt?
Grants the user read, write, and execute permissions; the group read and execute permissions; and others read permission.
Grants the user read and execute permissions; the group read, write, and execute permissions; and others no permissions.
Grants the user read, write, and execute permissions; the group read and execute permissions; and others execute permissions.
Grants the user read, write, and execute permissions; the group read and execute permissions; and others no permissions.
Which command is used to display a dynamic snapshot of the currently executing processes on the system?
top
tree
ps -el
kill
You want to find all occurrences of the word hat in the file abc.txt. What command will you use?
grep hat abc.txt
hat grep abc.txt
abc.txt hat grep
grep abc.txt hat
Which of the following statements about monolithic kernels is correct?
Monolithic kernels exhibit high performance due to little overhead in the system call interface.
Monolithic kernels are easy to extend by adding new services.
Monolithic kernels are modular in nature.
Monolithic kernels are generally very secure.
Which of the following is most related to a layered kernel architecture?
Layered kernel is organized into layers, where each layer depends on the functionalities provided by the layers below it.
In layered kernel architecture, the topmost layer is the hardware.
Non-essential services are dynamically linked with the kernel at run time.
The kernel is divided into distinct modules.
Which of the following is related to microkernel architecture?
It runs services like device drivers and file systems in user space.
It is larger in size.
Additional service inclusion always requires modification of the kernel.
It integrates all system services directly into kernel space for maximum performance.
Which of the following is not related to loadable kernel modules?
Presence of well defined interface for only certain modules
Dynamic linking of services
Inter-module communication via module interface
Additional services linked in via modules
Which of the following is true for hybrid kernel?
A hybrid kernel can be created by incorporating the features of loadable kernel modules.
A hybrid kernel is always created by combining the features of only two kernel architectures.
A hybrid kernel should never incorporate the features of a microkernel.
A hybrid kernel should never incorporate the features of a monolithic kernel.
EPROM stands for
Erasable Programmable Read-Only Memory
Extensively Programmable Read-Only Memory
Essential Programmable Read-Only Memory
Electronic Programmable Read-Only Memory
When is POST executed?
At boot time
When first user process is executed
During shut down time
After kernel is loaded
Which of the following reads the boot block content into the RAM?
BIOS
Second level bootloader
Kernel
POST
Suppose you are using an Ubuntu operating system. On this system, you are within a certain directory and that directory contains 5,000 files, but no subdirectories. First, you wish to list all those files on the console whose name starts with the uppercase letter P (irrespective of the file extension) along with the associated permissions, date, timestamp, etc. Next, you want to assign read, write and execute permissions to user, group and others for all those files whose name starts with uppercase P. Finally, you want to verify the permissions again by displaying all details of those files. Which of the following command sequences is correct?
ls -l P* chmod 777 P* ls -l P*
ls -l chmod 777 ls -l
ls -l chmod 777 P* ls
ls chmod 777 ls
Which of the following statements is correct?
Loadable kernel modules are more flexible than layered kernel since there is no dependency regarding the invocation of the modules.
Monolithic kernel is more secure than microkernel.
Layered kernel is faster than monolithic kernel.
Microkernel is faster than monolithic kernel.
Which of the following statements is true?
If a 2nd level bootloader is present, then the 2nd level bootloader loads the kernel onto the RAM.
POST checks whether all the software components of the system are working properly.
BIOS is stored on RAM.
POST runs after the 1st level bootloader has executed.
Which of the following is true?
The table of system calls is indexed by the numbers associated with the system calls.
Programs developed using system calls rather than API calls are portable.
A user program can read from a file entirely in user mode.
An API function is characterized only by its name and the parameters passed to it.
When considering the memory organization of a process, which of the following is correct?
The text section contains the program code.
The heap contains the contents of the processor registers.
The stack contains the program code.
When a process transitions through various states during its lifecycle, which of the following correctly describes the state in which the process is waiting for an event to occur before it can proceed?
Waiting state
Terminated state
Ready state
New state
Which of the following correctly describes the information that contains priorities, scheduling queue pointers, and scheduling parameters for a process?
CPU scheduling information
CPU registers
Memory-management information
Program counter
When the CPU performs a context switch, which of the following correctly describes the procedure and the associated considerations of process context switch?
The CPU pauses execution of the old process, saves its state in the PCB, and loads the state of the new process.
The context of a process, including CPU registers, program counter content, and process state, is irrelevant to a context switch.
The CPU continues executing the old process while loading the new process state.
Context-switch time, however high it is, does not impact system performance.
What is the primary role of the init process in a Unix-based operating system?
To create other processes
To handle file system operations
To manage network connections
To compile and execute programs
When the fork() system call is used in a Unix-based operating system, what values does it return to the child process and the parent process?
0 to the child process and the child's PID to the parent process
0 to the parent process and -1 to the child process
1 to the parent process and 0 to the child process
The child's PID to both the parent and child processes
Which sequence of system calls is typically used in a Unix-based operating system to create a new process, replace the new process’s memory space with a new program, and have the parent process wait for the child process to complete?
fork(), exec(), wait()
exec(), wait(), fork()
wait(), fork(), execlp()
execlp(), fork(), wait()
Which of the following correctly describes a zombie process and an orphan process?
A zombie process is a terminated process still listed in the process table; an orphan process is a running process whose parent has terminated.
A zombie process is a running process without a parent; an orphan process is a terminated process still listed in the process table.
A zombie process is a waiting process without a parent; an orphan process is a terminated process that can be restarted.
What is one of the primary benefits of using Interprocess Communication (IPC)?
It allows processes to share and exchange data.
It reduces the number of processes running on the system.
It eliminates the need for memory allocation.
It increases the security of the system.
What is one benefit of using shared memory for Interprocess Communication (IPC)?
It provides fast data exchange as processes can directly access the same memory space.
It allows processes to communicate through network connections.
It automatically synchronizes access between processes.
It eliminates the need for process creation.
In message passing based IPC, what is a key feature of indirect communication that distinguishes it from direct communication?
Messages are sent to and received from mailboxes.
Processes must name each other explicitly.
Indirect communication only allows sending of messages, but not receiving of messages.
Processes must share a common address space.
How is a message queue referenced?
system-wide unique identifier
system-wide unique name
its size
PID of the process creating it
What is the primary purpose of using ordinary pipes in Interprocess Communication (IPC)?
To allow one process to send data to another process in a unidirectional flow.
To provide a way for processes to directly access each other’s memory space.
To allow a process to create more processes.
To execute commands in parallel processes.
Job queue resides on
secondary storage
main memory
cache memory
CPU registers
Degree of multiprogramming is equal to the
number of jobs present in the ready queue of the system.
number of jobs present in the job queue of the system.
number of jobs present in a single device queue of the system.
number of jobs present in all the device queues of the system.
What is the role of a device queue in process management?
To hold processes that are waiting for I/O operations.
To hold processes that are waiting for CPU time.
To store processes that are currently being executed by the CPU.
To keep track of processes that have terminated.
Which of the following is correct?
More I/O-bound processes decrease CPU utilization, while more CPU-bound processes decrease I/O device utilization.
More I/O-bound processes increase CPU utilization, while more CPU-bound processes decrease I/O device utilization.
More I/O-bound processes increase CPU utilization, while more CPU-bound processes increase I/O device utilization.
More CPU-bound processes decrease CPU utilization, while more I/O-bound processes decrease I/O device utilization.
Swapping is performed by
the medium-term scheduler
the long-term scheduler
the short-term scheduler
the CPU scheduler
What is a key characteristic of threading in a program?
Threads allow a program to perform multiple tasks concurrently.
Threads are less lightweight than processes.
Threads of the same process run in separate address spaces.
Threads are completely independent and do not share any resources.
Why are threads considered lightweight compared to processes?
Threads share the same address space and resources within a process.
Threads have their own stacks.
Each thread has its own register set.
Threads can run on individual processors.
Which of the following is not a motivation for multithreading?
Threads eliminate the need for memory management.
Most of the current software applications are multithreaded.
Threads allow users to interact with multiple aspects of the same application.
Threads allow multiple similar tasks to be executed within the same application.
What of the following is not a benefit of multithreading?
Storage management
Economy
Resource sharing
Responsiveness
What is one advantage of multicore programming?
It enables multiple threads to run in parallel, improving overall system resource utilization and performance.
It ensures that programs will not have any bugs.
It eliminates the need for memory management for threads.
It allows a single thread to run faster than on a single-core processor.
Which of the following is not a challenge of multicore programming?
Keeping a backup of data
Identifying data dependency
Striking balance
Testing and debugging
What is the primary difference between parallelism and concurrency in programming?
Parallelism involves running multiple tasks simultaneously on multiple processors, while concurrency involves allowing multiple tasks to make progress at the same time but not necessarily executed simultaneously.
Parallelism only applies to single-threaded programs, while concurrency applies to multithreaded programs.
Concurrency requires multiple processors to function, while parallelism can be achieved on a single processor.
Concurrency eliminates the need to load multiple programs in the main memory simultaneously, while parallelism requires multiple programs to be loaded in the main memory simultaneously.
Which of the following examples best illustrates data parallelism?
Splitting a large dataset among multiple processors/tasks, each performing the same operation on their portion of the data simultaneously.
A single processor performing multiple tasks by switching between them rapidly.
One processor/task finds the maximum number from a list while another processor/task finds the minimum number from the same list at the same time.
One processor/task sorts a list while another processor/task searches a different list at the same time.
What is the primary difference between user level threads and kernel level threads?
Kernel level threads can be scheduled on different processors by the operating system, while user level threads are limited to a single processor.
User level threads do not require any synchronization mechanisms, while kernel level threads do.
User level threads are managed by the operating system, while kernel level threads are managed by the user level threads library.
Context switching for both user level threads and kernel level threads require kernel support.
Which of the following statements best describes the many-to-one threading model?
Multiple user level threads are mapped to a single kernel level thread.
Multiple user level threads are mapped to multiple kernel level threads.
One user level thread is mapped to one kernel level thread.
Multiple kernel level threads are mapped to a single user level thread.
In the one-to-one model, if there are 5 user level threads, how many kernel level threads will be present?
5
6
4
1
Which of the following best describes the relationship between user level and kernel level threads in the two-level threading model?
Multiple user level threads are mapped to multiple kernel level threads and a user level thread is also associated with a single kernel level thread.
All user level threads are mapped to a single kernel level thread, which limits parallel execution.
Each user level thread is always mapped to a specific kernel level thread, with no flexibility for different mappings.
Only multiple user level threads are always mapped to multiple kernel level threads, allowing each user level thread to be mapped to any kernel level thread.
Which of the following is used to identify a thread in the Pthreads library?
pthread_t
pthread_t_tid
pthread_attr_t
pthread_tid
Which of the following functions is used to initialize the attributes of a thread?
pthread_attr_init()
pthread_exit()
pthread_attr_destroy()
pthread_create()
In which header file is pthread_join() defined?
pthread.h
stdlib.h
stdio.h
malloc.h
Which of the following is true?
In asynchronous multithreading, there is less data sharing among the threads.
In synchronous multithreading, the parent thread runs parallelly with the child threads.
In synchronous multithreading, a parent thread can create only a single child thread.
In synchronous multithreading, the child threads wait for the parent thread to terminate.
What is the return type of pthread_cancel()?
int
void
float
long int
Suppose you have a distributed application which runs on 10 computer nodes. The computer nodes are spread across several floors of the same building. The distributed application is a multi-process application. The multiple processes which are part of this application need to exchange data to jointly perform some tasks. However, these processes bear no parent-child relationships. The communication between each pair of communicating processes may be unidirectional or bidirectional. None of the communicating processes will be involved in bulk data transfer. You are ready to tolerate latency in the data transfer process and will not be implementing any synchronization mechanism. Every process mandatorily needs to explicitly name the sender when it acts as the receiver or name the receiver when it acts as the sender. No mailboxes are to be used. Which of the following would you use to facilitate this distributed IPC?
direct message passing
ordinary pipe
shared memory
indirect message passing
Suppose you want to implement a multithreaded application containing 15 threads of control on a multicore system. Consider these threads to be user level threads. You do not want the entire application to block even if one of the user level threads makes a blocking system call. You also do not want to create more than 13 kernel level threads. Moreover, for 5 out of the 15 user level threads, you want to bind each user level thread to a single kernel level thread. Which multithreading model is most appropriate for your application?
Two-level model
One-to-One model
Many-to-One model
Many-to-Many model
Suppose you have a large sized dataset on which you must perform 5 operations, namely, calculating sum, calculating median, calculating mode, finding the maximum value and finding the minimum value. You have created 6 separate threads, T1, T2, T3, T4, T5 and T6. T1 and T2 perform the sum operation with T1 working on half of the dataset and T2 working on the remaining half of the dataset. T3 calculates the median, T4 calculates the mode, T5 calculates the maximum and T6 calculates the minimum. This is an example of which kind of parallelism?
Both data and task parallelism
No parallelism at all
Task parallelism
Data parallelism
Which of the following is not shared by threads belonging to the same process?
stack
code
files
data
Which of the following is not a valid process state transition?
waiting to running
new to ready
running to waiting
running to ready
In a TCB, which of the following components is crucial for saving the thread's execution context during a context switch?
The thread's execution context, including register values, program counter, and stack pointer.
The thread's memory management information, including page tables and virtual memory mappings.
The code section of the thread.
The thread's file descriptors and network connections.
When a process P is selected by the short-term scheduler, which one of the following state transitions occurs for P?
ready to running
running to waiting
running to terminated
waiting to ready
What is a key effect of cooperating processes on data or files?
Cooperating processes can concurrently access and modify shared data or files.
Cooperating processes eliminate the need for synchronization mechanisms.
Cooperating processes always run in separate memory spaces and do not affect each other's data.
Cooperating processes never share data or files.
What is a race condition in the context of concurrently executing processes?
A race condition occurs when the outcome of execution depends on the ordering of accesses to shared data by multiple processes.
A race condition is something that eliminates the need for using any synchronization mechanism.
A race condition guarantees data consistency and integrity even in the case of concurrently executing processes.
A race condition occurs when multiple processes run in a sequential order without any synchronization issues.
Why is process synchronization required?
Process synchronization ensures that multiple processes can access shared resources in a controlled and consistent manner.
Process synchronization allows processes to run without any dependencies on each other.
Process synchronization is used to completely eliminate the need for communication between processes.
Process synchronization is important to ensure that each process runs in its own memory space without interference from other processes.
Which of the following is true regarding process synchronization to ensure proper coordination among processes?
Mutual Exclusion ensures the consistency of the shared data even in the face of concurrent accesses whereas bounded waiting ensures fairness.
Bounded Waiting ensures that the number of processes waiting to enter the critical section is unlimited.
Mutual Exclusion ensures that all processes can access the critical section simultaneously.
Progress guarantees that a process in the critical section will be delayed indefinitely by other processes.
What is a key feature of Peterson's solution for process synchronization?
Peterson's solution ensures mutual exclusion, progress, and bounded waiting for two processes.
Peterson's solution is guaranteed to work on any computer architecture.
Peterson's solution is not related to process synchronization.
Peterson's solution allows multiple processes to enter the critical section simultaneously.
How does Peterson's solution satisfy the three requirements for process synchronization?
by using a flag array and a turn variable to ensure only one process enters the critical section at a time, making sure that waiting processes get a turn, and that processes can't be indefinitely postponed
by allowing one process to enter the critical section multiple times while the other process waits after having put up the request to enter the critical section
by allowing both processes to enter the critical section at the same time
by eliminating the need for synchronization mechanisms entirely
How does the test_and_set() function help achieve mutual exclusion in process synchronization?
by returning the value of the lock variable before it is set to true
by setting lock to false in the exit section
by returning a boolean variable
by using a boolean variable lock
Which of the following is true for mutex locks?
Both acquire() and release() are atomic.
acquire() and release() are not atomic.
acquire() is atomic, but release() is not atomic.
acquire() is not atomic, but release() is atomic.
Which of the following is a disadvantage of mutex locks?
wastage of CPU cycles
not providing mutual exclusion
necessitate process context switch
makes the critical section of a program very large
What is the data type of a semaphore variable?
int
char
float
double
What is the primary difference between a binary semaphore and a counting semaphore? Consider semaphore implementation with busy waiting.
A binary semaphore can only take values 0 and 1, while a counting semaphore can take any non-negative integer value.
A binary semaphore can have any non-negative integer value, while a counting semaphore is restricted to values 0 and 1.
There is no difference between a binary semaphore and a counting semaphore.
A binary semaphore is used for counting resources and not mutual exclusion, while a counting semaphore is used for mutual exclusion.
What is an example of improper use of semaphores in process synchronization?
Using semaphores to manage single-threaded operations without any shared resources.
Using counting semaphores to keep track of the access to a specific number of resources.
Using semaphores to manage access to a shared resource among multiple processes.
Using binary semaphores to enforce mutual exclusion in critical sections.
In the Producer-Consumer problem, what is the role of the consumer?
To remove items from the shared buffer and process them.
To manage the synchronization between multiple producers.
To ensure the buffer is always full.
To ensure that the producer blocks when the buffer is full.
In the solution to the producer-consumer problem, which of the following is a binary semaphore?
sem
full
n
empty
In the Dining Philosophers problem, which of the following corresponds to process?
philosopher
bowl of rice
chopstick
table
In the Dining Philosophers problem, what is a common strategy to avoid deadlock? Note that you need to make sure that the solution is still correct.
After picking up a chopstick if a philosopher finds that the other chopstick is unavailable, s/he will let go of the picked up chopstick.
Ensuring that a philosopher keeps on holding onto a chopstick even if the other one is not available.
Allowing each philosopher to eat with only one chopstick.
Suppose you have a counting semaphore S. After certain number of wait() and signal() operations, the value of S is -4. Determine the number of processes waiting on S. Assume semaphore implementation without busy waiting. You do not have to worry about how the value -4 was arrived upon.
4
-1
-4
3
Which of the following is true?
Semaphore implementation with busy waiting may cause the semaphore value to be negative.
Spinlock does not cause busy waiting.
Peterson’s solution is a hardware-based solution.
In a typical program, which of the following code segments determines which process can next execute the critical section?
entry section
exit section
remainder section
mutual exclusion section
Consider the solution to the producer-consumer problem that you have learnt. Assume that there are multiple producer processes as well as multiple consumer processes executing simultaneously. If the value of the full semaphore is -3 and the value of the empty semaphore is -4, then calculate the total number of blocked processes. Assume semaphore implementation without busy waiting. You do not have to worry about how the values of full and empty semaphores were derived.
7
3
-7
4
Which metric evaluates how efficiently the CPU is used?
CPU Utilization
Turnaround Time
Throughput
Waiting Time
Which performance metric measures the total time from the submission of a process to its completion?
Turnaround Time
Throughput
Waiting Time
CPU Utilization
In non-preemptive scheduling, when is a new process selected to run?
When a process terminates or when an explicit system request causes a wait state.
When a higher priority process arrives or when a process finishes its CPU burst.
When a process is created or when a process requests I/O.
When the CPU is idle or when a process is suspended.
What is dispatch latency?
The time taken by the dispatcher to stop one process and start another running.
The time taken by the CPU scheduler to select a process from the ready queue.
The time taken by the system to switch from user mode to kernel mode.
The time taken by a process to complete its CPU burst.
Which scheduler is responsible for deciding which processes should be brought into the ready queue from the job queue?
Long-term scheduler
Medium-term scheduler
Short-term scheduler
I/O scheduler
Which queue contains processes that are waiting for keyboard and a printer?
Device queue
Job queue
PCB queue
Ready queue
Which characteristic is crucial for a scheduling algorithm to minimize in an interactive system, such as an online video game?
Response Time
Scheduling Time
Waiting Time
Throughput
What happens during a context switch?
The state of the old process is saved, and the state of the new process is loaded.
A new process is created.
A process is terminated.
The CPU is idle.
Which type of process often requires quicker response times and may have higher priority in multilevel queue scheduling?
Foreground processes
Batch processes
Background processes
System processes
What happens if the time quantum in round-robin scheduling is set too small?
There will be high context-switching overhead.
Long CPU burst processes will finish first.
The CPU will be underutilized.
The system behaves like a First-Come, First-Served (FCFS) algorithm.
What is the primary characteristic of applications that fall under real-time systems?
They operate with low latency and provide prompt responses to external stimuli.
They require large memory usage.
They primarily run in batch mode.
They prioritize graphical performance.
In Preemptive Priority Scheduling, what happens when a new process with a higher priority arrives?
The new process immediately starts executing, preempting the current process.
The new process waits for the current process to finish.
The process with the lowest burst time is executed.
The current process continues until it finishes.
How can the issue of starvation be addressed in Priority Scheduling?
By gradually increasing the priority of waiting processes over time
By using a round-robin scheduling algorithm
By increasing the burst time of waiting processes
By decreasing the memory usage of processes
What problem can occur with SJF scheduling if there is a continuous influx of short jobs?
Starvation of long jobs
Increased average turnaround time
Starvation of short jobs
Decreased context switching overhead
What is the finish time for Process P1 if its arrival time is 2 ms and its turnaround time is 15 ms?
17 ms
13 ms
10 ms
20 ms
Which of the following is a characteristic of the Shortest Job First (SJF) scheduling algorithm?
It can be preemptive or non-preemptive.
It is also known as First-Come, First-Served (FCFS) scheduling.
It always leads to starvation for longer processes.
Processes with the longest burst time are executed first.
What is the total burst time for process P1, given that its CPU time is 6 ms followed by an I/O time of 3 ms and another CPU time of 2 ms?
11 ms
9 ms
8 ms
6 ms
What is the response time for Process P4 if its first response time is 13 ms and its arrival time is 5 ms?
8 ms
5 ms
13 ms
10 ms
What is the turnaround time for Process P4 if its arrival time is 5 ms and its finish time is 10 ms?
5 ms
7 ms
10 ms
12 ms
What is the waiting time for Process P1 if its burst time is 8 ms (CPU time + I/O time) and its turnaround time is 12 ms?
4 ms
6 ms
12 ms
8 ms
Which of the following is NOT a criterion used by process scheduling algorithms?
Reducing main memory size
Ensuring fairness among processes
Maximizing CPU utilization
Minimizing turnaround time
What is the main role of the medium-term scheduler?
To temporarily remove processes from main memory and place them on secondary memory, or vice versa
To decide which processes should be brought into the ready queue from the job queue
To handle the scheduling of processes that are blocked and waiting for I/O resources
To allocate CPU to processes in the ready queue
Consider a five state model. Which state transitions invoke the CPU scheduler?
From running to waiting, from running to ready, from waiting to ready, and running to termination
From new to ready, from ready to running, from running to blocked, and process creation
From waiting to running, from ready to running, from running to blocked, and process suspension
From ready to blocked, from running to new, from waiting to running, and process termination
What is the main difference between non-preemptive and preemptive scheduling?
Non-preemptive scheduling does not allow a running process to be interrupted, while preemptive scheduling does.
Neither allows a running process to be interrupted.
Both allow a running process to be interrupted.
Non-preemptive scheduling allows a running process to be interrupted, while preemptive scheduling does not.
Consider 5 processes whose Arrival time and CPU Burst time is as follows (Process no: Arrival time: Burst time): P1: 0,3; P2: 2,3; P3: 3,2; P4: 5,5; P5: 6,9. Assume that the processes are scheduled using the FCFS scheduling algorithm. The average waiting and turnaround time is ______
2.8 and 7.2
2.5 and 7.0
2.6 and 7.1
1.9 and 6.9
What does a cycle in a Resource Allocation Graph indicate when there is only one instance per resource type?
There is definitely a deadlock.
There might be a deadlock.
The system is in a safe state.
There is no deadlock.
Which of the following methods involves taking action to ensure that the system never enters a deadlock state?
Deadlock Prevention and Deadlock Avoidance
Resource Allocation Scheduling
Deadlock Detection and Recovery
Ignoring the problem
What is the correct sequence a process must follow to use a resource in an operating system?
Request, use, release
Lock, unlock, release
Allocate, lock, use
Use, release, request
What is the 'Circular Wait' condition in a deadlock scenario?
A set of processes are waiting for each other in a circular chain.
Processes are waiting for a resource that is not available.
Processes are holding multiple resources simultaneously.
Processes are waiting in a linear sequence.
Which of the following is one of the conditions that must be present for a deadlock to occur?
Mutual Exclusion
Infinite Resources
Resource Preemption
Sequential Processing
In a Resource Allocation Graph, how is a request edge represented?
A directed edge from a process to a resource.
A directed edge from a resource to a process.
An undirected edge between a process and a resource.
A circular edge within a process.
What is a deadlock in a multiprogramming environment?
A state where processes are blocked because each is holding a resource and waiting for a resource held by another.
A situation where processes can always acquire the resources they need.
A scenario where all processes are finished, and resources are released.
A condition where resources are infinite, and processes do not need to wait.
What type of resources require mutual exclusion to prevent deadlocks?
Non-sharable resources
Sharable resources
Virtual resources
Both sharable and non-sharable resources
There are two protocols to avoid Hold and Wait condition. Which protocol requires a process to acquire all needed resources before it begins execution?
The first protocol for avoiding Hold and Wait condition
The deadlock detection protocol
The second protocol for avoiding Hold and Wait condition
The mutual exclusion protocol
What does the No Preemption condition mean in the context of deadlock prevention?
A process cannot be forced to release its resources once they have been allocated.
A process can only hold one resource at a time.
A process can request resources as soon as they become available.
Resources are automatically released after a fixed time period.
What is the main requirement for the Deadlock Avoidance scheme?
Requires complete information about resource requests and releases from the start.
The ability to preempt resources at any time.
Processes must acquire all resources before execution begins.
The system must always be in a deadlock state.
In Deadlock Avoidance, what defines a safe state?
There is a sequence of processes that can finish without causing a deadlock.
The system has entered a deadlock and cannot recover.
All resources are allocated without considering future requests.
Processes can hold resources indefinitely.
What is the primary purpose of the Banker's Algorithm in deadlock avoidance?
To allocate resources in a way that ensures the system remains in a safe state.
To prevent processes from requesting more resources compared to other processes.
To immediately grant all resource requests.
To reduce the number of processes in the system.
What does the Work vector represent in the Safety Algorithm?
The number of currently available resources.
The total number of resources in the system.
The maximum resources needed by all processes.
The resources currently allocated to each process.
What does a safe sequence indicate in the context of the Safety Algorithm?
The order in which processes can be allocated resources without causing a deadlock.
The sequence in which processes must release their resources.
The order in which the system should terminate processes.
The maximum amount of resources that can be allocated to each process.
What is the primary goal of the Resource Request Algorithm in the Banker's Algorithm?
To ensure that a resource request can be granted while keeping the system in a safe state.
To terminate processes that exceed their resource requests.
To allocate resources to processes immediately.
To calculate the total resources available in the system.
Which of the following techniques is used to handle deadlocks by allowing the system to enter a deadlock state and then detecting it?
Deadlock Detection
Deadlock Prevention
Deadlock Avoidance
Resource Allocation
What type of graph is used in deadlock detection when resources have a single instance?
Wait-for Graph
Resource Allocation Graph
Process Resource Graph
System State Graph
Which of the following data structures are used in the deadlock detection algorithm for systems with multiple resource types?
Available vector, Allocation matrix, Request matrix
Process Table, Resource Table
Wait-for Graph, Resource Allocation Graph
Priority Queue, Mutex Locks
In a deadlock detection scheme, what is the main condition that must be checked to determine if a system is in a deadlocked state using the algorithm?
If any Finish[i] remains false after all possible allocations
If the Request matrix is empty
If the Work vector has been exhausted
If all processes have completed their execution
Which method requires the system to have prior information about the resources a process will request and use?
Deadlock Avoidance
Deadlock Detection and Recovery
Deadlock Prevention
Ignoring the problem
