Top 35+ | Operating System Interview Questions & Answers

Top 30 + | Operating System Interview Questions & Answers Here is the list of most frequently asked questions on the operating System. If you are preparing for an interview then you cannot skip the Operating system, which Means it is an important subject.

Top 35+ | Operating System Questions

1. What is an Operating System?

An Operating system is the software which acts as intermediate between users and the computer hardware. A users cannot directly interacts with hardware there is an operating system that act as mediator between two.

For example Windows, Mac, Linux, etc.

2. What are the goals of operating system?

Operating system goals:

  • Executes users programs and users tasks easier.
  • Make the system convenient to use.
  • Use computer hardware in an efficient manner.
  • To make complex tasks easy.

3. Enlists different types of operating System?

Following are the types of operating system:

  • Simple batch system.
  • Multi-programming batch system.
  • Time-Sharing Systems.
  • Personal- Computer Systems.
  • Parallel/ Multiprocessor Systems.
  • Distributed Systems.
  • Clustered System.
  • Real-Time System.

4. Explain Multi-programming Batch System?

In this types of operating system several jobs are kept in main memory(RAM) at the same time CPU picks one job which is ready for executing and execute it.

Example:

Operating System
Job1
Job2
Job3
Job n…

5. Explain Time Sharing System?

In Time sharing System CPU executes jobs kept in main memory or disk by switching among them. This switching is so fast that end-user can interact with program while it is running. It is also called as Multitasking.

6. Explain Parallel or Multiprocessor System?

In this System, Multiple Processors are responsible for handling multiple jobs. Suppose there are 10 jobs to be executed and we have 10 processors, so each job will be executed by an independent processor.

Note jobs can be anything: Programs, subprograms ,etc.

There are basically two types of Multiprocessor System:

  • Symmetric Multiprocessing.
  • Asymmetric Multiprocessing.

7. What is Symmetric Multiprocessing?

SMP (symmetric multiprocessing) is multiple-processor processing of programs that have a shared operating system and memory.

In SMP each processor runs an identical copy of the operating system. In which a single copy of an operating system is in charge of all the processors.

SMP systems are considered better than online transaction processing (OTP) systems in which many users access the same database in a fairly simple set of transactions. To this extent, an advantage of SMP is the ability to dynamically manage the workload between computers (and thus support more users more quickly).

Symmetric Multiprocessing

8. What is Asymmetric Multiprocessing?

It has the master-slave relationship between the processors. The remaining slave processor is managed by one master processor. The master processor allocates processes to slave processor, otherwise they may have to perform some predefined task.

It is suitable in extremely large system.

9. What are Advantages of Parallel/ Multi-programming System?

Following are the advantages of Parallel/ Multi-programming System:

  • It increases throughput of the system.
  • It is very economical.
  • Parallel System Increases the system reliability.

10. Explain Real time operating System?

In those systems where data processing can be performed in the specified and short period of time, In this case the real-time operating system is used.

Some of the best known, Most widely deployed real-time operating systems are:

Lynx OS, Windows, Free RTOS. etc.

There are two types of Real time operating system:

  • Hard RTOS.
  • Soft RTOS.

11. Explain Hard RTOS?

It is a Type of RTOS in which deadlines are important, meaning a given task must be executed at a specified scheduled time.

Suppose we have a task “x” and it has deadline 1 hours, So in Hard RTOS task x must be executed within 1 hour.

Example:m Medical Critical care System, Aircraft traffic controlling Systems, etc.

12. Explain soft RTOS?

The Type of RTOS in which deadlines are important but allow some delay, meaning a given task must be executed at a specified scheduled time but a delay of a small amount is acceptable.

So deadlines are handled softly by this types of RTOS.

Example: Online Transaction systems. Stock market, etc.

13. Describe distributed Operating System?

In this type of Operating system various autonomous loosely coupled systems communicate with each other using a shared communication system. Distributed systems use multiple central processors that are used to handle multiple applications and multiple users.

14. What are the advantages of Distributed Operating System?

