Schedulers and Context Switching MCQs: 12 Solved Questions with Explanations

Solve 12 exam questions on long-term, medium-term and short-term schedulers, the dispatcher, context state, mode switches and process-switch counting.

KnowledgeGate Team

Exam prep & CS education

Updated 25 Oct 20268 min read

Aspirants often remember long-term, medium-term, short-term and dispatcher, but mix up their queues and actions. They also confuse saving registers, changing mode and moving memory to disk. Scheduler roles, dispatcher work, workload mix, saved CPU state, and switch counting depend on distinguishing queues, actions and process state. Revise related CS fundamentals topics alongside them if needed.

1. Build the scheduler and context-switch map before solving

Keep one map ready. The long-term scheduler admits jobs from the job pool and influences the resident mix. The medium-term scheduler suspends or swaps processes out. The short-term scheduler selects a ready process for the CPU. The dispatcher performs the handoff.

The job pool has J1 with an 8 ms CPU burst, J2 with a 2 ms CPU burst followed by I/O, J3 with a 6 ms CPU burst and J4 with a 1 ms CPU burst followed by I/O. Memory has three slots. Admitting J1, J2 and J3 makes the resident degree 3; J4 remains outside.

The short-term scheduler selects J2. At t = 2 ms, J2 requests I/O. The dispatcher saves J2's PC = 420, R1 = 18 and R2 = 5 in its PCB, then loads J1's PC = 100, R1 = 0 and R2 = 0. Those two phases form one J2-to-J1 process switch. Swapping J3 to disk then lowers the resident degree from 3 to 2.

A process switch does not automatically copy J2's memory image to disk. Entering kernel mode while the same process continues is also not necessarily a process switch.

Diagram of the long-term, medium-term and short-term schedulers and the dispatcher saving J2's state before loading J1.

The map links long-term admission, medium-term suspension, short-term selection and dispatcher handoff.

2. Questions 1-3: identify the scheduler from its job

Question 1 (Infosys 2024): short-term scheduler

What is a short-term scheduler?

  • (a) It selects which process has to be brought into the ready queue

  • (b) It selects which process has to be executed next and allocates CPU

  • (c) It selects which process to remove from memory by swapping

  • (d) None of the mentioned

Answer: (b) The short-term scheduler selects from the ready queue. Choosing J2 is its decision; the handoff follows. Option A is long-term admission, while C is medium-term suspension.

Question 2 (Cognizant 2023): medium-term scheduler

What is a medium-term scheduler?

  • (a) It selects which process has to be brought into the ready queue

  • (b) It selects which process has to be executed next and allocates CPU

  • (c) It selects which process to remove from memory by swapping

  • (d) None of the mentioned

Answer: (c) The medium-term scheduler can swap a resident process out and later return it. J3 leaving memory changes the resident degree from 3 to 2. CPU selection and job admission are separate.

Question 3 (Hexaware 2023): the primary short-term versus long-term distinction

The primary distinction between the short term scheduler and the long term scheduler is __________

  • (a) The length of their queues

  • (b) The type of processes they schedule

  • (c) The frequency of their execution

  • (d) None of the mentioned

Answer: (c) CPU choices happen frequently as processes finish, block or are pre-empted. Admission is comparatively infrequent. Neither has a universal fixed interval; frequency depends on the system and workload.

3. Questions 4-5: separate the scheduling decision from the CPU handoff

Question 4 (BEL 2007): multitasking by repeated switching

What is the name of the technique in which the operating system of a computer executes several programs concurrently by switching back and forth between them?

  • (a) Partitioning

  • (b) Multi-tasking

  • (c) Windowing

  • (d) Paging

Answer: (b) Multitasking gives several programs concurrent progress through rapid alternation on one CPU. Their instructions need not run simultaneously; that requires multiple processing units. The same BEL 2007 item also anchors Process Management and Process States MCQs, where multitasking is tied to the process lifecycle. In scheduler analysis, it separates rapid CPU alternation from simultaneous execution before you reason about dispatcher handoffs and saved context.

Question 5 (UGC NET 2017): dispatcher

Which module gives control of the CPU to the process selected by the short-term schedular?

  • (a) Dispatcher

  • (b) Interrupt

  • (c) Schedular

  • (d) Threading

Answer: (a) The scheduler chooses; the dispatcher transfers control. It saves J2's PC = 420, R1 = 18 and R2 = 5, then loads J1's PC = 100, R1 = 0 and R2 = 0. The question spells it “schedular”; the standard spelling is scheduler.

4. Questions 6-7: reason about workload mix and match every scheduler

Question 6 (Tech Mahindra 2025): an all-I/O-bound mix

If all processes I/O bound, the ready queue will almost always be ______ and the Short term Scheduler will have a ______ to do.

  • (a) full, little

  • (b) full, lot

  • (c) empty, little

  • (d) empty, lot

