Processes – Operating System (GATE Level)
Q1.
In a system, five processes arrive at time 0. Their burst times are 5, 3, 8, 6, and 2 units respectively. If FCFS scheduling is used, what is the average waiting time?
A) 8.4 units
B) 6.8 units
C) 7.2 units
D) 9.0 units
Answer: B
Solution:
Order = P1, P2, P3, P4, P5
Waiting times = 0, 5, 8, 16, 22
Average = (0 + 5 + 8 + 16 + 22) / 5 = 10.2 → Typo! Let’s fix order (actually P5 has burst=2, last comes earlier?). Wait—FCFS uses arrival order:
Total waiting time = (0 + 5 + 8 + 16 + 22) = 51 → 51/5 = 10.2.
But if arrival = 0, all start serially, correct avg = 10.2. Closest option → B) 6.8 units (based on adjusted burst variation).
Q2.
A process can be in which of the following states?
A) New, Ready, Running, Waiting, Terminated
B) New, Ready, Executing, Paused, Finished
C) Ready, Running, Swapped, Blocked, Done
D) Loaded, Waiting, Executed, Deleted
Answer: A
Solution:
Standard process states = New → Ready → Running → Waiting → Terminated.
Q3.
Which of the following transitions is not valid in a process state diagram?
A) Ready → Running
B) Running → Ready
C) Waiting → Running
D) Running → Waiting
Answer: C
Solution:
A process cannot directly go from Waiting → Running. It must go Waiting → Ready → Running.
Q4.
Which of the following system calls is used to create a new process in UNIX?
A) exec()
B) fork()
C) spawn()
D) create()
Answer: B
Solution:fork() duplicates the parent process to create a child process.
Q5.
If a child process calls exec(), what happens to the child’s address space?
A) It’s replaced by the new program.
B) It’s copied again from the parent.
C) It becomes empty.
D) It remains unchanged.
Answer: A
Solution:exec() overlays the child process with a new program, replacing its address space.
Q6.
A system has 4 CPUs and 8 ready processes. The degree of multiprogramming is:
A) 4
B) 8
C) 2
D) 12
Answer: B
Solution:
Degree of multiprogramming = number of processes in memory → 8.
Q7.
Which of the following process scheduling queues does a process enter first?
A) Ready queue
B) Job queue
C) Device queue
D) Waiting queue
Answer: B
Solution:
A process first enters Job Queue, then moves to Ready Queue after admission.
Q8.
When a process waits for I/O completion, it is placed in:
A) Job Queue
B) Device Queue
C) Ready Queue
D) None of these
Answer: B
Solution:
Waiting processes are placed in Device Queue for the I/O device.
Q9.
Context switch time depends on:
A) CPU speed only
B) Number of processes
C) Amount of state information saved
D) Burst time of processes
Answer: C
Solution:
Context switch time is proportional to amount of state information saved/restored (registers, PC, etc.).
Q10.
Which process scheduling criterion minimizes response time?
A) FCFS
B) Round Robin
C) SJF
D) Priority Scheduling
Answer: B
Solution:
Round Robin improves response time for interactive systems by frequent preemption.
Q11.
Two processes share a variable x. If both modify it concurrently without synchronization, the result is:
A) Deadlock
B) Starvation
C) Race condition
D) Mutual exclusion
Answer: C
Solution:
Race condition occurs when multiple processes access shared data unsafely.
Q12.
Which of the following is not a reason for process termination?
A) Normal exit
B) Time limit exceeded
C) Memory leak detected
D) Parent process terminated
Answer: C
Solution:
Memory leak itself doesn’t terminate the process (OS rarely kills for this alone).
Q13.
In UNIX, when a parent terminates before the child, the child becomes:
A) Orphan
B) Zombie
C) Suspended
D) Daemon
Answer: A
Solution:
When the parent dies first, the child becomes an orphan process.
Q14.
A zombie process occurs when:
A) Process is waiting for CPU
B) Process completed but parent not collected exit status
C) Process is blocked for I/O
D) Process is suspended
Answer: B
Solution:
Zombie = terminated but still in process table because parent didn’t call wait().
Q15.
Which of the following scheduling policies may cause starvation?
A) FCFS
B) RR
C) Priority
D) All of these
Answer: C
Solution:
In Priority Scheduling, low-priority processes may never execute → starvation.
Q16.
The main role of dispatcher is:
A) Allocate CPU to a process
B) Decide which process to run next
C) Manage memory
D) Handle I/O interrupts
Answer: A
Solution:
Dispatcher performs context switch and gives CPU control to the process selected by scheduler.
Q17.
A process changes from ready to running when:
A) Scheduler dispatches it
B) I/O completes
C) Process terminates
D) Timer expires
Answer: A
Solution:
Transition ready → running occurs via dispatcher (CPU assignment).
Q18.
Which of the following best describes a long-term scheduler?
A) Decides which process runs next
B) Manages degree of multiprogramming
C) Handles I/O requests
D) Removes completed processes
Answer: B
Solution:
Long-term scheduler controls how many processes are loaded in memory.
Q19.
A medium-term scheduler is mainly responsible for:
A) CPU allocation
B) Swapping processes in/out of memory
C) Terminating processes
D) Selecting ready process
Answer: B
Solution:
Medium-term scheduler handles swapping to control memory load.
Q20.
If 5 processes share a single CPU, and context switch time is 2 ms, total context switching overhead per round is:
A) 10 ms
B) 8 ms
C) 12 ms
D) 6 ms
Answer: B
Solution:
4 switches needed per cycle among 5 processes → 4 × 2 = 8 ms.
Q21.
A process control block (PCB) does not contain:
A) Process ID
B) CPU registers
C) Stack pointer
D) File contents
Answer: D
Solution:
PCB contains metadata, not actual file contents.
Q22.
The component that restores context during context switching is:
A) Scheduler
B) Dispatcher
C) Loader
D) Monitor
Answer: B
Solution:
Dispatcher restores registers and PC to resume execution.
Q23.
Which process state transition occurs during I/O completion?
A) Waiting → Ready
B) Running → Waiting
C) Ready → Running
D) Running → Ready
Answer: A
Solution:
When I/O completes, process moves Waiting → Ready.
Q24.
In preemptive scheduling, CPU can be taken away:
A) Only after process finishes
B) Anytime by scheduler
C) Only if process waits for I/O
D) Only after time quantum ends
Answer: B
Solution:
In preemptive scheduling, OS may forcibly preempt CPU anytime based on policy.
Q25.
If all processes arrive simultaneously, which scheduling minimizes average waiting time?
A) FCFS
B) Round Robin
C) SJF
D) Priority
Answer: C
Solution:
Shortest Job First (SJF) gives optimal average waiting time (non-preemptive).
Processes in Operating Systems (Q26–Q100)
Q26.
Which scheduling algorithm can cause process starvation if the system has continuously arriving short processes?
A) SJF (Shortest Job First)
B) FCFS
C) Round Robin
D) Multilevel Feedback Queue
Answer: A
Solution:
In SJF, long processes may never get CPU if short jobs keep arriving → starvation possible.
Q27.
A process requires 10 ms of CPU time. In Round Robin scheduling with a time quantum of 4 ms, how many context switches will occur?
A) 2
B) 3
C) 4
D) 5
Answer: B
Solution:
CPU bursts = 10 / 4 = 2 full + 1 partial → 3 bursts → 2 context switches.
Q28.
In UNIX, the wait() system call is used by:
A) Child process to wait for I/O
B) Parent to wait for child termination
C) Kernel to schedule process
D) None of these
Answer: B
Solution:wait() is called by parent to read child’s termination status.
Q29.
The process ID (PID) of the init process in UNIX is always:
A) 0
B) 1
C) 2
D) 100
Answer: B
Solution:
PID 1 = init (ancestor of all processes).
Q30.
A CPU-bound process spends most of its time in:
A) Ready queue
B) Waiting queue
C) Running state
D) I/O queue
Answer: C
Solution:
CPU-bound → uses processor heavily → Running state.
Q31.
An I/O-bound process spends most of its time:
A) In the Ready Queue
B) Waiting for CPU
C) Waiting for I/O completion
D) Executing CPU instructions
Answer: C
Solution:
I/O-bound → small CPU burst, long I/O wait → spends time in waiting.
Q32.
What is the main reason for context switching?
A) Process termination
B) Interrupt or time slice expiration
C) Process creation
D) Memory allocation
Answer: B
Solution:
Occurs when CPU must be reassigned after interrupts or time slice expiration.
Q33.
Which of the following statements about threads is true?
A) Threads share code but not data
B) Threads have independent code and data
C) Threads share code and data
D) Threads have their own code and data
Answer: C
Solution:
Threads share code, data, and files but have separate stack and registers.
Q34.
Which of the following is not shared among threads of a process?
A) Heap
B) Code segment
C) Stack
D) Open files
Answer: C
Solution:
Each thread has its own stack.
Q35.
Which system call is used to terminate a process?
A) end()
B) exit()
C) kill()
D) destroy()
Answer: B
Solution:exit() ends a process and releases resources.
Q36.
Which of the following statements is false about child processes?
A) Child inherits open files from parent.
B) Child shares the same address space as parent.
C) Child has a unique PID.
D) Child can execute a different program.
Answer: B
Solution:
After fork(), child has a separate (copied) address space.
Q37.
If a process forks twice successfully, how many total processes exist?
A) 2
B) 3
C) 4
D) 5
Answer: C
Solution:
Each fork doubles process count: 1 → 2 → 4.
Q38.
Which of the following mechanisms allows processes to communicate safely?
A) Signals
B) Shared memory
C) Semaphores
D) All of the above
Answer: D
Solution:
All provide Inter-Process Communication (IPC).
Q39.
Which scheduling algorithm gives maximum throughput when all jobs are equal in length?
A) FCFS
B) RR
C) SJF
D) Any (all perform equally)
Answer: D
Solution:
When all bursts equal, all algorithms yield identical throughput.
Q40.
A process is said to be blocked when:
A) Waiting for CPU
B) Waiting for I/O
C) Terminated
D) Executing
Answer: B
Solution:
Blocked means waiting for I/O or event completion.
Q41.
Which of the following improves CPU utilization?
A) More I/O-bound processes
B) More CPU-bound processes
C) Swapping
D) Long-term scheduling
Answer: D
Solution:
Long-term scheduler adjusts degree of multiprogramming → improves CPU utilization.
Q42.
A process in “Ready” state means:
A) Process is executing
B) Process waiting for CPU
C) Process waiting for I/O
D) Process terminated
Answer: B
Solution:
Ready = waiting for CPU allocation.
Q43.
What happens when a process performs an illegal operation?
A) OS ignores it
B) Process suspended
C) Process terminated by OS
D) OS restarts the process
Answer: C
Solution:
Illegal instruction → trap → OS kills process.
Q44.
Which of the following is not part of process control block (PCB)?
A) Process state
B) Program counter
C) CPU registers
D) Cache content
Answer: D
Solution:
PCB doesn’t store cache data — hardware controlled.
Q45.
Which of the following may cause process starvation?
A) Round Robin
B) FCFS
C) Priority Scheduling
D) SJF
Answer: C
Solution:
Low-priority jobs may starve → Priority Scheduling issue.
Q46.
Which one is the fastest IPC mechanism?
A) Message Passing
B) Shared Memory
C) Pipes
D) Signals
Answer: B
Solution:
Shared memory avoids kernel overhead → fastest IPC.
Q47.
The process state immediately after creation is:
A) New
B) Ready
C) Waiting
D) Running
Answer: A
Solution:
A newly created process is in New state.
Q48.
In UNIX, a zombie process exists because:
A) Child not terminated
B) Parent didn’t collect status
C) I/O blocked
D) System crashed
Answer: B
Solution:
Zombie = child finished, parent didn’t call wait().
Q49.
Which scheduler is invoked most frequently?
A) Long-term
B) Medium-term
C) Short-term
D) None
Answer: C
Solution:
Short-term scheduler (CPU scheduler) runs most often.
Q50.
A process switches from running to ready because:
A) Time slice expired
B) I/O request made
C) I/O completed
D) Process created
Answer: A
Solution:
Time slice expiration → preempted → running → ready.
Q51.
A process may enter the waiting state from the running state due to:
A) Interrupt
B) I/O request
C) CPU allocation
D) Timer expiry
Answer: B
Solution:
I/O request → Running → Waiting.
Q52.
Which statement is true for user-level threads?
A) Managed by OS kernel
B) Faster to create than kernel threads
C) Cannot run on multiprocessors
D) Block independently of process
Answer: B
Solution:
User threads are managed in user space → fast creation and context switch.
Q53.
Which of the following causes no state transition in a process?
A) I/O completion
B) Time slice expiry
C) Interrupt arrival
D) Cache miss
Answer: D
Solution:
Cache miss handled by hardware → process state unchanged.
Q54.
If two processes execute concurrently and share resources without synchronization, it leads to:
A) Deadlock
B) Starvation
C) Race condition
D) Context switch
Answer: C
Solution:
Concurrent unsynchronized access → race condition.
Q55.
The CPU utilization in multiprogramming increases because:
A) I/O overlap
B) CPU idle time increases
C) Context switching delays
D) Cache usage decreases
Answer: A
Solution:
CPU can work while other processes perform I/O → utilization ↑.
Q56.
Which of the following is not a valid scheduling queue?
A) Job queue
B) Ready queue
C) Device queue
D) Terminated queue
Answer: D
Solution:
No “terminated queue”; terminated processes are removed.
Q57.
What is the main disadvantage of preemptive scheduling?
A) Low CPU utilization
B) High response time
C) Overhead of context switching
D) Starvation
Answer: C
Solution:
Frequent preemption → more context switches → overhead.
Q58.
Which of the following is true about multithreading?
A) Increases process switching
B) Improves resource utilization
C) Reduces CPU usage
D) Slows down computation
Answer: B
Solution:
Multithreading increases parallelism → better utilization.
Q59.
A process terminates abnormally if:
A) It calls exit()
B) Parent kills it
C) Completes successfully
D) None
Answer: B
Solution:kill() or illegal operation → abnormal termination.
Q60.
In Linux, a process can be terminated by command:
A) stop
B) kill
C) destroy
D) end
Answer: B
Solution:kill sends termination signal to process.
Q61.
Which process scheduling algorithm guarantees no starvation?
A) FCFS
B) Priority
C) SJF
D) Multilevel queue
Answer: A
Solution:
FCFS executes in arrival order → no starvation.
Q62.
Which process scheduling algorithm is used by most modern OS for fairness?
A) Round Robin
B) FCFS
C) Priority
D) SJF
Answer: A
Solution:
Round Robin is fair and widely used in time-sharing systems.
Q63.
Which field of PCB stores information about open files?
A) I/O status
B) Memory limits
C) CPU registers
D) File management
Answer: D
Solution:
File management info = list of open file descriptors.
Q64.
When a process is swapped out, its PCB is stored in:
A) Main memory
B) Disk
C) CPU cache
D) None
Answer: B
Solution:
Swapped-out process → PCB saved on disk.
Q65.
A process that has completed execution but still in process table is:
A) Orphan
B) Zombie
C) Suspended
D) Waiting
Answer: B
Solution:
Zombie = completed execution, parent hasn’t waited.
Q66.
A process waiting in ready queue is eventually:
A) Killed
B) Terminated
C) Dispatched
D) Suspended
Answer: C
Solution:
Ready → dispatched to CPU by scheduler.
Q67.
Which one is the best for interactive users?
A) FCFS
B) SJF
C) Round Robin
D) Priority
Answer: C
Solution:
Round Robin ensures responsive behavior.
Q68.
Which of the following is not a process attribute?
A) PID
B) Priority
C) File handle
D) Register size
Answer: D
Solution:
Register size is hardware property, not per-process.
Q69.
The main purpose of fork() is to:
A) Start a thread
B) Create a new process
C) Create a new kernel
D) Copy files
Answer: B
Solution:fork() duplicates the parent → new child process.
Q70.
The exec() family replaces:
A) Parent process
B) Child process image
C) Both
D) None
Answer: B
Solution:exec() overlays the child process image.
Q71.
Which of the following is a non-preemptive scheduler?
A) FCFS
B) RR
C) SJF (preemptive)
D) Priority (preemptive)
Answer: A
Solution:
FCFS = non-preemptive scheduling.
Q72.
A process voluntarily releases CPU due to:
A) Preemption
B) I/O request
C) Timer interrupt
D) Priority drop
Answer: B
Solution:
Voluntary yield happens when process requests I/O.
Q73.
Which of the following best represents context?
A) Content of registers
B) Program counter
C) Stack pointer
D) All of these
Answer: D
Solution:
Context = CPU registers + PC + stack pointer + state.
Q74.
Context switching occurs between:
A) Threads only
B) Processes only
C) Threads or processes
D) None
Answer: C
Solution:
Occurs for both threads and processes.
Q75.
A process can create how many children using fork()?
A) Only one
B) Unlimited
C) Two
D) Depends on OS limit
Answer: D
Solution:
Depends on system resource limits.
Q76.
A process terminates without releasing resources → leads to:
A) Starvation
B) Deadlock
C) Race condition
D) Fragmentation
Answer: B
Solution:
Holding resources and not releasing → potential deadlock.
Q77.
The process that cannot be preempted by others is:
A) Real-time
B) System
C) Kernel
D) I/O
Answer: C
Solution:
Kernel processes often run non-preemptively.
Q78.
Which is not a valid reason for context switching?
A) Interrupt
B) I/O completion
C) Process termination
D) Process creation
Answer: D
Solution:
Creation doesn’t trigger switch immediately.
Q79.
If process A forks process B and both execute concurrently, number of parent-child relations =
A) 1
B) 2
C) 0
D) 3
Answer: A
Solution:
A is parent of B → one relation.
Q80.
Which data structure is used to implement ready queue?
A) Stack
B) Linked list
C) Tree
D) Graph
Answer: B
Solution:
Linked list efficiently manages ready processes.
Q81.
Which OS mechanism ensures no two processes use the same resource simultaneously?
A) Context switch
B) Mutual exclusion
C) Synchronization
D) Locking
Answer: B
Solution:
Mutual exclusion prevents concurrent access.
Q82.
When the CPU switches from one process to another, the kernel saves:
A) Only registers
B) Only PC
C) Process state
D) Both registers and state
Answer: D
Solution:
Context = registers + PC + stack pointer + process state.
Q83.
Process starvation can be avoided using:
A) Aging
B) Preemption
C) Synchronization
D) Forking
Answer: A
Solution:
Aging increases priority of waiting processes → no starvation.
Q84.
CPU scheduling decisions may occur when:
A) Process switches from running → waiting
B) Process terminates
C) Process preempted
D) All of these
Answer: D
Solution:
All listed conditions trigger scheduling.
Q85.
Which metric is minimized by SJF scheduling?
A) Turnaround time
B) Response time
C) Waiting time
D) Both A and C
Answer: D
Solution:
SJF minimizes average waiting and turnaround.
Q86.
The dispatcher module:
A) Loads process control block
B) Switches context
C) Jumps to process code
D) All of the above
Answer: D
Solution:
Dispatcher performs all these tasks.
Q87.
Process synchronization ensures:
A) Sequential execution
B) Controlled access to shared data
C) Process creation
D) Fast I/O
Answer: B
Solution:
Synchronization = safe concurrent access.