+91 90691 39140 | +1 253 214 3115 | info@hub4tech.com | hub4tech

Operating System Interview Questions and Answers

1
Explain the main purpose of an operating system?

Operating systems exist for two main purposes. One is that it is designed to make sure a computer system performs well by managing its computational activities. Another is that it provides an environment for the development and execution of programs.

2
What are the different types of scheduling algorithms?

The scheduling algorithms decide which processes in the ready queue are to be allocated to the cpu for execution. Scheduling algorithms can be broadly classified on the basis of:

  • Preemptive algorithms
  • Round Robin Scheduling
  • Shortest Job First Scheduling (can be both)
  • Priority Scheduling (can be both)
  • Non-preemptive algorithms
  • First Come First Served Scheduling
  • Non-Preemptive algorithms: In this type of scheduling once a cpu has been allocated to a process it would not release the cpu till a request for termination or switching to waiting state occurs.

    Preemptive algorithms: In this type of scheduling a process maybe interrupted during execution and the cpu maybe allocated to another process.

3
Explain the concept of Reentrancy?

It is a useful, memory-saving technique for multiprogrammed timesharing systems. A Reentrant Procedure is one in which multiple users can share a single copy of a program during the same period. Reentrancy has 2 key aspects: The program code cannot modify itself, and the local data for each user process must be stored separately. Thus, the permanent part is the code, and the temporary part is the pointer back to the calling program and local variables used by that program. Each execution instance is called activation. It executes the code in the permanent part, but has its own copy of local variables/parameters. The temporary part associated with each activation is the activation record. Generally, the activation record is kept on the stack.
Note: A reentrant procedure can be interrupted and called by an interrupting program, and still execute correctly on returning to the procedure.

4
What is demand paging?

Demand paging is a system wherein area of memory that are not currently being used are swapped to disk to make room for an application’s need.

5
Why is round robin algorithm considered better than first come first served algorithm?

The first come first served algorithm is the simplest scheduling algorithm known. The processes are assigned to the cpu on the basis of their arrival time in the ready queue. Since it is non-preemptive once a process is assigned to the cpu it will run till completion. Since a process takes the cpu till it is executed it is not very good in providing good response times. It can make other important processes wait un-necessarily.
On the other hand the round robin algorithm works on the concept of time slice or also known as quantum. In this algorithm every process is given a predefined amount of time to complete the process. In case a process is not completed in its predefined time then it is assigned to the next process waiting in queue. In this way a continuous execution of processes is maintained which would not have been possible in case of FCFS algorithm

Copyright ©2015 Hub4Tech.com, All Rights Reserved. Hub4Tech™ is registered trademark of Hub4tech Portal Services Pvt. Ltd.
All trademarks and logos appearing on this website are the property of their respective owners.
FOLLOW US