Unit 2 - Practice Quiz

CSE316 65 Questions
0 Correct 0 Wrong 65 Left
0/65

1 Which of the following best describes a non-preemptive scheduling algorithm?

CPU scheduler - preemptive and non preemptive Easy
A. The process with the highest priority is always executed first, even if another process is running.
B. Each process is given a fixed time slice to execute.
C. Once a process starts running, it continues until it terminates or blocks itself for I/O.
D. The operating system can force a process to stop running to allocate the CPU to another process.

2 The First-Come, First-Served (FCFS) scheduling algorithm is implemented using a...

First come first serve Easy
A. Priority queue
B. LIFO (Last-In, First-Out) stack
C. Binary tree
D. FIFO (First-In, First-Out) queue

3 What is Turnaround Time in the context of CPU scheduling?

Scheduling criteria Easy
A. The amount of time the CPU is busy executing a specific process.
B. The time a process spends waiting in the ready queue.
C. The time it takes for a scheduler to select the next process to run.
D. The total time from a process's submission to its completion.

4 In the Round Robin scheduling algorithm, what is a 'time quantum' or 'time slice'?

Round robin Easy
A. The priority level assigned to a process.
B. A small, predefined unit of CPU time allocated to each process.
C. The total execution time required by a process.
D. The time a process spends waiting for I/O.

5 Which component is responsible for switching context, switching to user mode, and jumping to the proper location in the user program to restart that program?

Dispatcher Easy
A. Short-term scheduler
B. Dispatcher
C. Job queue
D. Long-term scheduler

6 The Shortest-Job-First (SJF) scheduling algorithm is optimal because it gives the minimum...

Shortest job first Easy
A. Average turnaround time
B. CPU utilization
C. Average waiting time
D. Maximum waiting time

7 Which of these scheduling algorithms is always preemptive by its standard definition?

CPU scheduler - preemptive and non preemptive Easy
A. First-Come, First-Served (FCFS)
B. Round Robin
C. Batch Scheduling
D. Non-preemptive Shortest-Job-First (SJF)

8 What is 'starvation' or 'indefinite blocking' in the context of priority scheduling?

Priority Easy
A. The system runs out of available memory to allocate to new processes.
B. Two or more processes are waiting for an event that can only be caused by one of the waiting processes.
C. A process uses too many system resources, causing others to slow down.
D. A low-priority process is repeatedly prevented from running because of a continuous stream of high-priority processes.

9 Which type of scheduler selects processes from the job pool and loads them into memory for execution?

Types of Scheduling Easy
A. Long-term scheduler (or job scheduler)
B. Dispatcher
C. Medium-term scheduler
D. Short-term scheduler (or CPU scheduler)

10 Which scheduling criterion aims to keep the CPU as busy as possible?

Scheduling criteria Easy
A. CPU utilization
B. Response time
C. Throughput
D. Waiting time

11 In Symmetric Multiprocessing (SMP), how are processes scheduled?

multiprocessor scheduling Easy
A. One processor acts as a master and schedules processes for all other slave processors.
B. Processors are dedicated to specific types of tasks.
C. Processes are statically assigned to a processor and never move.
D. Each processor is self-scheduling and runs a copy of the operating system.

12 What is the primary concern for a hard real-time operating system scheduler?

real time scheduling Easy
A. Maximizing the number of processes completed per hour.
B. Meeting a task's deadline is critical; missing a deadline is a system failure.
C. Minimizing the average response time for interactive users.
D. Ensuring fairness among all processes.

13 What is the 'convoy effect' in FCFS scheduling?

First come first serve Easy
A. When a long process blocks several short processes that are waiting behind it in the queue.
B. When the dispatcher takes too long to switch between processes.
C. When all processes arrive at the same time, causing a traffic jam.
D. When a high-priority process gets stuck behind a low-priority one.

14 When scheduling kernel-level threads, who is responsible for the scheduling decisions?

thread scheduling Easy
A. The Operating System kernel
B. The compiler
C. The user-level thread library
D. The application developer

15 What is the primary challenge in implementing the Shortest-Job-First (SJF) scheduling algorithm in a real system?