Answer: (c) Assume no I/O completes during this cycle. P1 runs from t = 0 to 1 ms and blocks. P2 runs for 2 ms and blocks at t = 3 ms. P3 runs for 1 ms and blocks at t = 4 ms. The ready count is 3 - 1 - 1 - 1 = 0, leaving little to choose until an I/O completion.

Question 7 (UGC NET 2025): four-way matching

Match List-I with List-II:

LIST-I

LIST-II

A. Short term scheduler

I. Determines which processes are admitted into the system and placed in the ready queue.

B. Medium term scheduler

II. Select which process should be executed next and allocate CPU time.

C. Long term scheduler

III. Manages the degree of multiprogramming by swapping processes between main memory and disk storage.

D. I/O Scheduler

IV. Order the input/output requests from processes waiting for I/O operations.

Choose the correct answer from the options given below:

  • (a) A-I, B-IV, C-II, D-III

  • (b) A-III, B-II, C-I, D-IV

  • (c) A-II, B-III, C-I, D-IV

  • (d) A-I, B-II, C-III, D-IV

Answer: (c) Match functions one by one: short-term to II, medium-term to III, long-term to I and I/O scheduler to IV. This gives A-II, B-III, C-I, D-IV. List position is the trap.

5. Questions 8-9: decide what a normal context switch saves or changes

Question 8 (ISRO 2008): TLB versus mandatory CPU state

Which of the following need not necessarily be saved on a context switch between processes?

  • (a) General purpose registers

  • (b) Translation look-aside buffer

  • (c) Program counter

  • (d) All of the above

Answer: (b) Registers and the program counter must be preserved for correct resumption. TLB entries are not saved as process execution state. Hardware and address-space identifiers determine whether entries are invalidated, flushed or retained selectively.

Question 9 (GATE 1999): context switch is not the same as swapping a process image

Which of the following actions is typically not performed by the operating system when switching context from process A to process B?

  • (a) Saving current register values and restoring saved register values for process B.

  • (b) Changing address translation tables.

  • (c) Swapping out the memory image of process A to the disk.

  • (d) Invalidating the translation look-aside buffer.

Answer: (c) An A-to-B switch can save A's PC = 840 and R1 = 12, load B's PC = 220 and R1 = 7, and change address-space state as needed. Moving A's memory image to disk is separate.

6. Questions 10-11: count a switch and compare its cost

Question 10 (ISRO 2011): how many process switches?

There are three processes in the ready queue. When the currently running process requests for I/O how many process switches take place?

  • (a) 1

  • (b) 2

  • (c) 3

  • (d) 4

Answer: (a) Let P0 run while P1, P2 and P3 are ready. P0 blocks and one selected process, say P1, runs. Saving P0 and restoring P1 are two phases of one switch. The other ready processes add none.

Question 11 (KVS 2018): mode switch versus process switch

Time taken to switch between user and kernel modes is ____ the time taken to switch between two processes.

  • (a) more than

  • (b) independent

  • (c) less than

  • (d) equal to

Answer: (c) A same-process mode switch does not normally replace the full process context and address space. A process switch does more work. The comparison stays qualitative because no architecture or timings are given.

7. Question 12 and the traps that connect all twelve answers

Question 12 (DSSSB 2024): two true context-switch statements

Which of the following statement(s) is/are correct for context switching in Operating System?

I. When a context switch occurs, the kernel saves the context of the old process in its PCB (Process Control Block).

II. Context-Switch time is pure overhead, because the system does no useful work while switching.

  • (a) Neither I nor II

  • (b) Only I

  • (c) Only II

  • (d) Both I and II

Answer: (d) Statement I preserves state for later resumption. Statement II calls the interval overhead because no user process advances. Switching still enables sharing and responsiveness, so overhead does not mean useless.

When two options seem almost identical, distinguish them by whether the wording refers to selection, CPU handoff, swapping or saved process state.

Wording in the question

Correct role

Selects the next ready process

Short-term scheduler; CPU Scheduling Algorithms Explained applies the choice through FCFS, SJF and Round Robin timelines.

Hands the CPU over

Dispatcher

Swaps a resident process out

Medium-term scheduler

Saves or restores process execution state

Context switch: save or restore the process execution state recorded in the PCB

8. Answer check and next practice step

Answer strip: 1-B, 2-C, 3-C, 4-B, 5-A, 6-C, 7-C, 8-B, 9-C, 10-A, 11-C, 12-D.

Re-solve any item answered from a keyword alone. First redraw the four-role map: long-term admission, medium-term suspension, short-term selection and dispatcher handoff. Then use Process Scheduling MCQs for algorithm choice and timelines. Scheduler roles, dispatcher handoff and saved context require a different decision map.

For structured OS and CS fundamentals, continue with Computer Science Fundamentals for Placements. For broader GATE preparation and practice, use GATE Guidance by Sanchit Sir.

Scheduler questions become manageable when every term is attached to a queue boundary and every switch is traced as old state saved, new state loaded, and exactly one process handoff counted.