OS Viva
OS Viva
Intuit Interview
SpaceX Interview
Sapient Interview
Amazon Interview
It is designed to make sure that a computer system performs well by managing its
computational activities.
https://www.javatpoint.com/operating-system-interview-questions 2/22
Timesharing operating systems
4) What is a socket?
A socket is used to make connection between two applications. Endpoints of the connection
are called socket.
6) What is kernel?
Kernel is the core and most important part of a computer operating system which provides
basic services for all parts of the OS.
User Processes
New Process
Running Process
Waiting Process
Ready Process
https://www.javatpoint.com/operating-system-interview-questions 3/22
Terminated Process
The local data for each user process must be stored separately.
https://www.javatpoint.com/operating-system-interview-questions 4/22
Virtual memory is a very useful memory management technique which enables processes to
execute outside of memory. This technique is especially used when an executing program
cannot fit in the physical memory.
18) What are the four necessary and sufficient conditions behind
the deadlock?
These are the 4 conditions:
1) Mutual Exclusion Condition: It specifies that the resources involved are non-sharable.
2) Hold and Wait Condition: It specifies that there must be a process that is holding a
resource already allocated to it while waiting for additional resource that are currently being
held by other processes.
3) No-Preemptive Condition: Resources cannot be taken away while they are being used by
processes.
4) Circular Wait Condition: It is an explanation of the second condition. It specifies that the
processes in the system form a circular list or a chain where each process in the chain is
waiting for a resource held by next process in the chain.
No preemption: Once a process is holding a resource ( i.e. once its request has
been granted ), then that resource cannot be taken away from that process until
the process voluntarily releases it.
Circular Wait: A set of processes { P0, P1, P2, . . ., PN } must exist such that every P[ i
] is waiting for P[ ( i + 1 ) % ( N + 1 ) ].
Note: This condition implies the hold-and-wait condition, but it is easier to deal with the
conditions if the four are considered separately.
https://www.javatpoint.com/operating-system-interview-questions 6/22
25) What is Banker's algorithm?
Banker's algorithm is used to avoid deadlock. It is the one of deadlock-avoidance method. It is
named as Banker's algorithm on the banking system where bank never allocates available
cash in such a manner that it can no longer satisfy the requirements of all of its customers.
Internal fragmentation: It is occurred when we deal with the systems that have
fixed size allocation units.
https://www.javatpoint.com/operating-system-interview-questions 7/22
There are two types of semaphore:
Binary semaphores
Counting semaphores
Economical
https://www.javatpoint.com/operating-system-interview-questions 8/22
Logical address specifies the address which is generated by the CPU whereas physical
address specifies to the address which is seen by the memory unit.
After fragmentation
The Batches contains jobs of such a kind that the jobs or processes which are very similar in
the procedure to be followed by the jobs or processes. The Batch Operating System has an
operator which performs these tasks.
An operator groups together comparable jobs or processes that have the same criteria into
batches. The operator is in charge and takes up the job of grouping jobs or processes with
comparable requirements.
1. The time which the Operating System is at rest is very small or also known as Idle Time for the
Operating System is very small.
2. Very big tasks can also be managed very easily with the help of Batch Operating Systems
3. Many users can use this Batch Operating Systems.
https://www.javatpoint.com/operating-system-interview-questions 9/22
4. It is incredibly challenging to estimate or determine how long it will take to finish any task. The
batch system processors are aware of how long a work will take to complete when it is in line.
1. If any work fails in the Batch Operating System, the other jobs will have to wait for an
indeterminate period of time.
2. Batch Operating systems are very challenging to debug,
3. Batch Operating Systems can be expensive at times
4. The computer operators who are using Batch Operating Systems must to be knowledgeable
with batch systems.
1. File Management
2. Job Management
3. Process Management
4. Device Management
5. Memory Management
https://www.javatpoint.com/operating-system-interview-questions 10/22
Programs can communicate with the operating system by making a system call. When a
computer application requests anything from the kernel of the operating system, it performs
a system call.System call uses Application Programming Interfaces(API)to deliver operating
system services to user programs
1. Communication
2. Information Maintenance
3. File Management
4. Device Management
5. Process Contro
49) What are the functions which are present in the Process
Control and File Management System Call?
The Functions present in Process Control System Calls are:
1. Create
2. Allocate
3. Abort
4. End
5. Terminate
6. Free Memory
50) What are the functions which are present in the File
Management System Call?
The Functions present in File Management System Calls are:
1. Create
2. Open
3. Read
4. Close
5. Delete
The fundamental unit of work that has to be implemented in the system is called a process.
https://www.javatpoint.com/operating-system-interview-questions 11/22
An active program known as a process is the basis of all computing. Although relatively
similar, the method is not the same as computer code. A process is a "active" entity, in
contrast to the program, which is sometimes thought of as some sort of "passive" entity.
As data structure for processes is done in terms of the Process Control Block (PCB), it is crucial
for process management. Additionally, it describes the operating system's present condition.
1. Process State
2. Process Number
3. Program Counter
4. Registers
5. Memory Limits
6. List of Open Files
55) What are the Files used in the Process Control Block?
The Files used in Process Control Block are:
https://www.javatpoint.com/operating-system-interview-questions 12/22
Threads are executed within the same Processes are executed in the different
process memory spaces
Threads are not independent of each Processes are independent of each other
other
1. The code becomes more challenging to maintain and debug as there are more threads.
2. The process of creating threads uses up system resources like memory and CPU.
3. Because unhandled exceptions might cause the application to crash, we must manage them
inside the worker method.
They are treated like single-threaded processes under this system. User Kernel Threads are
smaller and quicker than kernel-level threads
The User Kernel Threads are represented by a Small Process Control Block (PCB), Stack,
Program Counter (PC), Stack.
Here, the User Kernel Threads are independent of Kernel Involvement in Synchronization.
https://www.javatpoint.com/operating-system-interview-questions 13/22
61) What are User Kernel Threads Advantages and Disadvantages?
The following are a few advantages of User Kernel Threads:
1. Creating user-level threads is quicker and simpler than creating kernel-level threads. They are
also simpler to handle.
2. Any operating system may be used to execute user-level threads.
3. Thread switching in user-level threads does not need kernel mode privileges.
1. Kernel-level threads allow the scheduling of many instances of the same process across several
CPUs.
2. The kernel functions also support multithreading.
3. Another thread of the same process may be scheduled by the kernel if a kernel-level thread is
stalled.
1. To pass control from one thread in a process to another, a mode switch to kernel mode is
necessary.
2. Compared to user-level threads, kernel-level threads take longer to create and maintain.
https://www.javatpoint.com/operating-system-interview-questions 14/22
65) What are types of Process Scheduling Techniques in Operating
Systems?
The types of Process Scheduling Techniques in Operating Systems are:
When a system performs a switch, it maintains the status of the previous operating process in
the form of registers and allots the CPU to the new process to carry out its operations.
The old process must wait in a ready queue while a new one is running in the system. At the
point when another process interrupted it, the old process resumes execution.
It outlines the features of an operating system that supports numerous workloads at once
without the use of extra processors by allowing several processes to share a single CPU.
https://www.javatpoint.com/operating-system-interview-questions 15/22
dispatcher is what grants a process control over the CPU once the short-term schedule has
chosen it.
Dispatcher is the one who moves the Scheduler is the one which selects a
process to the desired state process which is feasible to be executed
at this point of time.
The time taken by Dispatcher is known as The Time taken by the Scheduler is not
Dispatch Latency counted basically
Dispatcher allows Context Switching to Scheduler only allows the process to the
occur ready queue
The operating system has trouble authorizing and preventing processes from entering the
crucial part because more than one process cannot operate in the critical area at once.
1. Deadlock Prevention
2. Deadlock Detection and Recovery
3. Deadlock Avoidance
4. Deadlock Ignorance
We can recover the process from deadlock state by terminating or aborting all deadlocked
processes one at a time.
Process Pre Emption is also another technique used for Deadlocked Process Recovery.
The main memory is divided into small blocks called pages. Now, each of the pages contains
the process which is retrieved into main memory and it is stored in one frame of memory.
It is very important to have pages and frames which are of equal sizes which are very useful
for mapping and complete utilization of memory.
https://www.javatpoint.com/operating-system-interview-questions 17/22
80) What is Address Translation in Paging?
Logical and physical memory addresses, both of which are distinct, are the two types of
memory addresses that are employed in the paging process. The logical address is the
address that the CPU creates for each page in the secondary memory, but the physical
address is the actual location of the frame where each page will be allocated. We now require
a technique known as address translation carried out by the page table in order to translate
this logical address into a physical address.
https://www.javatpoint.com/operating-system-interview-questions 18/22
Round Robin is a CPU scheduling mechanism whose cycles around assigning each task a
specific time slot. It is the First come First Serve CPU Scheduling method prior Pre Emptive
Process Scheduling approach. The Round Robin CPU algorithm frequently emphasizes the
Time Sharing method.
https://www.javatpoint.com/operating-system-interview-questions 19/22