Shortest job first Easy
A. It requires a special hardware timer.
B. It can lead to excessive context switching.
C. It is a non-preemptive algorithm.
D. It is impossible to know the exact length of the next CPU burst for a process.

16 What is the main purpose of a Multi-Level Feedback Queue (MLFQ) scheduler?

Multi level feedback queue Easy
A. To ensure that every process gets an equal amount of CPU time.
B. To exclusively run high-priority system tasks.
C. To process jobs in the strict order they arrive.
D. To adapt to the behavior of processes, giving preference to shorter or I/O-bound jobs while preventing starvation.

17 What is 'aging' in the context of priority scheduling?

Priority Easy
A. A technique to decrease the priority of processes that have run for too long.
B. The process of a job getting older and thus less important.
C. A technique to gradually increase the priority of processes that have been waiting for a long time.
D. The time a process has been in the system.

18 The primary goal of a CPU scheduling algorithm is to...

Scheduling Algorithms Easy
A. Allocate memory to newly created processes.
B. Decide which of the processes in the ready queue is to be allocated the CPU.
C. Manage the I/O devices for all running processes.
D. Move processes from disk to main memory.

19 What happens in a Round Robin scheduler if the time quantum is set to be very large?

Round robin Easy
A. All processes will finish faster.
B. It behaves like the Shortest-Job-First (SJF) algorithm.
C. The system will crash due to too many context switches.
D. It behaves like the First-Come, First-Served (FCFS) algorithm.

20 In multiprocessor scheduling, what is 'load balancing'?

multiprocessor scheduling Easy
A. Balancing the number of user-level and kernel-level threads.
B. Ensuring that all I/O devices are equally busy.
C. The attempt to keep the workload evenly distributed across all processors.
D. The process of loading a program from disk into memory.

21 Consider three processes P1, P2, and P3 with CPU burst times of 6, 8, and 7 ms respectively. They all arrive at time 0. If the system uses a non-preemptive Shortest Job First (SJF) algorithm, what is the average waiting time for the three processes?

Shortest job first Medium
A. 7 ms
B. 0 ms
C. 6.33 ms
D. 9 ms

22 Consider three processes P1, P2, and P3 with CPU burst times of 6, 3, and 8 ms respectively. They all arrive at time 0. If the system uses a non-preemptive Shortest Job First (SJF) algorithm, what is the average waiting time for the three processes?

Shortest job first Medium
A. 3 ms
B. 4 ms
C. 5.67 ms
D. 9 ms

23 In a Round Robin scheduling algorithm, if the time quantum '' is set to be very large (i.e., larger than the longest burst time of any process), the algorithm's behavior will be most similar to which other scheduling algorithm?

Round robin Medium
A. Shortest Job First (SJF)
B. Priority Scheduling
C. First-Come, First-Served (FCFS)
D. Shortest Remaining Time First (SRTF)

24 A common problem with simple priority scheduling algorithms is indefinite blocking, or starvation, of low-priority processes. Which technique is commonly used to mitigate this problem?

Priority Medium
A. Preemption
B. Swapping
C. Dispatcher latency reduction
D. Aging

25 Which of the following scheduling algorithms is provably optimal for minimizing the average waiting time for a given set of processes?

Scheduling criteria Medium
A. First-Come, First-Served (FCFS)
B. Round Robin (RR)
C. Shortest Job First (SJF)
D. Priority Scheduling

26 In a typical Multi-Level Feedback Queue (MLFQ) scheduler, how are processes generally handled to favor shorter jobs and prevent starvation?

Multi level feedback queue Medium
A. All queues use the same large time quantum to ensure fairness.
B. A process is permanently assigned to a queue based on its initial burst time estimate.
C. A process that uses its full time quantum is moved to a lower-priority queue.
D. Processes in lower-priority queues are never executed if a higher-priority queue is not empty.

27 What is the primary function of the dispatcher, and what is the time it takes to perform this function called?

Dispatcher Medium
A. To determine the priority of processes; Aging time
B. To select a process from the ready queue; Scheduling time
C. To move processes from the job pool to main memory; Long-term latency
D. To switch context and load the state of a selected process onto the CPU; Dispatch latency

