Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Operating Systems Worksheet

Total questions: 150

Worksheet time: 1hrs 15mins

Name
Class
Date
1.

Which of the following is an incorrect statement?

a)

Operating system is a program that runs on the computer even if it is turned off.

b)

Mainframe operating system and operating system for embedded devices are same in terms of functionalities and services provided to the users.

c)

Operating system is a program that acts as a resource allocator.

d)

Ubuntu and Fedora are Linux operating systems.

2.

Which of the following is not a hardware component of computer system architecture?

a)

Word processor

b)

Secondary storage devices

c)

Processor

d)

Main memory

3.

Which of the following is wrong about Operating System?

a)

Ensures unfair resource usage

b)

Maximizes resource utilization

c)

Handles and resolves simultaneous and conflicting resource requests

d)

Manages all resources

4.

Which of the following is correct about Operations of OS?

a)

Antivirus is an OS Utility.

b)

Device drivers are software that perform memory allocation for processes.

c)

Full form of CLI is Command Line Integration.

d)

GUI stands for Graphical User Intuition.

5.

Which hardware component is bypassed in Direct Memory Access (DMA)?

a)

CPU

b)

I/O devices

c)

DMA controller

d)

Main memory

6.

Which of the following is false about Device Controller?

a)

Device controller is a part of the cache memory.

b)

Device Controller manages a specific type of hardware device.

c)

Device Controller bridges the gap between the hardware device and the OS.

d)

Device Controller is a hardware component.

7.

Which of the following is not correct about interrupts?

a)

Addresses of all ISRs are stored on the system stack.

b)

IVT stands for Interrupt Vector Table.

c)

When an I/O operation completes, the processor is informed via an interrupt.

d)

ISR stands for Interrupt Service Routine.

8.

Which of the following is correct about dual mode of operations?

a)

Kernel mode is also called supervisor mode.

b)

User mode has mode bit value of 2.

c)

ISRs are executed in user mode.

d)

Kernel mode has mode bit value of 1.

9.

Disk scheduling is part of which OS service?

a)

Storage management

b)

Protection and security

c)

Process management

d)

Memory management

10.

Which of the following is false about a single processor system?

a)

System reliability is high.

b)

Multiple processes can be present in the main memory simultaneously.

c)

System throughput is not very high.

d)

Only one process can be executed at a time.

11.

Job pool is present in:

a)

Secondary storage

b)

Cache memory

c)

Main memory

d)

Disk controller

12.

Which of the following is true regarding multitasking system?

a)

Response time is low.

b)

There is little scope of user interaction.

c)

The system does not switch among the various processes/tasks.

d)

Multiple processes are never present in the main memory simultaneously.

13.

Which of the following is true for a multiprocessor system?

a)

Each processor of a multiprocessor system has its own cache memory.

b)

Main memory is not shared by the processors.

c)

Peripheral devices are not shared among processors.

d)

Multiprocessor systems have very low reliability.

14.

Which of the following is true for multicore systems?

a)

Two or more computing cores are present on a single processor chip.

b)

Exactly four computing cores are always present on a single processor chip.

c)

Exactly two computing cores are always present on a single processor chip.

d)

Exactly three computing cores are always present on a single processor chip.

15.

Which of the following is false?

a)

Peer-to-peer systems do not involve any communication network.

b)

Peer-to-peer systems are distributed systems.

c)

There is no server in peer-to-peer systems.

d)

Clustered system provides high availability.

16.

Which of the following is false?

a)

Web browser is a system program.

b)

A single OS is not suitable for all types of computing systems that we encounter.

c)

OS acts as an intermediary between the users and the hardware of the computer.

d)

Main memory is part of the computer system architecture.

17.

Which of the following computing systems is not meant for individual usage?

a)

Mainframe computer

b)

Personal computer

c)

Mobile phone

d)

Tablet

18.

During interrupt handling, the content of the program counter of the interrupted program is saved on the system stack because:

a)

once interrupt handling is completed, the execution of the interrupted program needs to be resumed.

b)

the interrupt service routine needs to be examined

c)

the interrupted program can be terminated once the interrupt has been handled.

d)

the interrupt service routine is to be located

19.

Which of the following statements is true?

a)

Multiprogramming is possible in both single processor systems and multiprocessor systems.

b)

Multiprogramming is possible only in multiprocessor systems.

c)

Multiprogramming is not possible in single processor systems.

