Back to Practice OS & Networking

OS Concepts - Practice MCQs for CCAT

50 Questions Section B: Programming OS & Networking

OS Concepts Question Bank for C-CAT

Topic-wise OS Concepts MCQs for CDAC C-CAT preparation with answers and explanations.

Q1.
Which scheduling algorithm may cause starvation?
ARound Robin
BPriority Scheduling
CFCFS
DShortest Job First
Show Answer & Explanation

Correct Answer: B - Priority Scheduling

Priority Scheduling can cause starvation - solved using aging.

Q2.
Which is NOT a CPU scheduling algorithm?
AFCFS
BSJF
CRound Robin
DLRU
Show Answer & Explanation

Correct Answer: D - LRU

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

Q3.
Deadlock occurs when:
ACPU is idle
BAll four conditions hold simultaneously
CMemory is full
DProcess terminates
Show Answer & Explanation

Correct Answer: B - All four conditions hold simultaneously

Deadlock needs: Mutual Exclusion, Hold & Wait, No Preemption, Circular Wait.

Q4.
Banker's algorithm is used for:
ADeadlock avoidance
BCPU scheduling
CMemory allocation
DDisk scheduling
Show Answer & Explanation

Correct Answer: A - Deadlock avoidance

Banker's algorithm avoids deadlock by checking safe states.

Q5.
Semaphore is used for:
AMemory management
BProcess synchronization
CFile management
DCPU scheduling
Show Answer & Explanation

Correct Answer: B - Process synchronization

Semaphores synchronize concurrent processes to avoid race conditions.

Q6.
Page fault occurs when:
APage is in memory
BDisk is full
CMemory is empty
DPage is not in memory
Show Answer & Explanation

Correct Answer: D - Page is not in memory

Page fault occurs when a required page is not in main memory.

Q7.
Thrashing is:
AExcessive paging activity
BFast processing
CDisk formatting
DMemory cleaning
Show Answer & Explanation

Correct Answer: A - Excessive paging activity

Thrashing: system spends more time paging than executing.

Q8.
Virtual memory uses:
ARAM only
BROM
CCache only
DDisk as extension of RAM
Show Answer & Explanation

Correct Answer: D - Disk as extension of RAM

Virtual memory uses disk space to extend available memory.

Q9.
Context switching involves:
ADeleting process
BMemory allocation
CCreating new process
DSaving and loading process states
Show Answer & Explanation

Correct Answer: D - Saving and loading process states

Context switch saves current process state and loads another.

Q10.
Process in blocked state is waiting for:
AI/O or event
BCPU
CMemory
DNothing
Show Answer & Explanation

Correct Answer: A - I/O or event

Blocked process waits for I/O completion or an event.

Q11.
Mutex vs Semaphore:
ABoth are same
BMutex allows multiple access
CSemaphore is faster
DMutex is binary, Semaphore can have count
Show Answer & Explanation

Correct Answer: D - Mutex is binary, Semaphore can have count

Mutex is binary (locked/unlocked), Semaphore can have count > 1 for multiple resources.

Q12.
FIFO page replacement:
AReplaces oldest page
BReplaces most used page
CReplaces newest page
DReplaces random page
Show Answer & Explanation

Correct Answer: A - Replaces oldest page

FIFO replaces the oldest page in memory (first in, first out).

Q13.
LRU page replacement is based on:
APage size
BLeast recently used page
CMost frequently used
DFirst loaded
Show Answer & Explanation

Correct Answer: B - Least recently used page

LRU replaces the page that has not been used for the longest time.

Q14.
Internal fragmentation occurs in:
ALinked allocation
BSegmentation
CPaging
DNone
Show Answer & Explanation

Correct Answer: C - Paging

Internal fragmentation occurs in paging when allocated memory is larger than needed.

Q15.
External fragmentation occurs in:
AFixed partitioning
BAll schemes
CPaging
DVariable/dynamic partitioning
Show Answer & Explanation

Correct Answer: D - Variable/dynamic partitioning

External fragmentation occurs in variable partitioning when free memory is scattered.

Q16.
Belady's anomaly is seen in:
ALRU
BOptimal
CFIFO
DLFU
Show Answer & Explanation

Correct Answer: C - FIFO

Belady's anomaly: FIFO may have more page faults with more frames.

Q17.
Kernel mode vs User mode:
ASame privileges
BNeither has restrictions
CUser has full access
DKernel has full access, User restricted
Show Answer & Explanation

