20 Operating System Interview Questions & Answers in MCQ format

What type of kernel is Windows?
Which of the following serves as an interface for the user programs to access the service of an operating system?
A process is said to be in a ready state if
How many ways can a process be terminated? etc.

1. What type of kernel is Windows?


a) Monolithic kernel
b) Hybrid kernel
c) Microkernel
d) Nano kernel

Answer:b) Hybrid kernel
Explanation:The kernel is an important part of OS and manages the operations of a computer and its hardware. There are many types of kernels such as microkernel, monolithic kernel, Hybrid Kernel etc. In microkernel, user and kernel services are run in separate address space. This reduces the size of the Kernel which in turn, reduces the size of Operating System but reduces the speed of execution. In monolithic kernel, both user services and kernel services are kept in the same address space. Consequently, the execution of the process will be faster in Monolithic Kernels. A hybrid kernel is a combination of the features and benefits of both microkernel and monolithic kernel.  And the Windows kernel is a hybrid kernel


2. Which of the following is not true?


a) Kernel is at the core of an operating system.
b) Kernel is not the first part of an operating system that was loaded into memory when booting up a computer.
c) Kernel is responsible for various tasks such as disk management, task management, and memory management.
d) Kernel remains in the memory until the Operating System is shut-down.

Answer:b) Kernel is not the first part of an operating system that was loaded into memory when booting up a computer.
Explanation:Kernel is the first program of the operating system that was loaded into memory when booting up a computer.


3. Which of the following serves as an interface for the user programs to access the service of an operating system?


a) System calls
b) API
c) Modules
d) Assembly instructions.

Answer: a) System calls
Explanation:System call serves as an interface between the operating system and user programs. When a user program needs to access the operating system's kernel, it makes a system call. The kernel system can only be accessed using system calls.


4. A process is said to be in a ready state if


a) A process is newly created and is waiting for the CPU.
b) A process is unable to run and wait until some task has been completed
c) A process is using the CPU.
d) None of the above.

Answer:a) A process is newly created and is waiting for the CPU.
Explanation:A newly created process is in a ready state and is waiting for the CPU in order to execute it.
When a process is unable to run because it is waiting for some other task to be completed, it is said to be in a wait/block state.
When a process is using the CPU, it is said to be in a running state.


5. How many ways can a process be terminated?


a) Normal exit
b) Fatal error
c) Killed by another process.
d) All of the above.

Answer:d) All of the above.
Explanation:A process can be killed by all of the above methods. A process exits normally when it completes its task successfully. On account of fatal error while running, the process may exit abnormally. And it can also be terminated forcefully by another process.


6. A virtual address generated by the CPU while a program is running is called as?


a) Physical address
b) Logical address
c) MAC address
d) None of the above

Answer:b) Logical address
Explanation:Physical Address is the actual address of the data inside the memory. The user never deals with the Physical Address directly. It uses a virtual address or logical address generated by the CPU to access physical address inside the memory. It is the memory management unit, MMU that translates logical addresses to physical addresses that corresponds to RAM or main memory. So, a logical address does not exist physically but is only used for reference to access the physical address.


7. In Thrashing, the CPU spends most of its time


a) Executing
b) Swapping
c) Waiting
d) None of the above

Answer:b) Swapping
Explanation:Thrashing is a state where the CPU spends most of its time swapping pages between the main memory and virtual memory, rather than executing instructions. Thrashing results in performance problem in OS since CPU spends less time on actual productive work and spend more time swapping.


8. In which of the following situations a page fault can occur?


a) A page is not found in the main memory
b) A page is not found in the virtual memory
c) A page is not found in the secondary storage.
d) All of the above.

Answer:a) A page is not found in the main memory
Explanation:Page fault occurs when a program accesses a page that is mapped in the virtual address space, but not loaded in physical memory. The page fault causes an exception that notifies the operating system to retrieve the "pages" from the secondary memory into the main memory.


9. Which of the following is not an Operating System scheduling algorithm?


a) Round Robin(RR) Scheduling
b) First-Come, First-Served (FCFS) Scheduling.
c) Shortest Remaining Time
d) Banker’s

Answer:d) Banker’s
Explanation:Banker’s algorithm is a deadlock avoidance algorithm and not a scheduling algorithm.
Scheduling algorithms tell the CPU which will be the next process to have CPU time based on particular scheduling algorithms. The main objective of Scheduling algorithm is to maximize the CPU utilization. Some of the widely used scheduling algorithms are
- First-Come, First-Served (FCFS) Scheduling
- Shortest-Job-Next (SJN) Scheduling
- Priority Scheduling
- Shortest Remaining Time
- Round Robin(RR) Scheduling
- Multiple-Level Queues Scheduling