Following are the advantages of Distributed operating system:

  • Resource sharing is easy.
  • Computation speed is fast.
  • More reliable means if one nodes fails complete system is doesn’t fail.
  • Communication between system is easy.

15. What are the services of Operating system?

Following are the services of operating system:

  • Programs executions: It is a system capability to load a program into the main memory and run it.
  • I/O Operations: The Operating system must provide a means to perform input and output operations.
  • File Management: OS must provide service to read, write, create, and delete files.
  • Communications: Operating System must provide a communication medium to exchange information between a process executing either on the same computer or on different computers.
  • Error detection: It is a system capability to ensure correct computing by detecting errors in the CPU, memory, in IO devices, and in User programs.

Some more additional services by Operating systems are:

  • Resource allocations: Allocating resources to multiple users or multiple jobs running at the same time.
  • Accounting: keep track of user performed tasks.
  • Protection: Ensures only authenticate users enter the system.

16. What is Kernel in Operating System?

It is the heart of operating which is also the central part of the operating system. It is generally responsible for operations such as memory management, process and task management, and disk management. In simple terms, it is an interface between the user application and the hardware.

There are basically 5 types of kernel:

  • Monolithic kernel.
  • Micro kernel.
  • Hybrid kernel.
  • Nano kernel.
  • Exo kernel.

17. Explain Monolithic kernel?

In this type of kernel architecture all essential system services like- memory management, communication, file management are all packed in one module in kernel space.

This approach provides rich and powerful hardware access. These type of kernel is used in UNIX, Linux operating system.

18. Explain Micro kernel?

In Micro kernel, the kernel provides basic functionality that allows the execution of servers and separate programs.

The kernel is broken into separate processes known as servers, Where some of the servers run in the users space and some run in kernel space.

All servers are kept separate and run in different address space.

Communication in microkernel is done via message passing. Where servers communicate through Inter-process communication.

19. What is Process in Operating System?

In the Operating System, a process is a program under execution. Suppose we write a java program and execute it, the compiler creates byte code this byte code when executed become process.

When Program is loaded in main memory it is divided into four sections – Stack, Heap, Data. and Text

20 What is Thread?

A Thread is the smallest unit of execution, A process can be divided into multiple thread and each thread can be executed independently and then their result is combined.

Each Thread is having its own Thread ID, Program counter, register set, and the stack.

22. Difference between Process and Thread?

ProcessThread
A Process is a program in execution.A Thread is the smallest unit of execution.
It requires more time for context switching.As they are lighter than process it requires less time in context switching.
The process is totally independent and doesn’t share memory.Threads may share its memory with other threads.
Communication time is more.Communication time is less.
It requires more resources.It requires fewer resources.

23. What is inter process communication?

Inter-process communication is the mechanism that allow process to communicate with each other and synchronize their actions.

When a software is executed it is broken down into several dependent and independent processes, So there must be mechanism to synchronize process execution and communication between them.

There is the two ways by which Process communicate:

  • Shared Memory.
  • Message Passing.

24. Explain Message Passing and Shared memory?

Interprocess communication(IPC)

Message Passing: In this type of Inter-Process communication, Process communicate with each by exchanging messages between them. This type of IPC is useful when data is small.

It is easily implemented using System calls and it takes less time than Shared Memory.

Shared Memory: In This type of IPC a dedicated region is made and is shared among cooperating processes.

Processes exchanges information by reading, writing data to this shared region. kernel assistance is required only once for setting shared memory.

25. Explain Process Life Cycle?

During execution of process a process can be in following state:

  • New Born state: A newly born process resides in New born state.
  • Read State: When the Process is ready for execution it resides in a ready queue and the process is said to be in a ready state.
  • Running State: If a process is currently having CPU control and is executing then the process is said to be in running state.
  • Waiting State: When a process is waiting for CPU control, it is said to be in the waiting state.
  • Terminated State: If a process is fully executed we terminate its process control block.

26. What is Process control?

