0% found this document useful (0 votes)
12 views

OS Interview Questions

Uploaded by

Bhageerath
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

OS Interview Questions

Uploaded by

Bhageerath
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

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 is demand paging?

Demand paging is referred when not all of a process’s pages are in the
RAM, then the OS brings the missing(and required) pages from the disk
into the RAM.
3) What are the advantages of a multiprocessor system?
With an increased number of processors, there is a considerable increase
in throughput. It can also save more money because they can share
resources. Finally, overall reliability is increased as well.
4) What is kernel?
A kernel is the core of every operating system. It connects applications to
the actual processing of data. It also manages all communications between
software and hardware components to ensure usability and reliability.
5) What are real-time systems?
Real-time systems are used when rigid time requirements have been
placed on the operation of a processor. It has well defined and fixed time
constraints.
6) What is a virtual memory?
Virtual memory is a memory management technique for letting processes
execute outside of memory. This is very useful especially is an executing
program cannot fit in the physical memory.
7) Describe the objective of multiprogramming.
The main objective of multiprogramming is to have a process running at all
times. With this design, CPU utilization is said to be maximized.
8 ) What is time- sharing system?
In a Time-sharing system, the CPU executes multiple jobs by switching
among them, also known as multitasking. This process happens so fast
that users can interact with each program while it is running.
9) What is SMP?
SMP is a short form of Symmetric Multi-Processing. It is the most common
type of multiple-processor systems. In this system, each processor runs an
identical copy of the operating system, and these copies communicate with
one another as needed.
10) How are server systems classified?
Server systems can be classified as either computer-server systems or file
server systems. In the first case, an interface is made available for clients
to send requests to perform an action. In the second case, provisions are
available for clients to create, access and update files.
11) What is asymmetric clustering?
In asymmetric clustering, a machine is in a state known as hot standby
mode where it does nothing but to monitor the active server. That machine
takes the active server’s role should the server fails.
12) What is a thread?
A thread is a basic unit of CPU utilization. In general, a thread is composed
of a thread ID, program counter, register set, and the stack.
13) Give some benefits of multithreaded programming.
– there is increased responsiveness to the user
– resource sharing within the process
– economy
– utilization of multiprocessing architecture
14) Briefly explain FCFS.
FCFS stands for First-come, first-served. It is one type of scheduling
algorithm. In this scheme, the process that requests the CPU first is
allocated the CPU first. Implementation is managed by a FIFO queue.
15) What is RR scheduling algorithm?
RR (round-robin) scheduling algorithm is primarily aimed for time-sharing
systems. A circular queue is a setup in such a way that the CPU scheduler
goes around that queue, allocating CPU to each process for a time interval
of up to around 10 to 100 milliseconds.
16) What are necessary conditions which can lead to a deadlock situation in a
system?
Deadlock situations occur when four conditions occur simultaneously in a
system: Mutual exclusion; Hold and Wait; No preemption; and Circular wait.
17) Enumerate the different RAID levels.
RAID 0 – Non-redundant striping
RAID 1 – Mirrored Disks
RAID 2 – Memory-style error-correcting codes
RAID 3 – Bit-interleaved Parity
RAID 4 – Block-interleaved Parity
RAID 5 – Block-interleaved distributed Parity
RAID 6 – P+Q Redundancy
18) Describe Banker’s algorithm

