Unit 2: CPU Scheduling - Practice Quiz

CSE316 — Operating Systems 50 Questions
0 Correct 0 Wrong 50 Left
0/50

1 Which component of the Operating System is responsible for selecting a process from the ready queue and allocating the CPU to it?

A. CPU Scheduler
B. Job Scheduler
C. Interrupt Handler
D. Dispatcher

2 The module that gives control of the CPU to the process selected by the short-term scheduler is known as:

A. Allocator
B. Scheduler
C. Interrupt Service Routine
D. Dispatcher

3 What is 'Dispatch Latency'?

A. The time it takes for the dispatcher to stop one process and start another
B. The time a process waits in the ready queue
C. The time taken by the CPU to execute an instruction
D. The time it takes for a process to complete execution

4 In which of the following situations is CPU scheduling decision mandatory (non-preemptive)?

A. When a process switches from running to ready state
B. When a process switches from waiting to ready state
C. When a process terminates
D. When a process switches from ready to running state

5 Which scheduling algorithm results in the 'Convoy Effect'?

A. Priority Scheduling
B. Shortest Job First
C. Round Robin
D. First-Come, First-Served

6 What is the primary objective of the Shortest Job First (SJF) scheduling algorithm?

A. To maximize throughput
B. To ensure fairness
C. To minimize average waiting time
D. To minimize response time

7 Preemptive Shortest Job First scheduling is also known as:

A. Shortest Remaining Time First
B. Round Robin
C. Multilevel Queue Scheduling
D. Preemptive Priority Scheduling

8 In Round Robin scheduling, if the time quantum is extremely large, the algorithm degenerates into which scheduling policy?

A. Multilevel Feedback Queue
B. Shortest Job First
C. Priority Scheduling
D. First-Come, First-Served

9 What is the major drawback of Priority Scheduling?

A. High overhead
B. Low throughput
C. Starvation
D. Deadlock

10 Which technique is used to solve the problem of starvation in Priority Scheduling?

A. Aging
B. Context Switching
C. Paging
D. Swapping

11 Which scheduling criteria refers to the number of processes that complete their execution per time unit?

A. CPU utilization
B. Response time
C. Turnaround time
D. Throughput

12 Turnaround time is defined as:

A. The time from submission of a process to the time of completion
B. The total time the CPU is busy
C. The time a process spends waiting in the ready queue
D. The time from submission to the first response

13 Which scheduling algorithm is designed specifically for time-sharing systems?

A. First-Come, First-Served
B. Shortest Job First
C. Round Robin
D. Non-preemptive Priority

14 In Multilevel Feedback Queue scheduling, a process can:

A. Only stay in one queue
B. Choose its own priority
C. Move between queues
D. Never be preempted

15 If a process is I/O bound, in a Multilevel Feedback Queue, it should ideally be placed in:

A. A higher priority queue with a short time quantum
B. A blocked queue permanently
C. The last queue in the system
D. A lower priority queue with a long time quantum

16 What is 'Process Affinity' (or Processor Affinity) in multiprocessor scheduling?

A. A process creates a child process
B. Processes communicate via signals
C. Two processes share the same memory
D. A process prefers to run on the same processor it ran on previously

17 Which of the following is NOT a characteristic of a Hard Real-Time System?

A. Deadlines are optional if system is busy
B. Guaranteed quality of service
C. Missing a deadline is a total system failure
D. Critical tasks must complete on time

18 Rate Monotonic Scheduling assigns priorities to tasks based on their:

A. Period (frequency)
B. CPU Burst time
C. Deadline
D. Arrival time

19 Earliest Deadline First (EDF) scheduling assigns priorities:

A. Dynamically based on closeness to deadline
B. Based on shortest burst
C. Randomly
D. Statically based on period

20 In Thread Scheduling, the distinction between PCS (Process-Contention Scope) and SCS (System-Contention Scope) relies on:

A. The level at which threads compete for CPU time
B. The amount of memory allocated
C. The programming language used
D. The size of the thread

21 The formula for calculating Waiting Time for a specific process is:

A. Burst Time + Arrival Time
B. Response Time + Burst Time
C. Turnaround Time - Burst Time
D. Completion Time - Arrival Time

22 Which scheduling algorithm is most difficult to implement because it requires predicting the future?

A. Round Robin
B. Multilevel Queue
C. SJF
D. FCFS

23 In asymmetric multiprocessing:

A. One processor (master) controls the system, others look to it or have predefined tasks
B. All processors are peers
C. No processor controls another
D. Each processor has its own ready queue only

24 Load balancing in multiprocessor systems involves:

A. Reducing the number of processors
B. Push migration and Pull migration
C. Increasing the time quantum
D. Disabling interrupts

25 Which of the following is a criterion for 'Response Time'?

