Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

What is spooling in OS?

Answer»

Spooling simply stands for Simultaneous peripheral operations online. It is referred to as putting data of various I/O JOBS in a buffer. Here, buffer means a special area in memory or hard disk that can be accessible to an I/O device. It is used for mediation between a computer application and a slow peripheral. It is very useful and important because devices ACCESS or acquire data at DIFFERENT rates. This operation also uses disk as a very large buffer and is capable of overlapping I/O operations for one task with processor operations for ANOTHER task.

Useful Resource

Operating System MCQ

Practice Coding

InterviewBit BLOG

2.

What do you mean by Belady’s Anomaly?

Answer»

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

3.

What is a deadlock in OS? What are the necessary conditions for a deadlock?

Answer»

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
4.

What are various sections of the process?

Answer»

There are basically four sections in the process as GIVEN below:

  • STACK: It is used for local variables and RETURNS addresses. 
  • Heap: It is used for dynamic memory allocation.
  • Data: It stores global and static variables.
  • Code or TEXT: It comprises compiled PROGRAM code.
5.

What is difference between process and thread?

Answer»

PROCESS: It is basically a program that is currently under execution by one or more threads. It is a very important part of the modern-day OS.

Thread: It is a path of execution that is composed of the program counter, thread id, stack, and set of registers within the process.

ProcessThread
It is a computer program that is under execution.It is the COMPONENT or entity of the process that is the smallest execution unit.
These are heavy-weight operators.These are lightweight operators.
It has its own memory space.It USES the memory of the process they belong to.
It is more difficult to create a process as compared to creating a thread.It is easier to create a thread as compared to creating a process.
It requires more resources as compared to thread.It requires fewer resources as compared to processes.
It takes more time to create and terminate a process as compared to a thread.It takes LESS time to create and terminate a thread as compared to a process.
It usually run-in separate memory space.It usually run-in SHARED memory space.
It does not share data.It shares data with each other.
It can be divided into multiple threads.It can’t be further subdivided.
6.

What is difference between Kernel and OS?

Answer»

Kernel: Kernel is a system program that controls all programs running on the computer. The kernel is BASICALLY a bridge between the software and hardware of the system.

Operating System: Operating system is a system program that runs on the computer to PROVIDE an interface to the computer user so that they can easily operate on the computer.

KernelOS
It is considered a central component of OSIt is considered system software.
It is GENERALLY responsible for converting user commands into machine-level commands.It is generally responsible for managing the resources of system.
It simply acts as an interface between hardware and applications.It simply acts as an interface between hardware and user.
It also performs functions like process management, file management, device management, I/O communication, etc.It also performs functions like providing security to data and files in the the system, providing access controls to users, maintaining the system privacy, etc.
Its type includes MICROKERNEL, Monolithic kernel, etc.Its type includes Single and Multiprogramming batch SYSTEMS, Distributed OS, Real-time OS.
7.

What is a time-sharing system?

Answer»

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.

8.

What is SMP (Symmetric Multiprocessing)?

Answer»

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. 

9.

Write difference between micro kernel and monolithic kernel?

Answer»

MicroKernel: It is a minimal OS that executes only important functions of OS. It only contains a near-minimum number of features and functions that are required to implement OS. 
Example: QNX, Mac OS X, K42, etc.

Monolithic Kernel: It is an OS ARCHITECTURE that supports all basic features of computer components such as resource management, MEMORY, FILE, etc. 
Example: SOLARIS, DOS, OpenVMS, Linux, etc. 

MicroKernelMonolithic Kernel
In this software or program, kernel services and user services are present in different ADDRESS spaces.In this software or program, kernel services and user services are usually present in the same address space.
It is smaller in size as compared to the monolithic kernel.It is larger in size as compared to a microkernel.
It is easily extendible as compared to a monolithic kernel.It is hard to as extend as compared to a microkernel.
If a service crashes, it does affect on working of the microkernel.If a service crashes, the whole system crashes in a monolithic kernel.
It uses message queues to achieve inter-process communication.It uses signals and sockets to achieve inter-process communication.
10.

What are different types of Kernel?

Answer»

There are BASICALLY FIVE types of Kernels as GIVEN below:

  • Monolithic Kernel
  • MicroKernel
  • Hybrid Kernel 
  • NANO Kernel
  • Exo Kernel
11.

What is Kernel and write its main functions?

Answer»

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.
12.

What do you mean by Semaphore in OS? Why is it used?

Answer»

SEMAPHORE is a signaling mechanism. It only holds one positive integer value. It is simply used to solve the problem or issue of critical sections in the synchronization process by using two atomic operations i.e., wait() and signal(). 

Types of Semaphore
There are usually two types of semaphores as given below:

  • Binary Semaphore
  • Counting Semaphore
Binary SemaphoreMutex
It allows various process threads to GET the finite instance of the resource until resources are available.It allows various process threads to get single SHARED resource only at a time.
Its functions are based upon signaling mechanisms.Its functions are based upon a locking mechanism.
Binary semaphores are MUCH faster as COMPARED to Mutex.Mutex is slower as compared to binary semaphores.
It is basically an integer.It is basically an object.