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

Gate Questions Operating Systems (1)

Uploaded by

vimalvr.sse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Gate Questions Operating Systems (1)

Uploaded by

vimalvr.sse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 50

SNO GATE QUESTIONS

1 Which of the following is NOT a valid deadlock prevention scheme?


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

2 Which of the following requires a device driver?


a) Register
b) Cache
c) Main memory
d) Disk

3 State an undesirable characteristic of each of the following criteria for measuring


performance of an operating system:
(a) Turn around time.
(b) Waiting time

4 The highest-response ratio next scheduling policy favours .............. jobs, but it also
limits the waiting time of .......... jobs.

5 Let m[0] ..m[4] be mutexes (binary semaphores) and P[0] ...P[4] be processes.
Suppose each process P[i] executes the following:
wait (m[i]); wait (m(m[(i+1) mod 4]))0;
.......
release (m[i]); release (m[(i+1) mod 4]);
This could Cause----------
a) Thrashing
b) Deadlock
c) Starvation, but not deadlock
d) None of the above

7 Which of the following CPU scheduling algorithms is non-preemptive?


a). FCFS
b). SJF
c). Round Robin
d). Priority
8 A computer handles several interrupt sources of which the following are relevant for
this question.
• Interrupt from CPU temperature sensor (raises interrupt if CPU temperature is too
high)
• Interrupt from Mouse (raises interrupt if the mouse is moved or a button is pressed)
• Interrupt from Keyboard (raises interrupt when a key is pressed or released)
• Interrupt from Hard Disk (raises interrupt when a disk read is completed)
Which one of these will be handled at the HIGHEST priority?
a). Interrupt from Hard Disk
b). Interrupt from Mouse
c). Interrupt from Keyboard
d). Interrupt from CPU temperature sensor

9 A scheduling algorithm assigns priority proportional to the waiting time of a process.


Every process starts with priority zero (the lowest priority). The scheduler re-
evaluates the process priorities every T time units and decides the next process to
schedule. Which one of the following is TRUE if the processes have no I/O
operations and all arrive at time zero?
a) This algorithm is equivalent to the first-come-first-serve algorithm.
b) This algorithm is equivalent to the round-robin algorithm.
c) This algorithm is equivalent to the shortest-job-first algorithm.
d) This algorithm is equivalent to the shortest-remaining-time-first algorithm

10 A system has 6 identical resources and N processes competing for them. Each
process can request atmost 2 resources. What value of N could lead to a deadlock?

11 Consider a system with 3 processes that share 4 instances of the same resource type.
Each process can request a maximum of K instances. Resource instances can be
requested and released only one at a time. The largest value of K that will always
avoid deadlock is ____.

12 The principle of locality justifies the use of____________


13 In a virtual memory system the address space specified by the address lines of the
CPU must be __________ than the physical memory size and _______ than the
secondary storage size.

14 Dynamic linking can cause security concerns because

a) Security is dynamic
b) The path for searching dynamic libraries is not known till runtime
c) Linking is insecure
d) Cryptographic procedures are not available for dynamic linking

15 Threads of a process share

a) global variables but not heap


b) heap but not global variables
c) neither global variables nor heap
d) both heap and global variable

16 A system shares 9 tape drives. The current allocation and maximum requirment of
tape drives for three processes are shown below:

Process Current Maximum


Allocation Requirment

P1 3 7

P2 1 6

P3 3 5
describe current state of the system indicating whether it is deadlocked or safe?

17 Consider a paging hardware with a TLB. Assume that the entire page table and all
the pages are in the physical memory. It takes 10 milliseconds to search the TLB and
80 milliseconds to access the physical memory. If the TLB hit ratio is 0.6, the
effective memory access time (in milliseconds) is _________.

18 The essential content(s) in each entry of a page table is/are


a) virtual page number.
b) page frame number.
c) both virtual page number and page frame number.
d) access right information.
19 The enter_CS() and leave_CS() functions to implement critical section of a process
are realized using test-and-set instruction as follows:
Void enter_CS(X)
{
while (test-and-set(X)) ;
}
void leave_CS(X)
{
X=0;
}
In the above solution, X is a memory location associated with the CS and is
initialized to 0. Now consider the following statements:
a). The above solution to CS problem is deadlock-free
b). The solution is starvation free.
c). The processes enter CS in FIFO order.
d). More than one process can enter CS at the same time.
Which of the above statements are TRUE?

20 In the following process state transition diagram for a uniprocessor system, assume
that there are always some processes in the ready state: Now consider the following
statements:

I. If a process makes a transition D, it would result in another process making


transition A immediately.
II. A process P2 in blocked state can make transition E while another process P 1 is in
running state.
III. The OS uses preemptive scheduling.
IV. The OS uses non-preemptive scheduling.
Which of the above statements are TRUE?
a) I and II
b) I and III
c) II and II
d) II and IV
21 Consider the methods used by processes P1 and P2 for accessing their critical
sections whenever needed, as given below. The initial values of shared Boolean
variables S1 and S2 are randomly assigned.

