0% found this document useful (0 votes)
98 views4 pages

Os Interview Notes

An operating system acts as an interface between the user and computer hardware. It provides an environment to execute programs and manages hardware resources like memory, processors, devices and files. The most popular operating systems currently are Android, Windows, and iOS. A kernel is the core of the operating system that controls hardware resources and allows other programs to interface with them through system calls. There are different types of kernels like monolithic, micro, and hybrid kernels that differ in how program code and memory are organized.

Uploaded by

Amisha Singh
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
0% found this document useful (0 votes)
98 views4 pages

Os Interview Notes

An operating system acts as an interface between the user and computer hardware. It provides an environment to execute programs and manages hardware resources like memory, processors, devices and files. The most popular operating systems currently are Android, Windows, and iOS. A kernel is the core of the operating system that controls hardware resources and allows other programs to interface with them through system calls. There are different types of kernels like monolithic, micro, and hybrid kernels that differ in how program code and memory are organized.

Uploaded by

Amisha Singh
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1/ 4

1)What is an operating system? What does it do?

OS acts as an interface between the user and the computer hardware components.
It is a system software that provides an environment to execute programs.
Every computer systemneeds an os to run programs and interact with the users.
Without os, it would just be one dumb hardware machine.
MAIN FUNCTIONS OF OS ARE:
Memory management, File management, I/O management, Processor management, Device
management,Security,Networking etc.
USER--->APPLICTION --->OPERATING SYSTEM--->HARDWARE

2)What are the most popular os at present?


os has evolved to slow and expensive system to fast, powerful and affordable in the
modern world and the most popular os are:
ANDROID, WINDOWS and IOS
Android os is the worlds most used mobile os with over 41% of global market share.
It is developed by GOOGLE for smartphones and tablets
it is free and open source software.
Windows (MICROSOFT) is the second most OS which accounts for 32% of global market
share. Windows is a proprietary os that is owned by microsoft.
It currently dominates the PC's market which includes desktops and laptops.
IOS is the os for most popular smartphones known as iphones.
It is a proprietary that is developed and owned by apple.
It accounts for over 16% of market share.

3)What are the main functions of an os?


It provides an interface to the user, the user gives commands to the os and the os
in turn would instruct the hardware components to execute the commands and perform
a specific task.
It organizes processing times of the various processes.
It deals with memory management (it allocates and deallocates memory space to
programs in need of memory.
It supervises scheduling of tasks and jobs to different resources
It also deals with various files activities such as organisation of files storage,
retrival of files,naming sharing, andprotection of files.
it also maintains security of the system access rights of the user.

4)What is a Kernel? What are different types of kernel?


APPLICATION<--->KERNEL<--->CPU,Memory,Devices.
Core of os think as a program that controls all other programs.
Interface between the Hardware and software components.
Responsible for Low level tasks as disk management, memory management, process
management, etc.
A kernel is the first program that is loaded starting up a computer and remains in
the system memory until the computer is shutdown.
TYPES: Monolithic, Micro,Hybrid,Exo,Nano kernel.

5)What is the difference between Monolithic and Micro kernels?


Monolithic: User & kernel share the same memory space.
Execution of the process is faster. It is bigger in size.
Entire service fails if one service fails. When a new service is added the entire
os needs to be modified.
The Linux kernel is an example of monolithic kernel.
Micro: User & kernel services are kept in seperate address space.
It is smaller in size, Operations are slower. It is easily extendible.
Minix, Symbian etc. are examples of microkernel.

6)What are device drivers ?


Application<--->OS<--->DEVICE DRIVERS<--->Hardware
A device driver is a piece of software that allows the OS to communicate with
different hardware in the system.
It facilitates the operation of the Kernel, the kernel doesn't have to know the
working details of the hardware but can simply call the device driver of that
particular when needed its opertions.

7)What is paging?
Paging is a memory management scheme in which the data is stored and retrieved from
the secondary storage for use in the main memory.
The part of secondary storage that is used for paging is known as virtual memory.
In paging a process is divided into fixed-size contiguous block known as pages & is
stored on secondary storage.
A page is the smallest of data for the memory management used in virtual memory &
the main memory is also divided into fixed size contiguous blocks known as frames.
Pages from the secondary storage are mapped into frames in the main memory & frames
must be kept of same size as the page inorder to have maximum utilization of
memory.
This process of transferring of pages between main memory & virtual memory is
referred to as Paging in Windows OS or Swapping in Linux.

8)What is a process in an OS?


PROCESS STATES:
Start--->Ready<--->Running--->Terminated
\ /
\ /
Waiting
A process is a program in execution. For eg: when we write our program in c we save
compile and run it and the moment we run it , it is transferred to the main memory
and becomes a process
When a process executes, it passes through many different stages like
Start,Ready,Running,Waiting & terminated state.

