Welcome to Interviewbit, help us create the best experience for you!

Currently, You are a:

Few details about your education

College/University *
Enter the name of your college
Branch *
Year of completion *

Few details about your education

College/University *
Enter the name of your college
Branch *
Year of completion *

Few details about your career...

Current Company *
Enter company name
Experience *

You're all set!

Begin your success journey!

Sign Up using
Full name *
Email *
Password *

By creating an account, I acknowledge that I have read and agree to InterviewBit’s Terms and Privacy Policy .

Welcome back!

Log In using
Email *
Password *

Operating System MCQ With Answers

Begin your success journey!

Sign Up using
Full name *
Email *
Password *

By creating an account, I acknowledge that I have read and agree to InterviewBit’s Terms and Privacy Policy .

Welcome back!

Log In using
Email *
Password *

An operating system provides a platform on which other applications programs can be installed. It also provides the environment within which programs are executed. It can be termed as a program or system software that acts as an intermediary between user and hardware.

Resource Manager/Allocator - It manages the system resources in an unbiased fashion in both hardware(mainly CPU time, memory, system buses) and software(access, authorization, semaphores) and provides the functionality to application programs.

Operating System controls and coordinates the use of resources among various application programs.

Computer Hardware - CPU, Memory units, I/O devices, system bus, registers, etc, provides the basic computing resources.

System and Application Programs - Defines the way in which these resources are used to solve the computing problems of the user.

Functions of Operating System

  • Process Management
  • Memory Management
  • I/O device management
  • File Management
  • Network Management
  • Security and Protection

Types of Operating Systems

Batch Operating System

  • To speed up the processing job with similar types, the tasks are batched together and were run through the processor as a group batch.
  • In some operating systems, grouping is done by the operator while in some systems, it is performed by the Batch Monitor resisted in the low end of the main memory.
  • The jobs are bundled into batches with similar requirements.
  • Then the submitted jobs were grouped as FORTRAN jobs, COBOL jobs, etc.

Advantages

  • The batched jobs were executed automatically one after another saving its time by performing the activities(like-loading of a compiler) only once. It resulted in improved system utilization due to reduced turnaround time.
  • Increased performed as a new job get started as soon as the previous job is finished, without any manual intervention.

Disadvantages

  • Memory limitation - memory was very limited, because of which interactive process of multiprogramming was not possible.

Multiprogramming Operating System

  • A single program cannot, in general, keep either the CPU or the I/O devices busy all times. The basic idea of a multiprogramming operating system is it keeps several jobs in the main memory simultaneously.
  • The OS picks and begins to execute one of the jobs in memory. Eventually, the jobs may have to wait for some task, such as an I/O operation, to complete.

Advantages

  • High and efficient CPU utilization.
  • Less response time or waiting time or turnaround time.
  • Several processes share CPU time.

Disadvantages

  • It is difficult to program a system because of complicated schedule handling.
  • To accommodate many jobs in the main memory, complex memory management is required.

Multitasking Operating System

  • In the modern OS, we are able to play MP3 music, edit documents, surf the web all running at the same time.
  • For multitasking to take place, firstly there should be multiprogramming i.e. presence of multiple programs for execution. And secondly the concept of time-sharing.

Advantages

  • High and efficient CPU utilization.
  • Less response time or waiting time or turnaround time.
  • Several processes share CPU time.

Disadvantages

  • More utilization of memory.

Real-Time Operating System

  • A real-time system is a time-bound system that has well-defined fixed time constraints. Processing must be done within the defined constraints or the system will fail.
  • RTOS is intended to serve real-time applications that process data as it comes in, typically without buffer delays. It is used in an environment where a large number of events must be accepted and processed in a short time.

Advantages

  • High and efficient CPU utilization.
  • Less response time or waiting time or turnaround time.
  • Several processes share CPU time.

Disadvantages

  • The cost to build is more.

Throughput: If the CPU is busy executing, then work is being done. One measure of work is the number of processes that are completed per time unit, which is called throughput.

Waiting Time: Waiting time is the sum of the periods spent waiting in the ready queue.

Response Time: It is the time that takes to start responding.

Terminologies:

  • Arrival Time(AT) -  Time at which process enters a ready state
  • Burst Time(BT) - Amount of CPU time required by the process to finish its execution.
  • Completion Time(CT) - Time at which the process finishes its execution.
  • Turn Around Time(TAT)- Completion Time(CT) - Arrival Time(AT)
  • Waiting Time(WT) :  Turn Around Time(TAT) - Burst Time(BT)

FCFS(First Come First Serve)

  • FCFS is the simplest scheduling algorithm. The process that requests the CPU first is allocated the CPU first.
  • Implementation is managed by FIFO Queue.
  • It is always non-pre-emptive in nature.

