Operating System Interview Questions & Answers
Operating System Interview Questions & Answers
Cracking
Interview
Operating System Interview Question
A list of top frequently asked Operating System interview questions and answers are given
below.
The operating system is a software program that facilitates computer hardware to communicate
and operate with the computer software. It is the most important part of a computer system
without it computer is just like a box.
It is designed to make sure that a computer system performs well by managing its
computational activities.
4) What is a socket?
A socket is used to make connection between two applications. Endpoints of the connection are
called socket.
Real-time system is used in the case when rigid-time requirements have been placed on the
operation of a processor. It contains a well defined and fixed time constraints.
6) What is kernel?
Kernel is the core and most important part of a computer operating system which provides basic
services for all parts of the OS.
A monolithic kernel is a kernel which includes all operating system code is in single executable
image.
User Processes
New Process
Running Process
Waiting Process
Ready Process
Terminated Process
10) What is the difference between micro kernel and macro kernel?
Micro kernel: micro kernel is the kernel which runs minimal performance affecting services for
operating system. In micro kernel operating system all other operations are performed by
processor.
It is a very useful memory saving technique that is used for multi-programmed time sharing
systems. It provides functionality that multiple users can share a single copy of program during the
same period.
The local data for each user process must be stored separately.
Paging is used to solve the external fragmentation problem in operating system. This technique
ensures that the data you need is available as quickly as possible.
Demand paging specifies that if an area of memory is not currently being used, it is swapped to
disk to make room for an application's need.
As many as processors are increased, you will get the considerable increment in throughput. It is
cost effective also because they can share resources. So, the overall reliability increases.
Virtual memory is a very useful memory management technique which enables processes to
execute outside of memory. This technique is especially used when an executing program cannot
fit in the physical memory.
Thrashing is a phenomenon in virtual memory scheme when the processor spends most of its time
in swapping pages, rather than executing instructions.
18) What are the four necessary and sufficient conditions behind the
deadlock?
1) Mutual Exclusion Condition: It specifies that the resources involved are non-sharable.
2) Hold and Wait Condition: It specifies that there must be a process that is holding a resource
already allocated to it while waiting for additional resource that are currently being held by other
processes.
3) No-Preemptive Condition: Resources cannot be taken away while they are being used by
processes.
4) Circular Wait Condition: It is an explanation of the second condition. It specifies that the
processes in the system form a circular list or a chain where each process in the chain is waiting for
a resource held by next process in the chain.
A thread is a basic unit of CPU utilization. It consists of a thread ID, program counter, register set
and a stack.
FCFS stands for First Come, First Served. It is a type of scheduling algorithm. In this scheme, if a
process requests the CPU first, it is allocated to the CPU first. Its implementation is managed by a
FIFO queue.
SMP stands for Symmetric MultiProcessing. It is the most common type of multiple processor
system. In SMP, each processor runs an identical copy of the operating system, and these copies
communicate with one another when required.
RAID stands for Redundant Array of Independent Disks. It is used to store the same data
redundantly to improve the overall performance.
Deadlock is a specific situation or condition where two processes are waiting for each other to
complete so that they can start. But this situation causes hang for both of them.
Mutual Exclusion: At least one resource must be held in a non-sharable mode. If any other
process requests this resource, then that process must wait for the resource to be released.
Hold and Wait: A process must be simultaneously holding at least one resource and waiting
for at least one resource that is currently being held by some other process.
No preemption: Once a process is holding a resource ( i.e. once its request has been
granted ), then that resource cannot be taken away from that process until the process
voluntarily releases it.
Circular Wait: A set of processes { P0, P1, P2, . . ., PN } must exist such that every P[ i ] is
waiting for P[ ( i + 1 ) % ( N + 1 ) ].
Note: This condition implies the hold-and-wait condition, but it is easier to deal with the
conditions if the four are considered separately.
26) What is the difference between logical address space and physical
address space?
Logical address space specifies the address that is generated by CPU. On the other hand physical
address space specifies the address that is seen by the memory unit.
Internal fragmentation: It is occurred when we deal with the systems that have fixed size
allocation units.
External fragmentation: It is occurred when we deal with systems that have variable-size
allocation units.
Spooling is a process in which data is temporarily gathered to be used and executed by a device,
program or the system. It is associated with printing. When different applications send output to
the printer at the same time, spooling keeps these all jobs into a disk file and queues them
accordingly to the printer.
Internal commands are the built-in part of the operating system while external commands are the
separate file programs that are stored in a separate folder or directory.
Semaphore is a protected variable or abstract data type that is used to lock the resource being
used. The value of the semaphore indicates the status of a common resource.
Binary semaphores
Counting semaphores
Binary semaphore takes only 0 and 1 as value and used to implement mutual exclusion and
synchronize concurrent processes.
33) What is Belady's Anomaly?
Belady's Anomaly is also called FIFO anomaly. Usually, on increasing the number of frames
allocated to a process virtual memory, the process execution is faster, because fewer page faults
occur. Sometimes, the reverse happens, i.e., the execution time increases even when more frames
are allocated to the process. This is Belady's Anomaly. This is true for certain page reference
patterns.
Starvation is Resource management problem. In this problem, a waiting process does not get the
resources it needs for a long time because the resources are being allocated to other processes.
Economical
37) What is the difference between logical and physical address space?
Logical address specifies the address which is generated by the CPU whereas physical address
specifies to the address which is seen by the memory unit.
After fragmentation
Overlays makes a process to be larger than the amount of memory allocated to it. It ensures that
only important instructions and data at any given time are kept in memory.
Cracking
Interview