9)What are the various attributes associated with a process?


OS maintains a Process Control Block or PCB.
PCB is nothing but a data structure that stores information about a process.
There are various attributes stored in pcb, they are:
Process Id- It is a unique identifier assigned by the OS
Process state-This represents the current state of the process such as ready,
running etc.
Priority- Each process has its own priority and the one with higher priority gets
the cpu first
Process counter-It stores the last instruction of the process when the process was
suspended, this will help the cpu to know the exact address when resuming the
process.
CPU registers-Each process has its own set of CPU registers, which are used to hold
the data during the execution of a process
List of open files-During execution there are some files that are needed by the
process that needs to be present in the main memory, OS maintains those open files
List of open devices-OS also maintains the list if all the devices that are open
during the execution of process.

10)What is a Thread?
A thread is the smallest unit of execution within a process. A process can have
multiple threads
It is a light weight process. It breaks up into smaller units that can be used
concurrently thus provides concurrency within a process.
It exists within a process and uses process resources such as code ,date and files.
Just like process it has its own attributes such as thread id ,program counter ,
register set and a stack.
Thread enhances the throughput of the system because when a process is split into
threads the function of each thread is considered as one job
& the no. of jobs done in unit time increases.
In a multiprocessing environment threads can be distributed over a series of
processes & can run in parallel on different processors

11)What is a deadlock?
A deadlock is a situation where the two processes are waiting for each other to
complete in order to start their operation.
This happens when first process is holding a resources and waiting for another
resource that is currently being held by the second process
& the second process is waiting for the resource held by the first process & this
waill cause them to wait forever and be in the state of deadlock

12)What are the necessary conditions that can lead to a deadlock situation in a
system?
There are 4 different conditions that result in deadlock and they are:
Mutual Exclution-a resource cannot be shared between two processes, only one
process can use a particular resource at a time

Hold and wait-A process is holding atleast one resource & waiting for another
resource

No Preemption- A resource cannot be taken from a process unless the process


releases the resource

Circular wait- a group of processors are waiting for each other to release the
resource and noone is releasing their own resource.

13)What is a Bankers Algorithm?


BANKERS ALGO:
Max Allocated Available
Bankers algorithm is a deadlock avoidance algorithm.
It manages resources allocation. It is also called a deadlock detection algo.
It is called Bankers algo because the banks use the same technique to allocate
money and provide loans to the customers so that they never run out of money.
It checks 3 things before allocation of resources , they are:
(1) How many maximum resources can be requested by each process.
(2) How many resources each process currently hod
(3) How many resources are currently available or not allocated to any process in
the system.

14)What is a virtual memory?


Virtual memory is the storage allocation scheme where the secondary storage such as
a hard drive can be used as a main memory by the system
It allows users to use large applications with less real RAM

15)What is demand paging ?


Demand paging is a paging technique used in virtual memory system where the pages
that are stored in the secondary storage are retrieved only when demanded by the
CPU.
It is also known as lazy swapper.

16) What is thrashing?


Thrashing is a state where the CPU spends most of its time swapping pages between
the main memory and virtual memory, rather than doing productive work such as
executing the instructions.
It occurs when the number of pages exceeds the number of frames in the memory which
leads the cpu to address too many faults in a constant state of paging.

17)What is a page fault?


A page occurs when the page referenced by the CPU is not found in the main memory
and has to be fetched from the secondary storage.
It notify the OS that it must retrieve the pages from the virtual memory in order
to continue the execution.

18)What is the difference between segmentation and paging?


Segmentation works in a similar manner as paging. It is a memory management
technique that divides the main memory into the segments of various size.
Difference:-
Paging Segmentation
-The size of a page is fixed -The size of a segment
is not fixed
-Procedures and data cannot be seperated in paging -Procedures and
data can be seperated in segmentation.
-It is faster -It is slower as
compared to paging
-the size of page is determined by the CPU & available memory -the size of
segment is determined by the user.

19)What are the different states of a process?


PROCESS STATES:
Start--->Ready<--->Running--->Terminated
\ /
\ /
Waiting
Start-when the program is picked up by the os into the main memory.
Ready-in the ready state the process is waiting for the processor to be assigned
for it to run.
Running- a process is said to be in running state when it is being executed by the
cpu.
Wait- if a process waits for a certain resource or waits for the input from the
user it is said to be in wait state and mean while the cpu picks up another
process.
Terminate-when a process finishes its execution it is said to be in termination
stage & in this state the process is removed from the main memory.

20)What is a scheduling algorithm? Name the different types of Scheduling


Algorithm?
A scheduling algorithm is an algorithm which intends to improve efficiency by
reducing the waiting time to a minimum while allocating resources to various
completing tasks.
Types:
FCFS First Come First Serve,
Priority Scheduling,
Round Robin Scheduling,
Multilevel Queue Scheduling.

You might also like