28 Consider a system with one CPU-bound process (long burst) and many I/O-bound processes (short bursts). If the CPU-bound process arrives first and is scheduled using the FCFS algorithm, what is the likely outcome?

First come first serve Medium
A. Optimal CPU and device utilization.
B. Starvation of the CPU-bound process.
C. The convoy effect, leading to poor device utilization.
D. Frequent context switching, increasing overhead.

29 A system is running a critical real-time task where the overhead of context switching is very high and unpredictable. In this specific scenario, which type of scheduling would likely be preferred to ensure a task completes its critical section without interruption?

CPU scheduler - preemptive and non preemptive Medium
A. Round Robin scheduling
B. Multi-level queue scheduling
C. Preemptive scheduling
D. Non-preemptive scheduling

30 An anti-lock braking system (ABS) in a car must respond to a wheel-locking event within a strict, fixed deadline. If the deadline is missed, the system fails, potentially causing an accident. This is an example of what kind of system?

Real time scheduling Medium
A. Interactive time-sharing system
B. Batch processing system
C. Hard real-time system
D. Soft real-time system

31 In multiprocessor scheduling, what is the concept of 'processor affinity' and why is it beneficial?

Multiprocessor scheduling Medium
A. It is the process of grouping processors into affinity groups that can only run certain types of threads.
B. It is the preference to keep a process running on the same CPU to leverage data already in that CPU's cache.
C. It is the tendency for a process to be randomly assigned to any available CPU to ensure load balancing.
D. It is a technique where all processes are restricted to a single master processor.

32 Consider a process with multiple user-level threads. If one of these threads makes a blocking system call (e.g., reading from a file), what is the effect on the other threads within the same process?

Thread scheduling Medium
A. Only the single thread that made the call will be blocked; the kernel schedules other threads.
B. The kernel will automatically convert the blocking call to a non-blocking one.
C. The other threads will continue to run in parallel on different processors.
D. The entire process, including all its user-level threads, will block.

33 A process has a CPU burst of 18 ms. The system uses Round Robin scheduling with a time quantum of 5 ms. How many context switches will occur for this specific process before it completes its burst?

Round robin Medium
A. 5
B. 3
C. 18
D. 4

34 Consider the following processes with arrival times and CPU burst times. Using the preemptive Shortest Job First (SJF) algorithm, also known as Shortest Remaining Time First (SRTF), what is the turnaround time for process P2?

| Process | Arrival Time | Burst Time |
|:---:|:---:|:---:|
| P1 | 0 | 8 |
| P2 | 1 | 4 |
| P3 | 2 | 9 |
| P4 | 3 | 5 |

Shortest job first Medium
A. 13 ms
B. 9 ms
C. 4 ms
D. 5 ms

35 Using the preemptive Shortest Job First (SRTF) algorithm, calculate the turnaround time for process P2 given the following data:

| Process | Arrival Time | Burst Time |
|:---:|:---:|:---:|
| P1 | 0 | 7 |
| P2 | 2 | 4 |
| P3 | 4 | 1 |
| P4 | 5 | 4 |

Shortest job first Medium
A. 6 ms
B. 5 ms
C. 4 ms
D. 7 ms

36 A system encounters a situation where a high-priority process (H) is blocked waiting for a resource held by a low-priority process (L). However, a medium-priority process (M) that doesn't need the resource is running, preventing L from running and releasing the resource. What is this classic synchronization problem called?

Priority Medium
A. Starvation
B. Deadlock
C. Convoy Effect
D. Priority Inversion

37 Which type of scheduler is responsible for controlling the degree of multiprogramming in a system?

Types of Scheduling Medium
A. Dispatcher
B. Long-term (job) scheduler
C. Short-term (CPU) scheduler
D. Medium-term scheduler

38 For an interactive, time-sharing system, which scheduling performance criterion is generally most important for ensuring a good user experience?

Scheduling Algorithms Medium
A. Turnaround Time
B. Throughput
C. Response Time
D. CPU Utilization

39 How are time quantum values typically assigned across different queues in a Multi-Level Feedback Queue (MLFQ) scheduler?