d)

Multiprogramming is neither possible in single processor systems nor in multiprocessor systems.

20.

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)

A user of this multitasking system can interact with ten executing processes simultaneously.

b)

A user of this multitasking system will always be able to interact with only four executing processes simultaneously.

c)

A user of this multitasking system will always be able to interact with less than four executing processes simultaneously.

d)

A user of this multitasking system has no scope of interacting with any of the executing processes.

21.

Choose the false statement.

a)

In GUI, we need to remember complex commands.

b)

In CLI, we can have faster access and operation.

c)

In GUI, shortcuts are provided.

d)

In CLI, we can use scripts to automate repetitive tasks.

22.

Which of the following is correct about Graphical User Interface?

a)

It is also called a desktop environment.

b)

Elements are not represented using any icons.

c)

It is not at all user friendly.

d)

Each and every action requires the user to enter a command.

23.

Which of the following is not a valid shell?

a)

MemeShell

b)

KornShell

c)

Bourne Again Shell

d)

Bourne Shell

24.

Which of the following statements about system calls and APIs is correct?

a)

Accessing system calls via APIs reduces the cognitive load of programmers.

b)

System calls are executed in user mode.

c)

When a user program requires an OS service, first a system call is invoked which in turn invokes an API function.

d)

An API function never returns a value.

25.

Which of the following types of system calls is primarily used for handling processes?

a)

Process management system calls

b)

File management system calls

c)

Information maintenance system calls

d)

Device management system calls

26.

Which command would you use to display some text on the console?

a)

echo

b)

sudo

c)

du

d)

cal

27.

Which command is used to display the contents of a file on the console?

a)

cat

b)

diff

c)

rm

d)

cp

28.

What is the effect of the following command on the file example.txt: chmod 754 example.txt?

a)

Grants the user read, write, and execute permissions; the group read and execute permissions; and others read permission.

b)

Grants the user read and execute permissions; the group read, write, and execute permissions; and others no permissions.

c)

Grants the user read, write, and execute permissions; the group read and execute permissions; and others execute permissions.

d)

Grants the user read, write, and execute permissions; the group read and execute permissions; and others no permissions.

29.

Which command is used to display a dynamic snapshot of the currently executing processes on the system?

a)

top

b)

tree

c)

ps -el

d)

kill

30.

You want to find all occurrences of the word hat in the file abc.txt. What command will you use?

a)

grep hat abc.txt

b)

hat grep abc.txt

c)

abc.txt hat grep

d)

grep abc.txt hat

31.

Which of the following statements about monolithic kernels is correct?

a)

Monolithic kernels exhibit high performance due to little overhead in the system call interface.

b)

Monolithic kernels are easy to extend by adding new services.

c)

Monolithic kernels are modular in nature.

d)

Monolithic kernels are generally very secure.

32.

Which of the following is most related to a layered kernel architecture?

a)

Layered kernel is organized into layers, where each layer depends on the functionalities provided by the layers below it.

b)

In layered kernel architecture, the topmost layer is the hardware.

c)

Non-essential services are dynamically linked with the kernel at run time.

d)

The kernel is divided into distinct modules.

33.

Which of the following is related to microkernel architecture?

a)

It runs services like device drivers and file systems in user space.

b)

It is larger in size.

c)

Additional service inclusion always requires modification of the kernel.

d)

It integrates all system services directly into kernel space for maximum performance.

34.

Which of the following is not related to loadable kernel modules?

a)

Presence of well defined interface for only certain modules

b)

Dynamic linking of services

c)

Inter-module communication via module interface

d)

Additional services linked in via modules

35.

Which of the following is true for hybrid kernel?

a)

A hybrid kernel can be created by incorporating the features of loadable kernel modules.

b)

A hybrid kernel is always created by combining the features of only two kernel architectures.

c)

A hybrid kernel should never incorporate the features of a microkernel.

d)

A hybrid kernel should never incorporate the features of a monolithic kernel.

36.

EPROM stands for

a)

Erasable Programmable Read-Only Memory

b)

Extensively Programmable Read-Only Memory

c)

Essential Programmable Read-Only Memory

d)

Electronic Programmable Read-Only Memory

37.

When is POST executed?

a)

At boot time

b)

When first user process is executed

c)

During shut down time

d)

After kernel is loaded

38.

Which of the following reads the boot block content into the RAM?

a)

