OS PYQ Questions and Answers
1. Discuss various functions of OS in short.
● Process Management: Handles process creation, scheduling, and termination.
● Memory Management: Manages system memory, allocating and freeing space
for programs.
● File System Management: Controls file operations like creation, deletion, and
access permissions.
● Device Management: Manages I/O devices and ensures efficient data transfer.
● Security and Access Control: Protects system resources and manages user
authentication.
● Error Handling: Detects and handles system errors to maintain reliability.
● User Interface: Provides a way for users to interact with the system, such as GUI
or command-line interface.
2. Explain multiprogramming.
Multiprogramming: It is a method where multiple programs are loaded into the
main memory, and the CPU switches between them to increase system utilization. While
one program waits (e.g., for I/O operations), the CPU executes another program,
maximizing efficiency.
3. Explain Priority scheduling.
Priority Scheduling: It is a CPU scheduling method where each process is
assigned a priority, and the CPU is allocated to the process with the highest priority. If
two processes have the same priority, they are scheduled using another criterion like
First-Come, First-Served (FCFS). It may lead to starvation, where low-priority processes
may never execute.
4. Discuss I/O Device Handlers.
I/O Device Handlers: These are specialized components of the OS that manage
communication between the operating system and I/O devices like printers, keyboards,
and disk drives. They handle I/O operations, including sending data to devices, receiving
data, and ensuring efficient use of the device.
5. Discuss Hierarchical view of operating system.
Hierarchical View: The operating system can be viewed in layers, where each
layer performs specific functions and interacts only with adjacent layers. At the bottom
are hardware and device drivers, followed by memory and process management, with
user interfaces at the top. This structure simplifies design and debugging.
6. Why do we need memory management ? Discuss.
Memory Management: It is needed to efficiently allocate and deallocate memory
to processes, ensure the system doesn’t run out of memory, and provide protection
between different processes. It also optimizes memory usage and ensures programs run
smoothly without interfering with each other.
7. Discuss Round Robin scheduling.
Round Robin Scheduling: It is a CPU scheduling algorithm where each process
is given a fixed time slot (called a time quantum) in a cyclic order. If a process doesn’t
complete within its time quantum, it is moved to the end of the queue, and the next
process gets the CPU. This method is fair and ensures all processes get equal CPU time
but may have higher overhead due to frequent context switching.
8. Discuss the concept of Symbolic File System.
Symbolic File System: This refers to a file system where files and directories
are represented using symbolic names rather than physical memory addresses. It allows
users to access files easily using human-readable names and simplifies file
management, as the operating system handles the mapping of these names to actual
locations on the storage device.
9. What is context switching? Explain in detail.
Context Switching: It is the process where the CPU switches from one process
to another. During this switch, the operating system saves the state (context) of the
current process (like program counter, registers, and memory) and loads the state of the
next process to resume its execution. This is essential for multitasking but adds
overhead, as the CPU spends time saving and loading contexts rather than doing useful
work.
10. Discuss an operating system as a resource manager.
Operating System as a Resource Manager: The OS acts as a manager for
various resources like the CPU, memory, storage, and I/O devices. It allocates these
resources to processes as needed, ensures efficient and fair resource use, and protects
resources from misuse or conflicts between processes.
11. Write the difference between Paging and Segmentation.
Paging:
● Divides memory into fixed-size blocks called pages.
● Physical memory is divided into frames of the same size as pages.
● Eliminates external fragmentation but can have internal fragmentation.
Segmentation:
● Divides memory into variable-sized segments based on logical divisions like
functions or data structures.
● Allows a more logical way of memory allocation but may lead to external
fragmentation.
12. What is CPU scheduling? What is the need for CPU scheduling
CPU Scheduling: It is the process of deciding which process should use the
CPU at a given time. The scheduler chooses the process based on the scheduling
algorithm being used, like Round Robin, Priority, or Shortest Job First.
Need for CPU Scheduling: It is necessary to ensure that CPU time is used
efficiently, maximize system performance, and provide fairness among all processes. It
helps avoid CPU idle time and ensures processes are executed in a timely manner.
13. Explain Simple File System.
Simple File System: A basic file system where files are stored sequentially or in
simple structures like directories. It provides operations like creating, reading, writing,
and deleting files. It is easy to implement but has limitations in terms of efficiency and
scalability for complex operations or large data sets.
14. Explain different non-contiguous memory management techniques along with
their advantages and disadvantages.
1. Paging:
Explanation: Divides memory into fixed-size pages and physical memory into frames.
Pages can be stored in non-contiguous frames.
Advantages: Eliminates external fragmentation, easy to manage memory.
Disadvantages: May have internal fragmentation; overhead due to maintaining page
tables.
2. Segmentation:
Explanation: Divides memory into variable-sized segments based on logical divisions.
Advantages: Easier to map logical structures, allows better protection and sharing.
Disadvantages: Can cause external fragmentation, more complex memory
management.
15. Discuss process view point of OS.
Simple File System: A basic file system where files are stored sequentially or in
simple structures like directories. It provides operations like creating, reading, writing,
and deleting files. It is easy to implement but has limitations in terms of efficiency and
scalability for complex operations or large data sets.
16. Discuss I/O Traffic controller.
I/O Traffic Controller: A component of the operating system that manages the
flow of data between I/O devices and the system to prevent data collision and ensure
efficient data transfer. It prioritizes I/O requests, manages device queues, and
coordinates data flow to maintain smooth I/O operations.
17. Explain Virtual devices.
Virtual Devices: These are software-based representations of physical devices,
providing a way to simulate device functionality without hardware. They allow efficient
sharing and abstraction of devices like virtual disks or network interfaces, making
hardware-independent device management possible.
18. Explain SJF.
SJF (Shortest Job First): A CPU scheduling algorithm where the process with
the shortest burst time is executed first. It is optimal in minimizing average waiting time
but can cause starvation for longer processes if many short processes keep arriving.
19. What is device management ? Discuss various techniques for Device
Management.
Device Management: The OS manages hardware devices, ensuring efficient
data transfer and avoiding conflicts. Techniques include:
Buffering: Temporarily holding data in memory to match speeds between
devices and the CPU.
Spooling: Storing data on a disk to manage slow devices like printers.
Interrupt Handling: Managing signals from devices to handle requests promptly.
20. Define OS. Discuss what does OS do?
Operating System (OS): Software that acts as an interface between the user
and computer hardware, managing hardware and software resources.
Functions: Manages processes, memory, file systems, I/O devices, security, and
provides user interfaces to facilitate smooth and efficient operation of the computer.
21. Discuss the importance of Channels and Control Units.
Channels: Hardware pathways that facilitate data transfer between devices and
the CPU, improving performance by allowing parallel operations.
Control Units: Manage the execution of I/O operations and ensure correct data
flow between devices and memory. They reduce CPU load by handling complex I/O
tasks independently.
22. Write short notes of any three of the following
I/O Scheduler:
I/O Scheduler: It is a component of the operating system that manages the order in
which I/O requests are processed to improve efficiency and performance. It decides the
sequence of access to I/O devices, reducing wait times and maximizing throughput.
Common strategies include First-Come, First-Served (FCFS), Shortest Seek Time First
(SSTF), and Deadline scheduling.
Process Synchronization:
Process Synchronization: It ensures that multiple processes can run concurrently without
conflicting or interfering with shared resources, maintaining data consistency.
Mechanisms like semaphores, mutexes, and monitors are used to manage
synchronization. It is crucial to prevent issues like race conditions and deadlocks when
processes access shared resources.
FCFS (First-Come, First-Served):
FCFS: It is the simplest CPU and I/O scheduling algorithm where the process that
arrives first gets served first. It operates like a queue, where processes are handled in
the order they arrive. The advantage is simplicity, but it can lead to inefficiencies like the
convoy effect, where short processes get stuck behind long ones, increasing average
wait time.