Back to Practice OS & Networking

Process Management - Practice MCQs for CCAT

50 Questions Section B: Programming OS & Networking

Process Management Question Bank for C-CAT

Topic-wise Process Management MCQs for CDAC C-CAT preparation with answers and explanations.

Q1.
Process Control Block (PCB) contains:
AOnly process ID
BProcess state, registers, memory info
COnly memory address
DOnly CPU registers
Show Answer & Explanation

Correct Answer: B - Process state, registers, memory info

PCB stores process ID, state, registers, memory limits, scheduling info, etc.

Q2.
Process states include:
AOnly Running and Waiting
BNew, Ready, Running, Waiting, Terminated
CStart and End only
DActive and Inactive
Show Answer & Explanation

Correct Answer: B - New, Ready, Running, Waiting, Terminated

Five process states: New, Ready, Running, Waiting (Blocked), Terminated.

Q3.
fork() system call:
ATerminates process
BCreates new process
CSleeps process
DChanges priority
Show Answer & Explanation

Correct Answer: B - Creates new process

fork() creates a child process as copy of parent.

Q4.
Zombie process is:
ARunning process
BTerminated but entry in process table exists
CSleeping process
DNew process
Show Answer & Explanation

Correct Answer: B - Terminated but entry in process table exists

Zombie: process terminated but parent hasn't read its exit status.

Q5.
Orphan process is:
AProcess with no children
BSystem process
CRoot process
DChild whose parent terminated
Show Answer & Explanation

Correct Answer: D - Child whose parent terminated

Orphan process: child process whose parent has terminated.

Q6.
Thread shares with other threads:
AStack
BRegisters
CCode, data, files
DProgram counter
Show Answer & Explanation

Correct Answer: C - Code, data, files

Threads share code, data, and files; each has own stack and registers.

Q7.
Multiprocessing means:
AMultiple threads
BMultiple CPUs
CMultiple users
DMultiple files
Show Answer & Explanation

Correct Answer: B - Multiple CPUs

Multiprocessing uses multiple processors/CPUs.

Q8.
Mutex is:
AMultiple execution
BMemory unit
CMutual exclusion lock
DDisk type
Show Answer & Explanation

Correct Answer: C - Mutual exclusion lock

Mutex ensures mutual exclusion in critical sections.

Q9.
Critical section problem solution must satisfy:
AMemory only
BOnly mutual exclusion
CSpeed only
DMutual exclusion, Progress, Bounded waiting
Show Answer & Explanation

Correct Answer: D - Mutual exclusion, Progress, Bounded waiting

Three requirements: Mutual Exclusion, Progress, Bounded Waiting.

Q10.
Producer-Consumer problem uses:
AOnly mutex
BOnly variables
CSemaphores (mutex + full + empty)
DNo synchronization
Show Answer & Explanation

Correct Answer: C - Semaphores (mutex + full + empty)

Uses mutex for critical section, full and empty semaphores for synchronization.

Q11.
Context switching involves:
AOnly saving PC
BNo overhead
COnly loading new process
DSaving and restoring process state
Show Answer & Explanation

Correct Answer: D - Saving and restoring process state

Context switching saves current process state and restores the state of another process.

Q12.
Preemptive scheduling means:
AProcess runs until completion
BOS can interrupt running process
CNo context switching
DOnly batch processing
Show Answer & Explanation

Correct Answer: B - OS can interrupt running process

Preemptive scheduling allows OS to interrupt a running process to run another.

Q13.
Non-preemptive scheduling means:
AOS can interrupt process anytime
BUses round robin
CFaster execution
DProcess runs until it voluntarily releases CPU
Show Answer & Explanation

Correct Answer: D - Process runs until it voluntarily releases CPU

In non-preemptive scheduling, a process runs until it completes or blocks voluntarily.

Q14.
Which is NOT a CPU scheduling algorithm?
ALRU
BSJF
CFCFS
DRound Robin
Show Answer & Explanation

Correct Answer: A - LRU

LRU (Least Recently Used) is a page replacement algorithm, not CPU scheduling.

Q15.
Convoy effect occurs in:
ASJF
BPriority scheduling
CRound Robin
DFCFS
Show Answer & Explanation

Correct Answer: D - FCFS

Convoy effect in FCFS: short processes wait behind long process.

Q16.
Starvation can occur in:
AFCFS
BAll algorithms equally
CRound Robin only
DSJF and Priority scheduling
Show Answer & Explanation

Correct Answer: D - SJF and Priority scheduling

Starvation can occur in SJF (long jobs) and Priority scheduling (low priority jobs).

Q17.
Aging is used to prevent:
ADeadlock
BThrashing
CStarvation
DFragmentation
Show Answer & Explanation

Correct Answer: C - Starvation

Aging gradually increases priority of waiting processes to prevent starvation.