BIOS

b)

Second level bootloader

c)

Kernel

d)

POST

39.

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?

a)

ls -l P* chmod 777 P* ls -l P*

b)

ls -l chmod 777 ls -l

c)

ls -l chmod 777 P* ls

d)

ls chmod 777 ls

40.

Which of the following statements is correct?

a)

Loadable kernel modules are more flexible than layered kernel since there is no dependency regarding the invocation of the modules.

b)

Monolithic kernel is more secure than microkernel.

c)

Layered kernel is faster than monolithic kernel.

d)

Microkernel is faster than monolithic kernel.

41.

Which of the following statements is true?

a)

If a 2nd level bootloader is present, then the 2nd level bootloader loads the kernel onto the RAM.

b)

POST checks whether all the software components of the system are working properly.

c)

BIOS is stored on RAM.

d)

POST runs after the 1st level bootloader has executed.

42.

Which of the following is true?

a)

The table of system calls is indexed by the numbers associated with the system calls.

b)

Programs developed using system calls rather than API calls are portable.

c)

A user program can read from a file entirely in user mode.

d)

An API function is characterized only by its name and the parameters passed to it.

43.

When considering the memory organization of a process, which of the following is correct?

a)

The text section contains the program code.

b)

The heap contains the contents of the processor registers.

c)

The stack contains the program code.

44.

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?

a)

Waiting state

b)

Terminated state

c)

Ready state

d)

New state

45.

Which of the following correctly describes the information that contains priorities, scheduling queue pointers, and scheduling parameters for a process?

a)

CPU scheduling information

b)

CPU registers

c)

Memory-management information

d)

Program counter

46.

When the CPU performs a context switch, which of the following correctly describes the procedure and the associated considerations of process context switch?

a)

The CPU pauses execution of the old process, saves its state in the PCB, and loads the state of the new process.

b)

The context of a process, including CPU registers, program counter content, and process state, is irrelevant to a context switch.

c)

The CPU continues executing the old process while loading the new process state.

d)

Context-switch time, however high it is, does not impact system performance.

47.

What is the primary role of the init process in a Unix-based operating system?

a)

To create other processes

b)

To handle file system operations

c)

To manage network connections

d)

To compile and execute programs

48.

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?

a)

0 to the child process and the child's PID to the parent process

b)

0 to the parent process and -1 to the child process

c)

1 to the parent process and 0 to the child process

d)

The child's PID to both the parent and child processes

49.

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?

a)

fork(), exec(), wait()

b)

exec(), wait(), fork()

c)

wait(), fork(), execlp()

d)

execlp(), fork(), wait()

50.

Which of the following correctly describes a zombie process and an orphan process?

a)

A zombie process is a terminated process still listed in the process table; an orphan process is a running process whose parent has terminated.

b)

A zombie process is a running process without a parent; an orphan process is a terminated process still listed in the process table.

c)

A zombie process is a waiting process without a parent; an orphan process is a terminated process that can be restarted.

51.

What is one of the primary benefits of using Interprocess Communication (IPC)?

a)

It allows processes to share and exchange data.

b)

It reduces the number of processes running on the system.

c)

It eliminates the need for memory allocation.

d)

It increases the security of the system.

52.

What is one benefit of using shared memory for Interprocess Communication (IPC)?

a)

It provides fast data exchange as processes can directly access the same memory space.

b)

It allows processes to communicate through network connections.

c)

It automatically synchronizes access between processes.

d)

It eliminates the need for process creation.

53.

In message passing based IPC, what is a key feature of indirect communication that distinguishes it from direct communication?

a)

Messages are sent to and received from mailboxes.

b)

Processes must name each other explicitly.

c)

Indirect communication only allows sending of messages, but not receiving of messages.

d)

Processes must share a common address space.

54.

How is a message queue referenced?

a)

system-wide unique identifier

b)

system-wide unique name

c)

its size

d)

PID of the process creating it

55.

What is the primary purpose of using ordinary pipes in Interprocess Communication (IPC)?

a)

To allow one process to send data to another process in a unidirectional flow.

b)

To provide a way for processes to directly access each other’s memory space.

c)

To allow a process to create more processes.

d)

To execute commands in parallel processes.

56.

Job queue resides on

a)

secondary storage

b)

main memory

c)

cache memory

d)

CPU registers

57.

Degree of multiprogramming is equal to the

a)