Correct Answer: D - Kernel has full access, User restricted

Kernel mode has full hardware access; User mode is restricted for protection.

Q18.
System call is used to:
ACall functions
BRequest OS services
CCreate variables
DDefine macros
Show Answer & Explanation

Correct Answer: B - Request OS services

System calls are the interface between user programs and operating system services.

Q19.
Producer-Consumer problem is solved using:
AOnly mutex
BNo synchronization needed
COnly spinlock
DSemaphores for synchronization
Show Answer & Explanation

Correct Answer: D - Semaphores for synchronization

Producer-Consumer uses semaphores (empty, full, mutex) for proper synchronization.

Q20.
Time quantum in Round Robin affects:
AResponse time and context switches
BMemory usage
CDisk speed
DFile size
Show Answer & Explanation

Correct Answer: A - Response time and context switches

Smaller quantum = better response time but more context switches; larger = opposite.

Q21.
Which of the following is NOT a function of an operating system?
AMemory management
BProcess management
CCompiler design
DFile management
Show Answer & Explanation

Correct Answer: C - Compiler design

Compiler design is not a function of an operating system. An OS is responsible for memory management, process management, file management, I/O management, and security.

Q22.
Which type of operating system is best suited for real-time missile guidance systems?
ABatch OS
BTime-sharing OS
CHard real-time OS
DNetwork OS
Show Answer & Explanation

Correct Answer: C - Hard real-time OS

Hard real-time OS guarantees that critical tasks are completed within strict time deadlines, which is essential for missile guidance systems where any delay could be catastrophic.

Q23.
What is the primary purpose of a system call?
ATo compile programs
BTo provide an interface between a process and the operating system
CTo schedule CPU
DTo manage network connections only
Show Answer & Explanation

Correct Answer: B - To provide an interface between a process and the operating system

System calls provide a programmatic interface between a running process and the operating system. They allow user-level processes to request services from the kernel such as file operations, process control, and communication.

Q24.
Which scheduling algorithm may cause starvation of low-priority processes?
ARound Robin
BFirst Come First Serve
CPriority Scheduling
DShortest Job First (non-preemptive)
Show Answer & Explanation

Correct Answer: C - Priority Scheduling

In Priority Scheduling, a low-priority process may wait indefinitely if higher-priority processes keep arriving. This problem is known as starvation and can be solved using aging.

Q25.
In a time-sharing operating system, what technique is used to give each user a fair share of CPU time?
ATime quantum / time slice
BBuffering
CSpooling
DInterrupt handling
Show Answer & Explanation

Correct Answer: A - Time quantum / time slice

Time-sharing OS uses a time quantum (time slice) to allocate CPU time to each user process in a round-robin fashion, ensuring fair and interactive use of the system.

Q26.
Which of the following system calls is used to create a new process in Unix/Linux?
Aexec()
Bwait()
Cfork()
Dexit()
Show Answer & Explanation

Correct Answer: C - fork()

The fork() system call creates a new child process that is a duplicate of the calling (parent) process. exec() is used to replace the process image, wait() waits for child termination, and exit() terminates a process.

Q27.
What is the role of a dispatcher in an operating system?
ATo give control of CPU to the process selected by the scheduler
BTo select a process from the ready queue
CTo handle interrupts
DTo manage memory allocation
Show Answer & Explanation

Correct Answer: A - To give control of CPU to the process selected by the scheduler

The dispatcher is the module that gives control of the CPU to the process selected by the short-term scheduler. It involves context switching, switching to user mode, and jumping to the appropriate location in the program.

Q28.
What is the convoy effect in CPU scheduling?
AAll processes finish at the same time
BShort processes wait behind a long process in FCFS
CPriority inversion occurs
DMultiple processes execute simultaneously
Show Answer & Explanation

Correct Answer: B - Short processes wait behind a long process in FCFS

The convoy effect occurs in First Come First Serve (FCFS) scheduling when a long CPU-burst process holds the CPU, causing shorter processes to wait for a long time, leading to lower CPU and device utilization.

Q29.
Which of the following is a preemptive scheduling algorithm?
AFirst Come First Serve
BRound Robin
CShortest Job First (non-preemptive)
DPriority (non-preemptive)
Show Answer & Explanation

Correct Answer: B - Round Robin

Round Robin is a preemptive scheduling algorithm where each process is assigned a fixed time quantum. If a process doesn't complete within its quantum, it is preempted and placed at the end of the ready queue.