Q18.
Inter-process communication (IPC) methods include:
AOnly shared memory
BShared memory and message passing
COnly message passing
DOnly files
Show Answer & Explanation

Correct Answer: B - Shared memory and message passing

IPC methods include shared memory, message passing, pipes, and sockets.

Q19.
Which system call creates a new process in Unix?
Aexec()
Bcreate()
Cfork()
Dspawn()
Show Answer & Explanation

Correct Answer: C - fork()

fork() creates a new child process as a copy of the parent process.

Q20.
Process synchronization is needed because:
ATo speed up execution
BTo save memory
CTo prevent race conditions
DTo reduce CPU usage
Show Answer & Explanation

Correct Answer: C - To prevent race conditions

Synchronization prevents race conditions when multiple processes access shared resources.

Q21.
Which of the following is NOT a valid process state?
ARunning
BCompiled
CBlocked
DReady
Show Answer & Explanation

Correct Answer: B - Compiled

The valid process states are New, Ready, Running, Waiting (Blocked), and Terminated. 'Compiled' is not a process state — compilation happens before a process is created.

Q22.
What information is stored in a Process Control Block (PCB)?
AOnly the process ID
BProcess state, program counter, CPU registers, memory management info, scheduling info
COnly the program counter
DSource code of the program
Show Answer & Explanation

Correct Answer: B - Process state, program counter, CPU registers, memory management info, scheduling info

A PCB contains all information about a process: process state, process ID, program counter, CPU registers, memory management information, I/O status, scheduling information, and accounting information.

Q23.
What is a thread in operating systems?
AA separate process
BA type of file
CA memory block
DA lightweight process that is the smallest unit of CPU execution
Show Answer & Explanation

Correct Answer: D - A lightweight process that is the smallest unit of CPU execution

A thread is a lightweight process and the smallest unit of CPU execution. Threads within the same process share code, data, and OS resources but have their own program counter, registers, and stack.

Q24.
What are the four necessary conditions for a deadlock to occur?
AStarvation, aging, preemption, mutual exclusion
BScheduling, dispatching, swapping, paging
CMutual exclusion, spooling, buffering, caching
DMutual exclusion, hold and wait, no preemption, circular wait
Show Answer & Explanation

Correct Answer: D - Mutual exclusion, hold and wait, no preemption, circular wait

The four necessary conditions for deadlock (Coffman conditions) are: Mutual Exclusion, Hold and Wait, No Preemption, and Circular Wait. All four must hold simultaneously for a deadlock to occur.

Q25.
What is the difference between user-level threads and kernel-level threads?
AThere is no difference
BUser-level threads can only be created in C
CKernel-level threads are faster than user-level threads
DUser-level threads are managed by a thread library; kernel-level threads are managed by the OS
Show Answer & Explanation

Correct Answer: D - User-level threads are managed by a thread library; kernel-level threads are managed by the OS

User-level threads are managed entirely by a user-space thread library (the kernel is unaware of them), while kernel-level threads are managed directly by the OS kernel. Kernel threads can be scheduled independently.

Q26.
Which of the following is a solution to the critical section problem?
AUsing global variables
BUsing local variables
CPeterson's solution
DIncreasing CPU speed
Show Answer & Explanation

Correct Answer: C - Peterson's solution

Peterson's solution is a classic software-based solution to the critical section problem for two processes. It satisfies all three requirements: mutual exclusion, progress, and bounded waiting.

Q27.
What is a semaphore?
AA type of process
BA hardware interrupt
CA synchronization tool that uses an integer variable with atomic wait() and signal() operations
DA scheduling algorithm
Show Answer & Explanation

Correct Answer: C - A synchronization tool that uses an integer variable with atomic wait() and signal() operations

A semaphore is a synchronization tool consisting of an integer variable accessed through two atomic operations: wait() (P) and signal() (V). It is used to control access to shared resources.

Q28.
What is the producer-consumer problem?
AA problem in memory allocation
BA file management problem
CA CPU scheduling problem
DA classic synchronization problem where producers generate data and consumers consume it from a shared buffer
Show Answer & Explanation

Correct Answer: D - A classic synchronization problem where producers generate data and consumers consume it from a shared buffer

The producer-consumer problem is a classic synchronization problem where producer processes produce data items and place them in a shared buffer, while consumer processes remove and consume items from the buffer.

Q29.
In a system with 5 processes and 3 resource types, which algorithm can be used to avoid deadlock?
ABanker's algorithm
BFCFS scheduling
CRound Robin scheduling
DLRU replacement
Show Answer & Explanation

Correct Answer: A - Banker's algorithm

Banker's algorithm is a deadlock avoidance algorithm that checks whether granting a resource request would lead to an unsafe state. It considers maximum needs, current allocation, and available resources.