number of jobs present in the ready queue of the system.

b)

number of jobs present in the job queue of the system.

c)

number of jobs present in a single device queue of the system.

d)

number of jobs present in all the device queues of the system.

58.

What is the role of a device queue in process management?

a)

To hold processes that are waiting for I/O operations.

b)

To hold processes that are waiting for CPU time.

c)

To store processes that are currently being executed by the CPU.

d)

To keep track of processes that have terminated.

59.

Which of the following is correct?

a)

More I/O-bound processes decrease CPU utilization, while more CPU-bound processes decrease I/O device utilization.

b)

More I/O-bound processes increase CPU utilization, while more CPU-bound processes decrease I/O device utilization.

c)

More I/O-bound processes increase CPU utilization, while more CPU-bound processes increase I/O device utilization.

d)

More CPU-bound processes decrease CPU utilization, while more I/O-bound processes decrease I/O device utilization.

60.

Swapping is performed by

a)

the medium-term scheduler

b)

the long-term scheduler

c)

the short-term scheduler

d)

the CPU scheduler

61.

What is a key characteristic of threading in a program?

a)

Threads allow a program to perform multiple tasks concurrently.

b)

Threads are less lightweight than processes.

c)

Threads of the same process run in separate address spaces.

d)

Threads are completely independent and do not share any resources.

62.

Why are threads considered lightweight compared to processes?

a)

Threads share the same address space and resources within a process.

b)

Threads have their own stacks.

c)

Each thread has its own register set.

d)

Threads can run on individual processors.

63.

Which of the following is not a motivation for multithreading?

a)

Threads eliminate the need for memory management.

b)

Most of the current software applications are multithreaded.

c)

Threads allow users to interact with multiple aspects of the same application.

d)

Threads allow multiple similar tasks to be executed within the same application.

64.

What of the following is not a benefit of multithreading?

a)

Storage management

b)

Economy

c)

Resource sharing

d)

Responsiveness

65.

What is one advantage of multicore programming?

a)

It enables multiple threads to run in parallel, improving overall system resource utilization and performance.

b)

It ensures that programs will not have any bugs.

c)

It eliminates the need for memory management for threads.

d)

It allows a single thread to run faster than on a single-core processor.

66.

Which of the following is not a challenge of multicore programming?

a)

Keeping a backup of data

b)

Identifying data dependency

c)

Striking balance

d)

Testing and debugging

67.

What is the primary difference between parallelism and concurrency in programming?

a)

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.

b)

Parallelism only applies to single-threaded programs, while concurrency applies to multithreaded programs.

c)

Concurrency requires multiple processors to function, while parallelism can be achieved on a single processor.

d)

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.

68.

Which of the following examples best illustrates data parallelism?

a)

Splitting a large dataset among multiple processors/tasks, each performing the same operation on their portion of the data simultaneously.

b)

A single processor performing multiple tasks by switching between them rapidly.

c)

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.

d)

One processor/task sorts a list while another processor/task searches a different list at the same time.

69.

What is the primary difference between user level threads and kernel level threads?

a)

Kernel level threads can be scheduled on different processors by the operating system, while user level threads are limited to a single processor.

b)

User level threads do not require any synchronization mechanisms, while kernel level threads do.

c)

User level threads are managed by the operating system, while kernel level threads are managed by the user level threads library.

d)

Context switching for both user level threads and kernel level threads require kernel support.

70.

Which of the following statements best describes the many-to-one threading model?

a)

Multiple user level threads are mapped to a single kernel level thread.

b)

Multiple user level threads are mapped to multiple kernel level threads.

c)

One user level thread is mapped to one kernel level thread.

d)

Multiple kernel level threads are mapped to a single user level thread.

71.

In the one-to-one model, if there are 5 user level threads, how many kernel level threads will be present?

a)

5

b)

6

c)

4

d)

1

72.

Which of the following best describes the relationship between user level and kernel level threads in the two-level threading model?

a)

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.

b)

All user level threads are mapped to a single kernel level thread, which limits parallel execution.

c)

Each user level thread is always mapped to a specific kernel level thread, with no flexibility for different mappings.

d)

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.

73.

Which of the following is used to identify a thread in the Pthreads library?

a)

pthread_t

b)

pthread_t_tid

c)

pthread_attr_t

d)

pthread_tid

74.

Which of the following functions is used to initialize the attributes of a thread?

a)