It is a block that contain all information related to a process. Like Process Id, process state, process priority, program counter, etc.

27. What is System calls in Operating System?

Since we cannot directly contact hardware peripherals these system call provides an interface between a running program and the operating system.

28. What are schedulers in Operating System , also Enlist its types?

In order to run process we requires a process called scheduling, which allow execution of different processes using some criteria.

Process Scheduling is achieved using schedulers. Suppose we are having 10 processes in a queue and we want to process 3 should be executed first out of 1o processes. So we must be able to do this.

There are basically 3 Schedulers:

  • Short-Term Schedulers.
  • Medium-Term Schedulers.
  • Long-Term Schedulers.

29. Differentiate between Short, Medium and Long-Term Scheduler?

Short TermMedium TermLong Term
It is called as CPU Scheduler.It is used for process swapping.Long Term Scheduler are Job scheduler.
Speed is fastmoderate speed.Speed is lesser than short term scheduler.
Provides lesser control to degree of Multi-programming.It reduces degree of Multi-programming.It controls degree of multi-programming.

30. Explain Context switching with respect to Operating System?

It is a mechanism by which CPU switch from one process to next process, while switching from one process to other it saves the state of old process and load the saved state for new process.

31. Enlist Different types of scheduling algorithms?

Following are the scheduling algorithm:

  • First, come First First serve(FCFS).
  • Shortest Job Next scheduling(SJN).
  • Priority scheduling.
  • Shortest Remaining Time.
  • Round Robin (RR) Scheduling.

32. Explain Various types of Scheduling algorithm?

First come First serve scheduling– In this scheduling algorithm, the process which enters first will be allotted CPU first. Suppose there are two processes p1 and p2 where p1 enters before process p2. so in this case p1 will have it execution first.

Shortest Job Next Scheduling– In this scheduling the process which is will requires shortest CPU time will be executed first.

Priority Scheduling- Every process is having priority, if scheduling of process takes place on the basis of process priority, it is called as priority scheduling.

High priority process is executed first then low priority process.

Shortest Remaining Time Scheduling- Processor is allocated to the process which is closest to its completion. but this executing can be interupted by new process who has shorter time for execution.

Round Robin Scheduling- Each process is given fixed time for execution which is called quantum time, once a process is executed for given time, it is interrupted and new process is executed for quantum time, and this procedure continues.

33. Explain swapping in operating System?

The main memory is limited resource and whenever any program(process) is executed it is stored in main memory. Sometimes Main memory is occupied by the process which is ideal(not executing and waiting) so in this case memory is wasted.

So swapping is the process in which we temporarily swap some process from main memory to secondary storage and make the main memory available for other process.

After some time these swapped process is called back to the main memory for their execution.

34. Explain fragmentation in Operating system?

During execution of process, process is loaded and removed from memory. These free memory space is broken into little pieces and it cannot be allocated to the other processes, considering its small size, due to this memory blocks remain unused,this problem is called as fragmentation.

35. What is segmentation in os?

A memory management technique in which a process or job is divided into various segments consists of different sizes. when a process is executed its corresponding segment is also loaded into the non contiguous memory.

36. What is Paging in Operating System?

Paging is a storage mechanism used in Operating Systems to retrieve processes in the form of pages from the secondary storage into the main memory.

The main idea behind paging is to divide up each process in pages form. Even the central memory is split in the form of frames.

One page of the process shall be stored in one of the memory frames. The pages may be located at various memory locations but it is always a priority to locate the contiguous frames or gaps.

Process pages are only brought into the main memory when required otherwise they reside in the secondary storage.

Different operating systems define various frame sizes. Every frame has to have equal sizes.

37. What is demand paging?

Demand paging is similar to paging with swapping, In this process operating system bring all the pages to RAM which are not present.

38 What is thrashing in os?

Thrashing is a state or circumstance where the machine spends a large portion of its time fixing the faults on the list, but it is quite marginal to actually process.

Click here for more Interview Questions

Latest Posts:

Leave a Comment