Q30.
What is the main advantage of multiprogramming?
AFaster execution of a single process
BIncreased CPU utilization
CReduced memory usage
DSimplified OS design
Show Answer & Explanation

Correct Answer: B - Increased CPU utilization

Multiprogramming increases CPU utilization by keeping multiple processes in memory. When one process waits for I/O, the CPU can switch to another process, reducing CPU idle time.

Q31.
What is the difference between a program and a process?
AThere is no difference
BA program is active; a process is passive
CA program runs in kernel mode; a process runs in user mode
DA process is an instance of a program in execution
Show Answer & Explanation

Correct Answer: D - A process is an instance of a program in execution

A program is a passive entity (code stored on disk), while a process is an active entity — an instance of a program that is currently being executed, with its own program counter, stack, and data section.

Q32.
Which mode bit value indicates kernel mode in most operating systems?
A-1
B1
C2
D0
Show Answer & Explanation

Correct Answer: D - 0

In most operating systems, a mode bit value of 0 indicates kernel mode (supervisor mode), while a value of 1 indicates user mode. This hardware-supported mechanism protects the OS from errant user programs.

Q33.
What is thrashing in an operating system?
AA process executing too fast
BMemory overflow due to large programs
CDeadlock between two processes
DExcessive paging activity causing system slowdown
Show Answer & Explanation

Correct Answer: D - Excessive paging activity causing system slowdown

Thrashing occurs when a system spends more time swapping pages in and out of memory than executing processes. It happens when the degree of multiprogramming is too high and processes don't have enough frames.

Q34.
Which of the following is NOT a type of operating system?
ABatch Operating System
BDistributed Operating System
CCompiler Operating System
DReal-Time Operating System
Show Answer & Explanation

Correct Answer: C - Compiler Operating System

There is no such thing as a 'Compiler Operating System.' A compiler is a translator program, not an OS type. Valid OS types include Batch, Time-sharing, Distributed, Real-Time, and Network OS.

Q35.
What is the purpose of spooling in an operating system?
ATo speed up CPU execution
BTo overlap I/O of one job with computation of another
CTo manage virtual memory
DTo handle deadlocks
Show Answer & Explanation

Correct Answer: B - To overlap I/O of one job with computation of another

Spooling (Simultaneous Peripheral Operations Online) uses a disk as a buffer to overlap I/O operations of one job with the computation of another, improving overall system throughput.

Q36.
In Shortest Job First (SJF) scheduling, what criterion is used to select the next process?
AExpected CPU burst time
BPriority number
CArrival time
DProcess ID
Show Answer & Explanation

Correct Answer: A - Expected CPU burst time

SJF scheduling selects the process with the shortest expected CPU burst time next. It is optimal in terms of average waiting time but requires knowing or estimating burst times in advance.

Q37.
What is the purpose of an interrupt in an operating system?
ATo slow down the CPU
BTo allocate memory
CTo signal the CPU that an event needs attention
DTo compile programs
Show Answer & Explanation

Correct Answer: C - To signal the CPU that an event needs attention

An interrupt is a signal to the CPU indicating that an event requires immediate attention. When an interrupt occurs, the CPU saves its state and transfers control to an interrupt handler routine.

Q38.
Which of the following is true about a microkernel OS architecture?
AOnly essential services run in kernel space
BAll services run in kernel space
CIt does not support system calls
DIt is slower than monolithic kernel in all cases
Show Answer & Explanation

Correct Answer: A - Only essential services run in kernel space

In a microkernel architecture, only the most essential services (like IPC, basic scheduling, and memory management) run in kernel space. Other services like file systems and device drivers run in user space.

Q39.
What does the exec() system call do in Unix?
ACreates a new process
BTerminates the current process
CReplaces the current process image with a new program
DWaits for a child process
Show Answer & Explanation

Correct Answer: C - Replaces the current process image with a new program

The exec() system call replaces the current process's memory image with a new program. The process ID remains the same, but the code, data, and stack are replaced with the new program.

Q40.
What is context switching?
ASaving and restoring the state of a process so execution can be resumed later
BSwitching between user mode and kernel mode
CSwitching between different operating systems
DChanging the priority of a process
Show Answer & Explanation

Correct Answer: A - Saving and restoring the state of a process so execution can be resumed later