Multi level feedback queue Medium
A. Higher-priority queues are given a longer time quantum.
B. The time quantum is the same for all queues to ensure fairness.
C. The time quantum is dynamically calculated based on process burst time.
D. Higher-priority queues are given a shorter time quantum.

40 In Rate-Monotonic Scheduling (RMS), a common static-priority algorithm for real-time systems, how are priorities assigned to periodic tasks?

Real time scheduling Medium
A. Priority is assigned based on the execution time of the task; shorter tasks get higher priority.
B. Priority is assigned based on the task's deadline; tasks with earlier deadlines get higher priority.
C. Priority is assigned based on the task's period; tasks with shorter periods get higher priority.
D. All tasks are assigned the same priority and are scheduled using FCFS.

41 What is a primary challenge that load balancing attempts to solve in a Symmetric Multiprocessing (SMP) system?

Multiprocessor scheduling Medium
A. Keeping the workload evenly distributed across all processors to avoid idle CPUs while others are overloaded.
B. Ensuring that the cache of one processor is not invalidated by another.
C. Preventing high-priority processes from starving low-priority ones.
D. Migrating threads between user space and kernel space efficiently.

42 Consider a preemptive Shortest-Remaining-Time-First (SRTF) scheduler where the context switch overhead is a non-zero value, . A new process arrives with a burst time . The currently running process has a remaining burst time of . Under which precise condition will the scheduler preempt in favor of ?

Shortest job first Hard
A.
B.
C.
D.

43 In a Round Robin scheduling system, let be the time quantum, be the context switch time, and be the average CPU burst time of processes. Which of the following relationships leads to the worst combination of high turnaround time and low CPU efficiency?

Round robin Hard
A.
B.
C.
D.

44 Consider a Multi-Level Feedback Queue (MLFQ) scheduler with three queues: (highest priority, RR, ), (medium priority, RR, ), and (lowest priority, FCFS). A process is demoted if it uses its full quantum and promoted if it blocks for I/O. A CPU-bound process is designed to 'game' the scheduler to maximize its CPU time. What strategy would it employ?

Multi level feedback queue Hard
A. Always run for its full time quantum in every queue to show it's a long-running job.
B. Perform a CPU burst of 29ms, then issue an I/O request.
C. Perform a CPU burst of exactly 9ms, then issue a short, trivial I/O request.
D. Perform a CPU burst of 10ms, then voluntarily yield the CPU.

45 In a preemptive priority scheduling system, two processes and have base priorities of 10 and 20 respectively (lower number is higher priority). The system implements aging, increasing a process's priority (by lowering the priority number) by 1 for every 5 time units it waits. If arrives at with a burst of 30ms, and arrives at with a burst of 10ms, at what time does first get the CPU?

Priority Scheduling Hard
A. P2 never runs before P1 finishes
B. t = 16
C. t = 1
D. t = 21

46 Consider a preemptive Shortest-Remaining-Time-First (SRTF) scheduler where the context switch overhead is a non-zero value, . A new process arrives with a burst time . The currently running process has a remaining burst time of . Under which precise condition will a scheduler that aims to optimize completion time choose to preempt in favor of ?

Shortest job first Hard
A.
B.
C.
D.

47 In a Round Robin (RR) scheduling system, the time quantum is set to be equal to the context switch time . If the average CPU burst time of processes is much larger than (i.e., ), what is the approximate CPU efficiency, defined as the ratio of useful CPU time to total time (useful + overhead)?

Round robin Hard
A. Approaching 50%
B. Dependent on the number of processes in the ready queue.
C. Approaching 100%
D. Approaching 0%

48 A Multi-Level Feedback Queue (MLFQ) scheduler is designed with the following rules: N queues ( to , highest to lowest priority), a process entering is placed in , and if a process in uses its entire time quantum, it is demoted to . There is no mechanism for promotion or aging. What is the most significant flaw of this specific design?

Multi level feedback queue Hard
A. It cannot adapt if a process changes its behavior from CPU-bound to I/O-bound.
B. It requires complex prediction of CPU burst times.
C. It is functionally equivalent to FCFS.
D. It causes starvation for short, interactive jobs.