Bankers Algorithm
Banker’s algorithm is one form of deadlock-avoidance in a system. It gets
its name from a banking system wherein the bank never allocates available
cash in such a way that it can no longer satisfy the needs of all of its
customers.
19) What factors determine whether a detection-algorithm must be utilized in
a deadlock avoidance system?
One is that it depends on how often a deadlock is likely to occur under the
implementation of this algorithm. The other has to do with how many
processes will be affected by deadlock when this algorithm is applied.
20) State the main difference between logical from physical address space.
Logical address refers to the address that is generated by the CPU. On the
other hand, physical address refers to the address that is seen by the
memory unit.
21) How does dynamic loading aid in better memory space utilization?
With dynamic loading, a routine is not loaded until it is called. This method
is especially useful when large amounts of code are needed in order to
handle infrequently occurring cases such as error routines.
22) What are overlays?
Overlays are used to enable a process to be larger than the amount of
memory allocated to it. The basic idea of this is that only instructions and
data that are needed at any given time are kept in memory.
23) What is the basic function of paging?
Paging is a memory management scheme that permits the physical
address space of a process to be noncontiguous. It avoids the considerable
problem of having to fit varied sized memory chunks onto the backing
store.
24) What is fragmentation?
Fragmentation is memory wasted. It can be internal if we are dealing with
systems that have fixed-sized allocation units, or external if we are dealing
with systems that have variable-sized allocation units.
25) How does swapping result in better memory management?
During regular intervals that are set by the operating system, processes
can be copied from main memory to a backing store, and then copied back
later. Swapping allows more operations to be run that can fit into memory
at one time.
26) Give an example of a Process State.
– New State – means a process is being created
– Running – means instructions are being executed
– Waiting – means a process is waiting for certain conditions or events to
occur
– Ready – means a process is waiting for an instruction from the main
processor
– Terminate – means a process is stopped abruptly
27) What is a socket?
A socket provides a connection between two applications. Each endpoint of
a communication is a socket.
28) What is Direct Access Method?
Direct Access method is based on a disk model of a file, such that it is
viewed as a numbered sequence of blocks or records. It allows arbitrary
blocks to be read or written. Direct access is advantageous when
accessing large amounts of information.
29) When does thrashing occur?
Thrashing refers to an instance of high paging activity. This happens when
it is spending more time paging instead of executing.
30) What is the best page size when designing an operating system?
The best paging size varies from system to system, so there is no single
best when it comes to page size. There are different factors to consider in
order to come up with a suitable page size, such as page table, paging
time, and its effect on the overall efficiency of the operating system.
31) When designing the file structure for an operating system, what attributes
are considered?
Typically, the different attributes for a file structure are naming, identifier,
supported file types, and location for the files, size, and level of protection.
32) What is root partition?
Root partition is where the operating system kernel is located. It also
contains other potentially important system files that are mounted during
boot time.
33) What are device drivers?
Device drivers provide a standard means of representing I/O devices that
maybe manufactured by different companies. This prevents conflicts
whenever such devices are incorporated in a systems unit.
34) What are the primary functions of VFS?
VFS, or Virtual File System, separate file system generic operations from
their implementation by defining a clean VFS interface. It is based on a file-
representation structure known as vnode, which contains a numerical
designator needed to support network file systems.
35) What are the different types of CPU registers in a typical operating system
design?
– Accumulators
– Index Registers
– Stack Pointer
– General Purpose Registers
36) What is the purpose of an I/O status information?
I/O status information provides information about which I/O devices are to
be allocated for a particular process. It also shows which files are opened,
and other I/O device state.
37) What is multitasking?
Multitasking is the process within an operating system that allows the user
to run several applications at the same time. However, only one application
is active at a time for user interaction, although some applications can run
“behind the scene”.
38) Explain pros and cons of a command line interface?
A command line interface allows the user to type in commands that can
immediately provide results. Many seasoned computer users are well
accustomed to using the command line because they find it quicker and
simpler.
However, the main problem with a command line interface is that users
have to be familiar with the commands, including the switches and
parameters that come with it. This is a downside for people who are not
fond of memorizing commands.
39) What is caching?
Caching is the processing of utilizing a region of fast memory for a limited
data and process. A cache memory is usually much efficient because of its
high access speed.
40) What is spooling?
Spooling is normally associated with printing. When different applications
want to send an output to the printer at the same time, spooling takes all of
these print jobs into a disk file and queues them accordingly to the printer.
41) What is an Assembler?
An assembler acts as a translator for low-level language. Assembly codes
written using mnemonic commands are translated by the Assembler into
machine language.
42) What are interrupts?
Interrupts are part of a hardware mechanism that sends a notification to the
CPU when it wants to gain access to a particular resource. An interrupt
handler receives this interrupt signal and “tells” the processor to take action
based on the interrupt request.
43) What is GUI?
GUI is short for Graphical User Interface. It provides users with an interface
wherein actions can be performed by interacting with icons and graphical
symbols. People find it easier to interact with the computer when in a GUI
especially when using the mouse. Instead of having to remember and type
commands, users click on buttons to perform a process.
44) What is preemptive multitasking?
Preemptive multitasking allows an operating system to switch between
software programs. This, in turn, allows multiple programs to run without
necessarily taking complete control over the processor and resulting in
system crashes.
45) Why partitioning and formatting is a prerequisite to installing an
operating system?
Partitioning and formatting create a preparatory environment on the drive
so that the operating system can be copied and installed properly. This
includes allocating space on the drive, designating a drive name,
determining and creating the appropriate file system and structure.
46) What is plumbing/piping?
It is the process of using the output of one program as an input to another.
For example, instead of sending the listing of a folder or drive to the main
screen, it can be piped and sent to a file, or sent to the printer to produce a
hard copy.
47) What is NOS?
NOS is short for Network Operating System. It is a specialized software
that will allow a computer to communicate with other devices over the
network, including file/folder sharing.
48) Differentiate internal commands from external commands.
Internal commands are built-in commands that are already part of the
operating system. External commands are separate file programs that are
stored in a separate folder or directory.
49) Under DOS, what command will you type when you want to list down the
files in a directory, and at the same time pause after every screen output?
a) dir /w
b) dir /p
c) dir /s
d) dir /w /p
Answer: d) dir /w /p
50) How would a file name EXAMPLEFILE.TXT appear when viewed under
the DOS command console operating in Windows 98?
The filename would appear as EXAMPL~1.TXT . The reason behind this is
that filenames under this operating system are limited to 8 characters when
working under DOS environment.
51) What is a folder in Ubuntu?
There is no concept of Folder in Ubuntu. Everything included in your
hardware is a FILE.
52) Explain why Ubuntu is safe and not affected by viruses?
• It does not support malicious e-mails and contents, and before any e-
mail is opened by users it will go through many security checks
• Ubuntu uses Linux, which is a super secure O.S system
• Unlike other O.S, countless Linux users can see the code at any time
and can fix the problem if there is any
• Malware and viruses are coded to take advantage of the weakness in
Windows
53) Explain what is Unity in Ubuntu? How can you add new entries to the
launcher?
In Ubuntu, Unity is the default graphical shell. On the left side of the
Ubuntu, it introduces the launcher and Dash to start programs.
In order to add new entries to the launcher, you can create a file name
like .desktop and then drag the file on the launcher.
54) Explain the purpose of using a libaio package in Ubuntu?
Libaio is Linux Kernel Asynchronous I/O (A/O). A/O allows even a single
application thread to overlap I/O operations with other processing, by
providing an interface for submitting one or more I/O requests in one
system call without waiting for completion. And a separate interface to
reap completed I/O operations associated with a given completion group.
55) What is the use of behavior tab in Ubuntu?
Through behaviors tab, you can make many changes on the appearance of
the desktop
• Auto-hide the launcher: You can use this option to reveal the
launcher when moving the pointer to the defined hot spot.
• Enable workspaces: By checking this option, you can enable
workspace
• Add show desktop icon to the launcher: This option is used to display
the desktop icon on the launcher
56) What is the meaning of “export” command in Ubuntu?
Export is a command in Bash shell language. When you try to set a
variable, it is visible or exported to any subprocess started from that
instance of bash. The variable will not exist in the sub-process without the
export command.
57) Explain how you can reset Unity Configuration?
To reset the unity configuration the simplest way to do is to hit open a
Terminal or hit Atl-F2 and run the command # unity –reset
58) Explain how to access Terminal?
To access terminal, you have to go under Application Menu -> Accessories -
> Terminal.