Q30.
What is the difference between a process and a thread?
AA process is lighter than a thread
BProcesses are faster to create than threads
CThreads share the same address space; processes have separate address spaces
DThere is no difference
Show Answer & Explanation

Correct Answer: C - Threads share the same address space; processes have separate address spaces

Threads within the same process share the same address space (code, data, files), while processes have separate address spaces. Thread creation and context switching is faster than process creation.

Q31.
What is a zombie process?
AA process that is actively running
BA process waiting for I/O
CA terminated process whose exit status has not been collected by its parent
DA process in the ready queue
Show Answer & Explanation

Correct Answer: C - A terminated process whose exit status has not been collected by its parent

A zombie process is a process that has completed execution but still has an entry in the process table because its parent hasn't called wait() to read its exit status. It consumes a PID but no other resources.

Q32.
What is a race condition?
AWhen two processes run simultaneously on different CPUs
BWhen two processes have the same priority
CWhen a process finishes before its deadline
DWhen the outcome depends on the order of execution of concurrent processes accessing shared data
Show Answer & Explanation

Correct Answer: D - When the outcome depends on the order of execution of concurrent processes accessing shared data

A race condition occurs when multiple processes or threads access shared data concurrently and the final result depends on the particular order of execution. It can lead to inconsistent or incorrect results.

Q33.
What is a mutex?
AA mutual exclusion lock that allows only one thread to access a resource at a time
BA type of process state
CA memory allocation technique
DA scheduling policy
Show Answer & Explanation

Correct Answer: A - A mutual exclusion lock that allows only one thread to access a resource at a time

A mutex (mutual exclusion) is a synchronization primitive that allows only one thread to enter a critical section at a time. A thread must acquire the mutex before entering and release it when leaving.

Q34.
Which deadlock handling strategy involves terminating processes to break the deadlock?
ADeadlock detection and recovery
BDeadlock avoidance
CDeadlock prevention
DDeadlock ignorance
Show Answer & Explanation

Correct Answer: A - Deadlock detection and recovery

Deadlock detection and recovery allows deadlocks to occur, detects them using algorithms (like wait-for graph), and recovers by terminating one or more processes or preempting resources.

Q35.
What is the readers-writers problem?
AA synchronization problem where multiple readers can read simultaneously but writers need exclusive access
BA file allocation problem
CA CPU scheduling problem
DA network protocol issue
Show Answer & Explanation

Correct Answer: A - A synchronization problem where multiple readers can read simultaneously but writers need exclusive access

The readers-writers problem is a synchronization problem where multiple readers can read a shared resource simultaneously, but a writer must have exclusive access. No other reader or writer can access the resource while a writer is writing.

Q36.
What is the dining philosophers problem used to illustrate?
AMemory management challenges
BConcurrency and synchronization challenges like deadlock and starvation
CFile system design
DNetwork routing
Show Answer & Explanation

Correct Answer: B - Concurrency and synchronization challenges like deadlock and starvation

The dining philosophers problem illustrates synchronization challenges in concurrent systems, particularly deadlock and starvation. Five philosophers share forks and must pick up two to eat, risking deadlock.

Q37.
In the Banker's algorithm, what does a 'safe state' mean?
ANo process is currently running
BThere exists at least one sequence in which all processes can complete
CAll resources are allocated
DThe system is in deadlock
Show Answer & Explanation

Correct Answer: B - There exists at least one sequence in which all processes can complete

A safe state means there exists a safe sequence — an order in which all processes can be allocated their maximum resources and complete. If the system is in a safe state, deadlock cannot occur.

Q38.
What happens when a process transitions from the Running state to the Waiting state?
AIt is terminated
BIt gets a higher priority
CIt issues an I/O request or waits for an event
DIt is preempted by the scheduler
Show Answer & Explanation

Correct Answer: C - It issues an I/O request or waits for an event

A process moves from Running to Waiting (Blocked) state when it needs to wait for something — typically an I/O operation or an event (like a signal from another process or a resource becoming available).

Q39.
What is the purpose of the wait() system call?
ATo delay a process by a specified time
BTo pause all processes
CTo put a process to sleep
DTo make a parent process wait until one of its child processes terminates
Show Answer & Explanation

Correct Answer: D - To make a parent process wait until one of its child processes terminates

The wait() system call causes a parent process to block until one of its child processes terminates. It also allows the parent to collect the child's exit status, preventing zombie processes.

Q40.
What is an orphan process?
AA child process whose parent has terminated
BA process with no allocated memory
CA process in deadlock
DA process with high priority
Show Answer & Explanation

Correct Answer: A - A child process whose parent has terminated

An orphan process is a child process that continues running after its parent process has terminated. In Unix/Linux, orphan processes are adopted by the init process (PID 1) which calls wait() for them.

Q41.
What is a counting semaphore used for?
AControlling access to a resource with multiple instances
BOnly mutual exclusion
CScheduling processes
DMemory allocation
Show Answer & Explanation