Method used by PI Method used by P2

while (S1 = = S2) ; while (S1 != S2) ;

Critical Section Critical section

S1 = S2; S2 = not (S1);

Which one of the following statements describes the properties achieved?

a) Mutual exclusion but not progress


b) Progress but not mutual exclusion
c) Neither mutual exclusion nor progress
d) Both mutual exclusion and progress

22 A thread is usually defined as a "light weight process" because an operating system


(OS) maintains smaller data structures for a thread than for a process. In relation to
this, which of the following is TRUE?
a) On per-thread basis, the OS maintains only CPU register state
b) The OS does not maintain a separate stack for each thread
c) On per-thread basis, the OS does not maintain virtual memory state
d) On per-thread basis, the OS maintains only scheduling and accounting
information
23 Consider the procedure below for the Producer-Consumer problem which uses
semaphores:
semaphore n = 0;
semaphore s = 1;

void producer() void consumer()


{ {
while(true) while(true)
{ {
produce(); semWait(s);
semWait(s); semWait(n);
addToBuffer(); removeFromBuffer();
semSignal(s); semSignal(s);
semSignal(n); consume();
} }
} }

Which one of the following is TRUE?

a) The producer will be able to add an item to the buffer, but the consumer can never
consume it.
b). The consumer will remove no more than one item from the buffer.
c). Deadlock occurs if the consumer succeeds in acquiring semaphore s when the
buffer is empty.
d). The starting value for the semaphore n must be 1 and not 0 for deadlock-free
operation.

24 Which one of the following is FALSE?

a). User level threads are not scheduled by the kernel.


b).When a user level thread is blocked, all other threads of its process are blocked.
c). Context switching between user level threads is faster than context switching
between kernel level threads.
d) Kernel level threads cannot share the code segment.
25 Consider the following policies for preventing deadlock in a system with mutually
exclusive resources.

1. Processes should acquire all their resources at the beginning of execution. If


any resource is not available, all resources acquired so far are released
2. The resources are numbered uniquely, and processes are allowed to request
for resources only in increasing resource numbers
3. The resources are numbered uniquely, and processes are allowed to request
for resources only in decreasing resource numbers
4. The resources are numbered uniquely. A process is allowed to request only
for a resource with resource number larger than its currently held resources

Which of the above policies can be used for preventing deadlock?

a) Any one of I and III but not II or IV


b) Any one of I, III, and IV but not II
c) Any one of II, and III but not I or IV
d) Any one of I, II, III, and IV

26 Assume that for a certain processor, a read request takes 50 nanoseconds on a cache
miss and 5 nanoseconds on a cache hit. Suppose while running a program, it was
observed that 80% of the processor’s read requests result in a cache hit. The average
read access time in nanoseconds is ______.

27 The following are some events that occur after a device controller issues an interrupt
while process L is under execution.
(P) The processor pushes the process status of L onto the control stack.
(Q) The processor finishes the execution of the current instruction.
(R) The processor executes the interrupt service routine.
(S) The processor pops the process status of L from the control stack.
(T) The processor loads the new PC value based on the interrupt.
Which one of the following is the correct order in which the events above occur ?
A) QPTRS
B) PTRSQ
C) TRPQS
D) QTPRS
28 The following C program is executed on a Unix/Linux system:
#include <unistd.h>
int main ()
{
int i ;
for (i=0; i<10; i++)
if (i%2 == 0) fork ( ) ;
return 0 ;
}
The total number of child processes created is _____.
a. 26
b. 31
c. 33
d. 28

30 Consider three concurrent processes P1, P2 and P3 as shown below, which access a
shared variable D that has been initialized to 100.

The process are executed on a uniprocessor system running a time-shared operating


system. If the minimum and maximum possible values of D after the three processes
have completed execution are X and Y respectively, then the value of Y–X is
_______.

a) 10
b) 40
c) 60
d) 80
31 Consider the following four processes with arrival times (in milliseconds) and their
length of CPU bursts (in milliseconds) as shown below:

These processes are run on a single processor using preemptive Shortest Remaining
Time First scheduling algorithm. If the average waiting time of the processes is 1
millisecond, then the value of Z is _____.
a) 2
b) 7
c) 1
d) 4

32 Consider allocation of memory to a new process. Assume that none of the existing
holes in the memory will exactly fit the process’s memory
requirement. Hence, a new hole of smaller size will be created if allocation is made
in any of the existing holes. Which one of the following statements is TRUE?
a) The hole created by worst fit is always larger than the hole created by first fit.
b) The hole created by best fit is never larger than the hole created by first fit
c) The hole created by first fit is always larger than the hole created by next fit
d) The hole created by next fit is never larger than the hole created by best fit

