Operating System Notes and Questions MCQ Part
Operating System Notes and Questions MCQ Part
Operating System Tutorial provides the basic and advanced concepts of operating system . Our
Operating system tutorial is designed for beginners, professionals and GATE aspirants. We have
designed this tutorial after the completion of a deep research about every concept.
The content is described in detailed manner and has the ability to answer most of your queries. The
tutorial also contains the numerical examples based on previous year GATE questions which will help
you to address the problems in a practical manner.
Operating System can be defined as an interface between user and the hardware. It provides an
environment to the user so that, the user can perform its task in convenient and efficient way.
The Operating System Tutorial is divided into various parts based on its functions such as Process
Management, Process Synchronization, Deadlocks and File Management.
We need a system which can act as an intermediary and manage all the processes and resources
present in the system.
An Operating System can be defined as an interface between user and hardware. It is responsible
for the execution of all the processes, Resource Allocation, CPU management, File Management and
many other tasks.
The purpose of an operating system is to provide an environment in which a user can execute
programs in convenient and efficient manner.
Structure of a Computer System
A Computer System consists of:
In Batch operating system, access is given to more than one person; they submit their respective jobs
to the system for the execution.
The system put all of the jobs in a queue on the basis of first come first serve and then executes the
jobs one by one. The users collect their respective output when all the jobs get executed.
The purpose of this operating system was mainly to transfer control from one job to another as soon
as the job was completed. It contained a small set of programs called the resident monitor that always
resided in one part of the main memory. The remaining part is used for servicing jobs.
Advantages of Batch OS
o The use of a resident monitor improves computer efficiency as it eliminates CPU time between two jobs.
Disadvantages of Batch OS
1. Starvation
For Example:
There are five jobs J1, J2, J3, J4, and J5, present in the batch. If the execution time of J1 is very high,
then the other four jobs will never be executed, or they will have to wait for a very long time. Hence
the other processes get starved.
2. Not Interactive
Batch Processing is not suitable for jobs that are dependent on the user's input. If a job requires the
input of two numbers from the console, then it will never get it in the batch processing scenario since
the user is not present at the time of execution.
In a multiprogramming environment, when a process does its I/O, The CPU can start the execution of
other processes. Therefore, multiprogramming improves the efficiency of the system.
Advantages of Multiprogramming OS
o Throughout the system, it increased as the CPU always had one program to execute.
o Response time can also be reduced.
Disadvantages of Multiprogramming OS
o Multiprogramming systems provide an environment in which various systems resources are used
efficiently, but they do not provide any user interaction with the computer system.
o Increased reliability: Due to the multiprocessing system, processing tasks can be distributed among
several processors. This increases reliability as if one processor fails, the task can be given to another
processor for completion.
o Increased throughout: As several processors increase, more work can be done in less.
o Multiprocessing operating system is more complex and sophisticated as it takes care of multiple CPUs
simultaneously.
Multitasking Operating System
The multitasking operating system is a logical extension of a multiprogramming system that enables
multiple programs simultaneously. It allows a user to perform more than one computer task at the
same time.
An Operating system, which includes software and associated protocols to communicate with other
computers via a network conveniently and cost-effectively, is called Network Operating System.
Advantages of Network Operating System
o In this type of operating system, network traffic reduces due to the division between clients and the
server.
o This type of system is less expensive to set up and maintain.
The Application of a Real-Time system exists in the case of military applications, if you want to drop a
missile, then the missile is supposed to be dropped with a certain precision.
Advantages of Real-time operating system:
o Easy to layout, develop and execute real-time applications under the real-time operating system.
o In a Real-time operating system, the maximum utilization of devices and systems.
There may exist more than one process in the system which may require the same resource at the
same time. Therefore, the operating system has to manage all the processes and the resources in a
convenient and efficient way.
Some resources may need to be executed by one process at one time to maintain the consistency
otherwise the system can become inconsistent and deadlock may occur.
The operating system is responsible for the following activities in connection with Process
Management
Attributes of a process
The Attributes of the process are used by the Operating System to create the process control block
(PCB) for each of them. This is also called context of the process. Attributes which are stored in the
PCB are described below.
1. Process ID
When a process is created, a unique id is assigned to the process which is used for unique
identification of the process in the system.
2. Program counter
A program counter stores the address of the last instruction of the process on which the process was
suspended. The CPU uses this address when the execution of this process is resumed.
3. Process State
The Process, from its creation to the completion, goes through various states which are new, ready,
running and waiting. We will discuss about them later in detail.
4. Priority
Every process has its own priority. The process with the highest priority among the processes gets the
CPU first. This is also stored on the process control block.
Every process has its own set of registers which are used to hold the data which is generated during
the execution of the process.
During the Execution, Every process uses some files which need to be present in the main memory.
OS also maintains a list of open files in the PCB.
OS also maintain the list of all open devices which are used during the execution of the process.
Process States
State Diagram
The process, from its creation to completion, passes through various states. The minimum number of
states is five.
The names of the states are not standardized although the process may be in one of the following
states during execution.
1. New
A program which is going to be picked up by the OS into the main memory is called a new process.
2. Ready
Whenever a process is created, it directly enters in the ready state, in which, it waits for the CPU to be
assigned. The OS picks the new processes from the secondary memory and put all of them in the
main memory.
The processes which are ready for the execution and reside in the main memory are called ready state
processes. There can be many processes present in the ready state.
3. Running
One of the processes from the ready state will be chosen by the OS depending upon the scheduling
algorithm. Hence, if we have only one CPU in our system, the number of running processes for a
particular time will always be one. If we have n processors in the system then we can have n processes
running simultaneously.
4. Block or wait
From the Running state, a process can make the transition to the block or wait state depending upon
the scheduling algorithm or the intrinsic behavior of the process.
When a process waits for a certain resource to be assigned or for the input from the user then the OS
move this process to the block or wait state and assigns the CPU to the other processes.
5. Completion or termination
When a process finishes its execution, it comes in the termination state. All the context of the process
(Process Control Block) will also be deleted the process will be terminated by the Operating system.
6. Suspend ready
A process in the ready state, which is moved to secondary memory from the main memory due to lack
of the resources (mainly primary memory) is called in the suspend ready state.
If the main memory is full and a higher priority process comes for the execution then the OS have to
make the room for the process in the main memory by throwing the lower priority process out into
the secondary memory. The suspend ready processes remain in the secondary memory until the main
memory gets available.
7. Suspend wait
Instead of removing the process from the ready queue, it's better to remove the blocked process
which is waiting for some resources in the main memory. Since it is already waiting for some resource
to get available hence it is better if it waits in the secondary memory and make room for the higher
priority process. These processes complete their execution once the main memory gets available and
their wait is finished.
Operations on the Process
1. Creation
Once the process is created, it will be ready and come into the ready queue (main memory) and will
be ready for the execution.
2. Scheduling
Out of the many processes present in the ready queue, the Operating system chooses one process
and start executing it. Selecting the process which is to be executed next, is known as scheduling.
3. Execution
Once the process is scheduled for the execution, the processor starts executing it. Process may come
to the blocked or wait state during the execution then in that case the processor starts executing the
other processes.
4. Deletion/killing
Once the purpose of the process gets over then the OS will kill the process. The Context of the
process (PCB) will be deleted and the process gets terminated by the Operating system.
Operating System MCQ Part-2
1) What is the use of directory structure in the operating system?
a. The directory structure is used to solve the problem of the network connection in OS.
b. It is used to store folders and files hierarchically.
c. It is used to store the program in file format.
d. All of the these
Explanation: In the OS, a directory structure is a container that is used to store folders and files in a
hierarchical manner.
a. Bounded Waiting
b. Progress
c. Mutual Exclusion
d. All of these.
4) Which of the following options is correct about the windows operating system?
Explanation: Windows is a GUI operating system. Windows OS does not require a command to run.
Only one mouse is required to run the windows operating system.
a. NTFS
b. FAT32
c. exFAT
d. All of the these
Explanation: The following are the types of file systems that support the Windows operating system,
such as NTFS, FAT, exFAT, HFS Plus, and EXT.
6) Which of the following keys does the user use to switch between applications running simultaneously in
the Windows operating system?
a. FN + TAB
b. ALT + TAB
c. CTRL + TAB
d. SHIFT + TAB
Explanation: The user uses the Alt + Tab button to switch from one window to another in the
Windows operating system. Also, the user can use the Ctrl + Tab button to switch from tab to tab in
internet explorer.
7) Which of the following commands creates an emergency repair disk for Windows NT 4.0?
a. BAT
b. EXE
c. EXE/S
d. ADD/REMOVE program
Explanation: There are the following steps to repair disk in windows NT 4.0:
Step 1: Go to the search button in windows NT 4.0, then type Command Prompt.
Step 3: Then open a pop-up window. This pop-up window will update the emergency repair disk.
a. FCFS Scheduling
b. SJF Scheduling
c. Network Scheduling
d. SRTF Scheduling
Explanation: Shortest Remaining Time First (SRTF) scheduling is preemptive scheduling. In this
scheduling, the process that has the shortest processing time left is executed first.
9) How can you get a printout of the system configuration on windows 9x OS?
Answer: (c) From the device manager, click the print button
Explanation: Windows 9x is a generic term that refers to a series of Microsoft windows OS from 1995
to 2000. If you want to print out in Windows 9x, go to the device manager and click the printer option
and then print the page.
a. Batch OS
b. Distributed OS
c. Real-time OS
d. Network OS
Explanation: The network operating system runs on a server. This operating system has some
functions that work to connect local area networks and computers.
11) What type of memory stores data in a swap file on a hard drive?
a. Secondary memory
b. Virtual memory
c. Low memory
d. RAM
Explanation: A swap file is a type of file that stores the data retrieved from Read-Only-Memory
(RAM) or main memory. It is also a virtual memory because it is not stored in physical RAM.
12) Which of the following "semaphore" can take the non-negative integer values?
a. Binary Semaphore
b. Counting Semaphore
c. Real Semaphore
d. All of the these
Explanation: Counting semaphore takes only the non-negative integer value that is used to solve the
critical section problem and process synchronization.
13) In which directory the local user profile settings are stored by default in windows 2000?
a. C: \ USERS
b. C: \ NETLOGON
c. C: \ WIN NTUSER.DAT
d. C: \ Documents and settings
Explanation: When a user logs in with an account for the first time, Windows 2000 automatically
creates a user's profile in the "Documents and Settings" folder.
14) Which of the following operating system does not require a command to run?
a. Kali Linux
b. Windows
c. Unix
d. All of the these
Explanation: Windows is a GUI operating system. This operating system does not require a command
to run. Only one mouse is required to run this operating system.
a. Linked
b. Contiguous
c. Indexed
d. None of the these
Explanation: The indexed allocation method is the best file allocation method because it removes the
problem of contiguous and linked allocation.
Explanation: In the operating system, paging is a memory management scheme (MMS) in which
memory is divided into pages of fixed size.
18) Which of the following programs is loaded first when starting a computer?
a. Window desktop
b. Network connection program
c. Operating system
d. CMD
Explanation: When the computer is powered on, the first operating system program is loaded into
the computer. The OS's job is to control the computer's hardware and help other computer programs
work.
19) Which of the following backup methods is quickest and requires the least amount of backup space?
a. Complete backups
b. Incremental
c. Differential
d. None of the these
Explanation: Incremental backups take less time and space than differential and complete backups.
Explanation: Acyclic-graph, Single-level, and Tree directory structures are a type of directory
structure in the operating system. But the stack is a linear data structure, so option (d) is correct
answer.
a. SJF scheduling
b. Round-Robin scheduling
c. SRTF scheduling
d. None of these.
Explanation: Shortest job first scheduling is non-preemptive scheduling. In this scheduling algorithm,
the process which takes the least time to complete executes that process first.
Explanation: Shortest job first scheduling is non-preemptive scheduling. In this scheduling algorithm,
the process which takes the least time to complete executes that process first.
P1 3 3
P2 6 6
P3 9 9
a. 2
b. 3
c. 4
d. 5
Answer: (b) 3
Explanation:
TA Time = CT - AT
Waiting Time = TA - BT
P1 3 3 3 3 0
P2 6 6 9 8 2
P3 9 9 18 16 7
a. Two
b. Six
c. Seven
d. Five
25) In which allocation method does the user size the file before creating the file?
a. Contiguous
b. Linked
c. Indexed
d. None of the these
Explanation: In the contiguous allocation method, the user has to give the size of the file before
creating the file so that the operating system can give contiguous blocks in the disk-based on the size
of that file.
26) Which of the following algorithms is used to avoid deadlock?
Explanation: Banker's algorithm is a deadlock avoidance and resource allocation algorithm. This
algorithm was developed by Edger Dijkstra. It is also called a detection algorithm.
27) Which of the following component does not belong to PCB (Process Control Block)?
a. CPU registers
b. CPU scheduling information
c. Operating System information
d. Accounting information
Explanation: The operating system information is not the component of the PCB, so option (d) is the
correct answer.
28) Which of the following method is used to improve the main memory utilization?
a. Swapping
b. Operating system
c. Memory stack
d. None of these.
a. Permanent area
b. Temporary area
c. Small area
d. Large area
Explanation: Buffer is a temporary area where data is stored for some time before being transferred
to the main memory.
30) Which of the following operating systems supports only real-time applications?
a. Batch OS
b. Distributed OS
c. Real-time OS
d. Network OS
Explanation: The real-time OS supports real-time applications. This OS is used for industrial and
scientific work. It completes the tasks in a given time.
31) Which of the following binary formats support the Linux operating system?
a. 0 and 1
b. Binary Number Format
c. ELF Binary Format
d. None of the these
Hide Answer Workspace
Explanation: ELF stands for "Executable-and-Linkable-Format". The ELF format is used for libraries
and executable files in Linux operating systems.
a. Network device
b. Operating system
c. Server name
d. Computer name
Explanation: Kali Linux is an operating system similar to Windows, Unix, and macOS. Kali operating
system was designed for reverse engineering, security, computer forensics, etc.
Explanation: A fragmentation is a state of a hard disk in which the most important parts of a single
file are stored at different places in the disk. Due to which there is a loss of memory, and the working
efficiency of the operating system is also affected.
Explanation: SSTF stands for Shortest-Seek-Time-First. In the SSTF algorithm, that request is executed
first, whose seek time is the shortest.
a. Real-Number
b. Binary Number
c. Store block
d. Integer Process ID
Explanation: PCB is a data structure that is used to store the information of processes. It is identified
by an integer process ID (PID).
36) Which of the following method is used to prevent threads or processes from accessing a single
resource?
a. PCB
b. Semaphore
c. Job Scheduler
d. Non-Contiguous Memory Allocation
Explanation: Semaphore is an integer variable that is used to prevent threads or processes from
accessing a single resource.
37) Which of the following mechanisms is a locking mechanism?
a. Semaphore
b. PCB
c. Mutex
d. Binary Semaphore
Explanation: The mutex is a locking mechanism that ensures that only one thread can occupy the
mutex at a time and enter the critical section.
Explanation: Virtual memory is used to separate the user's logical memory and actual physical
memory. Therefore, option (b) is the correct answer.
Explanation: COW stands for Copy-Overwrite. Initially, it allows both the parent and child systems to
share the same page.
40) Who is responsible for keeping the process from the program?
a. Operating system
b. CPU
c. Monitor
d. All of the these
Explanation: A process is created from a program by the operating system. The OS is software that
acts as an interface between a device and users and is also known as system software.
a. Kali Linux
b. Windows
c. Mac OS
d. Single-user operating system
Explanation: Kali Linux is a fast operating system as more work is done through the command line in
it. This OS is a Debian-based Linux OS.