61. What is the difference between short-term, medium-term, and long-term schedulers?
- Short-term handles daily tasks; medium-term handles weekly; long-term handles monthly
- Short-term scheduler (CPU scheduler) selects which ready process gets the CPU; medium-term scheduler swaps processes in/out of memory; long-term scheduler controls the degree of multiprogramming by admitting new processes
- All three schedulers perform identical functions at different time intervals
- Short-term is for user processes; long-term is for system processes only
Answer : B Explanation: Long-Term Scheduler (Job Scheduler): selects which processes from the job pool (secondary storage) are loaded into memory. Controls the degree of multiprogramming. Runs infrequently (seconds to minutes). Medium-Term Scheduler (Swapper): temporarily removes processes from memory to reduce multiprogramming degree (swapping out) and later reintroduces them (swapping in). Helps manage memory pressure. Short-Term Scheduler (CPU Scheduler / Dispatcher): selects which process in the ready queue gets CPU access next. Runs most frequently (milliseconds). Implements scheduling algorithms (FCFS, SJF, RR, Priority). The dispatcher does the actual context switching based on the short-term scheduler’s decision.
62. What is the Reader-Writer problem in operating systems?
- A synchronization problem between disk read and write operations in file systems
- A classic synchronization problem where multiple readers can read shared data simultaneously but writers need exclusive access — requiring synchronization to prevent data corruption while maximizing read concurrency
- A scheduling conflict between processes that read from memory and those that write to disk
- A problem in file system design where read and write speeds are mismatched
Answer : B Explanation: The Reader-Writer Problem involves a shared data object accessed by multiple readers and writers. Rules: Multiple readers can read simultaneously (no data corruption since reads don’t modify data), Only one writer can write at a time (exclusive access), and No reader can read while a writer is writing. Two versions: First Readers-Writers Problem (no reader waits unless a writer holds access — writers may starve), Second Readers-Writers Problem (once a writer is waiting, no new reader can start — readers may starve). Solutions use semaphores: read_count (number of active readers), mutex (protects read_count), write_lock (provides writer exclusion). Database systems implement this for concurrent read/write access.
63. What is the working set model in operating systems?
- A model that describes how much physical work an OS can perform per second
- A model that defines the set of pages a process is actively using at a given time — used to determine how many frames to allocate to prevent thrashing while maximizing multiprogramming
- A framework for defining the set of system calls available in an operating system
- A memory model describing the working area of the operating system kernel
Answer : B Explanation: The Working Set Model (proposed by Peter Denning) is based on the principle of locality of reference. The Working Set W(t, Δ) is the set of pages referenced by a process during the most recent Δ time units (the working set window). Key idea: if the total size of all processes’ working sets exceeds available frames, thrashing occurs. Solution: allocate at least as many frames as the working set size to each process. If total working set size > available frames, suspend some processes and give their frames to others. This prevents thrashing while keeping multiprogramming as high as possible. The working set approximates the process’s current locality.
64. What is FIFO page replacement algorithm and what is Belady’s anomaly?
- FIFO is the optimal page replacement algorithm with no anomaly
- FIFO (First In First Out) replaces the oldest page in memory; Belady’s anomaly is the counterintuitive phenomenon where increasing the number of page frames actually increases page faults in FIFO
- FIFO is used for disk scheduling; Belady’s anomaly describes CPU cache behavior
- Belady’s anomaly occurs in all page replacement algorithms including LRU and Optimal
Answer : B Explanation: FIFO (First In First Out) page replacement simply replaces the page that has been in memory the longest (the oldest page). It is easy to implement using a queue but performs poorly because the oldest page might still be heavily used. Belady’s Anomaly: in FIFO, adding more physical frames can paradoxically increase the number of page faults for certain reference strings — contradicting intuition that more memory always helps. Discovered by László Bélády in 1969. LRU and Optimal algorithms do NOT suffer from Belady’s anomaly — they belong to the class of stack algorithms. Belady’s anomaly is a frequently tested GATE and placement exam topic.
65. What is a file system in an operating system?
- A filing cabinet system used by system administrators to store physical documents
- The OS component that organizes, stores, retrieves, and manages files on storage devices — defining how data is stored, named, accessed, and protected on disk
- A database system for storing operating system configuration files only
- A network protocol for sharing files between computers in a local network
Answer : B Explanation: A File System provides an abstraction over raw disk storage. It manages: File naming (how files are identified), Directory structure (hierarchical organization), Storage allocation (how disk blocks are assigned to files), Access control (permissions — who can read/write/execute), and File metadata (size, creation date, permissions, owner). Common file systems: FAT32 (older Windows), NTFS (modern Windows), ext4 (Linux), APFS (macOS), exFAT (cross-platform flash drives). File operations: create, delete, open, close, read, write, seek, rename. Disk allocation methods: Contiguous, Linked, and Indexed allocation — each with different advantages for sequential vs. random access.
66. What is inode in Unix/Linux file systems?
- A type of network interface used for connecting Unix systems to the internet
- A data structure in Unix/Linux file systems that stores all metadata about a file (permissions, owner, size, timestamps, disk block locations) — every file has exactly one inode identified by an inode number
- An index node in a B-tree database used for fast file searching
- An input/output node that manages data flow between files and processes
Answer : B Explanation: In Unix/Linux file systems, every file and directory is represented by an inode (index node). The inode stores: file type (regular, directory, symlink, etc.), file permissions (read/write/execute for owner, group, others), owner and group IDs, file size, timestamps (created, modified, accessed), number of hard links, and pointers to data blocks on disk. The inode does NOT store the filename — filenames are stored in directory entries that map names to inode numbers. Hard links share the same inode; symbolic links have their own inode pointing to the path. The inode table is created during file system formatting. df -i shows inode usage.
67. What is disk scheduling and what are the common disk scheduling algorithms?
- The process of scheduling regular disk defragmentation to maintain performance
- The technique of ordering disk I/O requests to minimize seek time and improve throughput — common algorithms include FCFS, SSTF, SCAN (Elevator), C-SCAN, and LOOK
- A method of scheduling when disk backups occur to minimize system disruption
- The process of partitioning a disk into multiple logical drives in optimal order
Answer : B Explanation: Disk Scheduling minimizes disk head seek time to improve I/O performance. Common algorithms: FCFS (First Come First Served) — simplest, processes requests in arrival order; poor performance with random requests. SSTF (Shortest Seek Time First) — serves the closest request next; high throughput but may cause starvation. SCAN (Elevator) — head moves in one direction servicing requests until the end, then reverses; like an elevator. C-SCAN (Circular SCAN) — head moves in one direction, jumps back to beginning without servicing on return; uniform wait times. LOOK/C-LOOK — like SCAN/C-SCAN but reverses at the last request, not disk end. SSTF and SCAN-based algorithms are most commonly used.
68. What is the concept of process synchronization in operating systems?
- Ensuring that all processes complete at exactly the same time for efficiency
- Coordinating the execution of cooperating processes that share resources or data, ensuring consistent and correct results by controlling the order of operations and preventing race conditions
- Synchronizing the system clock across all processes in a distributed system
- Ensuring all processes are loaded into memory at the same time for parallel execution
Answer : B Explanation: Process Synchronization is necessary when multiple processes share resources or communicate — without it, race conditions occur where the outcome depends on the timing of execution, leading to unpredictable and incorrect results. Example: two processes simultaneously incrementing a shared counter without synchronization can result in lost updates. Synchronization mechanisms: Semaphores (Dijkstra), Mutex Locks, Monitors (higher-level abstraction with mutual exclusion and condition variables), Spinlocks (busy-waiting — good for short critical sections on multiprocessors), and Barriers (all processes wait at a barrier until all arrive). Proper synchronization prevents race conditions, deadlocks, and ensures data consistency.
69. What is starvation in an operating system and how is it prevented?
- A system condition where the OS runs out of memory and cannot allocate any more
- A condition where a process is indefinitely denied the resources it needs because other processes continuously get preference — prevented through aging (gradually increasing the priority of waiting processes)
- A hardware condition where a processor overheats from running too many processes
- A network condition where a process receives no data packets due to congestion
Answer : B Explanation: Starvation occurs when a process waits indefinitely for resources because other processes are continuously given preference. Common causes: Priority Scheduling (low-priority processes wait forever while high-priority processes arrive constantly), SSTF disk scheduling (requests near disk head always served first, far requests starve), and SJF (long processes wait indefinitely if short ones keep arriving). Prevention: Aging — gradually increasing the priority of processes that have been waiting for a long time, ensuring they eventually get served. Starvation differs from deadlock: in deadlock, all waiting processes are blocked; in starvation, waiting processes could run but are perpetually bypassed.
70. What is a real-time operating system (RTOS)?
- An operating system that operates faster than all other operating systems
- An operating system designed to respond to inputs and process events within strict, guaranteed time constraints (deadlines) — used in time-critical applications like embedded systems, industrial control, and medical devices
- An OS that provides real-time updates to users about system performance
- An operating system that streams real-time data from the internet to applications
Answer : B Explanation: A Real-Time Operating System (RTOS) guarantees that critical tasks are completed within specified time bounds (deadlines). Types: Hard Real-Time OS — missing a deadline is catastrophic (aircraft control, nuclear reactor, pacemakers), Soft Real-Time OS — missing occasional deadlines is tolerable but degrades performance (video streaming, online gaming). Key characteristics: deterministic scheduling, fast interrupt response, priority-based preemptive scheduling, and minimal OS overhead. Examples: FreeRTOS, VxWorks, QNX, RT-Linux, TRON. RTOS schedulers commonly use Rate Monotonic Scheduling (RMS) and Earliest Deadline First (EDF) algorithms.