33 Which scheduling policy is most suitable for a time-shared operating systems?


a) Shortest job first
b) Round Robin
c) First Come First Serve
d) Elevator

34 A critical section is a program segment


a) Which should run in certain amount of time
b) Which avoids deadlock
c) Where shared resources are accessed
d) Which must be encLosed by pair of semaphore operations, P and V

35 When the result of a computation depends on the speed of the processes involved
there is said to be
a) Cycle stealing
b) Race Condition
c) A time clock
d) A deadlock
36 System calls are usually invoked by using
a) a software interrupt.
b) polling.
c) an indirect jump.
d) a privileged instruction.

37 Which of the following scheduling algorithms is non-preemptive?


a) Round Robin.
b) First-In First-Out.
c) Multilevel Queue Scheduling.
d) Multilevel Queue Scheduling with Feedback.

38 Consider the following statements with respect to user-level threads and kernel
supported threads.
(i) context switch is faster with kernel-supported threads.
(ii) for user-level threads, a system call can block the entire process.
(iii) Kernel supported threads can be scheduled independently.
(iv) User level threads are transparent to the kernel.
Which of the above statements are true?
a) (ii), (iii) and (iv) only.
b) (ii) and (iii) only.
c) (i) and (iii) only.
d) (i) and (ii) only.

39 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

40 A process executes the code


fork ();
fork ();
fork ();
The total number of child processes created is
a) 3
b) 4
c) 7
41 Where does the swap space reside?
(a) RAM
(b) Disk
(c) ROM
(d) On-chip cache

42 A thread is usually defined as a ‘light weight process’ because an operating system


(OS) maintains smaller data structures for a thread than for a process. In relation to
this, which of the followings is TRUE?
a) On per-thread basis, the OS maintains only CPU register state
b) The OS does not maintain a separate stack for each thread
c) On per-thread basis, the OS does not maintain virtual memory state
d) On per thread basis, the OS maintains only scheduling and accounting
information

43 Consider the following table of arrival time and burst time for three processes P0, P1
and P2.
Process Arrival time Burst Time
P0 0 ms 9 ms
P1 1 ms 4ms
P2 2 ms 9ms
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried
out only at arrival or completion of processes. What is the average waiting time for
the three processes?
a) 5.0 ms
b) 4.33 ms
c) 6.33 ms
d) 7.33 ms

44 Consider the 3 process, P1, P2 and P3 shown in the table The completion order of
the 3 processes under the policies FCFS and RR2 (round robin scheduling with CPU
quantum of 2 time units) are
a) FCFS: P1, P2, P3 RR2: P1, P2, P3
b) FCFS: P1, P3, P2 RR2: P1, P3, P2
c) FCFS: P1, P2, P3 RR2: P1, P3, P2
d) FCFS: P1, P3, P2 RR2: P1, P2, P
45 An operating system uses the Banker’s algorithm for deadlock avoidance when
managing the allocation of three resource types X, Y, and Z to three processes P0,
P1, and P2. The table given below presents the current system state. Here, the
Allocation matrix shows the current number of resources of each type allocated to
each process and the Max matrix shows the maximum number of resources of each
type required by each process during its execution.
There are 3 units of type X, 2 units of type Y and 2 units of type Z still
available. The system is currently in a safe state. Consider the following
independent requests for additional resources in the current state:
REQ1: P0 requests 0 units of X,
0 units of Y and 2 units of Z
REQ2: P1 requests 2 units of X,
0 units of Y and 0 units of Z
Which one of the following is TRUE?
a) Only REQ1 can be permitted
b) Only REQ2 can be permitted
c) Both REQ1 and REQ2 can be permitted
d) Neither REQ1 nor REQ2 can be permitted

46 A solution to the Dining Philosophers Problem which avoids deadlock is


a) ensure that all philosophers pick up the left fork before the right fork.
b) ensure that all philosophers pick up the right fork before the left fork.
c) ensure that one particular philosopher picks up the left fork before the right fork,
and that all other philosophers pick up the right fork before the left fork.
d) None of the above.

47 A process executes the following code for (i = 0; i < n; i + +) fork ( );


The total number of child processes created is
a) n
b) 2n – 1
c) 2n
d) 2n+1 – 1
48 Which of the following is/are shared by all the threads in a process?

I. Program counter
II. Stack
III. Address space
IV. Registers
a) I and II only
b) III only
c) IV only
d) III and IV only

49 Let 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

50 Which of the following is NOT an advantage provided by shared libraries?


a) They save disk space
b) They save space in main memory
c) Multiple versions of the same library can be loaded into main memory
d) None of the above

51 Consider the following statements about process state transitions for a system using
preemptive scheduling.
I. A running process can move to a ready state.
II. A ready process can move to a ready state.
III. A blocked process can move to a running state.
IV. A blocked process can move to ready state.
Which of the above statements are TRUE?

