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 starvation and aging in OS?

Answer»

When we use Priority Scheduling or Shortest Job First Scheduling, Starvation can happen, This algorithm is mostly used in CPU schedulers

Starvation: It is GENERALLY a problem that usually occurs when a process has not been able to get the required resources it needs for progress with its EXECUTION for a long period of time. In this condition, low priority processes get BLOCKED and only high priority processes proceed towards completion because of which low priority processes suffer from lack of resources. 

Aging: It is a technique that is used to overcome the SITUATION or problem of starvation. It simply increases the priority of processes that wait in the system for resources for a long period of time. It is considered the best technique to resolve the problem of starvation as it adds an aging factor to the priority of each and every request by various processes for resources. It also ENSURES that low-level queue jobs or processes complete their execution. 

2.

What do you mean by cascading termination?

Answer»

CASCADING TERMINATION is a process termination in which if the parent process is exiting or TERMINATING then the CHILDREN process will also GET terminated. It does not allow the child to continue processing as its parent process terminates. It is generally initiated by OS.

3.

Explain zombie process?

Answer»

Zombie process, referred to as a defunct process, is basically a process that is terminated or completed but the whole process control block is not cleaned up from the main memory because it still has an entry in the process table to report to its parent process. It does not consume any of the RESOURCES and is DEAD, but it still exists. It ALSO shows that resources are HELD by process and are not free.

4.

What do you mean by Sockets in OS?

Answer»

The socket in OS is generally referred to as an endpoint for IPC (Interprocess Communication). Here, the endpoint is referred to as a combination of an IP address and port number.  Sockets are used to make it easy for software DEVELOPERS to create network-enabled programs. It also allows communication or exchange of INFORMATION between two different processes on the same or different machines. It is MOSTLY used in client-server-based systems. 

Types of Sockets

There are basically four types of sockets as given below:

  • STREAM Sockets
  • Datagram Sockets
  • Sequenced Packet Sockets
  • Raw Sockets
5.

What is the difference between multitasking and multiprocessing OS?

Answer»

Multitasking: It is a system that allows more efficient USE of COMPUTER hardware. This system WORKS on more than one task at one time by rapidly switching between various tasks. These systems are also known as time-sharing systems. 

Multiprocessing: It is a system that allows multiple or various processors in a computer to process two or more different portions of the same PROGRAM simultaneously. It is used to complete more work in a shorter period of time. 
 

MultitaskingMultiprocessing
It performs more than one task at a time using a single processor.It performs more than one task at a time using multiple processors.
In this, the number of CPUS is only one.In this, the number of CPUs is more than one.
It is more economical.It is less economical.
It is less efficient than multiprocessing.It is more efficient than multitasking.
It allows fast switching among various tasks.It allows smooth processing of multiple tasks at once.
It requires more time to execute tasks as compared to multiprocessing.It requires less time for job processing as compared to multitasking.
6.

What do you mean by asymmetric clustering?

Answer»

ASYMMETRIC Clustering is generally a system in which one of the nodes AMONG all nodes is in hot standby MODE whereas the rest of all nodes run different applications. It simply USES whole or entire hardware RESOURCES therefore it is considered a more reliable system as compared to others. 

7.

What is the main objective of multiprogramming?

Answer»

It refers to the ability to execute or perform more than one PROGRAM on a single processor machine. This TECHNIQUE was introduced to overcome the problem of UNDERUTILIZATION of CPU and main memory. In simple words, it is the coordination of EXECUTION of various programs simultaneously on a single processor (CPU). The main objective of multiprogramming is to have at least some processes running at all times. It SIMPLY improves the utilization of the CPU as it organizes many jobs where the CPU always has one to execute. 

8.

What is thrashing in OS?

Answer»

It is generally a situation where the CPU performs less productive work and more swapping or PAGING work. It spends more time swapping or paging activities rather than its execution. By evaluating the level of CPU utilization, a system can detect THRASHING. It OCCURS when the process does not have enough PAGES due to which the page-fault rate is increased. It inhibits MUCH application-level processing that causes computer performance to degrade or collapse. 

9.

What is the difference between paging and segmentation?

Answer»