pthread_attr_init()

b)

pthread_exit()

c)

pthread_attr_destroy()

d)

pthread_create()

75.

In which header file is pthread_join() defined?

a)

pthread.h

b)

stdlib.h

c)

stdio.h

d)

malloc.h

76.

Which of the following is true?

a)

In asynchronous multithreading, there is less data sharing among the threads.

b)

In synchronous multithreading, the parent thread runs parallelly with the child threads.

c)

In synchronous multithreading, a parent thread can create only a single child thread.

d)

In synchronous multithreading, the child threads wait for the parent thread to terminate.

77.

What is the return type of pthread_cancel()?

a)

int

b)

void

c)

float

d)

long int

78.

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?

a)

direct message passing

b)

ordinary pipe

c)

shared memory

d)

indirect message passing

79.

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?

a)

Two-level model

b)

One-to-One model

c)

Many-to-One model

d)

Many-to-Many model

80.

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?

a)

Both data and task parallelism

b)

No parallelism at all

c)

Task parallelism

d)

Data parallelism

81.

Which of the following is not shared by threads belonging to the same process?

a)

stack

b)

code

c)

files

d)

data

82.

Which of the following is not a valid process state transition?

a)

waiting to running

b)

new to ready

c)

running to waiting

d)

running to ready

83.

In a TCB, which of the following components is crucial for saving the thread's execution context during a context switch?

a)

The thread's execution context, including register values, program counter, and stack pointer.

b)

The thread's memory management information, including page tables and virtual memory mappings.

c)

The code section of the thread.

d)

The thread's file descriptors and network connections.

84.

When a process P is selected by the short-term scheduler, which one of the following state transitions occurs for P?

a)

ready to running

b)

running to waiting

c)

running to terminated

d)

waiting to ready

85.

What is a key effect of cooperating processes on data or files?

a)

Cooperating processes can concurrently access and modify shared data or files.

b)

Cooperating processes eliminate the need for synchronization mechanisms.

c)

Cooperating processes always run in separate memory spaces and do not affect each other's data.

d)

Cooperating processes never share data or files.

86.

What is a race condition in the context of concurrently executing processes?

a)

A race condition occurs when the outcome of execution depends on the ordering of accesses to shared data by multiple processes.

b)

A race condition is something that eliminates the need for using any synchronization mechanism.

c)

A race condition guarantees data consistency and integrity even in the case of concurrently executing processes.

d)

A race condition occurs when multiple processes run in a sequential order without any synchronization issues.

87.

Why is process synchronization required?

a)

Process synchronization ensures that multiple processes can access shared resources in a controlled and consistent manner.

b)

Process synchronization allows processes to run without any dependencies on each other.

c)

Process synchronization is used to completely eliminate the need for communication between processes.

d)

Process synchronization is important to ensure that each process runs in its own memory space without interference from other processes.

88.

Which of the following is true regarding process synchronization to ensure proper coordination among processes?

a)

Mutual Exclusion ensures the consistency of the shared data even in the face of concurrent accesses whereas bounded waiting ensures fairness.

b)

Bounded Waiting ensures that the number of processes waiting to enter the critical section is unlimited.

c)

Mutual Exclusion ensures that all processes can access the critical section simultaneously.

d)

Progress guarantees that a process in the critical section will be delayed indefinitely by other processes.

89.

What is a key feature of Peterson's solution for process synchronization?

a)

Peterson's solution ensures mutual exclusion, progress, and bounded waiting for two processes.

b)

Peterson's solution is guaranteed to work on any computer architecture.

c)

Peterson's solution is not related to process synchronization.

d)

Peterson's solution allows multiple processes to enter the critical section simultaneously.

90.

How does Peterson's solution satisfy the three requirements for process synchronization?

a)

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

b)

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

c)

by allowing both processes to enter the critical section at the same time

d)

by eliminating the need for synchronization mechanisms entirely

91.

How does the test_and_set() function help achieve mutual exclusion in process synchronization?

a)

by returning the value of the lock variable before it is set to true

b)

by setting lock to false in the exit section

c)

by returning a boolean variable

d)

by using a boolean variable lock

92.

Which of the following is true for mutex locks?

a)

Both acquire() and release() are atomic.

b)

acquire() and release() are not atomic.

c)

acquire() is atomic, but release() is not atomic.

d)

acquire() is not atomic, but release() is atomic.

93.