Shortest Job First(SJF)

  • In SJF, once a decision is made and among all the available processes, the process with the smallest CPU burst is scheduled on the CPU, it cannot be pre-empted even if a new process with the smaller CPY burst requirement, then the remaining CPU burst of the running process enter in the system.

Longest Job First

  • Process having the longest burst time will get scheduled first.
  • It can be both pre-emptive and non-pre-emptive in nature.
  • The pre-emptive version is referred to as Longest Remaining Time First Scheduling Algorithm.

Mutual Exclusion: No two processes should be present inside the critical section at the same time, i.e. only one process is allowed in the critical section at an instant of time.

Semaphores: Semaphores are synchronization tools using which we will attempt n-process solutions. It is a simple integer variable, but apart from initialization it can be accessed only through two standard atomic operations, wait(S) and signal(S).

Types of Semaphores

  • Binary Semaphores: The value of a binary semaphore can range only between 0 and 1.
  • Counting Semaphores: it can range over an unrestricted domain.  It can be used to control access to a given resource consisting of a finite number of instances.

Deadlock: In a multiprogramming environment, several processes may compete for a finite number of resources. A process requests for a resource. If the resource is not available at that time, the process enters a waiting state. Sometimes, a waiting process is never again able to change state, because the resource it has requested is held by other waiting processes. This situation is called a deadlock.

Necessary Conditions for deadlock: A deadlock can occur if all these four conditions occur in the system simultaneously:

  • Mutual exclusion
  • Hold and Wait
  • No pre-emption
  • Circular Wait

Livelock: A livelock is a situation where a request for an exclusive lock is denied repeatedly, as many overlapping shared locks keep on interfering with each other.

Resources

Practice Coding
OS Interview Questions

Operating System MCQ

1. 

Which of the following are CPU scheduling algorithms?

2. 

Operating systems

3. 

A process which is copied from main memory to secondary memory on the basis of 
requirement is known as -

4. 

FIFO scheduling is a type of:

5. 

Which of the type of OS reads and reacts in terms of actual time?

6. 

A systematic procedure for moving the CPU to new process is known as-

7. 

UNIX is written in which language?

8. 

Thread is a

9. 

OS classifies the threads as-

10. 

Among the following CPU scheduling algorithms, which of these allocated the CPU first to the process that requests the CPU first?

11. 

What are the two types of operating modes of AT?

12. 

Which of the following schedules threads?

13. 

What is meant by ready state of a process?

14. 

Among the following, which is an example of a spooled device?

15. 

Main memory of a computer system is?

16. 

For which of the following purposes in Banker’s algorithm is used?

17. 

Device driver required in?

18. 

When are the register context and stack of thread deallocated?

19. 

Threads is not shared among which of the following?

20. 

For which of the following is the jacketing technique used?

21. 

For which of the following is resource sharing used?

22. 

Many to One model is at an advantage in which of the following conditions?

23. 

Identify the system calls that on termination does not return control to the calling point.

24. 

Consider the following program:

main()
{
     if(fork()>0)
sleep(100);
}
25. 

The output of the following C program is?

int main(){
	fork();
    fork();
    printf("code ");
}
26. 

Identify the call which never returns an error?

27. 

What of the following defines Thread cancellation?

28. 

When a thread terminates some target thread immediately, it is known as?

29. 

Signals of some given type are

30. 

Which of the following commands in UNIX is used to send a signal?

31. 

The speed of writing data in magnetic tape disks is comparable to that of disk drives. State True/False

32. 

What else is a command interpreter called?

33. 

Select the correct definition of spooling.

34. 

Which of the following is the only state transition that is initiated by the user process itself?

35. 

Identify the two steps of a process execution.

36. 

Why is CPU scheduling done?

37. 

The most optimal CPU scheduling algorithm is ________

38. 

How many minimum variables is/are required to share between processes, so as to solve the critical section problem?

39. 

Which of the following is known as uninterruptible unit?

40. 

Semaphore is a __ and it helps to solve the problem of  ___?

41. 

Which of the following are two types of atomic operations performed by semaphores?

42. 

The two types of semaphores are-

43. 

A binary semaphore has a value of

44. 

The release and request of resources are a type of which of the following?

45. 

Is mutual exclusion required for shareable resources?

46. 

Unsafe states are?

47. 

When can the binding of instructions and data to memory addresses be done?

48. 

Which of the following is also known as the base register?

49. 

Which of the following is not an operating system?

50. 

Which of the following is a single user operating system?

51. 

To access the services of operating system the interface is provided by the?

52. 

The size of virtual memory is based on which of the following?

53. 

Which of the following is an example of a real-time operating system?

Your feedback is important to help us improve.