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. Each process is given a fixed time slice to execute.
B. Once a process starts running, it continues until it terminates or blocks itself for I/O.
C. The process with the highest priority is always executed first, even if another process is running.
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. LIFO (Last-In, First-Out) stack
B. Binary tree
C. Priority queue
D. FIFO (First-In, First-Out) queue

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

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

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

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

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. Long-term scheduler
B. Job queue
C. Short-term scheduler
D. Dispatcher

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

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

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. Two or more processes are waiting for an event that can only be caused by one of the waiting processes.
B. A process uses too many system resources, causing others to slow down.
C. A low-priority process is repeatedly prevented from running because of a continuous stream of high-priority processes.
D. The system runs out of available memory to allocate to new 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. Medium-term scheduler
C. Short-term scheduler (or CPU scheduler)
D. Dispatcher

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

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

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. Each processor is self-scheduling and runs a copy of the operating system.
C. Processes are statically assigned to a processor and never move.
D. Processors are dedicated to specific types of tasks.

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

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

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

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

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

thread scheduling Easy
A. The compiler
B. The user-level thread library
C. The Operating System kernel
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 is impossible to know the exact length of the next CPU burst for a process.
B. It can lead to excessive context switching.
C. It is a non-preemptive algorithm.
D. It requires a special hardware timer.

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

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

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

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

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

Scheduling Algorithms Easy
A. Decide which of the processes in the ready queue is to be allocated the CPU.
B. Allocate memory to newly created processes.
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 First-Come, First-Served (FCFS) algorithm.
C. The system will crash due to too many context switches.
D. It behaves like the Shortest-Job-First (SJF) algorithm.

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

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

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. 6.33 ms
B. 0 ms
C. 9 ms
D. 7 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. 9 ms
B. 3 ms
C. 5.67 ms
D. 4 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. First-Come, First-Served (FCFS)
B. Priority Scheduling
C. Shortest Job First (SJF)
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. Dispatcher latency reduction
B. Preemption
C. Aging
D. Swapping

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. Priority Scheduling
D. Shortest Job First (SJF)

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

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 move processes from the job pool to main memory; Long-term latency
B. To switch context and load the state of a selected process onto the CPU; Dispatch latency
C. To determine the priority of processes; Aging time
D. To select a process from the ready queue; Scheduling time

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. The convoy effect, leading to poor device utilization.
B. Starvation of the CPU-bound process.
C. Optimal CPU and 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. Non-preemptive scheduling
B. Round Robin scheduling
C. Preemptive scheduling
D. Multi-level queue 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. Hard real-time system
C. Soft real-time system
D. Batch processing system

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

Multiprocessor scheduling Medium
A. It is a technique where all processes are restricted to a single master processor.
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 the process of grouping processors into affinity groups that can only run certain types of threads.

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

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. 18
B. 5
C. 4
D. 3

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. 5 ms
B. 4 ms
C. 9 ms
D. 13 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. 7 ms
B. 6 ms
C. 5 ms
D. 4 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. Deadlock
B. Convoy Effect
C. Starvation
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. Short-term (CPU) scheduler
C. Long-term (job) 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. Response Time
B. Throughput
C. CPU Utilization
D. Turnaround Time

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 dynamically calculated based on process burst time.
C. Higher-priority queues are given a shorter time quantum.
D. The time quantum is the same for all queues to ensure fairness.

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 task's period; tasks with shorter periods get higher priority.
B. Priority is assigned based on the execution time of the task; shorter tasks get higher priority.
C. Priority is assigned based on the task's deadline; tasks with earlier deadlines 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. Migrating threads between user space and kernel space efficiently.
C. Preventing high-priority processes from starving low-priority ones.
D. Ensuring that the cache of one processor is not invalidated by another.

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. Perform a CPU burst of 10ms, then voluntarily yield the CPU.
B. Perform a CPU burst of exactly 9ms, then issue a short, trivial I/O request.
C. Perform a CPU burst of 29ms, then issue an I/O request.
D. Always run for its full time quantum in every queue to show it's a long-running job.

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. t = 21
B. P2 never runs before P1 finishes
C. t = 16
D. t = 1

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. Approaching 100%
C. Dependent on the number of processes in the ready queue.
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 requires complex prediction of CPU burst times.
B. It cannot adapt if a process changes its behavior from CPU-bound to I/O-bound.
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. Not schedulable by RM, but schedulable by EDF.
D. Schedulable by RM, but not 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 estimated waiting time for CPU1 to become free is greater than the time cost of a full cache invalidation and repopulation on CPU2.
B. The process has been waiting in the ready queue for longer than a predefined threshold.
C. The system's overall load is above 75%.
D. The process P has a lower priority than the process running on CPU1.

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

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. ~4200%
B. ~5800%
C. ~2500%
D. ~1000%

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. 50
B. 62
C. 49
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. Loading the registers, program counter, and memory management information from the PCB of the chosen process into the hardware registers.
B. Maintaining the ready queue of processes.
C. Determining the time quantum for a process in a Round Robin system.
D. Selecting the next process to run from the ready queue based on a priority heuristic.

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's predictions become static and never change from the initial default value.
B. The scheduler gives equal weight to the entire history of the process's execution.
C. The scheduler's predictions become a simple average of all past burst times.
D. The scheduler's prediction for the next burst is always equal to the actual length of the previous burst.

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 oscillate between the lowest queue and a slightly higher queue, but never reach the top queue.
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 be permanently stuck in the lowest queue, as aging cannot override the demotion rule.

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. Round Robin (RR) with a small time quantum to minimize response time.
C. First-Come, First-Serve (FCFS) to maximize fairness.
D. Shortest Job First (SJF) to minimize average turnaround time.

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's execution corrupts the data structure protected by the mutex.
B. Because M is running, it prevents the low-priority process L from running and releasing the lock that the high-priority process H needs.
C. Because M might also need the same mutex lock, creating a deadlock.
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. I/O-bound processes will often not use their full quantum, implicitly giving them higher priority.
C. CPU-bound processes will get more total CPU time.
D. The system will behave identically to FCFS scheduling for all processes.

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 preemptively switch between and , causing both to miss their deadlines.
B. It will execute to completion and cause to miss its deadline.
C. It will use a predefined rule to drop the task with the lower importance.
D. It will execute to completion and cause to miss its deadline.

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

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. Shortest-Job-First (SJF)
B. Round Robin (RR)
C. First-Come, First-Serve (FCFS)
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 improve CPU utilization by context switching between ready processes very rapidly.
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 control the degree of multiprogramming by temporarily swapping processes out of main memory to disk.