WorksheetsOperating System Concepts - Multiple Choice Questions
Total questions: 97
Worksheet time: 49hrs 30mins
Which of the following is an incorrect statement?
Ubuntu and Fedora are Linux operating systems.
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.
Operating system is a program that runs on the computer even if it is turned off.
Which of the following is not a hardware component of computer system architecture?
Processor
Secondary storage devices
Word processor
Main memory
Which of the following is wrong about Operating System?
. Manages all resources
Maximizes resource utilization
. Handles and resolves simultaneous and conflicting resource requests
Ensures unfair resource usage
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 manages a specific type of hardware device.
Device controller is a part of the cache memory.
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?
When an I/O operation completes, the processor is informed via an interrupt.
IVT stands for Interrupt Vector Table.
Addresses of all ISRs are stored on the system stack.
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?
Memory management
Protection and security
Process management
Storage management
Which of the following is false about a single processor system?
System throughput is not very high.
Multiple processes can be present in the main memory simultaneously.
System reliability is high.
Only one process can be executed at a time.
Job pool is present in:
Disk controller
Cache memory
Main memory
Secondary storage
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?
Peripheral devices are not shared among processors.
Main memory is not shared by the processors.
Each processor of a multiprocessor system has its own cache memory.
Multiprocessor systems have very low reliability.
Which of the following is true for multicore systems?
Exactly four computing cores are always present on a single processor chip..
Two or more computing cores are 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?
A single OS is not suitable for all types of computing systems that we encounter.
Web browser is a system program.
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 not possible in single processor systems.
Multiprogramming is possible only in multiprocessor systems.
Multiprogramming is possible in both single processor systems and multiprocessor 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 will always be able to interact with less than four 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 can interact with ten 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?
Each and every action requires the user to enter a command.
Elements are not represented using any icons.
It is not at all user friendly.
It is also called a desktop environment.
Which of the following is not a valid shell?
Bourne Again Shell
KornShell
MemeShell
Bourne Shell
Which of the following is not correct?
System calls are written in a low-level programming language.
Input-output operations by application programs invoke system calls.
Memory access by application programs invoke system calls.
OS services are made available to application programs via system calls.
Which of the following statements about system calls and APIs is correct?
System calls are executed in user mode.
Accessing system calls via APIs reduces the cognitive load of programmers.
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?
Device management system calls
File management system calls
Information maintenance system calls
Process management system calls
Which command would you use to display some text on the console?
sudo
echo
du
cal
Which command is used to display the contents of a file on the console?
A. cat
B. diff
C. rm
D. 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.
Which command is used to display a dynamic snapshot of the currently executing processes on the system?
ps -el
tree
top
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 are generally very secure.
Monolithic kernels are easy to extend by adding new services.
Monolithic kernels are modular in nature.
Monolithic kernels exhibit high performance due to little overhead in the system call interface.
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 not related to loadable kernel modules?
dynamic linking of services
presence of well defined interface for only certain modules
inter-module communication via module interface
additional services linked in via modules
Which of the following is true for hybrid kernel?
A hybrid kernel should never incorporate the features of a microkernel.
A hybrid kernel is always created by combining the features of only two kernel architectures.
A hybrid kernel can be created by incorporating the features of loadable kernel modules.
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?
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
Which of the following statements is correct?
Microkernel is faster than monolithic kernel.
Monolithic kernel is more secure than microkernel.
Layered kernel is faster than monolithic kernel.
Loadable kernel modules are more flexible than layered kernel since there is no dependency regarding the invocation of the modules.
Which of the following statements is true?
POST runs after the 1st level bootloader has executed.
POST checks whether all the software components of the system are working properly.
BIOS is stored on RAM.
if a 2nd level bootloader is present, then the 2nd level bootloader loads the kernel onto the RAM.
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.
The data section contains the program counter.
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?
Terminated state
Waiting 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 registers
CPU scheduling information
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 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.
The CPU pauses execution of the old process, saves its state in the PCB, and loads the state of the new process.
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(), execlp(), wait()
execlp(), 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 waiting process without a parent; an orphan process is a terminated process that can be restarted.
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 terminated process still listed in the process table; an orphan process is a running process whose parent has terminated
What is one of the primary benefits of using Interprocess Communication (IPC)?
It increases the security of the system.
It reduces the number of processes running on the system.
It eliminates the need for memory allocation.
It allows processes to share and exchange data.
What is one benefit of using shared memory for Interprocess Communication (IPC)?
It allows processes to communicate through network connections.
It provides fast data exchange as processes can directly access the same memory space.
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?
Processes must name each other explicitly.
Messages are sent to and received from mailboxes.
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 a process to create more processes.
To provide a way for processes to directly access each other's memory space.
To allow one process to send data to another process in a unidirectional flow.
To execute commands in parallel processes.
Job queue resides on
cache memory
main memory
secondary storage
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 increase CPU utilization, while more CPU-bound processes decrease I/O device utilization.
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 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 long-term scheduler
the medium-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?
Each thread has its own register set.
Threads have their own stacks.
Threads share the same address space and resources within a process.
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?
Resource sharing
Economy
Storage management
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?
Testing and debugging
Identifying data dependency
Striking balance
Keeping a backup of data
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.
Which of the following examples best illustrates data parallelism?
One processor/task sorts a list while another processor/task searches a different list at the same time.
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.
A single processor performing multiple tasks by switching between them rapidly.
Splitting a large dataset among multiple processors/tasks, each performing the same operation on their portion of the data simultaneously.
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?
1
6
4
5
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.
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_destroy()
pthread_exit()
pthread_attr_init()
pthread_create()
In which header file, pthread_join() is defined?
stdio.h
stdlib.h
pthread.h
malloc.h
Which of the following is true?
In synchronous multithreading, the parent thread runs parallelly with the child threads.
In asynchronous multithreading, there is less data sharing among the threads.
In asynchronous 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()?
long int
void
float
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?
Many-to-One model
One-to-One model
Two-level 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.
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?
data
code
files
stack
Which of the following is not a valid process state transition?
ready to running
new to ready
new to waiting
running to waiting
In a TCB, which of the following components is crucial for saving the thread's execution context during a context switch?
The code section of the thread.
The thread's memory management information, including page tables and virtual memory mappings.
The thread's execution context, including register values, program counter, and stack pointer.
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 guarantees data consistency and integrity even in the case of concurrently executing processes.
A race condition is something that eliminates the need for using any synchronization mechanism.
A race condition occurs when the outcome of execution depends on the ordering of accesses to shared data by multiple 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 allowing both processes to enter the critical section at the same time
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 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 eliminating the need for synchronization mechanisms entirely
How does the test_and_set() function help achieve mutual exclusion in process synchronization?
by setting lock to false in the exit section
by returning the value of the lock variable before it is set to true
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?
makes the critical section of a program very large
not providing mutual exclusion
necessitate process context switch
wastage of CPU cycles
What is the data type of a semaphore variable?
int
char
float
double
What is the difference between a binary semaphore and a counting semaphore?
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.
Which of the following is related to microkernel architecture?
It is larger in size.
It runs services like device drivers and file systems in user space.
Additional service inclusion always requires modification of the kernel.
It integrates all system services directly into kernel space for maximum performance.
