Operating Systems
About Computer Science MCQs
Master computer science concepts with our comprehensive MCQs. This section covers Artificial Intelligence, Programming, Data Structures, and more. Perfect for exam prep and interviews.
All Questions for: Operating Systems
Question 51: What is aging in operating systems scheduling?
- A Removing old files from the system automatically
- B Gradually increasing the priority of processes that wait for a long time to prevent starvation
- C Recycling physical RAM sticks after years of usage
- D Reducing CPU frequency to save battery life over time
Explanation: Aging is a technique of gradually increasing the priority of processes that wait in the system for a long time to prevent starvation.
Question 52: What is the primary function of a device driver?
- A To translate operating system commands into hardware-specific operations for a device
- B To connect the computer to wireless internet access points
- C To supply electrical power to hardware components
- D To act as a graphical user interface for applications
Explanation: A device driver is a specific program that controls or operates a particular device attached to a computer, providing an interface to the OS.
Question 53: Which of the following is a synchronization mechanism that can be implemented in hardware?
- A Test-and-Set instruction
- B Message passing queues
- C Paging tables
- D Inode structures
Explanation: Test-and-Set and Compare-and-Swap are atomic hardware instructions used to implement mutual exclusion and semaphores.
Question 54: What is a monolithic kernel?
- A A kernel where all operating system services run in kernel space as a single large program
- B A minimal kernel containing only process scheduling and memory management
- C A cloud-based kernel running on distributed virtual servers
- D An embedded kernel stored entirely in read-only ROM
Explanation: A monolithic kernel is an operating system architecture where the entire operating system works in kernel space and runs in a single address space.
Question 55: What is a real-time operating system (RTOS)?
- A An OS that guarantees processing data within strict, fixed time constraints
- B An OS used exclusively for high-end graphic rendering and gaming
- C An OS that tracks physical time zone changes globally
- D An OS with no concept of multitasking or scheduling
Explanation: An RTOS is an operating system intended to serve real-time applications that process data as it comes in with strict timing constraints.
Question 56: What is the function of the Translation Lookaside Buffer (TLB)?
- A To store recently used virtual-to-physical address translations for fast lookup
- B To buffer network packets before sending them over Ethernet
- C To keep track of open files and directory pointers
- D To store user login credentials securely
Explanation: The TLB is a special fast-lookup hardware cache used to speed up virtual-to-physical address translation.
Question 57: Which storage placement strategy allocates the smallest hole that is big enough to satisfy a memory request?
- A First-fit
- B Best-fit
- C Worst-fit
- D Next-fit
Explanation: Best-fit allocates the smallest hole from the list of available free holes that is large enough.
Question 58: What is dynamic loading?
- A Loading routines into memory only when they are actually called
- B Swapping entire memory partitions to disk during runtime
- C Updating device driver software automatically over the internet
- D Allocating virtual memory pages dynamically on demand
Explanation: Dynamic loading is a routine loaded into memory only when it is called, improving memory space utilization.
Question 59: What is dynamic linking?
- A Linking system libraries to the executable only at execution time
- B Binding memory addresses during compile time
- C Connecting network sockets dynamically between clients
- D Merging multiple source code files into a single object file
Explanation: Dynamic linking postpones the linking of library routines until execution time, reducing executable file size.
Question 60: Which of the following describes mutual exclusion?
- A Only one process can execute in its critical section at a time
- B All processes can access shared resources simultaneously
- C Processes must share CPU time equally without priority
- D Two processes can never execute on separate CPU cores
Explanation: Mutual exclusion ensures that if one process is executing in its critical section, no other processes can execute in their critical sections.
Question 61: What is a bootstrap program?
- A A program stored in ROM that initializes hardware and loads the OS kernel
- B An application used to format hard drives during installation
- C A user-mode utility that manages desktop themes
- D A network tool used to test connection speeds
Explanation: The bootstrap program is stored in ROM or EPROM and initializes hardware, loads the kernel, and starts the OS.
Question 62: What is an interrupt?
- A A signal to the processor indicating an event that requires immediate attention
- B An error that permanently damages the CPU arithmetic unit
- C A command that shuts down the operating system safely
- D A pause in user keyboard input due to inactivity
Explanation: An interrupt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention.
Question 63: What is direct memory access (DMA)?
- A A feature allowing devices to transfer data directly to/from memory without CPU intervention
- B A method for programs to bypass security checks and access RAM directly
- C The physical wiring connecting the CPU to the RAM slots
- D A technique for expanding virtual memory using flash drives
Explanation: DMA allows hardware subsystems to access main system memory independently of the central processing unit.
Question 64: Which scheduler selects processes from the ready queue and allocates the CPU to one of them?
- A Short-term scheduler (CPU scheduler)
- B Long-term scheduler (job scheduler)
- C Medium-term scheduler (swapper)
- D I/O scheduler
Explanation: The short-term scheduler (or CPU scheduler) selects which process should be executed next and allocates CPU time.
Question 65: What is the primary role of the long-term scheduler?
- A To select processes from job storage and load them into memory
- B To allocate CPU time slices every few milliseconds
- C To manage virtual memory page swaps to disk
- D To control peripheral device drivers during startup
Explanation: The long-term scheduler (job scheduler) selects processes from a pool and loads them into memory for execution.
Question 66: What does a medium-term scheduler do?
- A Swaps processes between main memory and secondary storage
- B Decides which thread runs on which CPU core
- C Manages network socket connections over time
- D Schedules disk track head movements
Explanation: The medium-term scheduler removes processes from memory (swapping) to reduce the degree of multiprogramming and later re-introduces them.
Question 67: What is a zombie process?
- A A process that has finished execution but still has an entry in the process table
- B A malicious malware process hidden inside system files
- C A process stuck in an infinite loop consuming 100% CPU
- D A process that refuses to terminate when killed by the user
Explanation: A zombie process is a process that has completed execution but still has an entry in the process table, usually because its parent has not yet read its exit status.
Question 68: What is an orphan process?
- A A child process whose parent process has terminated
- B A process running without any memory allocation
- C A file that is no longer linked to any directory
- D A thread whose parent process crashed unexpectedly
Explanation: An orphan process is a child process whose parent process has finished or terminated, leaving it to be adopted by the init process.
Question 69: Which of the following is an example of inter-process communication (IPC)?
- A Shared memory and message passing
- B Paging and segmentation
- C Compilation and linking
- D Caching and buffering
Explanation: Shared memory and message passing are standard mechanisms for inter-process communication.
Question 70: What is a critical section?
- A A code segment that accesses shared resources prone to race conditions
- B The boot sequence code executed when the PC starts
- C A section of the kernel responsible for handling hardware errors
- D Encrypted memory reserved for security credentials
Explanation: A critical section is a piece of code that accesses shared variables or resources that can lead to race conditions if executed concurrently.
Question 71: What is a monitor in concurrency?
- A A synchronization construct providing mutual exclusion and conditional waiting
- B A hardware display screen controller driver
- C A diagnostic tool for monitoring CPU temperature and voltage
- D A logging daemon that records system error messages
Explanation: A monitor is a synchronization construct that allows threads to have both mutual exclusion and the ability to wait for certain conditions.
Question 72: What is spinlock?
- A A lock where a thread waits in a loop repeatedly checking if it becomes available
- B A mechanism that locks hard drive platters during sudden physical movement
- C A security feature that locks user accounts after failed login attempts
- D A process scheduling queue that cycles in a round-robin order
Explanation: A spinlock is a lock where a thread trying to acquire it simply waits in a loop ("spin") while repeatedly checking if the lock is available.
Question 73: What is priority inversion?
- A When a high-priority process is indirectly blocked by a low-priority process holding a resource
- B When background tasks run faster than foreground applications
- C When the operating system reverses process priorities randomly
- D When a user manually lowers the priority of system services
Explanation: Priority inversion occurs when a high-priority process is indirectly preempted by a lower-priority process holding a required resource.
Question 74: Which page replacement algorithm replaces the page that will not be used for the longest time in the future?
- A Optimal page replacement algorithm
- B Least Recently Used (LRU)
- C First-In, First-Out (FIFO)
- D Clock page replacement
Explanation: The Optimal page replacement algorithm looks forward in time and replaces the page that won't be needed for the longest time.
Question 75: What is the primary purpose of hierarchical paging?
- A To break down large page tables so they do not need to be contiguous in memory
- B To speed up disk read and write speeds for large files
- C To prioritize high-priority tasks over background processes
- D To encrypt virtual memory pages against unauthorized access
Explanation: Hierarchical paging breaks the page table into smaller pieces to avoid keeping an entire large page table contiguous in memory.
Question 76: What is an inverted page table?
- A A page table structure with one entry per physical frame instead of per virtual address
- B A table that stores physical addresses in reverse numerical order
- C A directory structure used exclusively for inverted file systems
- D A backup table used when the primary page table becomes corrupted
Explanation: An inverted page table has one entry for each real page frame of memory, saving significant memory space.
Question 77: What is segmentation in memory management?
- A Dividing memory into logical variable-sized segments like code, data, and stack
- B Splitting hard drive storage into equal sectors and tracks
- C Dividing CPU time slices among active user threads
- D Separating network traffic into individual TCP packets
Explanation: Segmentation is a memory management scheme that divides memory into logical variable-sized segments like code, data, and stack.
Question 78: What is the main advantage of user-level threads over kernel-level threads?
- A Thread management and switching can be done fast without kernel intervention
- B They can run on multiple CPU cores simultaneously without OS support
- C The kernel automatically handles all scheduling without library overhead
- D They have direct access to physical hardware registers
Explanation: User-level threads are managed by user-space libraries, allowing fast creation and switching without kernel intervention.
Question 79: What is a file descriptor?
- A An integer handle used by a process to identify and access an open file
- B A text metadata string describing the creation date of a file
- C The physical sector address where file data begins on disk
- D An encryption key used to protect private user documents
Explanation: A file descriptor is an abstract integer handle used by a process to identify and access an open file.
Question 80: What is an inode in UNIX file systems?
- A A data structure storing file metadata and block pointers, excluding filename and content
- B The root directory folder that contains all other system files
- C An input node used for managing keyboard and mouse interrupts
- D A network socket identifier used for remote file mounting
Explanation: An inode is a data structure that stores metadata about a file, excluding its filename and content.
Question 81: What is a hard link in a file system?
- A A directory entry that points directly to the same underlying inode as another filename
- B A shortcut pointer file that redirects to a different directory path
- C A physical connection cable linking two separate hard drives
- D A read-only backup copy stored on secondary storage
Explanation: A hard link points directly to the inode of a file, allowing multiple directory entries to reference the same inode.
Question 82: What is a symbolic link (soft link)?
- A A file containing a path reference to another file or directory
- B A direct pointer to an inode sharing the exact same file blocks
- C A virtual file created dynamically by the kernel in RAM
- D A compressed archive containing multiple backup files
Explanation: A symbolic link contains a reference path to another file or directory.
Question 83: Which disk scheduling algorithm selects the request closest to the current head position?
- A Shortest Seek Time First (SSTF)
- B First-Come, First-Served (FCFS)
- C C-SCAN
- D FIFO
Explanation: Shortest Seek Time First (SSTF) selects the disk request that requires the minimum head movement from the current position.
Question 84: What is C-SCAN (Circular SCAN) disk scheduling?
- A A variation of SCAN that services requests in only one direction, returning immediately to the beginning
- B A scheduling method that reverses direction every time a single request is completed
- C A random disk access algorithm designed for solid-state drives
- D An algorithm that prioritizes inner tracks over outer tracks exclusively
Explanation: C-SCAN services requests in one direction and immediately returns to the beginning without servicing requests on the return trip.
Question 85: What is write-through caching in file systems?
- A Data is written into the cache and immediately written to disk as well
- B Data is written only to cache and delayed until disk flush
- C Data bypasses cache entirely and goes straight to disk sectors
- D Data is written directly to secondary tape backups
Explanation: Write-through updates data in cache and simultaneously writes it to disk storage to maintain data integrity.
Question 86: What is write-back (write-deferred) caching?
- A Modifications are written to cache first and delayed until cache blocks are replaced
- B Modifications are written to disk immediately and cached afterwards
- C Writing is disabled until the system encounters a low memory warning
- D Data is mirrored across two physical disks simultaneously
Explanation: Write-back caching writes modifications to cache first, delaying disk writes until cache blocks are replaced.
Question 87: What is an access control matrix in operating system security?
- A A table defining permissions of subjects over objects in the system
- B A matrix used for calculating virtual-to-physical memory addresses
- C A scheduling queue priority assignment table
- D A network firewall routing rule table
Explanation: An access control matrix defines permissions of subjects over objects in the system.
Question 88: What is a capability list in file and resource protection?
- A A list associated with a domain specifying authorized objects and permissions
- B A list of hardware instructions supported by the CPU architecture
- C A list of running processes eligible for CPU scheduling
- D A registry of installed device drivers
Explanation: A capability list is associated with a domain specifying authorized objects and permissions.
Question 89: What is a hypervisor?
- A Software or firmware that creates and runs virtual machines
- B A high-speed network router connecting data center servers
- C A tool that monitors CPU clock speeds and temperatures
- D An advanced file system manager for RAID arrays
Explanation: A hypervisor is software, firmware, or hardware that creates and runs virtual machines.
Question 90: What is the main difference between Type 1 and Type 2 hypervisors?
- A Type 1 runs on bare metal hardware, while Type 2 runs on a host operating system
- B Type 1 supports Windows only, while Type 2 supports Linux only
- C Type 1 is software-based, while Type 2 is strictly hardware-based
- D Type 1 handles memory virtualization, while Type 2 handles I/O virtualization
Explanation: Type 1 hypervisors run directly on bare metal hardware, while Type 2 run on top of an existing host OS.
Question 91: What is symmetric multiprocessing (SMP)?
- A An architecture where multiple identical processors share main memory and run the OS concurrently
- B A system where one master processor controls all slave processors
- C A network of independent computers sharing workload over Ethernet
- D A single processor executing multiple threads using hyper-threading
Explanation: In SMP, multiple processors share main memory and run the OS concurrently with equal access.
Question 92: What is asymmetric multiprocessing?
- A An architecture where a master processor assigns tasks to slave processors
- B An architecture where all processors have equal access to all resources
- C A technique where CPU cores dynamically adjust voltage based on workload
- D Running different operating systems on separate partitions
Explanation: In asymmetric multiprocessing, a master processor manages and assigns tasks to slave processors.
Question 93: What is a bootstrap loader?
- A A small program that locates and loads the main OS kernel into memory
- B A tool that boots up connected USB peripheral devices
- C An application loader that starts user desktop programs
- D A network utility that downloads system updates
Explanation: The bootstrap loader is a small program responsible for locating and loading the OS kernel into memory.
Question 94: What is the purpose of the ready queue?
- A To hold processes that are ready and waiting for CPU execution time
- B To store processes currently waiting for I/O completion
- C To keep track of terminated processes before cleanup
- D To buffer files before they are written to disk
Explanation: The ready queue holds all processes that are ready and waiting to execute on the CPU.
Question 95: What is a device queue?
- A A queue of processes waiting for a specific I/O device
- B A list of hardware devices installed in the device manager
- C A buffer for storing network packets before routing
- D A queue of print jobs waiting in the spooler
Explanation: A device queue holds processes waiting for a specific I/O device.
Question 96: What is multiprogramming?
- A Holding multiple programs in main memory to increase CPU utilization
- B Writing code in multiple programming languages simultaneously
- C Running multiple operating systems inside virtual machines
- D Compiling source files using parallel compiler threads
Explanation: Multiprogramming keeps multiple programs in main memory so the CPU always has something to execute.
Question 97: What is the degree of multiprogramming?
- A The number of processes residing in main memory at one time
- B The number of CPU cores active in the system
- C The total capacity of installed RAM in gigabytes
- D The number of user accounts configured on the machine
Explanation: The degree of multiprogramming refers to the number of processes in main memory at a given time.
Question 98: What is CPU utilization?
- A The percentage of time the processor is busy executing instructions
- B The speed at which the CPU clock ticks per second
- C The amount of electric power consumed by the CPU core
- D The ratio of cache memory hits to misses
Explanation: CPU utilization measures the percentage of time the CPU is actively executing instructions.
Question 99: What is throughput in CPU scheduling?
- A The number of processes completed per time unit
- B The total amount of memory allocated to all running jobs
- C The data transfer rate of the hard disk controller
- D The response time of interactive user commands
Explanation: Throughput is the number of processes completed per unit of time.
Question 100: What is waiting time in CPU scheduling?
- A The total time a process spends waiting in the ready queue
- B The time taken to load a program from disk into RAM
- C The duration of an I/O request operation
- D The time elapsed between user login and desktop load
Explanation: Waiting time is the total amount of time a process spends waiting in the ready queue.