Operating System Interview Questions and Answers
Question - 81 : - What is context switching ?
Answer - 81 : - 1. It is the process of switching the CPU from one process to another.
2. This requires to save the state of the old process and loading the saved state for the new process.
3. The context of the process is represented in the process control block.
4. During switching the system does no useful work.
5. How the address space is preserved and what amount of work is needed depends on the memory management.
Question - 82 : - What is cascading termination?
Answer - 82 : - 1. If one process is terminated, its related processes are also terminated abnormally then it is called cascade termination.
2. It occurs in the case of parent child process.
3. If the parent process is terminated normally or abnormally then all its child processes must be terminated.
4. The parent is existing and the operating system does not allow a child to continue if its parent terminates.
5. This child process is the new process created by the process called the parent process.
Question - 83 : - Explain IPC.
Answer - 83 : - 1. It is called as the inter process communication.
2. The scheme requires that processes share a common buffer pool and code for implementing the buffer.
3. It allows processes to communicate and to synchronize their actions.
Example : chat program used on the world wide web.
Question - 84 : - What are sockets?
Answer - 84 : - 1. A socket is defined as endpoint for communication, a pair of sockets is used by the pair of processes.
2. It is made of IP address chained with a port number.
3. They use the client server architecture.
4. Server waits for incoming client requests by listening to specified port.
5. On reception of request, server accepts connection from client socket to complete the connection.
Question - 85 : - What is Kernel and write its main functions?
Answer - 85 : -
The kernel is basically a computer program usually considered as a central component or module of OS. It is responsible for handling, managing, and controlling all operations of computer systems and hardware. Whenever the system starts, the kernel is loaded first and remains in the main memory. It also acts as an interface between user applications and hardware.
Functions of Kernel:
- It is responsible for managing all computer resources such as CPU, memory, files, processes, etc.
- It facilitates or initiates the interaction between components of hardware and software.
- It manages RAM memory so that all running processes and programs can work effectively and efficiently.
- It also controls and manages all primary tasks of the OS as well as manages access and use of various peripherals connected to the computer.
- It schedules the work done by the CPU so that the work of each user is executed as efficiently as possible.
Question - 86 : - What are different types of Kernel?
Answer - 86 : -
There are basically five types of Kernels as given below:
- Monolithic Kernel
- MicroKernel
- Hybrid Kernel
- Nano Kernel
- Exo Kernel
Question - 87 : - 35. What is SMP (Symmetric Multiprocessing)?
Answer - 87 : -
SMP is generally referred to as computer architecture in which the processing of programs is done by multiple processors that share a common OS and memory. SMP is very much required if you want to take advantage of multiprocessor hardware. It simply enables any processor to work on any of the tasks no matter where data or resources for that particular task are located in memory. These systems are more reliable than single-processor systems.
Question - 88 : - What is a time-sharing system?
Answer - 88 : - It is a system that allows more than one user to access the resources of a particular system in many locations. In simple words, it performs multiple tasks on a single processor or CPU. As the name suggests, it means to share time into multiple slots in several processes. It also allows different users from different locations to use a particular computer system at the same time therefore it is considered one of the important types of OS.
Question - 89 : - What is a deadlock in OS? What are the necessary conditions for a deadlock?
Answer - 89 : -
Deadlock is generally a situation where a set of processes are blocked as each process is holding resources and waits to acquire resources held by another process. In this situation, two or more processes simply try to execute simultaneously and wait for each to finish their execution because they are dependent on each other. We can see a hand problem in our system whenever a deadlock occurs in a program. It is one of the common problems you can see in multiprocessing.
Necessary Conditions for Deadlock
There are basically four necessary conditions for deadlock as given below:
- Mutual Exclusion
- Hold and Wait
- No Pre-emption
- Circular Wait or Resource Wait
Question - 90 : - What do you mean by Belady’s Anomaly?
Answer - 90 : -
In the Operating System, process data is loaded in fixed-sized chunks and each chunk is referred to as a page. The processor loads these pages in the fixed-sized chunks of memory called frames. Belady’s Anomaly is a phenomenon in which if we increase the number of frames in memory, then the number of page faults also increases. It is generally experienced when we use FIFO (First in First out) page replacement algorithm.