Paging: It is GENERALLY a memory management technique that allows OS to retrieve processes from secondary storage into main memory. It is a non-contiguous allocation technique that divides each process in the form of pages. 
SEGMENTATION: It is generally a memory management technique that divides processes into modules and parts of different SIZES. These parts and modules are known as segments that can be ALLOCATED to process. 

PagingSegmentation
It is invisible to a programmer.It is visible to a programmer.
In this, the size of pages is fixed.In this, the size of segments is not fixed.
Procedures and data cannot be separated in paging.Procedures and data can be separated in segmentation.
It allows a cumulative total of virtual address spaces to cross physical main memory.It allows all programs, data, and codes to BREAK up into independent address spaces.
It is mostly available on CPUs and MMU chips.It is mostly available on Windows servers that may support backward compatibility, while Linux has limited support.
It is faster for memory access as compared to segmentation.It is slower as compared to paging.
In this, OS needs to maintain a free frame.In this, OS needs to maintain a list of holes in the main memory.
In paging, the type of fragmentation is internal.In segmentation, the type of fragmentation is external.
The size of the page is determined by available memory.The size of the page is determined by the user.
10.

What is a Scheduling Algorithm? Name different types of scheduling algorithms.

Answer»

A scheduling ALGORITHM is a process that is used to improve EFFICIENCY by utilizing maximum CPU and providing minimum waiting time to tasks. It simply deals with the problem of deciding which of outstanding requests is to be allocated RESOURCES. Its main aim is to REDUCE resource starvation and to ensure fairness amongst parties that are utilizing the resources. In SIMPLE words, it is used to allocate resources among various competing tasks. 

Types of Scheduling Algorithm

There are different types of scheduling algorithms as given below:

11.

What is Reentrancy?

Answer»

Reentrant is simply a function in which VARIOUS clients can USE and SHARES a single copy of a program during a similar period. This concept is generally associated with OS code and does not deal with concurrency. It has two major functions:

  • Program code cannot change or modify itself.
  • Local data for every CLIENT process needs to be stored in different disks.
12.

What do you mean by FCFS?

Answer»

FCFS (First Come First Serve) is a type of OS scheduling algorithm that executes PROCESSES in the same order in which processes arrive. In simple words, the process that arrives first will be executed first. It is non-preemptive in nature. FCFS scheduling may cause the problem of starvation if the burst time of the first process is the longest among all the jobs. Burst time here means the time that is REQUIRED in milliseconds by the process for its EXECUTION. It is ALSO considered the easiest and simplest OS scheduling algorithm as compared to others. Implementation of FCFS is GENERALLY managed with help of the FIFO (First In First Out) queue. 

13.

What is a process? What are the different states of a process?

Answer»

The process is basically a program that is currently under execution. The main function of an OS is to manage and handle all of these processes. When a program is loaded into the memory and it becomes a process, it can be divided into four sections ─ stack, heap, text, and DATA. There are two types of processes:

  1. Operating System Processes
  2. User Processes

STATES of Process:

Different states of the process through which process goes are given below:

  • New State: In this state, a process is just created.
  • Running: In this state, the CPU starts working on the process’s instructions.
  • Waiting: In this state, the process cannot RUN because it just waits for some event to occur
  • Ready: In this state, the process has all resources available that are required to run but it waits to get assigned to a PROCESSOR because CPUs are not working currently on instructions passed by the process.
  • Terminate: In this state, the process is completed I.e., the process has finished execution.
14.

What is thread in OS?

Answer»

Thread is a path of execution that is composed of a program counter, thread ID, stack, and set of registers within the PROCESS. It is a basic unit of CPU utilization that makes COMMUNICATION more effective and efficient, enables utilization of multiprocessor architectures to a greater scale and greater efficiency, and reduces the TIME required in context switching. It simply provides a way to improve and increase the performance of applications through PARALLELISM. Threads are sometimes called lightweight processes because they have their own stack but can access shared data. 

Multiple threads running in a process share: Address space, Heap, Static data, Code segments, File descriptors, Global variables, Child processes, Pending alarms, Signals, and signal handlers. 

Each thread has its own: Program counter, Registers, Stack, and State.