1) What is an operating system?


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.

2) What is the main purpose of an operating system?

There are two main purposes of an operating system:

o It is designed to make sure that a computer system


performs well by managing its computational activities.
o It provides an environment for the development and
execution of programs.

3) What are the different operating systems?

o Batched operating systems


o Distributed operating systems
o Timesharing operating systems
o Multi-programmed operating systems
o Real-time operating systems

4) What is a socket?

A socket is used to make connection between two applications.


Endpoints of the connection are called socket.

5) What is a real-time system?

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.

7) What is monolithic kernel?

A monolithic kernel is a kernel which includes all operating


system code is in single executable image.

8) What do you mean by a process?

An executing program is known as process. There are two types


of processes:

o Operating System Processes


o User Processes

9) What are the different states of a process?

A list of different states of process:

o New Process
o Running Process
o Waiting Process
o Ready Process
o 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.

Macro Kernel: Macro Kernel is a combination of micro and


monolithic kernel.

11) What is the concept of reentrancy?

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.

It has two key aspects:

o The program code cannot modify itself.


o The local data for each user process must be stored
separately.

12) What is the difference between process and program?

A program while running or executing is known as a process.

13) What is the use of paging in operating system?

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.

14) What is the concept of demand paging?


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.

15) What is the advantage of a multiprocessor system?

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.