49 Consider a real-time system with two periodic tasks, and , where is computation time and is period. Analyze the schedulability of this task set under Rate-Monotonic (RM) and Earliest-Deadline-First (EDF) scheduling.

Real time scheduling Hard
A. Not schedulable by either RM or EDF.
B. Schedulable by both RM and EDF.
C. Schedulable by RM, but not by EDF.
D. Not schedulable by RM, but schedulable by EDF.

50 In a symmetric multiprocessing (SMP) system that employs soft processor affinity, a process becomes ready to run. Its 'home' processor, CPU1, where its cache data is hot, is currently busy. However, another processor, CPU2, is idle. The scheduler will choose to migrate to the idle CPU2 only if...

Multiprocessor scheduling Hard
A. The system's overall load is above 75%.
B. The process P has a lower priority than the process running on CPU1.
C. The process has been waiting in the ready queue for longer than a predefined threshold.
D. The estimated waiting time for CPU1 to become free is greater than the time cost of a full cache invalidation and repopulation on CPU2.

51 A process is implemented using a many-to-one user-level threading model (e.g., GNU Portable Threads) on a modern multi-core processor. One of the user-level threads in the process makes a blocking read() system call. What is the most direct and significant consequence for the other threads within the same process?

Thread scheduling Hard
A. The entire process, including all of its user-level threads, is blocked until the system call completes.
B. Only the single blocking thread is paused; other threads continue to execute concurrently within the process.
C. The user-level thread scheduler promotes another thread to run, but it cannot execute until the system call completes.
D. Other threads are immediately scheduled onto other available processor cores.

52 In an FCFS system, process (CPU burst 100ms) arrives at . Processes , , and (CPU burst 1ms each) all arrive at ms. Calculate the percentage increase in average waiting time for this arrival pattern compared to the optimal non-preemptive scheduling order.

First come first serve Hard
A. ~1000%
B. ~2500%
C. ~5800%
D. ~4200%

53 A preemptive priority scheduler uses aging. A process is executing with a static priority of 50 (lower value is higher priority). A waiting process, , has been in the ready queue for 30 seconds. The aging policy reduces a process's priority value by 2 for every 5 seconds it waits. To preempt at this exact moment (after 30s of waiting), what is the maximum possible integer initial priority that could have had?

Priority Scheduling Hard
A. 49
B. 50
C. 62
D. 61

54 Which of the following activities is exclusively the responsibility of the OS dispatcher and NOT the short-term (CPU) scheduler?

Dispatcher Hard
A. Determining the time quantum for a process in a Round Robin system.
B. Selecting the next process to run from the ready queue based on a priority heuristic.
C. Loading the registers, program counter, and memory management information from the PCB of the chosen process into the hardware registers.
D. Maintaining the ready queue of processes.

55 In SJF scheduling, the next CPU burst is predicted using exponential averaging with the formula . If a system administrator sets the value of to 1.0, what is the behavior of the scheduler?

Shortest job first Hard
A. The scheduler gives equal weight to the entire history of the process's execution.
B. The scheduler's prediction for the next burst is always equal to the actual length of the previous burst.
C. The scheduler's predictions become a simple average of all past burst times.
D. The scheduler's predictions become static and never change from the initial default value.

56 Consider an MLFQ scheduler where processes in a higher priority queue can preempt processes in a lower priority queue . A long-running CPU-bound process has been demoted to the lowest-priority queue. The system also implements aging, periodically boosting the priority of processes that have waited for a long time. What is the most likely interaction between the demotion and aging mechanisms?

Multi level feedback queue Hard
A. The process will be permanently stuck in the lowest queue, as aging cannot override the demotion rule.
B. The aging mechanism will be disabled for any process that has been demoted.
C. The process's priority will be boosted high enough for it to eventually receive CPU time, after which it will be immediately demoted again.
D. The process will oscillate between the lowest queue and a slightly higher queue, but never reach the top queue.

57 A system must be optimized for a multi-user interactive environment where it is critical for users to receive fast feedback after pressing a key (e.g., in a text editor). Which scheduling algorithm and performance metric pairing is most directly aligned with this goal?

