Вы находитесь на странице: 1из 73

OPERATING SYSTEM

QUIZ
Q1
A process executes the code
fork();
fork();
fork();
The total number of child processes
created is
A)3 B)4 C)7 D)8
Answer
7
Q2
The time taken to switch between
user and kernel modes of execution
be t1 while the time taken to switch
between two processes be t2. Which
of the following is TRUE?
(A) t1 > t2
(B) t1 = t2
(C) t1 < t2
(D) nothing can be said about the
relation between t1 and t2
Answer
t1 < t2

Process switching involves mode


switch. Context switching can occur
only in kernel mode.
Q3
The following program consists of 3
concurrent processes and 3 binary
semaphores.The semaphores are
initialized as S0 = 1, S1 = 0, S2 = 0.

times will process P0 print '0'?


Q3
How many times will process P0 print
0?
(A) At least twice
(B) Exactly twice
(C) Exactly thrice
(D) Exactly once
Answer
At least twice

P0 first prints 0 then, after releasing


S1 and S2, either P1 or P2 will
execute and release S0. So 0 is
printed again.
Q4
Which of the following need not
necessarily be saved on a context
switch between processes?
(a) General purpose registers
(b) Translation look-aside buffer
(c) Program counter
(d) All of the above
Answer
Translation look-aside buffer
Q5
A process executes the following
code
for (i = 0; I
The total number of child processes
created is
(A) n
(B) 2^n 1
(C) 2^n
(D) 2^(n+1) 1; < n; i++) fork();
Answer
2^n 1
Q6
Which of the following does not
interrupt a running process?
(a) A device
(b) Timer
(c) Scheduler process
(d) Power failure
Answer
Scheduler process

Scheduler process doesnt interrupt


any process, its Job is to select the
processes
Q7
Consider three processes (process id 0, 1, 2
respectively) with compute time bursts 2, 4 and 8
time units. All processes arrive at time zero.
Consider the longest remaining time first (LRTF)
scheduling algorithm. In LRTF ties are broken by
giving priority to the process with the lowest
process id. The average turn around time is:
(A) 13 units
(B) 14 units
(C) 15 units
(D) 16 units
Answer
13 units
Q8
Consider three CPU-intensive processes, which
require 10, 20 and 30 time units and arrive at
times 0, 2 and 6, respectively. How many context
switches are needed if the operating system
implements a shortest remaining time first
scheduling algorithm? Do not count the context
switches at time zero and at the end.
(A) 1
(B) 2
(C) 3
(D) 4
Answer
2

P0 to P1 and P1 to P2.
Q9
Which of the following process
scheduling algorithm may lead to
starvation
(A) FIFO
(B) Round Robin
(C) Shortest Job Next
(D) None of the above
Answer
Shortest Job Next
Q 10
If the quantum time of round robin
algorithm is very large, then it is
equivalent to:
(A) First in first out
(B) Shortest Job Next
(C) Lottery scheduling
(D) None of the above
Answer
First in first out
Q 11
Which of the following statements are true?
I. Shortest remaining time first scheduling may
cause starvation
II. Preemptive scheduling may cause starvation
III. Round robin is better than FCFS in terms of
response time