A. I, II, and III only


B. II and III only
C. I, II, and IV only
D. I, II, III and IV only
52
A computer has six tape drives, with n processes competing for them. Each process
may need two drives. What is the maximum value of n for the system to be deadlock
free?
(a) 6
(b) 5
(c) 4
(d) 3

53 Which conditions must be satisfied to solve a critical section problem?

a. Bounded Waiting

b. Progress

c. Mutual Exclusion

d. All of these.

54 Consider the following set of processes, assumed to have arrived at time 0. Consider
the CPU scheduling algorithms Shortest Job First (SJF) and Round Robin (RR). For
RR, assume that the processes are scheduled in the order P 1, P2, P3, P4. If the time
quantum for RR is 4 ms, then the absolute value of the difference between the
average turnaround times (in ms) of SJF and RR (round off to 2 decimal places) is
_____.

(A) 5.0
(B) 5.25
(C) 5.50
(D) 5.75
55 Consider the following processes, with the arrival time and the length of the CPU
burst given in milliseconds. The scheduling algorithm used is preemptive shortest
remaining time first. The average turn around time of these processes is
milliseconds.

(A) 8.25

(B) 10.25

(C) 6.35

(D) 4.25

56 For the processes listed in the following table, which of the following scheduling
schemes will give the lowest average turnaround time?

Process Arrival Time Processing Time


A 0 3
B 1 6
C 4 4
D 6 2
(A) First Come First Serve
(B) Non-preemptive Shortest Job First
(C) Shortest Remaining Time
(D) Round Robin with Quantum value two
57 Consider a uniprocessor system executing three tasks T1, T2 and T3, each of which
is composed of an infinite sequence of jobs (or instances) which arrive periodically
at intervals of 3, 7 and 20 milliseconds, respectively. The priority of each task is the
inverse of its period, and the available tasks are scheduled in order of priority, with
the highest priority task scheduled first. Each instance of T1, T2 and T3 requires an
execution time of 1, 2 and 4 milliseconds, respectively. Given that all tasks initially
arrive at the beginning of the 1st millisecond and task preemptions are allowed, the
first instance of T3 completes its execution at the end of _____________
milliseconds

58 Consider a non-negative counting semaphore S. The operation P(S) decrements S,


and V(S) increments S. During an execution, 20 P(S) operations and 12 V(S)
operations are issued in some order. The largest initial value of S for which at least
one P(S) operation will remain blocked is ________.

(A) 7

(B) 8

(C) 9

(D) 10
59 Each of a set of n processes executes the following code using two semaphores a
and b initialized to 1 and 0, respectively. Assume that count is a shared variable

What does the code achieve?

A. It ensures that all processes execute CODE SECTION P mutually


exclusively.
B. It ensures that at most two processes are in CODE SECTION Q at any time.
C. ensures that no process executes CODE SECTION Q before every process
has finished CODE SECTION P.
D. It ensures that at most n-1 processes are in CODE SECTION P at any time.

60 Which page replacement policy sometimes leads to more page faults when size of
memory is increased?

A.Optimal

B.LRU

C.FIFO

D.NONE OF THESE

61 In a paged segmented scheme of memory management, the segment table itself must
have a page table because:
A.The segment table is often too large to fit in one page.
B. Each segment is spread over a number of pages.
C. Segment tables point to the page table and not to the physical locations of the
segment.
D. The processor's description base register points to a page table.
62 A ROM is used to store the table for multiplication of two 8-bit unsigned integers.
The size of ROM required is
A. 256×16
B. 64K× 8
C. 4K×16
D. 64K×16

63 In a resident –OS computer, which of the following systems must reside in the main
memory under all situations?

A .Assembler

B.linker

C.loader

D.compiler

64 At a particular time of computation the value of a counting semaphore is 7. Then 20


P operations and 15 V operations were completed on this semaphore. The resulting
value of the semaphore is:

A.42

B.2

C.7

D.12
65 A counting semaphore was initialized to 10. Then 6 P (wait) operations and 4 V
(signal) operations were completed on this semaphore. The resulting value of the
semaphore

A.0

B.8

C.10

D.12

66 What type of scheduling is round-robin scheduling?

a. Linear data scheduling

b. Non-linear data scheduling

c. Preemptive scheduling

d. Non-preemptive scheduling
67 The following program consists of 3 concurrent processes and 3 binary semaphores.
The semaphores are initialized as S0=1, S1=0, S2=0.

How many times will process P0 print '0'?

A Atleast twice

B.Exactly twice

C.Exactly thrice

D.Exactly once

68 What is the single-user operating system?

A.Windows

B.MAC

C.Ms-Dos

D.None of these
69 Who provides the interface to access the services of the operating system?

A.API

B.System call

C.Library

D.Assembly instruction

