OS & Networking

OS Concepts — Practice MCQs for CCAT

20 Questions Section B: Programming OS & Networking

Practice 20 OS Concepts multiple-choice questions designed for CDAC CCAT exam preparation. Click "Show Answer" to reveal the correct option with detailed explanation.

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

Correct Answer: C — Priority Scheduling

Priority Scheduling can cause starvation - solved using aging.

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

Correct Answer: C — 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:
ACPU scheduling
BDeadlock avoidance
CMemory allocation
DDisk scheduling
Show Answer & Explanation

Correct Answer: B — 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
BPage is not in memory
CMemory is empty
DDisk is full
Show Answer & Explanation

Correct Answer: B — Page is not in memory

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

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

Correct Answer: B — Excessive paging activity

Thrashing: system spends more time paging than executing.

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

Correct Answer: B — Disk as extension of RAM

Virtual memory uses disk space to extend available memory.

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

Correct Answer: B — Saving and loading process states

Context switch saves current process state and loads another.

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

Correct Answer: B — I/O or event

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

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

Correct Answer: B — 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 most used page
BReplaces oldest page
CReplaces newest page
DReplaces random page
Show Answer & Explanation

Correct Answer: B — 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:
APaging
BSegmentation
CLinked allocation
DNone
Show Answer & Explanation

Correct Answer: A — Paging

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

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

Correct Answer: B — 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
BKernel has full access, User restricted
CUser has full access
DNeither has restrictions
Show Answer & Explanation

Correct Answer: B — 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
BSemaphores for synchronization
COnly spinlock
DNo synchronization needed
Show Answer & Explanation

Correct Answer: B — Semaphores for synchronization

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

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

Correct Answer: B — Response time and context switches

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