Professional Documents
Culture Documents
OS Interview Questions
OS Interview Questions
CONNECT
https://rsinghal26.github.io/?contact
Data tructure Algorithm Intervie Preparation Topic-ie Practice C++ Java Pthon
Intervie Quetion
operating tem i reponile for managing all the procee that are
proce tale. Inide thi tale, ever proce i lited along ith the
reource the proce i uing and the current tate of the proce.
running tate mean that the proce ha all the reource it need for
ue the proceor. Onl one proce can e in the running tate at an
given time. The remaining procee are either in a aiting tate (i.e.,
aiting for ome external event to occur uch a uer input or dik
proceor). In a real operating tem, the aiting and read tate are
implemented a queue that hold the procee in thee tate.
3. What i a Thread?
have ome of the proper tie of procee, the are ometime called
A thread ha it on program counter (PC), a regiter et, and a tack
reult, thread hare ith other thread their code ection, data ection,
preferred.
6. What i Thrahing?
replacement i ued.
Deadlock. If a thread that had alread locked a mutex, trie to lock the
mutex again, it ill enter into the aiting lit of that mutex, hich
identif ing the oner of the mutex and return it if it i alread locked
Multiple application.
Priorit cheduling.
Deadlock i a ituation hen to or more procee ait for each other
to 몭nih and none of them ever 몭nih. Conider an example hen to
train are coming toard each other on the ame track and there i onl
one track, none of the train can move once the are in front of each
to or more procee that hold ome reource and ait for reource
held other().
Vir tual memor create an illuion that each uer ha one or more
of uch vir tual addre pace are generall ver high. The idea of
vir tual memor i to ue dik pace to extend the R AM. Running
the vir tual memor into maller piece, hich can e loaded into
and data) o that the CPU ala ha one to execute. The main ojective
one jo get occupied ith IO, CPU can e aigned to other jo.
18. What i the time-haring tem?
per form man tak itche that are o frequent that the uer can
multiple thread.
FCF tand for Firt Come Firt er ve. In the FCF cheduling
algorithm, the jo that arrived 몭rt in the read queue i allocated to the
CPU and then the jo that came econd and o on. FCF i a non-
either terminate or per form I/O. Thu, if a longer jo ha een
aigned to the CPU then man hor ter jo after it ill have to ait.
fairl for each jo a time lot or quantum and interrupting the jo if it i
not completed then the jo come after the other jo hich i arrived
23. What are the necear condition hich can lead to a deadlock in
a tem?
Hold and Wait: A proce i holding at leat one reource and aiting for
Circular Wait: A et of procee are aiting for each other in circular
form.
drive that the operating tem ee a a ingle logical unit. It plaed a
Level-0
Level-1
Level-2
Level-3
Level-4
Level-5
Level-6
25. What i anker ’ algorithm?
applied.
27. tate the main di몭erence eteen logical and phical addre
pace?
Viiilit Uer can vie the logical Uer can never vie the
program.
Acce The uer can ue the logical The uer can indirectl
ue the complete program at the ame time, it ill ue onl ome par t of
it. Then overla concept a that hatever par t ou required, ou load
it and once the par t i done, then ou jut unload it, hich mean jut
pull it ack and get the ne par t ou required and run it. Formall, “ The
Procee are tored and remove from memor , hich make free
lock ince it little ize and memor hinder conitentl ta unued
paging, oth main memor and econdar memor are divided into
equal 몭xed-ize par tition. The par tition of the econdar memor
area unit and the main memor area unit are knon a page and
frame repectivel.
from the econdar memor into the main memor in the form of page.
in paging, each proce i plit into par t herever the ize of ever par t
i the ame a the page ize. The ize of the lat half could alo e ut
the page ize. The page of the proce area unit hold on ithin the
procee and the execution continue ith the nel arrived proce.
During regular inter val that are et the operating tem, procee
can e copied from the main memor to a acking tore, and then
copied ack later. apping allo more procee to e run that can 몭t
ounded-u몭er
Reader-riter
Dining philoopher
leeping arer
The direct Acce method i aed on a dik model of a 몭le, uch that it
receive data directl to or from the main memor , paing the CPU to
peed up memor operation. The proce i managed a chip knon
36. What i the et page ize hen deigning an operating tem?
The et paging ize varie from tem to tem, o there i no ingle
et hen it come to page ize. There are di몭erent factor to conider
in order to come up ith a uitale page ize, uch a page tale, paging
time, and it e몭ect on the overall e몭cienc of the operating tem.
than one tak i executed at the ame time. In thi technique, the
The cache i a maller and fater memor that tore copie of the data
data. Cache memor i ued to reduce the average time to acce data
proce. In I/O device one of the u control line i dedicated for thi
GUI i hor t for Graphical Uer Inter face. It provide uer ith an
inter face herein action can e per formed interacting ith icon
mechanim hich the output of one proce i directed into the input
a to implement.
diagnotic tet are per formed, uch a the poer-on elf-tet (POT),
tem (Keoard). Data from the output i uuall u몭ered until the
Thi i a pipe ith a peci몭c name it can e ued in procee that don’t
have a hared common proce origin. .g. i FIFO here the detail
Meage Queuing –
emaphore –
avoid race condition. Thee are integer value that are greater than or
equal to 0.
hared memor –
hared memor .
ocket –
cheduling?
In preemptive cheduling, the CPU i allocated to the procee for a
tate.
arrive in the read queue then the proce ith lo priorit ha to
ait for a long, and it ma have to tar ve. On the other hand, in the
a larger urt time then the procee ith mall urt time ma
procee to acce the CPU a the arrive into the read queue, no
that ’ h it i cot aociative it hich i not the cae ith Non-
preemptive cheduling.
removed from the proce tale. The parent proce read the exit
tatu of the child proce hich reap o몭 the child proce entr from
orphan proce.
proce doe not get the reource it need for a long time ecaue the
aging factor mut increae the priorit of the requet a time pae
and mut enure that a requet ill eventuall e the highet priorit
requet
eteen application and hardare, ut uer er vice and kernel
er vice are implemented under the ame addre pace. It increae
the ize of the kernel, thu increae the ize of an operating tem a
ell. Thi kernel provide CPU cheduling, memor management, 몭le
call. A oth er vice are implemented under the ame addre pace,
itching of CPU to another proce mean aving the tate of the old
proce and loading the aved tate for the ne proce. In Context
the ne proce, o that the old proce can e reumed from the ame
55. What i the di몭erence eteen the Operating tem and kernel?
tem.
management.
tem to run.
Ditriuted O.
It i the 몭rt program to load hen It i the 몭rt program to load hen
.NOProce Thread
i in execution. proce.
then it ill not a몭ect the could not run, hile one er ver
7. The proce ha it on Thread ha Parent’ PC, it on
Proce Control lock, tack Thread Control lock and tack and
the proce control lock (PC) i a lock that i ued to track the
information aout the proce, i.e. regiter, quantum, priorit, etc. The
ithout inter fering ith the CPU. It i imilar to direct memor acce
inter vention.
main memor .
6. The program doe not have an The proce ha it on control
lock.
62.What i a dipatcher?
The dipatcher i the module that give proce control over the CPU
after it ha een elected the hor t-term cheduler. Thi function
itching context
program
CPU.
Max throughput [Numer of procee that complete their execution
When more than one procee acce the ame code egment that
Mutexe
Condition variale
emaphore
File lock
thread?
uer. O.
thread.
hardare uppor t.
If one uer-level thread per form If one kernel thread per form a the
An entire application ill not lock or other ie ait, pending the
client don’t lock other requet for er vice. The overall throughput
ithin an application
69.Di몭erence eteen Multithreading and Multitaking?
procee.
The programmer ha to keep track of all call to ait and to ignal
the emaphore.
i called Deadlock.
oftare olution
Hardare olution
emaphore
mechanim.
Non-atomic –
locking –
locked for a long period of time aiting for input from a terminal. If
e ver undeirale.
tar vation –
Deadlock –
It occur hen to procee are locked and hence neither can
proceed to execute
code.
uing R AG.
Proce termination
Aor t all the deadlock procee
Reource preemption
Rollack
electing a victim
Relocation
Protection
haring
Logical organization
Phical organization
3. Viiilit The uer can vie the The uer can never vie
4. Acce The uer ue the logical The uer can not directl
phical addre.
pace.
Dnamicall created lit iner tion and deletion can e done ver
When ou ant ou to ue the concept of tructure and linked lit in
to proce.
memor .
lock. egmentation.
fragmentation.
memor or dik.
Advantage
earch tree or an other tale lookup tructure. For thi reaon, the
are idel ued in man kind of computer oftare, par ticularl for
Diadvantage
Hah tale ecome quite ine몭cient hen there are man colliion.
Hah tale doe not allo null value, like a hah map.
hardare. uer.
comparion of
.NO Paging egmentation
egmentation.
page.
uer.
content. addre.
repeatedl.
5 It aic characteritic i it logic It aic characteritic i it fat
The per formance of vir tual memor of a vir tual memor management
몭ective acce time = (1-p) x Memor acce time + p x page fault time
torage.
Operation on 몭le:
Create
Open
Read
Write
Rename
Delete
Append
Truncate
Cloe
correpond to a dik lock. The it can take to value: 0 and 1: 0
FAT tand for File Allocation Tale and thi i called o ecaue it
allocate di몭erent 몭le and folder uing tale. Thi a originall
deigned to handle mall 몭le tem and dik. A 몭le allocation tale
ector of the dik to rotate into a poition o that it can acce the
eek Time : eek time i the time taken to locate the dik arm to a