Live Classes: Upskill your knowledge Now!
Chat NowPublished - Tue, 06 Dec 2022
A list of top frequently asked Operating System interview questions and answers are given below.
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.
There are two main purposes of an operating system:
A socket is used to make connection between two applications. Endpoints of the connection are called socket.
Real-time system is used in the case when rigid-time requirements have been placed on the operation of a processor. It contains a well defined and fixed time constraints.
Kernel is the core and most important part of a computer operating system which provides basic services for all parts of the OS.
A monolithic kernel is a kernel which includes all operating system code is in single executable image.
An executing program is known as process. There are two types of processes:
A list of different states of process:
Micro kernel: micro kernel is the kernel which runs minimal performance affecting services for operating system. In micro kernel operating system all other operations are performed by processor.
Macro Kernel: Macro Kernel is a combination of micro and monolithic kernel.
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:
A program while running or executing is known as a process.
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.
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.
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.
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.
Thrashing is a phenomenon in virtual memory scheme when the processor spends most of its time in swapping pages, rather than executing instructions.
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.
A thread is a basic unit of CPU utilization. It consists of a thread ID, program counter, register set and a stack.
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.
SMP stands for Symmetric MultiProcessing. It is the most common type of multiple processor system. In SMP, each processor runs an identical copy of the operating system, and these copies communicate with one another when required.
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
Deadlock is a specific situation or condition where two processes are waiting for each other to complete so that they can start. But this situation causes hang for both of them.
There are 4 necessary conditions to achieve a deadlock:
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.
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.
Fragmentation is a phenomenon of memory wastage. It reduces the capacity and performance because space is used inefficiently.
There are two types of fragmentation:
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.
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.
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 semaphore takes only 0 and 1 as value and used to implement mutual exclusion and synchronize concurrent processes.
Belady's Anomaly is also called FIFO anomaly. Usually, on increasing the number of frames allocated to a process virtual memory, the process execution is faster, because fewer page faults occur. Sometimes, the reverse happens, i.e., the execution time increases even when more frames are allocated to the process. This is Belady's Anomaly. This is true for certain page reference patterns.
Starvation is Resource management problem. In this problem, a waiting process does not get the resources it needs for a long time because the resources are being allocated to other processes.
Aging is a technique used to avoid the starvation in resource scheduling system.
A list of advantages of multithreaded programming:
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
Overlays makes a process to be larger than the amount of memory allocated to it. It ensures that only important instructions and data at any given time are kept in memory.
Thrashing specifies an instance of high paging activity. This happens when it is spending more time paging instead of executing.
Fri, 16 Jun 2023
Fri, 16 Jun 2023
Fri, 16 Jun 2023
Write a public review