70 Consider a set of n tasks with known runtimes r1,r2,.....rn, to be run on a


uniprocessor machine. Which of the following processor scheduling algorithms will
result in the maximum throughput?.

A.Round Robin

B.shortest -job- first

C.Highest-Response-Ratio-Next

D.First -Come-First-Serve

71 Which of the following system calls results in the sending of SYN packets?

A. Socket

B. Bind

C. Listen

D. Connect
72 An operating system uses Shortest Remaining Time first (SRT) process scheduling
algorithm. Consider the arrival times and execution times for the following
processes:

What is the total waiting time for process P2?

A.5

B.15

C.40

D. 55

73 Which of the following devices should get higher priority in assigning interrupts?

A Hard disk

B.printer

C keyboard

D.Floppy disk
74 Listed below are some operating system abstractions (in the left column) and the
hardware components. Which matching pairs are correct?

75
Which of the following options is correct about the windows operating
system?

a. Windows is a CUI operating system.

b. Windows is based on CUI.

c. Windows is a GUI operating system.

d. None of the these


76
The process state transition diagram in Figure is representative of

a) A batch operating system

b) An operating system with a non-preemptive scheduler

c) An operating system with a preemptive scheduler

d) A uni-programmed operating system

77
Which of the following is an example of spooled device?

a) A line printer used to print the output of number of jobs.

b) A terminal used to enter input data to a running program.

c) A secondary storage device in a virtual memory system

d) A graphic display device


78
Which of the following scheduling algorithms is preemptive
scheduling?

a. FCFS Scheduling
b. SJF Scheduling

c. Network Scheduling

d. SRTF Scheduling

79
Which of the following operating systems runs on the server?

a. Batch OS

b. Distributed OS

c. Real-time OS

d. Network OS
80
A processor needs software interrupt to

a) Test the interrupt system of the processor

b) Implement co-routines

c) Obtain system services which need execution of privileged instructions


Return from subroutine

81
Consider a set of n tasks with known runtimes r1,r2,.....rn to be run on a uniprocessor
machine. Which of the following processor scheduling algorithms will result in the
maximum throughput?

a) Round-Robin

b) Shortest -Job- First

c) Highest-Response-Ratio-Next

d) First-Come-First-Served

82
The maximum number of processes that can be in Ready state for a computer system
with n CPUs is :

a) n2

b) n

c) 2n

d) Independent of n
83
Consider an arbitrary set of CPU-bound processes with unequal CPU burst lengths
submitted at the same time to a computer system. Which one of the following
process scheduling algorithms would minimize the average waiting time in the ready
queue?

(A) Shortest remaining time first

(B) Round-robin with time quantum less than the shortest CPU burst

(C) Uniform random

(D) Highest priority first with priority proportional to CPU burst length

84
Who is responsible for keeping the process from the program?

a. Operating system

b. CPU

c. Monitor

d. All of the these

85
What is said to happen when the result of computation depends on the speed of the
processes involved?

a.A deadlock

b.A time lock

c.Cycle stealing

d.Race condition
86 Suppose a processor does not have any stack pointer register. Which of the following
statements is true?
(A) It cannot have subroutine call instruction
(B) It can have subroutine call instruction, but no nested subroutine calls
(C) Nested subroutine calls are possible, but interrupts are not
(D) All sequences of subroutine calls and also interrupts are possible

87
Which of the following mechanisms is a locking mechanism?

a. Semaphore

b. PCB

c. Mutex

d. Binary Semaphore

88
Which of the following method is used to prevent threads or processes
from accessing a single resource?

a. PCB

b. Semaphore

c. Job Scheduler

d. Non-Contiguous Memory Allocation


89
Three concurrent processes X, Y, and Z execute three different code segments that
access and update certain shared variables. Process X executes the P operation (i.e.,
wait) on semaphores a, b and c; process Y executes the P operation on semaphores b,
c and d; process Z executes the P operation on semaphores c, d, and a before entering
the respective code segments. After completing the execution of its code segment,
each process invokes the V operation (i.e., signal) on its three semaphores. All
semaphores are binary semaphores initialized to one. Which one of the following
represents a deadlock-free order of invoking the P operations by the processes?

(A) X: P(a)P(b)P(c) Y: P(b)P(c)P(d) Z: P(c)P(d)P(a)

(B) X: P(b)P(a)P(c) Y: P(b)P(c)P(d) Z: P(a)P(c)P(d)

(C) X: P(b)P(a)P(c) Y: P(c)P(b)P(d) Z: P(a)P(c)P(d)

(D) X: P(a)P(b)P(c) Y: P(c)P(b)P(d) Z: P(c)P(d)P(a)

90
A file is organized so that the ordering of data records is the same as or close to the
ordering of data entries in some index. Then that index is called

(A) Dense

(B) Sparse

(C) Clustered

