1.
Critical Regions & Synchronization
1. Critical Section
○ Code segment accessing shared resources (e.g., variables, files).
○ Requires mutual exclusion to prevent race conditions.
○ Solutions: Locks, semaphores, monitors.
2. Conditional Critical Regions (CCRs)
○ Critical sections with condition variables (e.g., wait()/signal()).
○ Process enters only if a condition is true (e.g., while (buffer_full)
wait();).
3. Monitors
○ High-level synchronization construct bundling:
■ Shared data.
■ Procedures to access data.
■ Condition variables for blocking.
○ Ensures only one process executes a monitor procedure at a time.
2. Interprocess Communication (IPC)
4. Message Passing
○ Processes communicate via send/receive primitives.
○ Types:
■ Direct (explicit sender/receiver IDs).
■ Indirect (via mailboxes/ports).
5. Pipes
○ Unidirectional communication (e.g., shell commands: cmd1 | cmd2).
○ Named pipes (FIFOs) persist beyond process life.
6. Shared Memory
○ Fastest IPC (processes map the same memory region).
○ Requires explicit synchronization (e.g., semaphores).
7. Semaphores
○ Integer variable with atomic wait() (P) and signal() (V) operations.
○ Types:
■ Binary (0/1 for mutual exclusion).
■ Counting (resource pools).
3. Deadlocks
8. Deadlock Characterization
Four necessary conditions (Coffman conditions):
○ Mutual Exclusion: Resource held exclusively.
○ Hold and Wait: Process holds resources while waiting for others.
○ No Preemption: Resources cannot be forcibly taken.
○ Circular Wait: Cycle in resource allocation graph.
9. Deadlock Prevention
Break one of the four conditions:
○ Eliminate Mutual Exclusion: Allow shared access (not always possible).
○ Remove Hold and Wait: Request all resources initially.
○ Allow Preemption: Forcefully release resources.
○ Avoid Circular Wait: Impose total ordering of resource requests.
10.Deadlock Avoidance
○ Banker’s Algorithm: Simulates resource allocation to ensure safe
states.
○ Requires advance knowledge of max resource needs.
11.Deadlock Detection & Recovery
○ Detection: Use resource allocation graphs or cycle-detection
algorithms.
○ Recovery:
■ Process Termination: Kill deadlocked processes.
■ Resource Preemption: Roll back and retry.
12.Combined Approach
○ Hybrid of prevention, avoidance, and detection (e.g., OS defaults).
4. Advanced Concepts
13.Precedence Graphs
○ Directed graphs to detect deadlocks in multi-threaded systems.
○ Nodes = processes; Edges = "waits-for" relationships.
14.Concurrent Languages
○ Java: synchronized blocks, wait()/notify().
○ Go: Goroutines + channels.
○ Erlang: Message-passing between lightweight processes.
15.Modularization
○ Design concurrent systems as independent modules with clear
interfaces.
○ Reduces unintended interactions.
Key Synchronization Problems
16.Producer-Consumer
○ Solved with bounded buffers + semaphores/monitors.
17.Readers-Writers
○ Prioritize readers (starvation risk) or writers (fairness).
18.Dining Philosophers
○ Illustrates deadlock (all pick left fork first) and solutions (resource
ordering).
Summary Table
Concept Key Mechanism Example
Critical Section Locks/Semaphores lock.acquire(); ...;
lock.release();
Monitor Encapsulated data + Java synchronized methods
procedures
Message send()/receive() MPI, Go channels
Passing
Deadlock Break Coffman conditions Request all resources upfront
Prevention
Banker’s Safe state checking Resource allocation simulation
Algorithm
1. Evolution of Operating Systems
Types of OS
1. Batch Processing
○ Jobs executed sequentially without user interaction.
○ Example: Early mainframe systems (1950s).
2. Time-Sharing
○ Multiple users interact concurrently via terminals.
○ Example: UNIX (1970s).
3. Real-Time OS (RTOS)
○ Guarantees timely response for critical tasks.
○ Types:
■ Hard RTOS: Strict deadlines (e.g., medical devices).
■ Soft RTOS: Tolerable delays (e.g., streaming).
4. Distributed OS
○ Manages resources across networked computers.
○ Example: Google's Borg system.
5. Embedded OS
○ Lightweight, for dedicated hardware (e.g., Android on IoT).
2. CPU Scheduling
Key Concepts
● Preemption: OS can interrupt a running process.
● Context Switch: Saving/restoring process state.
● Scheduling Criteria:
○ CPU utilization, throughput, turnaround time, waiting time, response
time.
Scheduling Algorithms
Algorithm Description Pros & Cons
FCFS First-Come-First-Served Simple, but poor for short jobs
SJF Shortest Job First Optimal avg wait time, but hard to
predict job length
Priority Assigns priority levels Risk of starvation (low-priority jobs)
Round Robin Time slices (quantum) for Fair, but high context switches
each job
Multilevel Separate queues for different Complex but flexible
Queue job types
3. Concurrent Programming
Key Challenges
1. Race Conditions
○ Occur when multiple processes access shared data concurrently.
○ Solved via synchronization (e.g., locks, semaphores).
2. Critical Sections
○ Code segments accessing shared resources.
○ Requirements:
■ Mutual exclusion.
■ Progress (no indefinite waiting).
■ Bounded waiting.
Synchronization Tools
Tool Description Use Case
Semaphores Integer with wait()/signal() Resource counting
Mutex Locks Binary locks (acquire/release) Simple mutual exclusion
Monitors Encapsulates data + sync High-level abstraction
procedures (Java)
Condition wait()/signal() within monitors Coordinating thread
Variables actions
Deadlocks
● Definition: Circular waiting for resources.
● Necessary Conditions (Coffman):
○ Mutual Exclusion
○ Hold and Wait
○ No Preemption
○ Circular Wait
● Handling Techniques:
○ Prevention: Break one condition (e.g., request all resources upfront).
○ Avoidance: Banker’s algorithm (safe state checks).
○ Detection & Recovery: Kill processes or preempt resources.
Key Comparisons
Concept Batch OS vs. Time-Sharing
Interaction None vs. Multi-user interactive
Efficiency High throughput vs. Fast
response
Algorithm FCFS vs. Round Robin
Fairness Unfair to short jobs vs.
Equitable
Overhead Low vs. High (context
switches)
Memory Management in Operating Systems
Memory management is a critical function of an OS that ensures efficient allocation,
tracking, and optimization of memory usage. It includes both contiguous and
non-contiguous allocation techniques, as well as virtual memory systems.
1. Contiguous Memory Allocation
Memory is allocated in a single continuous block.
A. Static Allocation (Fixed Partitioning)
● Memory is divided into fixed-size partitions.
● Disadvantages:
○ Internal Fragmentation: Unused memory within a partition.
○ Limited flexibility (e.g., a large program may not fit).
B. Dynamic Partitioning (Variable Partitioning)
● Memory is allocated in variable-sized blocks as needed.
● Algorithms:
○ First Fit: Allocate the first available block that fits.
○ Best Fit: Allocate the smallest suitable block.
○ Worst Fit: Allocate the largest available block (rarely used).
● Disadvantages:
○ External Fragmentation: Free memory becomes scattered.
○ Compaction (memory shuffling) may be needed.
C. Overlays
● Used when program size > available memory.
● Only required modules are loaded at runtime.
● Disadvantage: Manual management (rarely used today).
2. Non-Contiguous Memory Allocation
Memory is allocated in disjointed blocks, reducing fragmentation.
A. Paging
● Divides memory into fixed-size blocks (frames) and programs into pages.
● Page Table: Maps logical addresses to physical frames.
● Advantages:
○ No external fragmentation.
○ Efficient for virtual memory.
● Disadvantages:
○ Internal fragmentation (last page may be partially unused).
○ Overhead due to page tables.
B. Segmentation
● Divides memory into variable-sized segments (e.g., code, data, stack).
● Segment Table: Stores base address and segment length.
● Advantages:
○ Matches program structure better than paging.
● Disadvantages:
○ External fragmentation possible.
○ Slower than paging due to variable sizes.
C. Paged Segmentation
● Combines paging and segmentation:
○ Segments are divided into pages.
○ Reduces external fragmentation while keeping benefits of
segmentation.
3. Virtual Memory
Allows programs to use more memory than physically available via demand paging.
A. Demand Paging
● Pages are loaded into memory only when needed.
● Page Fault: Occurs when a required page is not in RAM.
○ OS fetches it from disk (swap space).
B. Page Replacement Algorithms
When RAM is full, the OS must decide which page to replace:
1. FIFO (First-In-First-Out)
○ Replaces the oldest page.
○ Disadvantage: May replace frequently used pages.
2. LRU (Least Recently Used)
○ Replaces the least recently accessed page.
○ Optimal but hard to implement.
3. Clock (Second Chance)
○ Approximates LRU using a reference bit.
4. Optimal (Theoretical)
○ Replaces the page that won’t be used for the longest time (not
practical).
C. Thrashing
● Occurs when excessive page faults slow down the system.
● Solution:
○ Increase RAM.
○ Use better page replacement (e.g., LRU).
○ Adjust working set (number of active pages per process).
4. Hardware Support for Memory Management
● MMU (Memory Management Unit): Translates logical → physical addresses.
● TLB (Translation Lookaside Buffer): Cache for page table entries (speeds up
address translation).
● Page Table Structures:
○ Hierarchical (Multi-level): Reduces memory overhead (e.g., 2-level
paging).
○ Hashed: Used in large address spaces (e.g., Linux).
○ Inverted: One entry per physical frame (saves space).
Summary Table
Technique Pros Cons
Fixed Partitioning Simple to implement Internal fragmentation
Dynamic Partitioning Flexible allocation External fragmentation
Paging No external fragmentation Internal fragmentation,
overhead
Segmentation Logical program External fragmentation
organization
Demand Paging Efficient memory use Page faults slow performance
LRU Page Minimizes page faults Hard to implement perfectly
Replacement
File Systems in Operating Systems
A file system organizes data storage on disks, providing structured access to files
and directories. It includes:
1. Logical File System (user view: files, directories).
2. Physical File System (how data is stored on disk).
3. Allocation Strategies (how disk blocks are assigned to files).
4. Disk Scheduling (optimizing read/write operations).
1. Simple File System Structure
A. File System Components
1. File: Named collection of data (text, binary, etc.).
2. Directory: Hierarchical structure to organize files.
3. Metadata:
○ File name, size, permissions, timestamps.
○ Stored in inodes (UNIX) or file control blocks (FCBs) (Windows).
B. Disk Layout
Section Purpose
Boot Block Stores OS bootloader.
Superblock File system metadata (size, free
blocks).
Inode Table Stores file metadata (UNIX/Linux).
Data Blocks Actual file contents.
2. Physical File System
A. Allocation Strategies
How disk blocks are assigned to files:
(1) Contiguous Allocation
● Files occupy sequential disk blocks.
● Pros:
○ Fast sequential access.
○ Simple to implement.
● Cons:
○ External fragmentation (free gaps between files).
○ Hard to grow files.
(2) Linked Allocation
● Files stored as linked lists of blocks.
○ Each block points to the next.
● Pros:
○ No external fragmentation.
○ Files can grow dynamically.
● Cons:
○ Slow random access (must traverse links).
○ Overhead for pointers.
(3) Indexed Allocation
● Uses an index block (or inode) to store pointers to all file blocks.
● Pros:
○ Fast random access.
○ No external fragmentation.
● Cons:
○ Overhead for index blocks.
3. Disk Scheduling Algorithms
Optimize disk head movement to reduce seek time.
Algorithm Description Pros & Cons
FCFS Requests served in Simple, but poor performance.
order.
SSTF (Shortest Seek Picks nearest request. Faster than FCFS, but may
Time First) starve far requests.
SCAN (Elevator) Moves back-and-forth Fair, but long wait at ends.
across disk.
C-SCAN Circular SCAN (resets at More uniform wait times.
end).
LOOK SCAN but reverses Reduces unnecessary
direction early. movement.
4. Device Handlers (Disk Drivers)
● Translate OS file requests into low-level disk commands.
● Functions:
○ Read/Write Scheduling: Uses disk scheduling algorithms.
○ Error Handling: Bad sector recovery.
○ Caching: Stores frequently accessed blocks in RAM (buffer cache).
5. Key File System Examples
File System Features
FAT (File Allocation Simple, used in USB drives. Linked allocation.
Table)
NTFS (Windows) Journaling, security (ACLs), large file support.
ext4 (Linux) Journaling, extents (contiguous blocks), faster
fsck.
ZFS Advanced error correction, snapshots,
RAID-like pooling.
Operating Systems MCQs with Answers
Evolution of Operating Systems
1. Which was the first widely used operating system?
a) UNIX
b) MS-DOS
c) Windows
d) Linux
Answer: b) MS-DOS
2. Time-sharing systems were developed to:
a) Improve CPU utilization
b) Allow multiple users simultaneous access
c) Handle real-time processes
d) Manage distributed systems
Answer: b) Allow multiple users simultaneous access
3. Which OS type is used in pacemakers?
a) Distributed OS
b) Real-Time OS
c) Batch OS
d) Time-Sharing OS
Answer: b) Real-Time OS
CPU Scheduling
4. Which scheduling algorithm always selects the shortest job next?
a) FCFS
b) SJF
c) Round Robin
d) Priority
Answer: b) SJF
5. The convoy effect occurs in:
a) Priority Scheduling
b) FCFS Scheduling
c) Round Robin
d) Multilevel Queue
Answer: b) FCFS Scheduling
6. In Round Robin scheduling, if time quantum is too large, it behaves like:
a) SJF
b) FCFS
c) Priority
d) Multilevel Feedback
Answer: b) FCFS
Concurrent Programming & Deadlocks
7. Which is NOT a necessary condition for deadlock?
a) Mutual Exclusion
b) Hold and Wait
c) No Preemption
d) Starvation
Answer: d) Starvation
8. The Banker's Algorithm is used for:
a) Deadlock Prevention
b) Deadlock Avoidance
c) Deadlock Detection
d) Deadlock Recovery
Answer: b) Deadlock Avoidance
9. A semaphore initialized to 1 is called:
a) Counting Semaphore
b) Binary Semaphore
c) Mutex Lock
d) Monitor
Answer: b) Binary Semaphore
Memory Management
10.Belady's anomaly occurs with which page replacement?
a) FIFO
b) LRU
c) Optimal
d) Clock
Answer: a) FIFO
11.Virtual memory uses:
a) Only physical memory
b) Only secondary storage
c) Both physical memory and disk
d) Cache memory only
Answer: c) Both physical memory and disk
12.The optimal page replacement algorithm:
a) Removes the least recently used page
b) Removes the page not used for longest time
c) Is impossible to implement
d) Uses a circular buffer
Answer: b) Removes the page not used for longest time
File Systems
13.Which disk scheduling algorithm services requests in the direction it's
moving?
a) FCFS
b) SSTF
c) SCAN
d) C-LOOK
Answer: c) SCAN
14.NTFS uses which allocation method?
a) Contiguous
b) Linked
c) Indexed
d) Hashed
Answer: c) Indexed
15.The file allocation table (FAT) is used in:
a) Contiguous allocation
b) Linked allocation
c) Indexed allocation
d) Hashed allocation
Answer: b) Linked allocation
Advanced Topics
16.Which is true about monitors?
a) They use message passing
b) Only one process can execute monitor code at a time
c) They don't provide synchronization
d) They are hardware features
Answer: b) Only one process can execute monitor code at a time
17.In paging, the page table maps:
a) Logical to physical addresses
b) Physical to logical addresses
c) Files to disk blocks
d) Processes to CPUs
Answer: a) Logical to physical addresses
18.Thrashing occurs when:
a) CPU utilization is high
b) Page fault rate is very high
c) Deadlock occurs
d) Disk fails
Answer: b) Page fault rate is very high
Additional Questions
19.Which scheduling algorithm is most suitable for real-time systems?
a) FCFS
b) SJF
c) Priority
d) Round Robin
Answer: c) Priority
20.The four necessary conditions for deadlock are known as:
a) Coffman conditions
b) Peterson conditions
c) Dijkstra conditions
d) Lamport conditions
Answer: a) Coffman conditions
21.In segmentation, memory is divided into:
a) Fixed-size blocks
b) Variable-size blocks
c) Equal-size pages
d) Cache lines
Answer: b) Variable-size blocks
22.Which IPC mechanism is fastest?
a) Pipes
b) Message queues
c) Shared memory
d) Sockets
Answer: c) Shared memory
23.The working set model is used for:
a) Deadlock avoidance
b) Memory management
c) Disk scheduling
d) Process synchronization
Answer: b) Memory management
24.Which is NOT a disk scheduling algorithm?
a) SCAN
b) SSTF
c) LOOK
d) SWAP
Answer: d) SWAP
25.In virtual memory, the page fault service time includes:
a) Only disk I/O time
b) Only memory access time
c) Disk I/O + context switch time
d) CPU execution time
Answer: c) Disk I/O + context switch time
26.A race condition occurs when:
a) Two processes compete for same resource
b) Process priority changes dynamically
c) Memory allocation fails
d) Disk becomes fragmented
Answer: a) Two processes compete for same resource
27.Which page replacement algorithm uses reference bits?
a) FIFO
b) LRU
c) Clock
d) Optimal
Answer: c) Clock
28.The critical section problem requires:
a) Mutual exclusion
b) Progress
c) Bounded waiting
d) All of the above
Answer: d) All of the above
29.Which is true about SJF scheduling?
a) It can cause starvation
b) It's always optimal
c) It's easy to implement
d) It's non-preemptive
Answer: a) It can cause starvation
30.In distributed systems, which protocol is used for mutual exclusion?
a) Banker's algorithm
b) Peterson's algorithm
c) Ricart-Agrawala algorithm
d) Round Robin algorithm
Answer: c) Ricart-Agrawala algorithm
31.The fork() system call creates:
a) Thread
b) Process
c) Pipe
d) Semaphore
Answer: b) Process
32.Which is NOT a component of a file system?
a) Directory structure
b) Memory manager
c) Access methods
d) Allocation methods
Answer: b) Memory manager
33.The dining philosophers problem illustrates:
a) Memory fragmentation
b) Deadlock
c) Page replacement
d) Disk scheduling
Answer: b) Deadlock
34.Which is true about demand paging?
a) All pages are loaded at startup
b) Pages are loaded when needed
c) It doesn't use disk
d) It's slower than swapping
Answer: b) Pages are loaded when needed
35.The PCB (Process Control Block) contains:
a) Process state
b) CPU registers
c) Memory limits
d) All of the above
Answer: d) All of the above
36.Which is NOT a memory allocation technique?
a) First-fit
b) Best-fit
c) Worst-fit
d) Quick-fit
Answer: d) Quick-fit
37.In UNIX, which system call creates a pipe?
a) pipe()
b) fork()
c) exec()
d) open()
Answer: a) pipe()
38.The principle of locality refers to:
a) Temporal and spatial locality
b) Process priority
c) Deadlock conditions
d) File allocation
Answer: a) Temporal and spatial locality
39.Which is true about multilevel queue scheduling?
a) Processes can move between queues
b) Each queue has its own scheduling algorithm
c) It doesn't use priorities
d) It's only for real-time systems
Answer: b) Each queue has its own scheduling algorithm
40.The purpose of TLB (Translation Lookaside Buffer) is to:
a) Speed up address translation
b) Detect deadlocks
c) Schedule processes
d) Manage files
Answer: a) Speed up address translation
Process Management
41.What is the main purpose of a Process Control Block (PCB)?
a) To store temporary files
b) To hold process execution state and context
c) To manage disk partitions
d) To schedule I/O operations
Answer: b) To hold process execution state and context
42.A zombie process is:
a) A terminated process waiting for its parent to read its status
b) A process consuming excessive CPU
c) A process blocked on I/O
d) A process with memory leaks
Answer: a) A terminated process waiting for its parent to read its status
43.The fork() system call returns:
a) 0 to the child, PID of child to parent
b) 1 to the child, -1 to parent
c) Same PID to both processes
d) Random values
Answer: a) 0 to the child, PID of child to parent
Threads
44.User-level threads are managed by:
a) The operating system kernel
b) A runtime library in user space
c) Hardware interrupts
d) Device drivers
Answer: b) A runtime library in user space
45.The main advantage of kernel-level threads over user-level threads is:
a) Lower creation overhead
b) Better parallelism on multiprocessors
c) No need for synchronization
d) Simpler implementation
Answer: b) Better parallelism on multiprocessors
46.In a many-to-one threading model:
a) Many user threads map to one kernel thread
b) One user thread maps to many kernel threads
c) Each user thread has a dedicated kernel thread
d) Threads are not supported
Answer: a) Many user threads map to one kernel thread
Synchronization
47.The test-and-set instruction is used to:
a) Implement mutual exclusion
b) Allocate memory
c) Schedule processes
d) Manage file systems
Answer: a) Implement mutual exclusion
48.A monitor differs from a semaphore in that:
a) Monitors are language constructs while semaphores are OS primitives
b) Semaphores are faster
c) Monitors don't provide mutual exclusion
d) Semaphores can't cause deadlocks
Answer: a) Monitors are language constructs while semaphores are OS
primitives
49.The readers-writers problem favors:
a) Readers (multiple can read simultaneously)
b) Writers (exclusive access)
c) Neither has priority
d) Depends on implementation
Answer: d) Depends on implementation
Memory Management
50.External fragmentation occurs in:
a) Paging
b) Segmentation
c) Virtual memory
d) Cache memory
Answer: b) Segmentation
51.The working set of a process is:
a) The set of pages currently in physical memory
b) The set of pages accessed in the last Δ time units
c) All pages the process will ever need
d) The pages swapped out to disk
Answer: b) The set of pages accessed in the last Δ time units
52.The purpose of a TLB is to:
a) Cache page table entries
b) Manage disk blocks
c) Schedule processes
d) Handle interrupts
Answer: a) Cache page table entries
File Systems
53.Inode in UNIX systems contains:
a) File metadata and block pointers
b) Only file name
c) Only access permissions
d) User credentials
Answer: a) File metadata and block pointers
54.Journaling in file systems helps with:
a) Faster file access
b) Recovery after crashes
c) Reducing disk space usage
d) Improving CPU scheduling
Answer: b) Recovery after crashes
55.The main advantage of indexed allocation over linked allocation is:
a) Better random access
b) Less memory usage
c) Simpler implementation
d) No need for disk space
Answer: a) Better random access
I/O Systems
56.DMA (Direct Memory Access) is used to:
a) Bypass CPU for bulk data transfers
b) Increase CPU clock speed
c) Manage virtual memory
d) Schedule processes
Answer: a) Bypass CPU for bulk data transfers
57.Which is NOT a disk scheduling algorithm?
a) SCAN
b) SSTF
c) LOOK
d) SWAP
Answer: d) SWAP
58.Spooling is used for:
a) Managing print jobs
b) Memory allocation
c) Process scheduling
d) File compression
Answer: a) Managing print jobs
Security & Protection
59.The principle of least privilege means:
a) Processes get only necessary permissions
b) All processes run as root
c) Memory is shared freely
d) No access control is needed
Answer: a) Processes get only necessary permissions
60.A capability list contains:
a) Objects a process can access and permitted operations
b) Process scheduling information
c) Memory allocation details
d) Disk block addresses
Answer: a) Objects a process can access and permitted operations
Virtualization
61.Type 1 hypervisor runs:
a) On bare metal
b) Within a host OS
c) Only on cloud systems
d) Without hardware support
Answer: a) On bare metal
62.Para-virtualization differs from full virtualization by:
a) Requiring modified guest OS
b) Not needing hardware support
c) Being slower
d) Not supporting multiple VMs
Answer: a) Requiring modified guest OS
Distributed Systems
63.The CAP theorem states that a distributed system can't simultaneously
guarantee:
a) Consistency, Availability, Partition tolerance
b) Computation, Accuracy, Performance
c) Concurrency, Access, Persistence
d) Clock, Accuracy, Precision
Answer: a) Consistency, Availability, Partition tolerance
64.Lamport timestamps are used to:
a) Order events in distributed systems
b) Schedule CPU processes
c) Manage memory pages
d) Allocate disk blocks
Answer: a) Order events in distributed systems
Real-Time Systems
65.Hard real-time systems require:
a) Guaranteed deadline meeting
b) Best-effort timing
c) No timing constraints
d) Only average performance
Answer: a) Guaranteed deadline meeting
66.Rate-monotonic scheduling assigns priorities based on:
a) Task periods (shorter period = higher priority)
b) Task execution time
c) Random assignment
d) Memory requirements
Answer: a) Task periods (shorter period = higher priority)
Miscellaneous Advanced Topics
67.The Belady's anomaly can occur with:
a) FIFO page replacement
b) LRU page replacement
c) Optimal page replacement
d) All page replacement algorithms
Answer: a) FIFO page replacement
68.The purpose of the Second Chance page replacement algorithm is to:
a) Approximate LRU at lower cost
b) Implement optimal replacement
c) Eliminate page faults completely
d) Reduce disk I/O bandwidth
Answer: a) Approximate LRU at lower cost
69.The ABA problem occurs in:
a) Lock-free programming
b) Deadlock detection
c) Memory allocation
d) File system design
Answer: a) Lock-free programming
70.Copy-on-write is used to:
a) Optimize process forking
b) Schedule disk I/O
c) Manage CPU caches
d) Implement semaphores
Answer: a) Optimize process forking
Linux/UNIX Specific
71.In Linux, the init process typically has PID:
a) 0
b) 1
c) 255
d) 1024
Answer: b) 1
72.The 'nice' command affects:
a) Process priority
b) Memory allocation
c) File permissions
d) Disk scheduling
Answer: a) Process priority
Windows Specific
73.The Windows Executive runs in:
a) Kernel mode
b) User mode
c) Both modes
d) Hardware directly
Answer: a) Kernel mode
74.NTFS uses which technique for small files?
a) Resident attributes
b) Journaling
c) RAID
d) Virtual memory
Answer: a) Resident attributes
Cloud Computing
75.Live migration of VMs requires:
a) Memory and state transfer without downtime
b) Complete VM restart
c) Changing hypervisor type
d) Physical server replacement
Answer: a) Memory and state transfer without downtime
76.Containerization differs from virtualization by:
a) Sharing host OS kernel
b) Requiring more resources
c) Needing special hardware
d) Being slower
Answer: a) Sharing host OS kernel
Performance
77.Thrashing can be detected by:
a) High page fault rate
b) Low CPU utilization
c) Both a and b
d) Neither a nor b
Answer: c) Both a and b
78.The working set model helps prevent:
a) Thrashing
b) Deadlocks
c) Race conditions
d) Memory leaks
Answer: a) Thrashing
Emerging Trends
79.Persistent memory (PMEM) differs from traditional RAM by:
a) Retaining data after power loss
b) Being slower
c) Volatility
d) Smaller capacity
Answer: a) Retaining data after power loss
80.Microkernels differ from monolithic kernels by:
a) Moving most functionality to user space
b) Being larger
c) Having no security features
d) Not supporting processes
Answer: a) Moving most functionality to user space
Advanced Memory Management
81.What is the primary purpose of memory-mapped files?
a) To allow files to be accessed as memory addresses
b) To increase disk storage capacity
c) To replace virtual memory
d) To speed up CPU cache
Answer: a) To allow files to be accessed as memory addresses
82.The slab allocation technique is primarily used for:
a) Kernel object allocation
b) User process memory
c) Disk block management
d) Network packet buffering
Answer: a) Kernel object allocation
File Systems & Storage
83.ZFS (Zettabyte File System) uses which innovative feature?
a) Copy-on-write transactional model
b) Fixed-size inodes
c) No checksumming
d) Single-disk reliability
Answer: a) Copy-on-write transactional model
84.RAID 5 provides:
a) Striping with distributed parity
b) Mirroring without parity
c) Double mirroring
d) No fault tolerance
Answer: a) Striping with distributed parity
Virtualization & Cloud
85.KVM (Kernel-based Virtual Machine) converts Linux into:
a) A Type-1 hypervisor
b) A Type-2 hypervisor
c) A container runtime
d) A microkernel
Answer: a) A Type-1 hypervisor
86.Docker uses which Linux feature for isolation?
a) cgroups and namespaces
b) Kernel modules
c) System calls
d) Interrupt handlers
Answer: a) cgroups and namespaces
Security & Protection
87.ASLR (Address Space Layout Randomization) protects against:
a) Buffer overflow attacks
b) Deadlocks
c) Disk failures
d) Memory leaks
Answer: a) Buffer overflow attacks
88.SELinux implements:
a) Mandatory Access Control
b) Discretionary Access Control
c) No access control
d) Only file permissions
Answer: a) Mandatory Access Control
Real-Time Systems
89.In priority inheritance protocol:
a) A lower priority task inherits higher priority when blocking a high-priority
task
b) Priorities remain fixed
c) All tasks get equal priority
d) Priorities decrease over time
Answer: a) A lower priority task inherits higher priority when blocking a
high-priority task
90.Earliest Deadline First (EDF) scheduling is:
a) Dynamic priority scheduling
b) Fixed priority scheduling
c) Non-preemptive
d) Only for non-real-time systems
Answer: a) Dynamic priority scheduling
Distributed Systems
91.The Byzantine Generals Problem relates to:
a) Fault tolerance in distributed consensus
b) Memory allocation
c) Process scheduling
d) File system design
Answer: a) Fault tolerance in distributed consensus
92.Paxos algorithm is used for:
a) Distributed consensus
b) Memory management
c) Disk scheduling
d) Process synchronization
Answer: a) Distributed consensus
Performance & Optimization
93.The Bélády anomaly demonstrates that:
a) More page frames can sometimes increase page faults
b) LRU is always optimal
c) Memory is unlimited
d) Disk I/O is unimportant
Answer: a) More page frames can sometimes increase page faults
94.The working set model helps determine:
a) How much memory a process needs
b) CPU clock speed
c) Disk rotation speed
d) Network bandwidth
Answer: a) How much memory a process needs
Contemporary Topics
95.Non-Uniform Memory Access (NUMA) architectures:
a) Have different memory access times depending on location
b) Provide uniform memory access times
c) Eliminate memory entirely
d) Only use disk storage
Answer: a) Have different memory access times depending on location
96.Persistent memory (e.g., Intel Optane) blurs the line between:
a) Memory and storage
b) CPU and GPU
c) Kernel and user space
d) Processes and threads
Answer: a) Memory and storage
Linux/Windows Internals
97.The Linux OOM (Out-Of-Memory) killer:
a) Selectively terminates processes to free memory
b) Crashes the entire system
c) Expands swap space automatically
d) Slows down all processes equally
Answer: a) Selectively terminates processes to free memory
98.Windows NT's Object Manager provides:
a) Uniform interface for all system resources
b) Only file management
c) Just memory management
d) Exclusive CPU scheduling
Answer: a) Uniform interface for all system resources
Emerging Technologies
99.Unikernels differ from traditional OS by:
a) Including only necessary OS components for each application
b) Being larger than monolithic kernels
c) Requiring hardware virtualization
d) Not supporting networking
Answer: a) Including only necessary OS components for each application
100. Serverless computing (e.g., AWS Lambda) actually uses:
a) Short-lived containers behind the scenes
b) No servers at all
c) Only physical servers
d) No operating system
Answer: a) Short-lived containers behind the scenes