(A) I only
(B) I and III only
(C) II and III only
(D) I, II and III
Answer
I, II and III
Q 12
The maximum number of processes
that can be in Ready state for a
computer system with n CPUs is
(A) n
(B) n2
(C) 2n
(D) Independent of n
Answer
Independent of n
Q 13
Which of the following is NOT a valid deadlock
prevention scheme? (GATE CS 2000)
(A) Release all resources before requesting a new
resource
(B) Number the resources uniquely and never
request a lower numbered resource than the last
one requested.
(C) Never request a resource after releasing any
resource
(D) Request and all required resources be
allocated before execution.
Answer
Never request a resource after
releasing any resource
Q 14
Which of the following page
replacement algorithms suffers from
Beladys anomaly?
(A) FIFO
(B) LRU
(C) Optimal Page Replacement
(D) Both LRU and FIFO
Answer
FIFO
Q 15
What is the swap space in the disk
used for?
(A) Saving temporary html pages
(B) Saving process data
(C) Storing the super-block
(D) Storing device drivers
Answer
Saving process data
Q 16
Increasing the RAM of a computer
typically improves performance
because:
(A) Virtual memory increases
(B) Larger RAMs are faster
(C) Fewer page faults occur
(D) Fewer segmentation faults occur
Answer
Fewer page faults occur
Q 17
Page fault occurs when
(A) When a requested page is in
memory
(B) When a requested page is not in
memory
(C) When a page is currupted
(D) When an exception is thrown
Answer
When a requested page is not in
memory
Q 18
Thrashing occurs when
(A) When a page fault occurs
(B) Processes on system frequently
access pages
(C) Processes on system are in
running state
(D) Processes on system are in
waiting state
Answer
Processes on system frequently
access pages
Q 19
Which of the following is major part of
time taken when accessing data on
the disk?
(A) Settle time
(B) Rotational latency
(C) Seek time
(D) Waiting time
Answer
Seek time
Q 20
Before proceeding with its execution,
each process must acquire all the
resources it needs is called
A. pre-emption.
B. circular wait.
C. hold and wait
D. deadlock.
Answer
hold and wait
Q 21
Which of these is a technique of
improving the priority of process
waiting in Queue for CPU allocation
A. Starvation
B. Relocation
C. Promotion
D. Ageing
Answer
Ageing
Q 22
A scheduler which selects processes
from Primary memory is called
A. Long Term Scheduler
B. Medium Term Scheduler
C. Short Term Scheduler
D. Job Scheduler
Answer
Short Term Scheduler
Q 23
Which of the following approaches
require knowledge of the system
state?
A. deadlock detection.
B. deadlock prevention.
C. deadlock avoidance.
D. all of the above.
Answer
all of the above
Q 23
Which scheduling policy is used for a
batch processing operating system
A. Shortest-job First.
B. Round-Robin.
C. Priority Based
D. First-Come-First-Serve.
Answer
First-Come-First-Serve
Q 24
A critical section is a program
segment
A. which is having a higher priority.
B. where shared resources are
accessed.
C. which forces deadlocks.
D. where code is shared by
programs.
Answer
where shared resources are
accessed.
Q 25
Which operating system
implementation has to focus on the
issue of Good response time
A. Batch Processing
B. Multiprogramming
C. Distributed
D. Time sharing
Answer
Time sharing
Q 26
Which of the following memory
allocation scheme suffers from
external fragmentation ?
A. Segmentation
B. Pure demand paging
C. Swapping
D. Paging
Answer
Segmentation
Q 27
Resources are allocated to the
process on non-sharable basis is
A. mutual exclusion
B. hold and wait
C. no pre-emption
D. circular wait
Answer
mutual exclusion
Q 28
What is the ready state of a process?
a) when process is scheduled to run
after some execution
b) when process is unable to run until
some task has been completed
c) when process is using the CPU
d) none of the mentioned
Answer
when process is scheduled to run
after some execution
Q 29
The Hardware mechanism that
enables a device to notify the CPU is
called __________.
1 Polling
2 Interrupt
3 System Call
4 None of the above
Answer
Interrupt
Q 30
Which directory implementation is
used in most Operating System?
1 Single level directory structure
2 Two level directory structure
3 Tree directory structure
4 Acyclic directory structure
Answer
Tree directory structure
Q 31
When two or more processes attempt
to access the same resource a
_________ occurs.
1 Critical section
2 Fight
3 Communication problem
4 Race condition
Answer
Race condition
Q 32
Which scheduler controls the degree
of multiprogramming?
1 Short term scheduler
2 Long term scheduler
3 Middle term scheduler
4 None of the above
Answer
Long term scheduler
Q 33
Give an example which was software
sometime back and is now
considered as a part of hardware?
Answer
Firewall
BIOS
Q 34
Name some devices which are both
input and output?
Answer
Modem
Touchscreen
CD/DVD
Thank You

Вам также может понравиться