(D) Unclustered
91
The following two functions P1 and P2 that share a variable B with an initial value
of 2 execute concurrently.

P1()

C = B – 1;

B = 2*C;

P2()

D = 2 * B;

B = D - 1;

The number of distinct values that B can possibly take after the execution is

(A) 3

(B) 2

(C) 5

(D) 4
92
What type of memory stores data in a swap file on a hard drive?

a. Secondary memory

b. Virtual memory

c. Low memory

d. RAM

93
The PCB is identified by ___________.

a. Real-Number

b. Binary Number

c. Store block

d. Integer Process ID

94
Which of the following statement is correct about fragmentation?

a. It is software that connects the OS.

b. It is part of the software.

c. Loss the memory

d. All of the these


95
Which of the following operating systems supports only real-time

a. Batch OS

b. Distributed OS

c. Real-time OS

d. Network OS

96
Which of the following method is used to improve the main memory
utilization?

a. Swapping

b. Operating system

c. Memory stack

d. None of these.
97
Disk Operating System (DOS) is an example of ___.

a) PC OS

b) Multi-processor OS

c) Distributed OS

d) Real-Time OS

98 Three processes arrive at time zero with CPU bursts of 16,20 and 10 10 milliseconds.
If the scheduler has prior knowledge about the length of the CPU bursts, the
minimum achievable average waiting time for these three processes in a non-
preemptive scheduler (rounded to nearest integer) is _____________ milliseconds.

99
Which of the following component does not belong to PCB (Process
Control Block)?

a. CPU registers

b. CPU scheduling information

c. Operating System information

d. Accounting information
100
Operating System is a _________ that provides an environment to help the user to
execute the programs.

101
A form of processing known as spooling is an acronym for ___.

102
A typical operating system that supports a multiprogramming environment will be
less than _________.

103
___ suggested the layered approach to lessen the design and implementation
complexities of an operating system.

104
Increasing the RAM of a computer typically improves performance because

1. Virtual memory increases


2. Larger RAMs are faster
3. Fewer fault occurs
4. 4. Fewer segmentation fault occurs

105
By using ___ techniques, an operating system can create the illusion that a process
has its own processor with its own memory.

a) CPU Scheduling

b) Virtual Memory

c) Both A and B

d) None of the above


106
Which of the following algorithms is used to avoid deadlock?

a. Dynamic Programming algorithm

b. Primality algorithms

c. Banker's algorithm

d. Deadlock algorithm

107
Which of the following scheduling reduces process flow time?

a. FCFS

b. LIFO

c. SJF

d. All of the these

108
___ is a part of UNIX OS.

a) Kernel

b) Module

c) Core

d) Software
109
In real systems CPU utilization ranges from ___ for a lightly loaded system to ___
for heavily loaded systems.

a) 40%, 90%

b) 50%, 50%

c) 90%, 40%

d) 25%, 75%

110
When a process is waiting for the CPU, we can say it is in ___ state.

a) Ready

b) New

c) Running

d) Waiting

111
If process Pi is executing in its critical section, then no other processes can be
executing in their critical-sections. This is called a ___.

a) Bounded Waiting

b) Mutual Exclusion

c) Progress

d) None of the above


112
___ is a high-level synchronization construct that is a collection of procedures,
variables and data structures grouped together.

a) Semaphores

b) Processes

c) Monitor

d) None of the above

113
A condition where at least one of the resources is non-shareable in a system is called
___.

a) Mutual Exclusion

b) Hold and Wait

c) Circular Wait

d) None of the above

114
___ algorithm is used where resources have multiple instances.

a) Resource Allocation Graph

b) Banker’s

c) Resource Request

d) None of the above


114
CPU switching from one process to another requires saving the state of the current
process and loading the latest state of the next process. This is known as a ___.

a) Program Switch

b) Context Switch

c) Process Switch

d) OS Switch

115
MAR stands for ___.

a) Memory Address Register

b) Memory Allocation Register

c) Main Address Register

d) Main Allocation Register

116
PTBR stands for ___.

a) Page Table Box Register

b) Page Table Base Register

c) Physical Table Base Register

d) Physical Table Box Register

Ans. b) Page Table Base Register


117
Segments of user programs are allocated memory by the ___.

a) FCFC Scheduler

b) FIFO Scheduler

c) Bob Scheduler

d) LIFO Scheduler

118
When a process is to be executed then only that page of the process, which needs to
be currently executed, is swapped into memory. This method is called a ___.

a) Demand Paging

b) Request Paging

c) Swap Paging

d) Change Paging

119
Which of the following programs is loaded first when starting a
computer?

a. Window desktop

b. Network connection program

c. Operating system

d. CMD
120
The operating system work between

a. User and Computer

b. Network and User

c. One user to another user

d. All of the these

121
Which of the following "semaphore" can take the non-negative integer
values?

a. Binary Semaphore

b. Counting Semaphore