16) What is virtual memory?

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.

17) What is thrashing?

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?

These are the 4 conditions:

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.

19) What is a thread?

A thread is a basic unit of CPU utilization. It consists of a thread


ID, program counter, register set and a stack.

20) What is FCFS?

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.

21) What is SMP?

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.
22) What is RAID? What are the different RAID levels?

RAID stands for Redundant Array of Independent Disks. It is used


to store the same data redundantly to improve the overall
performance.

Following are the different RAID levels:

RAID 0 - Stripped Disk Array without fault tolerance

RAID 1 - Mirroring and duplexing

RAID 2 - Memory-style error-correcting codes

RAID 3 - Bit-interleaved Parity

RAID 4 - Block-interleaved Parity

RAID 5 - Block-interleaved distributed Parity

RAID 6 - P+Q Redundancy

23) What is deadlock? Explain.

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.

24) Which are the necessary conditions to achieve a deadlock?

There are 4 necessary conditions to achieve a deadlock:

o 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.
o 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.
o 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.
o 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.

25) What is Banker's algorithm?

Banker's algorithm is used to avoid deadlock. It is the one of


deadlock-avoidance method. It is named as Banker's algorithm
on the banking system where bank never allocates available cash
in such a manner that it can no longer satisfy the requirements of
all of its customers.

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.

27) What is fragmentation?

Fragmentation is a phenomenon of memory wastage. It reduces


the capacity and performance because space is used inefficiently.
28) How many types of fragmentation occur in Operating System?

There are two types of fragmentation:

o Internal fragmentation: It is occurred when we deal with


the systems that have fixed size allocation units.
o External fragmentation: It is occurred when we deal with
systems that have variable-size allocation units.

29) What is spooling?

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.

30) What is the difference between internal commands and external


commands?

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.

31) What is semaphore?

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.

There are two types of semaphore:


o Binary semaphores
o Counting semaphores

32) What is a binary Semaphore?

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.

34) What is starvation in Operating System?

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.

35) What is aging in Operating System?

Aging is a technique used to avoid the starvation in resource


scheduling system.
36) What are the advantages of multithreaded programming?

A list of advantages of multithreaded programming:

o Enhance the responsiveness to the users.


o Resource sharing within the process.
o Economical
o Completely utilize the multiprocessing architecture.

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

38) What are overlays?

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.

39) When does trashing occur?

Thrashing specifies an instance of high paging activity. This


happens when it is spending more time paging instead of
executing.

You might also like