Context switching involves saving the state (context) of the currently running process and restoring the state of the next process to be executed. This includes saving/restoring registers, program counter, and memory maps.

Q41.
For a set of processes with burst times 6, 8, 7, 3 arriving at time 0, what is the average waiting time using SJF scheduling?
A7.0
B7.75
C4.0
D10.25
Show Answer & Explanation

Correct Answer: A - 7.0

SJF order is 3, 6, 7, 8. Waiting times are 0, 3, 9, and 16. Average waiting time = (0+3+9+16)/4 = 7.0.

Q42.
What is a bootstrap program?
AA program that installs the OS
BA program that manages boot devices
CThe first program that runs when a computer is powered on
DA utility for disk formatting
Show Answer & Explanation

Correct Answer: C - The first program that runs when a computer is powered on

The bootstrap program (bootloader) is the first program that runs when a computer is powered on or restarted. It is stored in ROM/EEPROM and is responsible for loading the operating system kernel into memory.

Q43.
What is the purpose of DMA (Direct Memory Access)?
ATo increase CPU clock speed
BTo manage virtual memory
CTo allow devices to transfer data to/from memory without CPU intervention
DTo handle process scheduling
Show Answer & Explanation

Correct Answer: C - To allow devices to transfer data to/from memory without CPU intervention

DMA allows hardware devices to transfer data directly to/from memory without involving the CPU for each byte. This frees the CPU to perform other tasks during bulk data transfers.

Q44.
Which scheduling algorithm gives the minimum average waiting time?
ASJF
BFCFS
CRound Robin
DPriority Scheduling
Show Answer & Explanation

Correct Answer: A - SJF

Shortest Job First (SJF) is provably optimal for minimizing the average waiting time among all non-preemptive scheduling algorithms. Its preemptive version (SRTF) is optimal among all algorithms.

Q45.
In Round Robin scheduling with a time quantum of 4, if a process has a burst time of 10, how many times will it be preempted?
A1
B2
C3
D4
Show Answer & Explanation

Correct Answer: B - 2

With burst time 10 and quantum 4: First run uses 4 (remaining 6, preempted), second run uses 4 (remaining 2, preempted), third run uses 2 (completes). So the process is preempted 2 times.

Q46.
What is a monolithic kernel?
AA kernel where all OS services run in user space
BA kernel that only supports single-user operations
CA kernel where all OS services run in kernel space as a single program
DA kernel without system call support
Show Answer & Explanation

Correct Answer: C - A kernel where all OS services run in kernel space as a single program

A monolithic kernel runs all OS services (file system, device drivers, memory management, etc.) in kernel space as a single large program. Examples include Linux and traditional Unix kernels.

Q47.
What is the function of the long-term scheduler?
ASelects processes from job pool to ready queue
BSelects processes from ready queue to CPU
CSwaps processes between memory and disk
DHandles I/O scheduling
Show Answer & Explanation

Correct Answer: A - Selects processes from job pool to ready queue

The long-term scheduler (job scheduler) selects processes from the job pool (secondary storage) and loads them into memory (ready queue). It controls the degree of multiprogramming.

Q48.
Which of the following is an example of a real-time operating system?
AWindows 10
BVxWorks
CUbuntu
DmacOS
Show Answer & Explanation

Correct Answer: B - VxWorks

VxWorks is a widely used real-time operating system (RTOS) designed for embedded systems that require deterministic response times. Windows, Ubuntu, and macOS are general-purpose operating systems.

Q49.
What is the response time in the context of CPU scheduling?
ATime from submission of a request to the first response
BTime taken to complete a process
CTime a process spends waiting in the ready queue
DTime to switch between processes
Show Answer & Explanation

Correct Answer: A - Time from submission of a request to the first response

Response time is the time from when a request (process) is submitted until the first response is produced. It is an important metric in interactive systems and is different from turnaround time.

Q50.
What is the difference between preemptive and non-preemptive scheduling?
APreemptive allows only one process; non-preemptive allows many
BThere is no difference
CPreemptive is faster; non-preemptive is slower
DIn preemptive, a running process can be interrupted; in non-preemptive, it runs to completion
Show Answer & Explanation

Correct Answer: D - In preemptive, a running process can be interrupted; in non-preemptive, it runs to completion

In preemptive scheduling, the OS can interrupt a running process and allocate the CPU to another process. In non-preemptive scheduling, a process holds the CPU until it finishes or voluntarily yields.

Showing 1-10 of 50 questions