Which of the following is a disadvantage of mutex locks?

a)

wastage of CPU cycles

b)

not providing mutual exclusion

c)

necessitate process context switch

d)

makes the critical section of a program very large

94.

What is the data type of a semaphore variable?

a)

int

b)

char

c)

float

d)

double

95.

What is the primary difference between a binary semaphore and a counting semaphore? Consider semaphore implementation with busy waiting.

a)

A binary semaphore can only take values 0 and 1, while a counting semaphore can take any non-negative integer value.

b)

A binary semaphore can have any non-negative integer value, while a counting semaphore is restricted to values 0 and 1.

c)

There is no difference between a binary semaphore and a counting semaphore.

d)

A binary semaphore is used for counting resources and not mutual exclusion, while a counting semaphore is used for mutual exclusion.

96.

What is an example of improper use of semaphores in process synchronization?

a)

Using semaphores to manage single-threaded operations without any shared resources.

b)

Using counting semaphores to keep track of the access to a specific number of resources.

c)

Using semaphores to manage access to a shared resource among multiple processes.

d)

Using binary semaphores to enforce mutual exclusion in critical sections.

97.

In the Producer-Consumer problem, what is the role of the consumer?

a)

To remove items from the shared buffer and process them.

b)

To manage the synchronization between multiple producers.

c)

To ensure the buffer is always full.

d)

To ensure that the producer blocks when the buffer is full.

98.

In the solution to the producer-consumer problem, which of the following is a binary semaphore?

a)

sem

b)

full

c)

n

d)

empty

99.

In the Dining Philosophers problem, which of the following corresponds to process?

a)

philosopher

b)

bowl of rice

c)

chopstick

d)

table

100.

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.

a)

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.

b)

Ensuring that a philosopher keeps on holding onto a chopstick even if the other one is not available.

c)

Allowing each philosopher to eat with only one chopstick.

101.

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.

a)

4

b)

-1

c)

-4

d)

3

102.

Which of the following is true?

a)

Semaphore implementation with busy waiting may cause the semaphore value to be negative.

b)

Spinlock does not cause busy waiting.

c)

Peterson’s solution is a hardware-based solution.

103.

In a typical program, which of the following code segments determines which process can next execute the critical section?

a)

entry section

b)

exit section

c)

remainder section

d)

mutual exclusion section

104.

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.

a)

7

b)

3

c)

-7

d)

4

105.

Which metric evaluates how efficiently the CPU is used?

a)

CPU Utilization

b)

Turnaround Time

c)

Throughput

d)

Waiting Time

106.

Which performance metric measures the total time from the submission of a process to its completion?

a)

Turnaround Time

b)

Throughput

c)

Waiting Time

d)

CPU Utilization

107.

In non-preemptive scheduling, when is a new process selected to run?

a)

When a process terminates or when an explicit system request causes a wait state.

b)

When a higher priority process arrives or when a process finishes its CPU burst.

c)

When a process is created or when a process requests I/O.

d)

When the CPU is idle or when a process is suspended.

108.

What is dispatch latency?

a)

The time taken by the dispatcher to stop one process and start another running.

b)

The time taken by the CPU scheduler to select a process from the ready queue.

c)

The time taken by the system to switch from user mode to kernel mode.

d)

The time taken by a process to complete its CPU burst.

109.

Which scheduler is responsible for deciding which processes should be brought into the ready queue from the job queue?

a)

Long-term scheduler

b)

Medium-term scheduler

c)

Short-term scheduler

d)

I/O scheduler

110.

Which queue contains processes that are waiting for keyboard and a printer?

a)

Device queue

b)

Job queue

c)

PCB queue

d)

Ready queue

111.

Which characteristic is crucial for a scheduling algorithm to minimize in an interactive system, such as an online video game?

a)

Response Time

b)

Scheduling Time

c)

Waiting Time

d)

Throughput

112.

What happens during a context switch?

a)

The state of the old process is saved, and the state of the new process is loaded.

b)

A new process is created.

c)

A process is terminated.

d)

The CPU is idle.

113.

Which type of process often requires quicker response times and may have higher priority in multilevel queue scheduling?

a)

Foreground processes

b)

Batch processes

c)

Background processes

d)

System processes

114.

What happens if the time quantum in round-robin scheduling is set too small?

a)

There will be high context-switching overhead.

b)

Long CPU burst processes will finish first.