Correct Answer: A - Controlling access to a resource with multiple instances

A counting semaphore has an integer value that can range over an unrestricted domain. It is used to control access to a resource with a finite number of instances, such as a connection pool.

Q42.
How does the test-and-set instruction help solve the critical section problem?
AIt atomically tests and modifies a memory word, ensuring mutual exclusion
BIt checks if memory is available
CIt tests CPU speed
DIt sets process priority
Show Answer & Explanation

Correct Answer: A - It atomically tests and modifies a memory word, ensuring mutual exclusion

Test-and-set is an atomic hardware instruction that reads the old value of a memory word and sets it to TRUE in one indivisible operation. This atomicity ensures mutual exclusion in the critical section.

Q43.
If a system has resources A=10, B=5, C=7 and 5 processes with varying max needs, what is checked by the safety algorithm?
AWhether there exists a sequence where each process can get its max resources and finish
BWhether all processes can finish in FCFS order
CWhether the total allocation exceeds available resources
DWhether any process is starving
Show Answer & Explanation

Correct Answer: A - Whether there exists a sequence where each process can get its max resources and finish

The safety algorithm checks if a safe sequence exists — an order in which processes can be allocated their remaining needed resources (Max - Allocation) from available resources and complete.

Q44.
What is priority inversion?
AWhen a high-priority process waits for a resource held by a low-priority process
BWhen all processes have the same priority
CWhen priority scheduling is replaced by FCFS
DWhen a process changes its own priority
Show Answer & Explanation

Correct Answer: A - When a high-priority process waits for a resource held by a low-priority process

Priority inversion occurs when a high-priority process is indirectly blocked by a low-priority process because the low-priority process holds a shared resource. Priority inheritance protocol can solve this.

Q45.
What is a monitor in the context of process synchronization?
AA display device
BA high-level synchronization construct that encapsulates shared data with procedures and condition variables
CA debugging tool
DA type of mutex
Show Answer & Explanation

Correct Answer: B - A high-level synchronization construct that encapsulates shared data with procedures and condition variables

A monitor is a high-level synchronization construct that encapsulates shared data, procedures to operate on that data, and condition variables for synchronization. Only one process can be active in a monitor at a time.

Q46.
What is the purpose of the signal() operation on a semaphore?
ATo decrement the semaphore value
BTo destroy the semaphore
CTo increment the semaphore value and potentially wake up a waiting process
DTo check the semaphore value
Show Answer & Explanation

Correct Answer: C - To increment the semaphore value and potentially wake up a waiting process

The signal() (V) operation increments the semaphore value. If there are processes waiting on the semaphore, one of them is woken up and allowed to proceed into the critical section.

Q47.
In a resource allocation graph, what does a cycle indicate?
AA deadlock may exist (if multiple instances) or definitely exists (if single instance)
BThere are no deadlocks
CResources are underutilized
DAll processes have completed
Show Answer & Explanation

Correct Answer: A - A deadlock may exist (if multiple instances) or definitely exists (if single instance)

In a resource allocation graph, a cycle is a necessary condition for deadlock. If each resource type has only one instance, a cycle implies deadlock. With multiple instances, a cycle is necessary but not sufficient.

Q48.
What is the main advantage of multithreading?
AImproved responsiveness, resource sharing, and better utilization of multiprocessor architectures
BIncreased memory usage
CSimpler debugging
DReduced context switching
Show Answer & Explanation

Correct Answer: A - Improved responsiveness, resource sharing, and better utilization of multiprocessor architectures

Multithreading provides improved responsiveness (one thread can handle UI while another computes), resource sharing (threads share process resources), economy (cheaper than creating new processes), and scalability on multiprocessor systems.

Q49.
What is the difference between a binary semaphore and a counting semaphore?
AThere is no difference
BBinary semaphore can only be 0 or 1; counting semaphore can be any non-negative integer
CCounting semaphore is binary
DBinary semaphore allows multiple accesses
Show Answer & Explanation

Correct Answer: B - Binary semaphore can only be 0 or 1; counting semaphore can be any non-negative integer

A binary semaphore can only take values 0 or 1 and is similar to a mutex lock. A counting semaphore can take any non-negative integer value and is used to control access to resources with multiple instances.

Q50.
How can circular wait be prevented to avoid deadlock?
ABy imposing a total ordering on resource types and requiring processes to request resources in order
BBy killing all processes
CBy increasing available resources
DBy using FCFS scheduling
Show Answer & Explanation

Correct Answer: A - By imposing a total ordering on resource types and requiring processes to request resources in order

Circular wait can be prevented by assigning a unique number to each resource type and requiring each process to request resources in increasing order of their numbering. This breaks the possibility of a circular chain.

Showing 1-10 of 50 questions