c. Real Semaphore

d. All of the these

122
A CPU generates 32-bit virtual addresses. The page size is 4 KB. The processor has
a translation look-aside buffer (TLB) which can hold a total of 128 page table entries
and is 4-way set associative. The minimum size of the TLB tag is:

1. 11
2. 13
3. 15
4. 20
123
Thrashing occurs when

1. When page fault occurs


2. Processes on system frequently access pages not memory
3. Processes on system are in running state
4. Processes on system are in waiting state

124
Given that a computer system has only 3 process.1st process is single threaded, 2nd
process is two threaded and 3rd process is 4 threaded. So total how many number of
page tables will be managed by the operating system?

125
Identify Correct Statements :

A. Forked Process shares the address space and other resources with the parent.

B. Forked Processes can't use multiprocessor for parallel execution.

C. Security is better in Process in comparison to threads.

D. Thread switching doesn't require Kernel Support unlike threads

S.No CONCEPT MAPPING

Draw the concept map to illustrate the fundamental


1
concepts of Operating Systems

Explore the concept map for Operating System


2
Types

Illustrate the concept of Operating System


3
Structures and operations with a mind map
Analyze the concepts of Process Synchronization
4
using a concept map.

Draw the concept map to illustrate the Hardware


5
Concepts

Analyze the concepts of Process Management using


6
concept mapping

Illustrate CPU scheduling algorithms and


7
scheduling criteria with a mind map

Illustrate Thread concepts, Multithreading models


8
and issues with a mind map.

Analyse the concepts of Deadlock characterization


9
with a mindmap

Explore the concepts of Deadlock detection and


10
recovery using a concept map.

Draw the concept map to illustrate the Memory


11
Management Concepts

12 Explore the concepts of Storage Allocation

13 Analyse the concepts of paging using a concept map

Analyze the concept of Inter Process


