A list of top frequently asked Operating System interview questions and answers are given below.
1) What is an operating system?
The operating system is a software program that facilitates computer hardware to communicate and operate with the computer software. It is the most important part of a computer system without it computer is just like a box.
2) What is the main purpose of an operating system?
There are two main purposes of an operating system:
- It is designed to make sure that a computer system performs well by managing its computational activities.
- It provides an environment for the development and execution of programs.
3) What are the different operating systems?
- Batched operating systems
- Distributed operating systems
- Timesharing operating systems
- Multi-programmed operating systems
- Real-time operating systems
4) What is the concept of reentrancy?
It is a very useful memory saving technique that is used for multi-programmed time sharing systems. It provides functionality that multiple users can share a single copy of program during the same period.
It has two key aspects:
- The program code cannot modify itself.
- The local data for each user process must be stored separately.
5) What is the difference between process and program?
A program while running or executing is known as a process.
6) What is the use of paging in operating system?
Paging is used to solve the external fragmentation problem in operating system. This technique ensures that the data you need is available as quickly as possible.
7) What is the concept of demand paging?
Demand paging specifies that if an area of memory is not currently being used, it is swapped to disk to make room for an application’s need.
8) What is the advantage of a multiprocessor system?
As many as processors are increased, you will get the considerable increment in throughput. It is cost effective also because they can share resources. So, the overall reliability increases.
9) What is virtual memory?
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.
10) What is thrashing?
Thrashing is a phenomenon in virtual memory scheme when the processor spends most of its time in swapping pages, rather than executing instructions.
11) 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.
12) What is a thread?
A thread is a basic unit of CPU utilization. It consists of a thread ID, program counter, register set and a stack.
13) What is FCFS?
FCFS stands for First Come, First Served. It is a type of scheduling algorithm. In this scheme, if a process requests the CPU first, it is allocated to the CPU first. Its implementation is managed by a FIFO queue.
14) What is RAID? What are the different RAID levels?
RAID stands for Redundant Array of Independent Disks. It is used to store the same data redundantly to improve the overall performance.
Following are the different RAID levels:
RAID 0 – Stripped Disk Array without fault tolerance
RAID 1 – Mirroring and duplexing
RAID 2 – Memory-style error-correcting codes
RAID 3 – Bit-interleaved Parity
RAID 4 – Block-interleaved Parity
RAID 5 – Block-interleaved distributed Parity
RAID 6 – P+Q Redundancy
15) 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.
16) What is the difference between logical address space and physical address space?
Logical address space specifies the address that is generated by CPU. On the other hand physical address space specifies the address that is seen by the memory unit.
17) What is fragmentation?
Fragmentation is a phenomenon of memory wastage. It reduces the capacity and performance because space is used inefficiently.
18) How many types of fragmentation occur in Operating System?
There are two types of fragmentation:
- Internal fragmentation: It is occurred when we deal with the systems that have fixed size allocation units.
- External fragmentation: It is occurred when we deal with systems that have variable-size allocation units.
19) What is spooling?
Spooling is a process in which data is temporarily gathered to be used and executed by a device, program or the system. It is associated with printing. When different applications send output to the printer at the same time, spooling keeps these all jobs into a disk file and queues them accordingly to the printer.
20) What is the difference between internal commands and external commands?
Internal commands are the built-in part of the operating system while external commands are the separate file programs that are stored in a separate folder or directory.
21) What is semaphore?
Semaphore is a protected variable or abstract data type that is used to lock the resource being used. The value of the semaphore indicates the status of a common resource.
There are two types of semaphore:
- Binary semaphores
- Counting semaphores
22) What is a binary Semaphore?
Binary semaphore takes only 0 and 1 as value and used to implement mutual exclusion and synchronize concurrent processes.