c)

The CPU will be underutilized.

d)

The system behaves like a First-Come, First-Served (FCFS) algorithm.

115.

What is the primary characteristic of applications that fall under real-time systems?

a)

They operate with low latency and provide prompt responses to external stimuli.

b)

They require large memory usage.

c)

They primarily run in batch mode.

d)

They prioritize graphical performance.

116.

In Preemptive Priority Scheduling, what happens when a new process with a higher priority arrives?

a)

The new process immediately starts executing, preempting the current process.

b)

The new process waits for the current process to finish.

c)

The process with the lowest burst time is executed.

d)

The current process continues until it finishes.

117.

How can the issue of starvation be addressed in Priority Scheduling?

a)

By gradually increasing the priority of waiting processes over time

b)

By using a round-robin scheduling algorithm

c)

By increasing the burst time of waiting processes

d)

By decreasing the memory usage of processes

118.

What problem can occur with SJF scheduling if there is a continuous influx of short jobs?

a)

Starvation of long jobs

b)

Increased average turnaround time

c)

Starvation of short jobs

d)

Decreased context switching overhead

119.

What is the finish time for Process P1 if its arrival time is 2 ms and its turnaround time is 15 ms?

a)

17 ms

b)

13 ms

c)

10 ms

d)

20 ms

120.

Which of the following is a characteristic of the Shortest Job First (SJF) scheduling algorithm?

a)

It can be preemptive or non-preemptive.

b)

It is also known as First-Come, First-Served (FCFS) scheduling.

c)

It always leads to starvation for longer processes.

d)

Processes with the longest burst time are executed first.

121.

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?

a)

11 ms

b)

9 ms

c)

8 ms

d)

6 ms

122.

What is the response time for Process P4 if its first response time is 13 ms and its arrival time is 5 ms?

a)

8 ms

b)

5 ms

c)

13 ms

d)

10 ms

123.

What is the turnaround time for Process P4 if its arrival time is 5 ms and its finish time is 10 ms?

a)

5 ms

b)

7 ms

c)

10 ms

d)

12 ms

124.

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?

a)

4 ms

b)

6 ms

c)

12 ms

d)

8 ms

125.

Which of the following is NOT a criterion used by process scheduling algorithms?

a)

Reducing main memory size

b)

Ensuring fairness among processes

c)

Maximizing CPU utilization

d)

Minimizing turnaround time

126.

What is the main role of the medium-term scheduler?

a)

To temporarily remove processes from main memory and place them on secondary memory, or vice versa

b)

To decide which processes should be brought into the ready queue from the job queue

c)

To handle the scheduling of processes that are blocked and waiting for I/O resources

d)

To allocate CPU to processes in the ready queue

127.

Consider a five state model. Which state transitions invoke the CPU scheduler?

a)

From running to waiting, from running to ready, from waiting to ready, and running to termination

b)

From new to ready, from ready to running, from running to blocked, and process creation

c)

From waiting to running, from ready to running, from running to blocked, and process suspension

d)

From ready to blocked, from running to new, from waiting to running, and process termination

128.

What is the main difference between non-preemptive and preemptive scheduling?

a)

Non-preemptive scheduling does not allow a running process to be interrupted, while preemptive scheduling does.

b)

Neither allows a running process to be interrupted.

c)

Both allow a running process to be interrupted.

d)

Non-preemptive scheduling allows a running process to be interrupted, while preemptive scheduling does not.

129.

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 ______

a)

2.8 and 7.2

b)

2.5 and 7.0

c)

2.6 and 7.1

d)

1.9 and 6.9

130.

What does a cycle in a Resource Allocation Graph indicate when there is only one instance per resource type?

a)

There is definitely a deadlock.

b)

There might be a deadlock.

c)

The system is in a safe state.

d)

There is no deadlock.

131.

Which of the following methods involves taking action to ensure that the system never enters a deadlock state?

a)

Deadlock Prevention and Deadlock Avoidance

b)

Resource Allocation Scheduling

c)

Deadlock Detection and Recovery

d)

Ignoring the problem

132.

What is the correct sequence a process must follow to use a resource in an operating system?

a)

Request, use, release

b)

Lock, unlock, release

c)

Allocate, lock, use

d)

Use, release, request

133.

What is the 'Circular Wait' condition in a deadlock scenario?

a)

A set of processes are waiting for each other in a circular chain.

b)