`14
Communication using a mind map

Explore the concepts of system calls with a


15
mindmap
Application Oriented Questions

S.No APPLICATION ORIENTED QUESTIONS

Consider the resource allocation graph given in the figure.


(a) Find if the system is in a deadlock state.
(b) Otherwise, find a safe sequence.

A computer system uses the Banker’s Algorithm to deal with


deadlocks. Its current state is shown in the tables below, where
P0, P1, P2 are processes and R0, R1, R2 are resource types.

(a) Show that the system can be in this state.


(b) What will the system do on a request by process P0 for one
unit of resource type R1?
Consider the following heap (Figure) in which blank regions are
not in use and hatched region are in use.

The sequence of requests for blocks of size 300,25,125,50 can be


satisfied if we use.

Consider the set of processes with arrival time (in milliseconds),


CPU burst time (in milliseconds) , and priority (0 is the highest
priority) shown below. None of the processes have I/O burst
time.
Process Arrival time Burst Time Priority

P1 0 11 2

P2 5 28 0
4
P3 12 2 3

P4 2 10 1

P5 9 16 4

The average waiting time (in milliseconds) of all the processes


using preemptive priority scheduling algorithm is
_____________.

Consider six memory partitions of sizes 200 KB, 400 KB, 600
KB, 500 KB, 300 KB and 250 KB, where KB refers to kilobyte.
These partitions need to be allotted to four processes of sizes 357
5 KB, 210 KB, 468 KB and 491 KB in that order. If the best fit
algorithm is used, which partitions are NOT allotted to any
process?
A computer installation has 1000K of main memory. The jobs
arrive and finish in the following sequence.
Job 1 requiring 200k arrives
Job 2 requiring 350k arrives
Job 3 requiring 300k arrives
Job 1 finishes
6
Job 4 requiring 120k arrives
Job 5 requiring 150k arrives
Job 6 requiring 80k arrives
(a) Draw the memory allocation table using Best Fit and First
fit algorithm.
(b) Which algorithm performs better for this sequence?

An operating system uses the Banker’s algorithm for deadlock


avoidance when managing the allocation of three resource types
X, Y, and Z to three processes P0, P1, and P2. The table given
below presents the current system state. Here, the Allocation
matrix shows the current number of resources of each type
allocated to each process and the Max matrix shows the
maximum number of resources of each type required by each
process during its execution.
There are 3 units of type X, 2 units of type Y and 2 units of type
Z still available. The system is currently in a safe state. Consider
7
the following independent requests for additional resources in
the current state:

REQ1: P0 requests 0 units of X, 0 units of Y and 2 units of Z


REQ2: P1 requests 2 units of X, 0 units of Y and 0 units of Z

Operating systems have evolved from slow and expensive


systems to present-day technology where computing power has
reached exponential speeds and relatively inexpensive costs. In
8
the beginning, computers were manually loaded with program
code to control computer functions and process code related to
business logic. Analyze in detail different stages of evolution.
Describe in detail about a programmatic method in which a
9 computer program requests a service from the kernel of the OS
along with its types. Analyze it’s working with suitable diagram

Analyze the concept where a CPU has the ability to process


multiple threads concurrently. Describe its various states, types
10
and compare and contrast between Multithreading and
Multiprocessing.

Implement the concept of Dining Philosopher Problem with


11 Semaphores with appropriate diagram and code

Consider the below set of processes that arrive at time zero. The
length of the CPU burst time given in millisecond. Calculate the
average waiting time, average turnaround time using FCFS and
SJF algorithms
Processes Burst Time

12 P1 5

P2 24

P3 16

P4 10

P5 3

A deadlock happens in the operating system when two or more


processes need some resource to complete their execution that is
13
held by the other process. Discuss the four conditions for
deadlock characterization with suitable diagrams
Consider a system with five processes P 0 through P4 and three
resources of type A, B, C. Resource type A has 10 instances, B
has 5 instances and type C has 7 instances. Suppose at time t 0
following snapshot of the system has been taken:

14

Calculate the Need Matrix and give the safe sequence of the
processes.

Here is the Round Robin scheduling with Time Quantum 5ms.


Draw the Gantt chart and find the average waiting time and turn
around time
Process Burst Time
15
P1 30

P2 6

P3 8

Design an algorithm for a producer-consumer in which the


16
buffers (portions) are embedded within the lock itself.

Consider a system consisting of processes P1, P2, ..., Pn, each of


which has a unique priority number. Write a monitor that
17
allocates three identical printers to these processes, using the
priority numbers for deciding the order of allocation.
Consider the following set of processes, with the length of the
CPU burst given in milliseconds:

Process Burst Time Priority

P1 2 2

P2 1 1

P3 8 4

P4 4 2

P5 5 3
18

The processes are assumed to have arrived in the order P1, P2,
P3, P4, P5, all at time 0.
a. Draw four Gantt charts that illustrate the execution of these
processes using the following scheduling algorithms: FCFS, SJF,
non preemptive priority (a larger priority number implies a
higher priority), and RR (quantum = 2).
b. What is the turnaround time of each process for each of the
scheduling algorithms in part a?
c. What is the waiting time of each process for each of these
scheduling algorithms?
d. Which of the algorithms results in the minimum average
waiting time (over all processes)?

The following processes are being scheduled using a preemptive,


round robin scheduling algorithm. Each process is assigned a
numerical priority, with a higher number indicating a higher
relative priority. In addition to the processes listed below, the
system also has an idle task (which consumes no CPU resources
and is identified as Pidle). This task has priority 0 and is
scheduled whenever the system has no other available processes
19 to run. The length of a time quantum is 10 units. If a process is
preempted by a higher-priority process, the preempted process is
placed at the end of the queue.
a. Show the scheduling order of the processes using a Gantt
chart.
b. What is the turnaround time for each process?
c. What is the waiting time for each process?
d. What is the CPU utilization rate?
Consider the following snapshot of a system:

20

Answer the following questions using the banker’s algorithm:


a. What is the content of the matrix Need?
b. Is the system in a safe state?
c. If a request from process P1 arrives for (0,4,2,0), can the
request be granted immediately?

A motherboard is capable of handling multiple processors in a


multiprocessing operating system. Processors are also capable of
21
being used in a multiprocessing system. Describe how to
employ a multiprocessing operating system effectively.

Analyze five services provided by an operating system, and


explain how each creates convenience for users. In which cases
22
would it be impossible for user-level programs to provide these
services? Explain your answer

How could a system be designed to allow a choice of operating


23 systems from which to boot? What would the bootstrap program
need to do?

Suppose that we have free segments with sizes: 6, 17, 25, 14,
24 and 19. Place a program with size 13kB in the free segment
using first-fit, best-fit and worst fit?

Compare the memory organization schemes of contiguous


memory allocation, pure segmentation, and pure paging with
respect to the following issues:
25
a. External fragmentation
b. Internal fragmentation
c. Ability to share code across processes
Discuss the tradeoff between fairness and throughput of
26 operations in the readers–writers problem. Propose a method for
solving the readers–writers problem without causing starvation.

Analyze different approaches to inter-process communication


27 and explain the purpose of IPC in detail with appropriate
diagrams.

A control unit is the most complex part in a processor. It sends


control signals to activate the data path of a processor. Analyze
28
microprogrammed control unit organization with respect to data
path and inspect how it fetches an instruction and executes it.

Discuss how the connection of multiple computers is done via a


29
single communication channel with suitable diagram

Three processes P1, P2 and P3 arrive at time zero. Their total


execution time is 10ms, 15ms, and 20ms respectively. They
spent the first 20% of their execution time in doing I/O, next
60% in CPU processing and the last 20% again doing I/O. For
30
what percentage of time was the CPU free? Use Round robin
algorithm with time quantum 5ms.

You might also like