Operating systems: structure, services, system calls, process management, interprocess communication and synchronization (semaphores, critical-section problem). - One Line Questions
1.
A deadlock occurs when: —
A set of processes are blocked indefinitely, each holding a resource and waiting to acquire a resource held by another process in the set.
2.
In the context of operating systems, what is a 'process'? —
An instance of a program in execution.
3.
A system call is best defined as: —
A request made by a user to the operating system for a service.
4.
What is a 'thread'? —
A lightweight unit of execution within a process, sharing resources with other threads of the same process.
5.
What does the term 'starvation' refer to in process scheduling? —
A situation where a process is repeatedly denied CPU access and never gets to execute.
6.
In the context of concurrency, what is a 'race condition'? —
A situation where the outcome of concurrent operations depends on the unpredictable timing of their execution, leading to incorrect results.
7.
What is a 'daemon' process in Unix-like operating systems? —
A background process that performs system services.
8.
A semaphore is a synchronization primitive that can be thought of as: —
A counter used to control access to a shared resource.
9.
Which of the following is a method for preventing deadlock? —
Ensuring at least one of the four necessary conditions for deadlock cannot hold.
10.
A mutex (mutual exclusion) lock is primarily used for: —
Ensuring that only one thread can access a critical section at a time.
11.
Which type of semaphore is initialized to 1 and is used to ensure mutual exclusion? —
Binary Semaphore
12.
The 'exec()' system call is used to: —
Replace the current process image with a new program.
13.
Which of the following is a classic example of a synchronization problem that can be solved using semaphores? —
The Producer-Consumer problem
14.
The `signal()` operation on a semaphore (also known as V operation) typically: —
Increments the semaphore value and potentially unblocks a waiting process.
15.
What is the main challenge in implementing a Round Robin scheduling algorithm? —
Determining the optimal time quantum.
16.
Which system call is typically used to create a new process? —
fork()
17.
What is the main advantage of kernel-level threads over user-level threads? —
Can run in parallel on multi-core processors without operating system intervention for each thread.
18.
Which scheduling algorithm aims to minimize the average waiting time by executing the process with the smallest execution time first? —
Shortest Job Next (SJN)
19.
Which system call is used by a process to terminate itself? —
exit()
20.
What is the primary advantage of a microkernel design? —
Increased reliability and maintainability as services run as separate processes.
21.
Which of the following is a benefit of using threads over processes? —
Lower overhead for creation and context switching.
22.
The `wait()` operation on a semaphore (also known as P operation) typically: —
Decrements the semaphore value and blocks the process if the value becomes negative.
23.
In a microkernel architecture, which of the following services are typically moved out of the kernel into user space? —
File system management and device drivers
24.
A critical section is a segment of code that: —
Accesses shared resources and must not be executed by more than one process at a time.
25.
Which operating system service is responsible for allocating CPU time to different processes? —
Process Management
26.
Which operating system structure involves a monolithic kernel that includes most OS services within a single large process? —
Monolithic Kernel
27.
Which of the following operating system structures is known for its modularity and extensibility? —
All of the above
28.
Which of the following is a fundamental requirement for solving the critical-section problem? —
Mutual Exclusion
29.
Which of the following is NOT one of the four necessary conditions for deadlock? —
Fairness
30.
The Process Control Block (PCB) is a data structure that contains: —
Information about the process's state, CPU registers, memory management, etc.
31.
Interprocess Communication (IPC) is essential for: —
Allowing processes to exchange data and synchronize their actions.
32.
In a kernel-level thread implementation, which entity is directly managed by the operating system scheduler? —
Threads
33.
Which of the following is an example of a system call used for file management? —
read()
34.
Which of the following scheduling algorithms is non-preemptive? —
First-Come, First-Served (FCFS)
35.
Which of the following is NOT a typical state of a process? —
Compiled
36.
When a process makes an I/O request, it typically transitions to which state? —
Waiting (or Blocked)
37.
Which of the following synchronization techniques can lead to 'busy waiting' (also known as spinning)? —
Spinlocks
38.
Which IPC mechanism allows processes to send and receive messages without sharing memory directly? —
Message Queues
39.
What does 'context switching' refer to in an operating system? —
Saving the state of a current process and loading the state of a new process to allow the CPU to resume execution.
40.
What is the purpose of the 'Ready' state in process management? —
The process is waiting to be assigned to the CPU.
41.
What is a potential problem if a process is preempted while it is in its critical section? —
Another process could enter the same critical section, violating mutual exclusion.
42.
In a preemptive scheduling algorithm, a running process can be interrupted by the scheduler if: —
A higher-priority process becomes ready to run.
43.
A 'blocking send' in message passing IPC means: —
The sending process is suspended until the message is received by the destination process.
44.
What is the main purpose of process scheduling? —
To maximize CPU utilization and minimize response time.
45.
Which of the following best describes the primary role of an operating system? —
To manage computer hardware and software resources, providing a platform for applications.
46.
What is the main purpose of the 'sleep()' system call? —
To allow a process to temporarily relinquish the CPU and go into a waiting state for a specified duration.
47.
What is the primary function of a scheduler in an operating system? —
To decide which process/thread gets to use the CPU next and for how long.
48.
What is the primary goal of the 'Producer-Consumer' problem in concurrency? —
To synchronize the actions of a producer process creating data and a consumer process using that data, using a shared buffer.
49.
What is a key function of the operating system's kernel? —
To provide core system services and manage hardware resources.
50.
Which of the following is an example of a user-level thread implementation? —
Solaris Green Threads (or similar user-level thread libraries)