Processes are waiting for a resource that is not available.

c)

Processes are holding multiple resources simultaneously.

d)

Processes are waiting in a linear sequence.

134.

Which of the following is one of the conditions that must be present for a deadlock to occur?

a)

Mutual Exclusion

b)

Infinite Resources

c)

Resource Preemption

d)

Sequential Processing

135.

In a Resource Allocation Graph, how is a request edge represented?

a)

A directed edge from a process to a resource.

b)

A directed edge from a resource to a process.

c)

An undirected edge between a process and a resource.

d)

A circular edge within a process.

136.

What is a deadlock in a multiprogramming environment?

a)

A state where processes are blocked because each is holding a resource and waiting for a resource held by another.

b)

A situation where processes can always acquire the resources they need.

c)

A scenario where all processes are finished, and resources are released.

d)

A condition where resources are infinite, and processes do not need to wait.

137.

What type of resources require mutual exclusion to prevent deadlocks?

a)

Non-sharable resources

b)

Sharable resources

c)

Virtual resources

d)

Both sharable and non-sharable resources

138.

There are two protocols to avoid Hold and Wait condition. Which protocol requires a process to acquire all needed resources before it begins execution?

a)

The first protocol for avoiding Hold and Wait condition

b)

The deadlock detection protocol

c)

The second protocol for avoiding Hold and Wait condition

d)

The mutual exclusion protocol

139.

What does the No Preemption condition mean in the context of deadlock prevention?

a)

A process cannot be forced to release its resources once they have been allocated.

b)

A process can only hold one resource at a time.

c)

A process can request resources as soon as they become available.

d)

Resources are automatically released after a fixed time period.

140.

What is the main requirement for the Deadlock Avoidance scheme?

a)

Requires complete information about resource requests and releases from the start.

b)

The ability to preempt resources at any time.

c)

Processes must acquire all resources before execution begins.

d)

The system must always be in a deadlock state.

141.

In Deadlock Avoidance, what defines a safe state?

a)

There is a sequence of processes that can finish without causing a deadlock.

b)

The system has entered a deadlock and cannot recover.

c)

All resources are allocated without considering future requests.

d)

Processes can hold resources indefinitely.

142.

What is the primary purpose of the Banker's Algorithm in deadlock avoidance?

a)

To allocate resources in a way that ensures the system remains in a safe state.

b)

To prevent processes from requesting more resources compared to other processes.

c)

To immediately grant all resource requests.

d)

To reduce the number of processes in the system.

143.

What does the Work vector represent in the Safety Algorithm?

a)

The number of currently available resources.

b)

The total number of resources in the system.

c)

The maximum resources needed by all processes.

d)

The resources currently allocated to each process.

144.

What does a safe sequence indicate in the context of the Safety Algorithm?

a)

The order in which processes can be allocated resources without causing a deadlock.

b)

The sequence in which processes must release their resources.

c)

The order in which the system should terminate processes.

d)

The maximum amount of resources that can be allocated to each process.

145.

What is the primary goal of the Resource Request Algorithm in the Banker's Algorithm?

a)

To ensure that a resource request can be granted while keeping the system in a safe state.

b)

To terminate processes that exceed their resource requests.

c)

To allocate resources to processes immediately.

d)

To calculate the total resources available in the system.

146.

Which of the following techniques is used to handle deadlocks by allowing the system to enter a deadlock state and then detecting it?

a)

Deadlock Detection

b)

Deadlock Prevention

c)

Deadlock Avoidance

d)

Resource Allocation

147.

What type of graph is used in deadlock detection when resources have a single instance?

a)

Wait-for Graph

b)

Resource Allocation Graph

c)

Process Resource Graph

d)

System State Graph

148.

Which of the following data structures are used in the deadlock detection algorithm for systems with multiple resource types?

a)

Available vector, Allocation matrix, Request matrix

b)

Process Table, Resource Table

c)

Wait-for Graph, Resource Allocation Graph

d)

Priority Queue, Mutex Locks

149.

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?

a)

If any Finish[i] remains false after all possible allocations

b)

If the Request matrix is empty

c)

If the Work vector has been exhausted

d)

If all processes have completed their execution

150.

Which method requires the system to have prior information about the resources a process will request and use?

a)

Deadlock Avoidance

b)

Deadlock Detection and Recovery

c)

Deadlock Prevention

d)

Ignoring the problem