10. Which of the following is true?


a) Overlays are used to increase the size of physical memory
b) Overlays are used to increase the size of virtual memory
c) Overlays are used to overcome the limitation of physical memory.
d) None of the above.

Answer:c) Overlays are used to overcome the limitation of physical memory.
Explanation:Overlay is a technique that allows a program to run despite it is bigger than the size of the physical memory. Using this technique, only those instructions and data are kept inside the main memory that is needed at any given time.


11. What does virtual memory allow?


a) Execution of a process that may not be completely in the memory
b) A program to be smaller than the physical memory.
c) A program to be larger than the secondary storage
d) Execution of a process without being in the physical memory.

Answer: a) Execution of a process that may not be completely in the memory
Explanation:Virtual memory is a part of the secondary storage but gives the user an illusion that it is a part of the main memory. It allows running big applications with low main memory and increases the degree of multiprogramming in systems. Virtual memory frees up RAM by swapping data that has not been used recently over to a storage device, such as a hard drive.


12. Which memory management technique is used to retrieve process from the secondary storage into the main memory in the form of pages?


a) fragmentation
b) paging
c) mapping
d) none

Answer:b) paging
Explanation:Paging divides each process in the form of pages. These pages are brought into the main memory only when they are required otherwise they reside in the secondary storage.


13. Which of the followings is/are true about Microkernel?


a) The user services are kept in user address space, and kernel services are kept under kernel address space
b) The operation of the Microkernel kernel is slower as compared to monolithic kernels
c) It doesnt require any modification in kernel space if new service is added to user address space
d) All of the above

Answer:d) All of the above


14. The part of the secondary storage use for paging is known as ___________


a) Virtual memory
b) Main memory
c) Secondary storage
d) Primary memory

Answer:a) Virtual memory
Explanation:In paging, a process is divided into fixed-size contiguous block known as pages and is stored on the secondary storage


15. Which of the following is the most suitable scheduling scheme for the real-time operating system?


a) Round-robin
b) Pre-emptive
c) Random
d) First come first serve

Answer:b) Pre-emptive
Explanation:Pre-emptive is the most suitable scheduling scheme for the real time operating system
A Real-time system requires producing the result urgently and preemptive scheduling allows a real-time process to preempt a process currently running in the kernel.


16. What is the purpose of Banker’s algorithm?


a) Prevent deadlock
b) Solving deadlock
c) Recover from deadlock
d) All of the above

Answer:a) Prevent deadlock
Explanation:Banker’s algorithm is a deadlock avoidance algorithm. It manages resources allocation. It is also called as deadlock detection algorithm.
It is named as Banker's algorithm because the banks use the same technique to allocate money and provide loans to their customers so that they never run out of money.


17. Which of the following is a situation where all the low priority processes get blocked, and the high priority processes execute?


a) Deadlock
b) Starvation
c) Aging
d) Thrashing

Answer:b) Starvation
Explanation:Starvation is a situation where all the low priority processes get blocked, and the high priority processes execute. Unlike Deadlock, starvation is a long waiting but not an infinite process. Every starvation doesn’t necessarily cause a deadlock. And Starvation basically happens due to uncontrolled priority and resource management.


18. The address of the next instruction to be executed by the current process is provided by which of the following?


a) CPU registers
b) Program counter
c) Process stack
d) Pipe

Answer:b) Program counter
Explanation:Program counter is one of the attributes of a process where it stores address of the next instruction to be executed by the process.


19. The circular wait condition can be prevented by


a) Using a thread
b) Defining a linear ordering of resource types
c) Using pipes
d) All of the above.

Answer:b) Defining a linear ordering of resource types
Explanation:The circular wait condition can be prevented by defining a linear ordering of resource types. This means that we must number all resources and a process has to access the resource in an increasing or decreasing order.
For example, all resources are given an integer value in an increasing order, suppose a process acquired a resource R4 in an increasing order, this process will only have access to additional resources which has a higher integer value than the allocated resource such as R5, R6. And if that process wants a resource with a lesser integer value such as R3 or R2, it must first free the acquired resource before taking the new resource.


20. Which of the following algorithm schedules job according to their arrival time?


a) FCFS
b) SJF
c) RR
d) None of the above

Answer:a) FCFS
Explanation:First Come First Server (FCFS) is a scheduling algorithm, where a process that request the CPU first will be executed first. Hence, it schedules processes and requests according to their arrival time.