Scheduling criteria Hard
A. Non-preemptive Priority Scheduling to maximize throughput.
B. Shortest Job First (SJF) to minimize average turnaround time.
C. Round Robin (RR) with a small time quantum to minimize response time.
D. First-Come, First-Serve (FCFS) to maximize fairness.

58 Under which of the following specific conditions would a non-preemptive scheduler be demonstrably superior to a preemptive one for a given workload?

CPU scheduler - preemptive and non preemptive Hard
A. In a batch processing system where all jobs are of similar, known, and short duration, and context switch overhead is very high.
B. When processes are mostly I/O-bound and have varying priorities.
C. In a real-time system with frequent arrivals of high-priority, urgent tasks.
D. In a multi-user interactive system where response time is critical.

59 A high-priority process and a low-priority process share a mutex lock. A medium-priority, CPU-bound process is also in the system. Consider the following sequence of events: 1. acquires the mutex. 2. arrives and preempts , then attempts to acquire the mutex and blocks. 3. starts running. This scenario is a classic case of priority inversion. Why is the execution of process the direct cause of the problem for process ?

Priority Scheduling Hard
A. Because M might also need the same mutex lock, creating a deadlock.
B. Because M's execution corrupts the data structure protected by the mutex.
C. Because M is running, it prevents the low-priority process L from running and releasing the lock that the high-priority process H needs.
D. Because M is CPU-bound, it starves process L.

60 In a Round Robin scheduler, consider the impact of the time quantum on I/O-bound processes versus CPU-bound processes. If is set to be significantly longer than the typical CPU burst of an I/O-bound process, what is the likely outcome?

Round robin Hard
A. I/O-bound processes will be demoted in priority.
B. CPU-bound processes will get more total CPU time.
C. The system will behave identically to FCFS scheduling for all processes.
D. I/O-bound processes will often not use their full quantum, implicitly giving them higher priority.

61 In a system scheduled by Earliest-Deadline-First (EDF), a transient overload occurs, making it impossible for two tasks, and , to both meet their deadlines. The deadline for is at , and the deadline for is at . Assuming no other tasks are active, what will be the behavior of a standard EDF scheduler?

Real time scheduling Hard
A. It will use a predefined rule to drop the task with the lower importance.
B. It will execute to completion and cause to miss its deadline.
C. It will execute to completion and cause to miss its deadline.
D. It will preemptively switch between and , causing both to miss their deadlines.

62 When developing a high-performance application on a multicore system that supports both Process Contention Scope (PCS) and System Contention Scope (SCS) for threads, a programmer would most likely choose PCS (many-to-one or many-to-many model) over SCS (one-to-one model) for a group of threads when...

Thread scheduling Hard
A. Each thread needs to perform frequent blocking system calls.
B. The number of threads is very large, and the overhead of creating kernel-level threads for each one is a significant performance concern.
C. The application needs to take maximum advantage of the underlying parallel processing hardware.
D. The threads require strict real-time scheduling guarantees from the operating system.

63 What is the primary problem in scheduling fine-grained parallel applications that Gang Scheduling is designed to solve?

Multiprocessor scheduling Hard
A. The scenario where threads of a parallel task are scheduled individually, with some running while others wait, preventing progress due to synchronization.
B. The inability to balance load evenly across multiple processors.
C. The overhead of context switching on a single processor.
D. The high cost of cache invalidation when threads are migrated between processors.

64 Consider a set of processes where the process with the highest priority is also the one with the longest CPU burst. In a preemptive priority scheduling system without aging, which scheduling algorithm's behavior will this system's performance (in terms of average waiting time) most closely resemble?

Scheduling Algorithms Hard
A. First-Come, First-Serve (FCFS)
B. Shortest-Job-First (SJF)
C. Round Robin (RR)
D. The inverse of Shortest-Job-First (Longest-Job-First)

65 What is the primary motivation for an operating system to implement a medium-term scheduler in addition to long-term and short-term schedulers?

Types of Scheduling Hard
A. To control the degree of multiprogramming by temporarily swapping processes out of main memory to disk.
B. To select a good mix of I/O-bound and CPU-bound processes for the ready queue.
C. To decide which of the programs submitted to a batch system should be loaded into memory.
D. To improve CPU utilization by context switching between ready processes very rapidly.