A. Time spent in ready queue
B. Time to output the first character
C. Time to finish the whole job
D. Time from submission to first response produced

26 Under preemptive scheduling, when can the CPU be taken away from a process?

A. Only when the process requests I/O
B. Never
C. Only when the process terminates
D. When an interrupt occurs or a higher priority process arrives

27 What determines the efficiency of the Round Robin algorithm?

A. The memory size
B. The I/O speed
C. The number of processes
D. The size of the time quantum

28 In the context of scheduling, what is 'Little's Law' used for?

A. Detecting deadlocks
B. Determining average queue length based on arrival rate and average wait time
C. Assigning priorities
D. Estimating the next CPU burst

29 Which method is commonly used to predict the next CPU burst duration for SJF?

A. Random guessing
B. User input
C. Exponential averaging of previous bursts
D. Fixed constant value

30 What is 'Soft Affinity'?

A. The OS guarantees the process runs on the same processor
B. The process runs only on the master processor
C. The OS attempts to keep the process on the same processor but doesn't guarantee it
D. The process runs on any processor randomly

31 A system where the ready queue is partitioned into separate queues (e.g., foreground and background) with different scheduling algorithms is called:

A. Multilevel Queue Scheduling
B. Round Robin
C. FCFS
D. SJF

32 Which priority applies in Windows scheduling when a thread is running in the kernel?

A. Idle priority
B. GUI priority
C. Real-time priority
D. Variable priority

33 Pthread scheduling API allows specifying the scope of contention. What does PTHREAD_SCOPE_SYSTEM mean?

A. The thread cannot be preempted
B. The thread competes only within the process
C. The thread competes with all threads in the system for CPU
D. The thread is a kernel thread only

34 In a real-time system, 'Interrupt Latency' refers to:

A. Time to execute the ISR
B. Time from interrupt arrival to the start of the execution of the ISR
C. Time to return from the ISR
D. Time waiting for the interrupt

35 Which scheduling algorithm ensures that no process waits more than (n-1) x q time units, where n is the number of processes and q is the time quantum?

A. FCFS
B. Round Robin
C. SJF
D. Priority

36 Cooperative scheduling is another name for:

A. Thread scheduling
B. Preemptive scheduling
C. Multiprocessor scheduling
D. Non-preemptive scheduling

37 Typically, a long-term scheduler executes:

A. When an interrupt occurs
B. Much less frequently than the short-term scheduler
C. Only at system boot
D. Every few milliseconds

38 Which of the following is true about 'Admission Control' in Real-Time Scheduling?

A. It admits a process only if the system can guarantee its deadline
B. It ignores deadlines
C. It is used in FCFS
D. It admits all processes regardless of load

39 In calculating average waiting time, what is the arrival time usually assumed to be if not specified?

A. 1
B. 10
C. Infinity
D. 0

40 What is the main disadvantage of Multilevel Feedback Queue scheduling?

A. It is the most complex to implement and tune
B. It cannot handle I/O bound processes
C. It does not support interactive users
D. It causes immediate deadlock

41 What happens to the 'Context Switch' time?

A. It is pure overhead
B. It is used for I/O
C. It is useful processing time
D. It shortens the process execution

42 Conflict phase of dispatch latency typically involves:

A. Loading the new program from disk
B. Formatting the hard drive
C. Waiting for user input
D. Preemption of any process running in the kernel and release by low-priority process of resources

43 Which scheduling algorithm suffers from the problem of indefinite blocking?

A. Round Robin
B. Priority Scheduling
C. FIFO
D. Rate Monotonic

44 In SMP (Symmetric Multiprocessing), where can a process run?

A. On the GPU only
B. Only on CPU 0
C. On the I/O processor only
D. On any available processor

45 What is the 'Throughput' if 10 processes finish in 5 seconds?

A. 50 processes/second
B. 5 processes/second
C. 0.5 processes/second
D. 2 processes/second

46 Typically, 'Foreground' processes in a Multilevel Queue system use which algorithm?

A. SJF
B. FCFS
C. Random
D. Round Robin

47 Typically, 'Background' processes in a Multilevel Queue system use which algorithm?

A. Priority
B. Round Robin
C. Real-time
D. FCFS

48 Which type of thread scheduling allows the user-level thread library to schedule threads?

A. Process-Contention Scope (PCS)
B. System-Contention Scope (SCS)
C. Round Robin
D. Hard Real-time

49 If a process has a CPU burst of 10ms and the time quantum is 20ms, what happens?

A. The CPU idles for 10ms
B. An error occurs
C. The process is forced to run for 20ms
D. The process runs for 10ms, terminates/yields, and the context switches

50 Which concept describes the cycle of CPU execution and I/O wait?

A. Interrupt Cycle
B. Fetch-Decode-Execute Cycle
C. Boot Cycle
D. CPU-I/O Burst Cycle