Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

OS Question Bank

Download as pdf or txt
Download as pdf or txt
You are on page 1of 62

QUESTION BANK

1. In terms of resource utilization, what advantage does a bounded operating system


offer over an unbounded operating system?

a. Bounded operating systems offer better resource utilization by dynamically allocating


resources based on demand.

b. Bounded operating systems consume fewer system resources because they do not
need to support dynamic expansion.

c. Unbounded operating systems utilize system resources more efficiently due to their
fixed feature set.

d. Bounded operating systems are less flexible in resource management compared to


unbounded operating systems.

2. Which section of a process contains the program code?

a. Data Section

b. Stack

c. Heap

d. Text Section

3. What information is typically stored in a Process Control Block (PCB)?

a. Program Code

b. CPU Scheduling Information

c. Memory Management Information

d. Accounting Information

4. The one program running at all times on the computer is:

a. Operating System

b. Kernel

c. Central Processing Unit

d. Firmware
5. The process of exchanging information, on the same computer or between
computers over a network is known as:

a. Communication

b. System Calls

c. Networking

d. I/O operations

6. What is the primary goal of the dispatcher module?

a. To switch the CPU to another process

b. To manage the ready queue

c. To allocate memory to processes

d. To manage I/O devices

7. Which of the scheduling algorithm uses quantum time:

a. First-Come, First-Served (FCFS) Scheduling

b. Round Robin (RR) Scheduling

c. Shortest-Job-First (SJF) Scheduling

d. Priority Scheduling

8. Which of the following statements accurately describes the purpose of using a


mutex lock in concurrent programming?

a. Mutex locks are used to maximize parallelism by allowing multiple threads to access
critical regions simultaneously.

b. Mutex locks are employed to introduce delays in accessing critical regions, ensuring fair
resource allocation among threads.

c. Mutex locks are utilized to protect critical regions and prevent race conditions by
allowing only one thread at a time to access them.

d. Mutex locks are primarily used to terminate threads that attempt to access critical
regions concurrently.

9. What happens when a user program makes a system call?


a. The program continues to run concurrently with the kernel.

b. Control is transferred to the kernel, which handles the request.

c. The system call is automatically denied due to security restrictions.

d. The program terminates and the operating system takes over.

10. In which scheduling algorithm does the process with the shortest next CPU burst
time get selected?

a. First-Come, First-Served (FCFS) Scheduling

b. Round Robin (RR) Scheduling

c. Priority Scheduling

d. Shortest-Job-First (SJF) Scheduling

11. What are the Non preemptive processes?

a. If high priority process arrives, low priority process may starve

b. The resources are allocated to a process for a limited time

c. Process cannot be interrupted till it terminates or switches to waiting state

d. It relies on processes to release the CPU voluntarily

12. Correct formulae for Turnaround Time:

a. Burst time + Waiting time.

b. Arrival time + Burst time

c. Waiting time + Arrival time

d. Completion time - Arrival time

13. Select the 2 correct arrangements of layers:

a. Hardware layer - Kernel layer - Libraries layer - User layer

b. User layer - Kernel layer - System Call Inference layer - Hardware layer

c. Hardware layer - System Call Inference layer - Libraries layer - User Interface layer

d. User layer - Libraries layer - Kernel layer - System Call Inference layer

14. Which statements accurately describe APIs in the context of operating systems?

a. APIs never include libraries or frameworks that wrap system calls


b. APIs act as an intermediary layer between user-level applications and system calls.

c. APIs do not provide a higher-level abstraction for accessing OS features and services.

d. APIs define the syntax, semantics, and behavior of functions and data structures that
applications can use to interact with the OS.

15. What is the primary role of an operating system?

a. To provide hardware to the user

b. To manage all resources

c. To control user interactions

d. To act as an interface between the user and the computer hardware

16. What are the true statements about a bootstrap program?

a. A program that initializes the hardware components of a computer system

b. A program responsible for loading the initial instructions of the operating system into
memory and starting its execution

c. A program that manages the allocation of system resources to various processes

d. The bootstrap program is typically stored in firmware, such as ROM or EEPROM.

17. Which of the following describes system calls?

a. Low-level programming language constructs

b. A way for applications to request services or resources from the operating system

c. Interfaces for interaction between applications and the operating system kernel

d. Interfaces for interaction between applications and hardware

18. Which of the following are NOT typical steps in operating system debugging?

a. Skip testing and validation

b. Analyzing system state

c. Ignoring user reports

d. Using debugging tools

19. Which of the following are Windows commands?

a. CreateFile()
b. read()

c. write()

d. Sleep()

20. CPU Bursts are measured in:

a. Seconds

b. Milliseconds

c. Microseconds

d. Nanoseconds

21. Round Robin Preemptive (with arrival time) Qt=2ms


Ans. B

22. Priority Scheduling: With Arrival time - Consider Higher time

Ans. D
23. SJF: Without Arrival Time

Ans. A

24. FCFS: Without Arrival Time


Ans. A

Which of the following statement is incorrect


i) If the time slice used in round robin is more than the maximum time required to execute
any process. Then the policy will work similar to FCFS.
ii) Processes access shared data at the same time it can cause data inconsistency.
iii) The portion of program text where the shared variables or the shared resources will be
placed is called PCB.
iv) The final output of any variable depends on the execution sequence of processes this
type of condition is called progress.

Options:
a) I and II
b) II and III
c) III and IV
d) IV and I
Answer:C

In which of the following process states, a process exists in main memory.


a)Running State, Suspended wait, Ready State
b)New State, Ready, Running State
c)New State, Suspended Ready, Running State
d)Ready State, Running State, I/O wait State

Answer: D

Which of the following given mechanisms provide mutual exclusion


a) Lock Variable and Decker Algorithm
b) Lock variable and peterson’s algorithm
c) Peterson’s algorithm and Decker Algorithm
d) None of these

Answer: C

In which of the following process states, a process exists in main memory.


a)Running State, Suspended wait, Ready State
b)New State, Ready, Running State
c)New State, Suspended Ready, Running State
d)Ready State, Running State, I/O wait State

Answer: D

Which of the following given mechanisms provide mutual exclusion


a) Lock Variable and Decker Algorithm
b) Lock variable and peterson’s algorithm
c) Peterson’s algorithm and Decker Algorithm
d) None of these

Answer: C

Which of the following we don’t want to achieve through process synchronization


a) Mutual Exclusion
b) Progress
c) Race Condition
d) Bounded Waiting
Answer: C
Which of the following statement must be incorrect about the below given operating system

a) The operating system does not support pre-emptive scheduling


b) Operating system supports pre-emptive scheduling
c) It is a multi-programmed operating system
d) It is a multiuser operating system

Answer:b
In a single processor system which scheduling algorithm results the maximum throughput
a) Shortest Job First
b) Round Robin
c) Longest Job First
d) Highest Response First
Answer: a
Which one of the following is not the goal of the CPU scheduling algorithm
a) Maximizing the burst time
b) Minimizing the response time
C) Minimizing the average waiting time
d) Minimizing the turn-around time
Answer: a

Which of the following statement are true?


I) Shortest remaining time first scheduling may cause starvation
II) Pre-emptive 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 and II and III
Answer: d

In which situation a currently running process always moves from running to ready state
i) When a higher priority process enters into the ready state
ii) When the running process demands an Input/Output operation
iii) When a new process arrives in the ready state
iv) When the running process gets suspended
v) When a block process resumes to ready state
vi) When time quanta of the running process expires

Options:
a) I and V
b) II and III
c) I and VI
d) III and V
e) III,IV,V and VI
Answer: c

Three processes A,B and C each execute a loop of 50 iterations. In each iteration of the loop,
a process performs a single computation that requires tc CPU milliseconds and then initiates a single
I/O operation that lasts for tio milliseconds. It is assumed that the computer where the processes
execute has sufficient number of I/O devices and the OS of the computer assigns different I/O
devices to each process. Also the scheduling overhead of the OS is negligible. The processes have
the following characteristics
Process ID Arrival Time tc tio
P1 0 100ms 450ms
P2 5 350ms 450ms
P3 10 200ms 250ms

The system is using round robin CPU scheduling with time quanta of 50ms. The time in milliseconds
at which the process C would complete its first I/O operation is
a) 750ms
b) 1000ms
c) 500ms
d) 1250ms
Answer :a
Consider the peterson’s algorithm for mutual exclusion between two concurrent processes K and L.
The program executed by process is shown below.
While(True)
{
Interested[k]=true;
Turn =L
While(X);
Enter critical section,
Perform action
Exit critical section
Interested[k]=False
}

For the program to guarantee mutual exclusion the predicate X in the while loop should be
a) Interested[L]==True and Turn ==L
b) Interested[L]!=True and Turn ==L
c) Interested[k]==True and Turn ==k
d) Interested[k]==True and Turn ==L

Answer:a

Consider three processes P0,P1 and P2, all arriving at time zero, with total execution time of
10,20 and 30 units respectively. Each process spends the first 20% of execution time doing I/O, the
next 70% of time doing computation and the last 10% of time doing I/O again. The operating
system uses a shortest remaining compute time first scheduling algorithm and schedules a new
process either when the running process get blocked on I/O or when the running process finishes
its compute burst . Assume that all I/O operation can be overlapped as much as possible. For how
much time the processes have waited for the processor?
a) P0:0, P1:7,P2:15
b) P0:0, P1:5,P2:17
c) P0:2,P1:5,P2:15
d) P0:2,P1:7,P2:17
Answer: b

If the time quanta used in the round robin scheduling policy is more than the maximum time required
to execute any process, then the policy will be
a) The policy will become first come first serve
b) The policy will become priority scheduling
c) The policy will become shortest come first
d) The policy will become shortest remaining first
Answer : a
In a computer system having single processor, has two processes, both are having alternate 10ms
CPU bursts with 90ms I/O bursts. Both the processes are created nearly at the same time. The input
output operation of both processes can proceed in parallel. Which one of the following scheduling
strategies will result in the least CPU utilization (over a long period of time)
a) First come first serve
b) Static priority scheduling with different priorities for the two processes
c) Round Robin with time quanta of 10ms
d) Round robin with time quanta of 5 ms
Answer: d
Each process Pi =1…….13 is coded as follows
While(True)
{
P(mutex)
{critical section}
V(mutex)
}
The code for P14 is identical except that it uses V(mutex) in place of P(mutex). What is the largest
number of processes that can be inside the critical section at any moment.

a) 2
b) 14
c) 1
d) 7
Answer:b

At a particular time of computation the value of a counting semaphore is 9.Then 15 P


operations and 12 V operations were completed on this semaphore. The resulting value of the
semaphore is
a)12
b)3
C)6
D)2
Answer:C
Consider the following set of processes, with the arrival times and the CPU burst times given in
milliseconds

Process Arrival Time Burst Time


P1 0 6
P2 1 3
P3 2 3
P4 4 2
What is the average turnaround time for these processes with the pre-emptive shortest remaining
processing time first (SRPT)
a) 5.50
b) 6.50
c) 6.25
d) 5.75
Answer:b

Consider ‘m’ processes sharing the CPU in a round robin fashion. Assuming that each process switch
takes ‘k’ seconds , what must be the quantum size Q such that overhead resulting from process
switching is minimized but at the same time each process is guaranteed to get its turn at the CPU at
least every ‘h’ seconds? (4 Marks)
a) Q≥(h-mk/m-1)
b) Q≤ (h-mk/m-1)
c) Q≤(k-mh/m+1)
d) Q≥(k-mh/m+1)
Answer: b

Consider three processes, all arriving at time zero, with total execution time of 10,20 and 30 units
respectively. Each process spends the first 30% of execution time doing I/O, the next 60% of time
doing computation and the last 10% of time doing I/O again. The operating system uses a shortest
remaining compute time first scheduling algorithm and schedules a new process either when the
running process get blocked on I/O or when the running process finishes its compute burst .
Assume that all I/O operation can be overlapped as much as possible. For what percentage of time
does the CPU remain Idle.
a) 10.64%
b)14.28%
c)89.42%
d)23.07%
Answer : b

Consider the following table of arrival time and burst time for three processes P0,P1 and P2
Process Arrival Time Burst Time
P1 0 9ms
P2 1 4ms
P3 3 5ms

The round robin scheduling algorithm is used with time quanta of 2 ms. What will be the average
turnaround time of the processes.
a)11.5 ms
b)12.4 ms
c)15.3 ms
d)13.6 ms
Answer : d

Consider 3 processes A, B and C to be scheduled as per the SRTF algorithm. The processes ‘A’ is
known to be scheduled first and when ‘A’ has been running for 7 units of time, the process C has
arrived . The process ‘C’ has run for 1 unit of time the process B has arrived and completed running
in 2 units of time. Then what could be the minimum burst time of the processes A and C.
a) 11 and 4
b) 11 and 3
c)12 and 4
d) 10 and 3
Answer: c
Consider the below given table and find out the average waiting time of the processes if highest
response ration algorithm is applied for CPU scheduling.

Options:
a)5.4 ms
b)4.6 ms
c)5.2 ms
d)4.8 ms
Answer :d
In a timeshare operating system, when the time slot assigned to a process is completed, the process
switches from the current state to?
a) Suspended state
b) Terminated state
c) Ready state
d) Blocked state
ANS: C
In real time operating system ____________
a) Process scheduling can be done only once
b) All processes have the same priority
c) Kernel is not required
d) A task must be serviced by its deadline period

ANS: D

Out of the following, which one needs a device driver


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

ANS: B

Which of the following is the feature of the operating system


a) Error detection aids
b) Control over system performance
c) Job Accounting
d) Coordination between other software and users
e) All
ANS: E
What is a bootstrap program
a) It is the first code that is executed when the computer system is started
b) It is the program that helps in restarting the system
c) It is just a simple program like we have other programs in a system
d) None of these
ANS: A

The address of the next instruction to be executed by the current process is provided by the
__________

a) CPU registers
b) Program counter
c) Process stack
d) Pipe
ANS: B

If the semaphore value is negative ____________

a) Its magnitude is the number of processes waiting on that semaphore


b) It is invalid
c) No operation can be further performed on it until the signal operation is performed on it
d) none of the mentioned
ANS: A

The code that changes the value of the semaphore is ____________


a) Remainder section code
b) Non – critical section code
c) Critical section code
d) None of the mentioned
ANS: C

Which state of a process defined "The process is waiting for some event to occur (such as an I/O
completion or reception of a signal)"
a) Ready
b) Running
c) Waiting
d) Terminated

ANS: C
To access the services of the operating system, the interface is provided by the ___________
a) Library
b) System calls
c) Assembly instructions
d) API

ANS: B
Which of the following state transitions is not possible?
a) Blocked to running
b) Ready to running
c) Blocked to ready
d) Running to blocked
ANS: A
Which of the following scheduling algorithms is used in real-time systems to ensure that critical tasks
meet their deadlines?
a) First-Come, First-Served (FCFS)
b) Shortest Job Next (SJN)
c) Round Robin (RR)
d) Rate-Monotonic Scheduling (RMS)
Ans: A

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
ANS: D

Consider the following set of processes, the length of the CPU burst time given in milliseconds.
Process Burst time
P1 6
P2 8
P3 7
P4 3
Assuming the above process being scheduled with the SJF scheduling algorithm.
a) The waiting time for process P1 is 0ms
b) The waiting time for process P1 is 3ms
c) The waiting time for process P1 is 9ms
d) The waiting time for process P1 is 16ms

ANS: B
Once the process is allocated the CPU and is executing, which of several events could occur:
I. The process could issue an I/O request and then be placed in an I/O queue
II. The process could create a new child process and wait for the child’s termination.
III. The process could be removed forcibly from the CPU, as a result of an interrupt, and be put back
in the ready queue.
a) Only 1
b) 1 and 2
c) 1, 2,3
d) 2 and 3
ANS:C
Which of the following state transitions is not possible?
a) Blocked to running
b) Ready to running
c) Blocked to ready
d) Running to blocked
ANS: A
Which of the following scheduling algorithms is used in real-time systems to ensure that critical tasks
meet their deadlines?
a) First-Come, First-Served (FCFS)
b) Shortest Job Next (SJN)
c) Round Robin (RR)
d) Rate-Monotonic Scheduling (RMS)
Ans: A

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
ANS: D

Consider the following set of processes, the length of the CPU burst time given in milliseconds.
Process Burst time
P1 6
P2 8
P3 7
P4 3
Assuming the above process being scheduled with the SJF scheduling algorithm.
a) The waiting time for process P1 is 0ms
b) The waiting time for process P1 is 3ms
c) The waiting time for process P1 is 9ms
d) The waiting time for process P1 is 16ms

ANS: B

With _____________ only one process can execute at a time; meanwhile all
other process is waiting for the processor. With ______________ more than
one process can be running simultaneously each on a different processor.
a) Multiprocessing, Multiprogramming
b) Multiprogramming, Uni-processing
c) Multiprogramming, Multiprocessing
d) Uni-programming, Multiprocessing
ANS: D

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


system 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 operating system maintains only CPU register
state
b) The OS does not maintain a separate stack for each thread.
c) On pre-thread basis, the operating system does not maintain virtual
memory system.
d) On per thread basis, the operating system maintains only scheduling
and accounting information
ANS: D

What is the main function of the command interpreter


a) To provide the interface between the API and application program
b) To handle the files in the operating system
c) To get and execute the next user-specified command
d) None of the mentioned
ANS: C
Under non-pre-emptive scheduling, once the CPU has been allocated to a
process, the process keeps the CPU until.
1. It releases the CPU by terminating
2. It releases the CPU by switching to the waiting state
3. It releases the CPU By switching to the ready state
4. It releases the CPU By switching to the Running state
a) 1 and 2
b) 1,2,3
c) 2,3,4
d) 1,2,3,4

ANS: A

In the context of synchronization, what does a "critical section" refer to?

a) A section of code that is critical for the proper functioning of the program
b) A section of code that must be executed atomically by only one process
or thread at a time
c) A section of code that handles error conditions
d) A section of code that performs I/O operations
ANS: B
Consider the set of 6 processes whose arrival time and burst time are given
below:
Process Id Arrival time Burst time
P1 0 7
P2 1 5
P3 2 3
P4 3 1
P5 4 2
P6 5 1
If the CPU scheduling policy is the shortest remaining time first, the average
turnaround time will be………….
a) 7.17
b) 6.17
c) 8.27
d) 5.67

ANS: A

Consider the set of 6 processes whose arrival time and burst time are given
below:
Process Id Arrival time Burst time
P1 5 5
P2 4 6
P3 3 7
P4 1 9
P5 2 2
P6 6 3
If the CPU scheduling policy is Round Robin with time quantum = 3, the
average waiting time is equal to ………..
a) 17
b) 14
c) 15
d) 16

ANS: D
Consider the set of 3 processes whose arrival time and burst time are given
below

If the CPU scheduling policy is SRTF, the average waiting time and average
turnaround time is calculated as
a) 12.33, 10
b) 11.22, 6
c) 12.33, 5
d) 11.22, 10

ANS: C
For process P1, P2, P3, P4, P5 How many time the following function print
“Semaphore”. If Semaphore is initialized by 0?

Do
{
wait (S);
{
While(s<=0);
{
s=s-1;
Print (“Semaphore”);
}
signal(s);
{
s=s+1;
}
}

a) None
b) 2
c) 3
d) 1

Ans: A
What is the mean of the Booting in the operating system?
a) Restarting computer
b) Install the program
c) To scan
d) To turn off
Ans. a

In Operating Systems, which of the following is not a CPU scheduling


algorithm?
a) Priority
b) Round Robin
c) Shortest Job First
d) Bankers Algorithm
Ans. d

To access the services of the operating system, the interface is provided by


the ___________
a) Library
b) System calls
c) Assembly instructions
d) API
Ans. b

In a timeshare operating system, when the time slot assigned to a process is


completed, the process switches from the current state to?
a) Suspended state
b) Terminated state
c) Ready state
d) Blocked state
Ans. c

Which one of the following errors will be handle by the operating system?
a) lack of paper in printer
b) connection failure in the network
c) power failure
d) all of the mentioned
Ans. d

In real time operating system ____________


a) process scheduling can be done only once
b) all processes have the same priority
c) kernel is not required
d) a task must be serviced by its deadline period
Ans. d

In operating system, each process has its own __________


a) address space and global variables
b) open files
c) pending alarms, signals and signal handlers
d) all of the mentioned
Ans. d

A thread shares its resources (like data section, code section, open files,
signals) with ___________
a) other process similar to the one that the thread belongs to
b) other threads that belong to similar processes
c) other threads that belong to the same process
d) all of the mentioned
Ans. b

A process having multiple threads of control implies ___________


a) it can do more than one task at a time
b) it can do only one task at a time, but much faster
c) it has to use only one thread per process
d) none of the mentioned
Ans. a
Concurrent access to shared data may result in ____________
a) data consistency
b) data insecurity
c) data inconsistency
d) none of the mentioned
Ans. c
The following pair of processes share a common variable X.
Process A
int Y;
A1: Y = X*2;
A2: X = Y;
Process B
int Z;
B1: Z = X+1;
B2: X = Z;
X is set to 5 before either process begins execution. As usual, statements
within a process are executed sequentially, but statements in process A may
execute in any order concerning statements in process B.
How many different values of X are possible after both processes finish
executing?
a) two
b) four
c) three
d) eight
Ans. b

With _____________ only one process can execute at a time; meanwhile all
other process are waiting for the processor. With ______________ more than
one process can be running simultaneously each on a different processor.
a) Multiprocessing, Multiprogramming
b) Multiprogramming, Uniprocessing
c) Multiprogramming, Multiprocessing
d) Uniprogramming, Multiprocessing
Ans. d
. 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
Ans. d
Consider the following set of processes, the length of the CPU burst time
given in milliseconds.
Process Burst time
P1 6
P2 8
P3 7
P4 3
Assuming the above process being scheduled with the SJF scheduling
algorithm.
a) The waiting time for process P1 is 0ms
b) The waiting time for process P1 is 3ms
c) The waiting time for process P1 is 9ms
d) The waiting time for process P1 is 16ms
Ans. b
Mutual exclusion implies that ____________
a) if a process is executing in its critical section, then no other process must
be executing in their critical sections
b) if a process is executing in its critical section, then other processes must be
executing in their critical sections
c) if a process is executing in its critical section, then all the resources of the
system must be blocked until it finishes execution
d) none of the mentioned
Ans. a
Consider a transaction T1 that was committed before the checkpoint. The <T1
commits> record appears in the log before the <checkpoint> record. Any
modifications made by T1 must have been written to the stable storage either
with the checkpoint or before it. Thus at recovery time ____________
a) There is a need to perform an undo operation on T1
b) There is a need to perform a redo operation on T1
c) There is no need to perform an undo and redo operation on T1
d) All of the mentioned
Ans. c
The portion of the process scheduler in an operating system that dispatches
processes is concerned with ____________
a) assigning ready processes to CPU
b) assigning ready processes to waiting queue
c) assigning running processes to blocked queue
d) all of the mentioned
Ans. a

10 different processes are running on a workstation. Idle processes are


waiting for an input event in the input queue. Busy processes are scheduled
with the Round-Robin time-sharing method. Which of the following quantum
times is the best value for small response times, if the processes have a short
runtime, e.g. less than 10ms?
a) tQ = 15ms
b) tQ = 40ms
c) tQ = 45ms
d) tQ = 50ms
Ans. a
Under multiprogramming, turnaround time for short jobs is usually ________
and that for long jobs is slightly ___________
a) Lengthened; Shortened
b) Shortened; Lengthened
c) Shortened; Shortened
d) Shortened; Unchanged
Ans. b
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) 2
b) 7
c) 42
d) 12
Ans. a
Consider the set of 5 processes whose arrival time and burst time are given
below:
Process Id Arrival time Burst time
P1 3 1
P2 1 4
P3 4 2
P4 0 6
P5 2 3
According to the SJF CPU scheduling algorithm, the average waiting time will
be ………….
a) 8
b) 6
c) 6.8
d) 4.8
Ans. d
Which of the following is NOT a valid inter-process communication
mechanism?
1. Pipes
2. Semaphores
3. Shared memory
4. Thread synchronization
Answer: 4) Thread synchronization

. In the producer-consumer problem, if the buffer is full and a producer


attempts to add an item to the buffer, what will happen?
1. The producer will wait until the buffer has space available.
2. The producer will overwrite the existing data in the buffer.
3. The producer will terminate.
4. The system will raise an error.
Answer: 1) The producer will wait until the buffer has space available

. In the context of synchronization, what does a "critical section" refer to?


1. A section of code that is critical for the proper functioning of the program
2. A section of code that must be executed atomically by only one process
or thread at a time
3. A section of code that handles error conditions
4. A section of code that performs I/O operations
Answer: 2) A section of code that must be executed atomically by only one
process or thread at a time

What are the essential contents in each entry of a page table?


1. Page frame number
2. Both virtual page number and page frame number
3. Virtual page number
4. Access right information
Answer : 2) Both virtual page number and page frame number

Which of the following scheduling algorithms is non-preemptive?


1. Round Robin
2. First-In First-Out
3. Multilevel Queue Scheduling
4. Multilevel Queue Scheduling with Feedback
Answer: (2) First-In First-Out

Consider the following statements with respect to user-level threads and


kernel supported threads:
1. context switch is faster with kernel-supported threads
2. for user-level threads, a system call can block the entire process
3. Kernel supported threads can be scheduled independently
4. User level threads are transparent to the kernel
Which of the above statements are true?
1. (ii), (iii) and (iv) only
2. (ii) and (iii) only
3. (i) and (iii) only
4. (i) and (ii) only
Answer(i)

A process executes the code


fork ();
fork ();
fork ();
The total number of child processes created is
1. 3
2. 4
3. 7
4. 8
Answer (3)

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
(1) I only
(2) I and III only
(3) II and III only
(4) I, II and III
Answer (4)

What does an operating system do?


1. An interface that regulates hardware and software programs
2. A hardware device
3. A program that operates the hardware devices
4. All of the above
Answer. 1)

What is the full form of BIOS?


1. Between input-output system
2. Binary input-output system
3. Basic input/output system
4. All of the above
Answer. 3) Basic input/output system
Consider the set of 6 processes whose arrival time and burst time are given
below:
Process Id Arrival time Burst time
P1 0 7
P2 1 5
P3 2 3
P4 3 1
P5 4 2
P6 5 1
If the CPU scheduling policy is the shortest remaining time first, the average
turnaround time will be…………..
a) 7.17
b) 6.17
c) 8.27
d) 5.67
Ans. a
Q3. Consider the set of 6 processes whose arrival time and burst time are
given below:
Process Id Arrival time Burst time
P1 5 5
P2 4 6
P3 3 7
P4 1 9
P5 2 2
P6 6 3
If the CPU scheduling policy is Round Robin with time quantum = 3, the
average waiting time is equal to ………..
a) 17
b) 14
c) 15
d) 16
Ans. d
Using the Priority Scheduling algorithm, find the average waiting time for the
following set of processes given with their priorities in the order: Process:
Burst Time: Priority respectively.
P1 : 10 : 3 ,
P2 : 1 : 1 ,
P3 : 2 : 4 ,
P4 : 1 : 5 ,
P5 : 5 : 2.
a) 8 milliseconds
b) 8.2 milliseconds
c) 7.75 milliseconds
d) 3 milliseconds
Ans. b
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 the 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
Ans. c
To access the services of operating system, the interface is provided by the
___________
a) System calls
b) API
c) Library
d) Assembly instructions
Answer(a)
Which one of the following is not true?
a) kernel is the program that constitutes the central core of the operating
system
b) kernel is the first part of operating system to load into memory during
booting
c) kernel is made of various modules which can not be loaded in running
operating system
d) kernel remains in the memory during the entire computer session.
Answer (c)
The OS X has ____________
a) monolithic kernel
b) hybrid kernel
c) microkernel
d) monolithic kernel with modules
Answer (b)
The systems which allow only one process execution at a time, are called
__________
a) uniprogramming systems
b) uniprocessing systems
c) unitasking systems
d) none of the mentioned
Answer (b)
In operating system, each process has its own __________
a) address space and global variables
b) open files
c) pending alarms, signals and signal handlers
d) all of the mentioned
Answer (d)
The number of processes completed per unit time is known as __________
a) Output
b) Throughput
c) Efficiency
d) Capacity
Answer (b)
Which of the following do not belong to queues for processes?
a) Job Queue
b) PCB queue
c) Device Queue
d) Ready Queue
Answer (b)
What is a medium-term scheduler?
a) It selects which process has to be brought into the ready queue
b) It selects which process has to be executed next and allocates CPU
c) It selects which process to remove from memory by swapping
d) None of the mentioned
Answer (c)
Restricting the child process to a subset of the parent’s resources prevents
any process from __________
a) overloading the system by using a lot of secondary storage
b) under-loading the system by very less CPU utilization
c) overloading the system by creating a lot of sub-processes
d) crashing the system by utilizing multiple resources
Answer (c)
With _____________ only one process can execute at a time; meanwhile all
other process are waiting for the processor. With ______________ more than
one process can be running simultaneously each on a different processor.
a) Multiprocessing, Multiprogramming
b) Multiprogramming, Uniprocessing
c) Multiprogramming, Multiprocessing
d) Uniprogramming, Multiprocessing
Answer (d)
Consider the following table of arrival time and the burst time for the five
processes P0, P1, P2, P3, P4, P5. What is the average waiting time for the
five processes?

A) 8 B) 12 C) 9 D) 11
Answer A) 8

Consider the set of 5 processes whose arrival time and burst time are given
below-
If the CPU scheduling policy is SJF preemptive, calculate the average waiting
time.
A) 3.8 unit B) 4.4unit C) 4.2 unit D) 3.9 unit
Answer A) 3.8 unit
Consider the set of 6 processes whose arrival time and burst time are given
below-

Process Id Arrival time Burst time


P1 5 5
P2 4 6
P3 3 7
P4 1 9
P5 2 2
P6 6 3

If the CPU scheduling policy is Round Robin with time quantum = 3, calculate
the average waiting time and average turnaround time.
A) 21.33 unit and 16 unit
B) 22.23 unit and 8.21 unit
C) 19.8 unit and 17.14 unit
D) 19.34 unit and 18.44 unit
Answer (A)
Consider the set of 5 processes whose arrival time and burst time are given
below-
Process Id Arrival time Burst time Priority
P1 0 4 2
P2 1 3 3
P3 2 1 4
P4 3 5 5
P5 4 2 5

If the CPU scheduling policy is priority non-preemptive, calculate the average


waiting time and average turnaround time. (Higher number represents higher
priority)

A) 8.2 unit and 5.2 unit


A) 9.2 unit and 6.2 unit
B) 7.4 unit and 5.3 unit
C) 8.9 unit and 6.4 unit
Answer A)
Which combination of the following features will suffice to characterize an OS
as a multi-programmed OS?
(a) More than one program may be loaded into main memory
at the same time for execution.
(b) If a program waits for certain events such as I/O,
another program is immediately scheduled for execution.
(c) If the execution of program terminates, another program
is immediately scheduled for execution.
(A) a
(B) a and b
(C) a and c
(D) a, b and c

Answer: (B)

Suppose we want to synchronize two concurrent processes P and Q using


binary semaphores S and T. The code for the processes P and Q is shown
below.
Process P:
while (1) {
W:
print '0';
print '0';
X:
}

Process Q:
while (1) {
Y:
print '1';
print '1';
Z:
}
Synchronization statements can be inserted only at points W, X, Y and Z
Which of the following will ensure that the output string never contains a
substring of the form 01^n0 or 10^n1 where n is odd?
(A) P(S) at W, V(S) at X, P(T) at Y, V(T) at Z, S and T initially 1
(B) P(S) at W, V(T) at X, P(T) at Y, V(S) at Z, S and T initially 1
(C) P(S) at W, V(S) at X, P(S) at Y, V(S) at Z, S initially 1
(D) V(S) at W, V(T) at X, P(S) at Y, P(T) at Z, S and T initially 1

Answer: (C)
At a particular time of computation the value of a counting semaphore is 7.
Then 20 P operations and xV operations were completed on this semaphore.
If the new value of semaphore is 5, x will be
a)18
b)22
c)15
d)13
answer 'A'.

Two concurrent processes P1 and P2 use four shared resources R1, R2, R3
and R4, as shown below.
P1 P2
Compute: Use R1; Use R2; Use R3; Use R4; Compute; Use R1; Use R2;
Use R3;. Use R4;
Both processes are started at the same time, and each resource can be
accessed by only one process at a time The following scheduling constraints
exist between the access of resources by the processes:
• P2 must complete use of R1 before P1 gets access to R1
• P1 must complete use of R2 before P2 gets access to R2.
• P2 must complete use of R3 before P1 gets access to R3.
• P1 must complete use of R4 before P2 gets access to R4.
There are no other scheduling constraints between the processes. If only
binary semaphores are used to enforce the above scheduling constraints,
what is the minimum number of binary semaphores needed?
(A) 1
(B) 2
(C) 3
(D) 4
Answer (b)
Suppose we want to synchronize two concurrent processes P and Q using
binary semaphores S and T. The code for the processes P and Q is shown
below.
Process P:
while (1) {
W:
print '0';
print '0';
X:
}

Process Q:
while (1) {
Y:
print '1';
print '1';
Z:
}

Synchronization statements can be inserted only at points W, X, Y and Z.


Which of the following will always lead to an output starting with
‘001100110011’ ?
(A) P(S) at W, V(S) at X, P(T) at Y, V(T) at Z, S and T initially 1
(B) P(S) at W, V(T) at X, P(T) at Y, V(S) at Z, S initially 1, and T initially 0
(C) P(S) at W, V(T) at X, P(T) at Y, V(S) at Z, S and T initially 1
(D) P(S) at W, V(S) at X, P(T) at Y, V(T) at Z, S initially 1, and T initially 0

Answer: (B)

A shared variable x, initialized to zero, is operated on by four concurrent


processes W, X, Y, Z as follows. Each of the processes W and X reads x from
memory, increments by one, stores it to memory and then terminates. Each of
the processes Y and Z reads x from memory, decrements by two, stores it to
memory, and then terminates. Each process before reading x invokes the P
operation (i.e. wait) on a counting semaphore S and invokes the V operation
(i.e. signal) on the semaphore S after storing x to memory. Semaphore S is
initialized to two. What is the maximum possible value of x after all processes
complete execution?
Process W Process X Process Y Process Z
Wait(s) Wait(s) Wait(s) Wait(s)
Read (x) Read (x) Read (x) Read (x)
x= x+1; x=x+1; x=x-2; x= x-2;
write (x) write (x) write (x) write (x)
signal (s) Signal(s) Signal(s) Signal (s)
initially, counting semaphore S is initialized with value 2
A. -2
B -1
C 1
D 2
Answer D
A process executes the following code

for(i=0; i<n; i++)


{
fork();
}
The total number of child processes created is

A. 2
B. 2n
C. 2n
D. 2n-1

Consider Peterson's algorithm for mutual exclusion between two concurrent


processes i and j. The program executed by process is shown below.
repeat
flag[i] = true;
turn = j;
while (P) do no-op;
Enter critical section, perform actions, then
exit critical section
Flag[i] = false;
Perform other non-critical section actions.
Until false;
For the program to guarantee mutual exclusion, the predicate P in the
while loop should be
A. flag[j] == true and turn == i
B. flag[j] = =true and turn == j
C. flag[i] == true and turn == j
D. flag[i] = =true and turn == i
Answer(B)
Consider the following two-process synchronization solution.
Process 0 Process 1
Entry: loop while (turn == 1); Entry: loop while (turn == 0);
(critical section) (critical section)
Exit: turn = 1; Exit turn = 0;
The shared variable turn is initialized to zero. Which one of the following is
TRUE?
(A) This is a correct two-process synchronization solution.
(B) This solution violates mutual exclusion requirement.
(C) This solution violates progress requirement.
(D) This solution violates bounded wait requirement.
Answer (c)
Consider two processes P1 and P2 accessing the shared variables X and Y
protected by two binary semaphores SX and SY respectively, both initialized
to 1. P and V denote the usual semaphone operators, where P decrements
the semaphore value, and V increments the semaphore value. The
pseudo-code of P1 and P2 is as follows :
P1 :
While true do {
L1 : ................
L2 : ................
X = X + 1;
Y = Y - 1;
V(SX);
V(SY);
}
P2 : While true do {
L3 : ................
L4 : ................
Y = Y + 1;
X = Y - 1;
V(SY);
V(SX);
}

In order to avoid deadlock, the correct operators at L1, L2, L3 and L4 are
respectively
a)P(SY), P(SX); P(SX), P(SY)
b)P(SX), P(SY); P(SY), P(SX)
c)P(SX), P(SX); P(SY), P(SY)
d)P(SX), P(SY); P(SX), P(SY)
Correct answer is option 'D'

Consider the following set of process that arrive at time 0, with the length of
CPU burst given in milliseconds. Calculate the average waiting time when the
processes arrive in the following order:

a. P1, P2, P3 P4 P5

Provide the Gantt chart for the same.

Process Burst time


P1 4
P2 7
P3 3
P4 3
P5 5

Consider the set of 6 processes whose arrival time and burst time are given
below: -

Process Id Arrival time Burst time


P1 0 7
P2 1 5
P3 2 3
P4 3 1
P5 4 2
P6 5 1
If the CPU scheduling policy is shortest remaining time first, calculate the
average
waiting time and average turnaround time.
How does a semaphore differ from a mutex?
1) A semaphore allows multiple threads to access a resource simultaneously,
while a mutex allows only one.
2) A semaphore is more efficient than a mutex.
3) A mutex can be shared across processes, while a semaphore cannot.
4) There is no difference between a semaphore and a mutex.
Answer: 1) A semaphore allows multiple threads to access a resource
simultaneously, while a mutex allows only one.

Consider a set of 5 processes whose arrival time. CPU time needed and the
priority are given below

smaller the number, higher the priority. If the CPU scheduling policy FCFS,
What will be the the average waiting time?
Consider a computer system that supports 32-bit physical as well
as virtual addresses. Now since the space of the physical address is the same
size as the virtual address, the OS designers would decide to entirely get rid
of its virtual memory. Which one of these is true in this case
A. It is no longer possible to efficiently implement multi-user support
B. It is possible to make CPU scheduling more efficient now
C. There would no longer be a requirement for hardware support for memory
management
D. It would be possible to make the processor cache organisation more
efficient no
Ans D

Out of the following, which one needs a device driver


A. Main memory
B. Disk
C. Register
D. Cache

Ans B

3 Which of the following is the feature of the operating system


A. Error detection aids
B. Control over system performance
C. Job Accounting
D. Coordination between other software and users
E. All
Ans E

4 What is a bootstrap program


A. It is the first code that is executed when the computer system is started
B. It is the program that helps in restarting the system
C. It is just a simple program like we have other programs in a system
D. None of these A
5 By operating system, the resource management can be done via
A. time division multiplexing
B. space division multiplexing
C. both (a) and (b)
D. none of the mentioned C
6 In operating system, each process has its own
A. address space and global variables
B. open files
C. pending alarms, signals and signal handlers
D. all of the mentioned A
7 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 A
8 Kernel threads

A. cannot be supported and managed directly by the operating system


B. can be supported and managed directly by the operating system
C. are supported below the kernel and are managed without kernel support
D. None of the above
B
9 Round robin scheduling falls under the category of
____________
A. Non-preemptive scheduling
B. Preemptive scheduling
C. All of the mentioned
D. None of the mentioned
B

10 Suppose that a process is in “Blocked” state waiting for some I/O


service. When the service is completed, it goes to the
A. Running state
B. Ready state
C. Suspended state
D. Terminated state
Ans A

The scheduling in which CPU is allocated to the process with least


CPU-burst time is called

A. Priority Scheduling

B. Shortest job first Scheduling

C. Round Robin Scheduling

D. Multilevel Queue Scheduling

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 C. II and III D. I, II , III


A thread is usually defined as a light weight process because an
operating system 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 operating system maintains only CPU register
state

B. The OS does not maintain a separate stack for each thread.

C. On prethread basis, the operating system does not maintain virtual


memory system.

D. On per thread basis, the operating system maintains only scheduling and
accounting information

The portion of the process scheduler in an operating system that


dispatches processes is concerned with

A. assigning ready processes to CPU

B. assigning ready processes to waiting queue

C. assigning running processes to blocked queue

D. All of these

What is the main function of the command interpreter


A. to provide the interface between the API and application program
B. to handle the files in the operating system
C. to get and execute the next user-specified command
D. none of the mentioned

What is interprocess communication

A. communication within the process

B. communication between two process

C. communication between two threads of same process


D. none of the mentioned

Each process has a segment of code, called a ____________, in which the process

may be changing common variables, updating a table, writing a file, and so on

A. None-critical section

B. Critical section

C. Exit Section

D. Entry Section

Under nonpreemptive scheduling, once the CPU has been allocated to a process, the

process keeps the CPU until.

1. It releases the CPU by terminating2

2. It releases the CPU by switching to the waiting state

3. It releases the CPU By switching to the ready state

4. It releases the CPU By switching to the Running state

A. 1 and 2

B. 1,2,3

C. 2,3,4

D. 1,2,3,4
In which of the following scheduling algorithm new processes are added to the tail of

the ready queue. The CPU scheduler picks the first process from the ready queue,

sets a timer to interrupt after 1 time quantum, and dispatches the process.

A. Shortest-Job-First Scheduling

B. Priority Scheduling

C. First-Come, First-Served Scheduling

D. Round-Robin Scheduling

Which of the following statement is True for Aging

A. Aging involves gradually increasing the priority of processes that wait in


the system for a long time

B. Aging involves gradually decreasing the priority of processes that wait in


the system for a long time

C. Aging involves gradually increasing the priority of processes that wait in


the system for a small time

D. Aging involves gradually decreasing the priority of processes that wait in


the system for a small time

Consider the set of 3 processes whose arrival time and burst time are
given below

If the CPU scheduling policy is SRTF, the average waiting time and average
turnaround time is calculated as

A. 12.33, 10
B. 11.22, 6

C. 12.33, 5

D. 11.22, 10

Ans c

Consider the following set of processes, the length of the CPU burst time
given in milliseconds.

Process Burst time

P0 6

P1 8

P2 7

P3 3

Process being scheduled with the SJF scheduling algorithm.

A. The waiting time for process P1 is 3ms

B. The waiting time for process P1 is 11ms

C. The waiting time for process P1 is 16ms

D. The waiting time for process P1 is 9ms

Ans c

Consider the set of 5 processes whose arrival time and burst time are given
below.

If the CPU scheduling policy is Round Robin with time quantum = 2 unit,
average turnaround time is calculated as

A. 8

B. 7.6
C. 8.2

D. 8.6

Ans d

5 If the Disk head is located initially at 32, find the number of disk
moves required with FCFS if the disk queue of I/O blocks requests are 98,
37,14,124,65,67.

A. 310 B. 324 C. 315 D. 321

Ans D

. What is a batch operating system?


1. Multiple individual tasks
2. Similar types of tasks are grouped together
3. Tasks operating at different systems
4. All of the above
Answer. 2) Similar types of tasks grouped together
. What is a time sharing operating system?
1. Makes use of log files to do basic task
2. One shell seems to be shared
3. Allows users to use one system with two different terminals
4. All of the above
Answer. 3) Allows users to use one system with two different terminals
. What of the following isn’t directly related to the operating system?
1. BIOS
2. Software programs
3. Hardware devices
4. All of the above
Answer. 3) hardware devices.

Which one of the following is not true?


1)Kernel remains in the memory during the entire computer session
2) Kernel is made of various modules which can not be loaded in running operating
system
3) Kernel is the first part of the operating system to load into memory during booting
4) Kernel is the program that constitutes the central core of the operating system
Answer. 3) Kernel is the first part of the operating system to load into memory during
booting.

What is the main purpose of an operating system's scheduler?


1) To allocate memory resources
2) To manage input/output operations
3) To prioritize processes for execution
4) To maintain file system integrity
Answer:3) To prioritize processes for execution

. What is the purpose of interprocess communication (IPC) in operating systems?


1) To enable processes to share data and information
2) To manage CPU scheduling
3) To control access to peripheral devices
4) To allocate memory resources
Answer: 1) To enable processes to share data and information

Which of the following mechanisms is used to prevent multiple processes or threads


from simultaneously accessing a shared resource?
1) Critical Section
2) Semaphore
3) Mutex
4) Monitor
Answer: 3) Mutex

In a critical section problem, if two processes attempt to enter their critical sections
simultaneously, what issue can occur?
1) Deadlock
2) Race condition
3) Starvation
4) Thrashing
Answer: 2) Race condition

. The switching of the CPU from one process or thread to another is called
____________
1) process switch
2) task switch
3) context switch
4) all of the mentioned
Answer:3) context switch
The processes that are residing in main memory and are ready and waiting to
execute are kept on a list called _____________
1) job queue
2) ready queue
3) execution queue
4) process queue
Answer: 2) Ready queue
To access the services of operating system, the interface is provided by the
___________
a) System calls
b) API
c) Library
d) Assembly instructions
Answer(a) Which one of the following is not true?
a) kernel is the program that constitutes the central core of the operating system
b) kernel is the first part of operating system to load into memory during booting
c) kernel is made of various modules which can not be loaded in running operating
system
d) kernel remains in the memory during the entire computer session.
Answer (c)
The OS X has ____________
a) monolithic kernel
b) hybrid kernel
c) microkernel
d) monolithic kernel with modules
Answer (b)
The systems which allow only one process execution at a time, are called
__________
a) uniprogramming systems
b) uniprocessing systems
c) unitasking systems
d) none of the mentioned
Answer (b)
In operating system, each process has its own __________
a) address space and global variables
b) open files
c) pending alarms, signals and signal handlers
d) all of the mentioned
Answer (d)
The number of processes completed per unit time is known as __________
a) Output
b) Throughput
c) Efficiency
d) Capacity
Answer (b)
Which of the following do not belong to queues for processes?
a) Job Queue
b) PCB queue
c) Device Queue
d) Ready Queue
Answer (b)
What is a medium-term scheduler?
a) It selects which process has to be brought into the ready queue
b) It selects which process has to be executed next and allocates CPU
c) It selects which process to remove from memory by swapping
d) None of the mentioned
Answer (c)
Restricting the child process to a subset of the parent’s resources prevents
any process from __________
a) overloading the system by using a lot of secondary storage
b) under-loading the system by very less CPU utilization
c) overloading the system by creating a lot of sub-processes
d) crashing the system by utilizing multiple resources
Answer (c)
With _____________ only one process can execute at a time; meanwhile all
other process are waiting for the processor. With ______________ more than one
process can be running simultaneously each on a different processor.
a) Multiprocessing, Multiprogramming
b) Multiprogramming, Uniprocessing
c) Multiprogramming, Multiprocessing
d) Uniprogramming, Multiprocessing
Answer (d)
Which of the following scheduling algorithms gives priority to the process with the
smallest execution time?
A) Round Robin
B) Shortest Job Next (SJN)
C) First Come First Serve (FCFS)
D) Priority Scheduling

Answer: B) Shortest Job Next (SJN)


Explanation: SJN scheduling selects the process with the smallest execution time
next

What is the purpose of the Process Control Block (PCB)?


A) To store the program code.
B) To manage the CPU registers.
C) To store information about a process.
D) To manage the file system.
Answer: C) To store information about a process.
Explanation: PCBs contain information about each process, including its state,
program counter, and CPU registers.
What is the primary role of the interrupt vector table?
A) To store the addresses of interrupt service routines.
B) To manage memory allocation.
C) To store user-level processes.
D) To handle process scheduling.

Answer: A) To store the addresses of interrupt service routines.


Explanation: The interrupt vector table contains addresses of interrupt service
routines for handling interrupts.

What is the role of the 'fork' system call in Unix-like operating systems?
A) To create a new process.
B) To terminate the currently running process.
C) To allocate memory for a new process.
D) To change the ownership of a file.

Answer: A) To create a new process.


Explanation: The 'fork' system call creates a new process in Unix-like operating
systems.

Question: What is the purpose of a semaphore in process synchronization?


a) To prevent race conditions
b) To implement mutual exclusion
c) To control access to shared resources
d) To allocate memory for processes

Answer: c) To control access to shared resources

. Question: What is the difference between preemptive and non-preemptive


scheduling algorithms?
a) Preemptive algorithms allow a process to voluntarily give up the CPU, while
non-preemptive algorithms do not.
b) Preemptive algorithms allow the CPU to be taken away from a process, while
non-preemptive algorithms do not.
c) Preemptive algorithms prioritize processes based on their priority levels, while
non-preemptive algorithms do not.
d) Preemptive algorithms are designed for real-time systems, while non-preemptive
algorithms are not.
Answer: b) Preemptive algorithms allow the CPU to be taken away from a process,
while non-preemptive algorithms do not.

Question: What is the difference between deadlock prevention and deadlock


avoidanc techniques?
a) Deadlock prevention techniques aim to detect and recover from deadlocks, while
deadlock avoidance techniques aim to prevent deadlocks from occurring altogether.
b) Deadlock prevention techniques require processes to request resources in a
specific order, while deadlock avoidance techniques use algorithms to ensure safe
resource allocation.
c) Deadlock prevention techniques involve preemption of resources, while deadlock
avoidance techniques do not.
d) Deadlock prevention techniques require the use of synchronization primitives,
while deadlock avoidance techniques do not.
Answer: b) Deadlock prevention techniques require processes to request resources
in a specific order, while deadlock avoidance techniques use algorithms to ensure
safe resource allocation.
Question: In a multi-threaded environment, what is the primary advantage of using
user-level threads over kernel-level threads?
a) User-level threads provide better concurrency
b) User-level threads are more lightweight
c) User-level threads have faster context switching
d) User-level threads have direct access to kernel resources
Answer: b) User-level threads are more lightweight
Which one of the following is not true?
a) kernel remains in the memory during the entire computer session
b) kernel is made of various modules which can not be loaded in running operating
system
c) kernel is the first part of the operating system to load into memory during booting
d) kernel is the program that constitutes the central core of the operating system
Answer: b
Explanation: Kernel is the first program that is loaded in memory when OS is loading
as well as it remains in memory till OS is running. Kernel is the core part of the OS
which is responsible for managing resources, allowing multiple processes to use the
resources and provide services to various processes. Kernel modules can be loaded
and unloaded in run-time i.e. in running OS.
What is a long-term scheduler?
a) It selects processes which have to be brought into the ready queue
b) It selects processes which have to be executed next and allocates CPU
c) It selects processes which heave to remove from memory by swapping
d) None of the mentioned
Answer: a
Explanation: A long-term scheduler selects processes which have to be brought into
the ready queue. When processes enter the system, they are put in the job queue.
Long-term scheduler selects processes from the job queue and puts them in the
ready queue. It is also known as Job Scheduler.
Consider the following statements about process state transitions for a system using
preemptive scheduling.

I. A running process can move to ready state.


II. A ready process can move to ready state.
III. A blocked process can move to 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
Answer (a)
Consider a process P currently running on a CPU. Identify which of the
following events will invariably necessitate a context switch by the operating system,
causing process P to transition to a non-running state (such as ready or blocked):

I. P makes a blocking system call to read a block of data from the disk.
II. P tries to access a page that is in the swap space, resulting in a page fault.
III. An interrupt is raised by the disk to deliver data requested by some other process.
IV. A timer interrupt is raised by the hardware.

Which of the above statements are TRUE?


a) I and II only
b) II and III only
c) II and IV only
d) I, II, III and IV

Answer a) I and II only

Consider the following two-process synchronization solution.


Process 0 Process 1
Entry: loop while (turn == 1); Entry: loop while (turn == 0);
(critical section) (critical section)
Exit: turn = 1; Exit turn = 0;
The shared variable turn is initialized to zero. Which one of the following is TRUE?
(A) This is a correct two-process synchronization solution.
(B) This solution violates mutual exclusion requirement.
(C) This solution violates progress requirement.
(D) This solution violates bounded wait requirement.
Answer (c)
Consider Peterson's algorithm for mutual exclusion between two concurrent
processes i and j. The program executed by process is shown below.
repeat
flag[i] = true;
turn = j;
while (P) do no-op;
Enter critical section, perform actions, then
exit critical section
Flag[i] = false;
Perform other non-critical section actions.
Until false;
For the program to guarantee mutual exclusion, the predicate P in the while loop
should be
A. flag[j] == true and turn == i
B. flag[j] = =true and turn == j
C. flag[i] == true and turn == j
D. flag[i] = =true and turn == i

Answer(B)
A counting semaphore S is initialized to 10. Then, 6 P operations and 4 V operations
are performed on S. What is the final value of S?
A. 0
B. 5
C. 8
D. 3
Answer C

A shared variable x, initialized to zero, is operated on by four concurrent


processes W, X, Y, Z as follows. Each of the processes W and X reads x from
memory, increments by one, stores it to memory and then terminates. Each of the
processes Y and Z reads x from memory, decrements by two, stores it to memory,
and then terminates. Each process before reading x invokes the P operation (i.e.
wait) on a counting semaphore S and invokes the V operation (i.e. signal) on the
semaphore S after storing x to memory. Semaphore S is initialized to two. What is
the maximum possible value of x after all processes complete execution?
Process W Process X Process Y Process Z
Wait(s) Wait(s) Wait(s) Wait(s)
Read (x) Read (x) Read (x) Read (x)
x= x+1; x=x+1; x=x-2; x= x-2;
write (x) write (x) write (x) write (x)
signal (s) Signal(s) Signal(s) Signal (s)
initially, counting semaphore S is initialized with value 2
A. -2
B. -1
C. 1
D. 2

A counting semaphore S is initialized to 7. Then, 20 P operations and 15 V


operations are performed on S. What is the final value of S?
(A) 5
(B) 2
(C) 6
(D) 3
Answer (B)
Consider the following table of arrival time and the burst time for the five processes
P0, P1, P2, P3, P4, P5. What is the average waiting time for the five processes?
Process. No Arrival Time Burst Time
P0 0 14
P1 1 3
P2 2 1
P3 3 2
P4 4 5
A) 15 unit
B) 12 unit
C) 18 unit
D) 13 unit
Answer B) 12 unit
If the CPU scheduling policy is SRTF, calculate the waiting time of process P2.
A) 15 unit B) 12 unit C) 16 unit D) 14 unit
Answer (A)

A) 7.6 unit and 4.6 unit

B) 8.6 unit and 5.7 unit


C) 7.2 unit and 4.0 unit

D) 8.4 unit and 4.1 unit

Answer (A)

Question 1: In the context of inter-process communication, which of the following are


true?
A. Message passing can be easier to implement in distributed systems compared to
shared
memory.
B. Race conditions can be avoided by ensuring that shared resources are accessed
in a
mutually exclusive manner.
C. Signals are a form of asynchronous communication used in UNIX systems.
D. Pipes in UNIX are an example of two-way communication between processes.
Ans:
A. True - Message passing is often more feasible in distributed systems than shared
memory.
B. True - Mutual exclusion helps avoid race conditions.
C. True - Signals in UNIX are an asynchronous communication method.

Question 2: You are designing a CPU scheduler for a system that prioritises
interactive
processes to ensure a responsive user experience. However, you must also ensure
that
batch processing jobs, which are lower in priority compared to interactive processes,
do not
starve. Based on these requirements, which of the following strategies would you
implement
in your CPU scheduling algorithm?
Options:
A. Apply the Shortest Job First (SJF) algorithm, as it offers the lowest average
waiting time
for processes.
B. Utilise the Round Robin (RR) algorithm with a dynamic time quantum, adjusting
the
quantum based on the process type (interactive vs. batch).
C. Implement a Multilevel Feedback Queue (MFQ) scheduling algorithm, where
interactive
processes are placed in a higher-priority queue compared to batch processes, but
batch
processes can gradually increase their priority if they wait too long.
D. Implement Aging with Priority Scheduling, where lower priority processes
gradually
increase their priority over time to prevent starvation.
Ans:
C. Implementing a Multilevel Feedback Queue (MFQ) scheduling algorithm is most
appropriate in this scenario, as it allows for prioritising interactive processes while
ensuring
batch processes are not starved.
D. Implementing Aging with Priority Scheduling is also a viable strategy. It modifies
the
Priority Scheduling algorithm to increase the priority of waiting processes over time,
ensuring
that lower-priority batch jobs do not suffer from starvation

Question3 : You are analysing a system that utilises both multitasking and
multithreading to
optimise performance. Given the following statements, identify which accurately
reflect the
principles and functionalities of multitasking and multithreading in operating systems.
Options:
A. Multitasking allows a single CPU to run multiple processes concurrently by rapidly
switching between them, giving the illusion of parallelism.
B. Multithreading within a single process allows threads to share resources such as
memory
space, which can lead to more efficient use of system resources compared to
multiple
processes.
C. In a multithreaded environment, each thread has its own separate stack, but all
threads
within the same process share the heap space.
D. Multitasking increases the performance of CPU-intensive applications by allowing
multiple
CPUs to execute different threads of the same process simultaneously.
Ans: Correct Answers:
A. True - Multitasking involves the CPU switching context between different
processes or
tasks to give the impression of parallel execution.
B. True - Threads within the same process can share resources like memory, which
can lead
to more efficient resource utilisation.
C. True - In multithreading, each thread has its own stack, but the heap is shared
among all
threads of the process.
Question4: Select the system calls from the list below that would typically be used in
a
Unix-like operating system to manage process control and file operations. Choose all
that
apply.
Options:
A. fork()
B. read()
C. chmod()
D. socket()
E. getpid()
Ans: Correct Answers: A, B, C, E
Scenario: Imagine you are designing a new operating system for a high-performance
computing system that requires efficient management of processes, memory, and I/O
operations. You need to ensure that the operating system can handle multiple tasks
simultaneously, manage memory efficiently to support various applications, and
provide
robust I/O operations management.

Question5: Based on the scenario above, which of the following features should be
incorporated into the design of the new operating system to meet the specified
requirements? Select all that apply.
A. Implement a preemptive multitasking scheduler to allow the operating system to
manage
the execution time of processes efficiently.
B. Use a monolithic kernel to simplify the design and reduce the overhead
associated with
context switching and inter-process communication.
C. Integrate a virtual memory management system to provide a larger address space
to
processes and to support efficient memory utilization.
D. Employ a Round Robin scheduling algorithm with a fixed time quantum for all
processes
to ensure fairness in process execution.
E. Incorporate a Direct Memory Access (DMA) mechanism to allow peripherals to
directly
read from and write to main memory, reducing the CPU's I/O operation load.
Ans: Correct Answers:
A. True - A preemptive multitasking scheduler can efficiently manage process
execution
time, allowing for better multitasking capabilities.
C. True - A virtual memory management system is essential for providing a larger
address
space and for efficient memory utilization, crucial for high-performance computing
systems.
E. True - DMA is important for offloading the CPU from handling all I/O operations,
improving
the system's overall efficiency

Question 6: Identify the components of an operating system that are directly involved
in
managing system memory. Select all that apply.
Options:
A. Memory Manager - Handles the allocation and deallocation of memory blocks to
processes, ensuring efficient memory usage.
B. File System - Organises and manages the storing and retrieval of data on disk
drives.
C. Scheduler - Determines which process will be executed by the processor at any
given
time.
D. Virtual Memory Manager - Manages virtual memory, allowing processes to use
more
memory than physically available by using disk space.
Correct Answers:
A. The Memory Manager is directly responsible for managing the system's memory,
allocating, and deallocating memory as needed.
D. The Virtual Memory Manager is crucial for extending the apparent amount of
physical
memory using disk storage.

Question 7: Which of the following strategies can be used to handle deadlocks?


Options:
A. Deadlock Prevention - Design the system in such a way that one of the necessary
conditions for deadlock is systematically negated.
B. Deadlock Avoidance - The system dynamically examines the allocation state to
ensure
that a circular wait condition can never exist.
C. Deadlock Detection and Recovery - Allow the system to enter a deadlock state
but then
detect it and recover.
D. Deadlock Ignorance - Ignore the problem entirely and reboot the system when a
deadlock
occurs.
Correct Answers:
A, B, and C are all strategies to handle deadlocks. Deadlock Ignorance (D) is not a
strategy
but rather a lack of strategy, often not viable for systems requiring high reliability and
availability.
Question 8: In the context of operating systems, which of the following are valid
methods of
inter-process communication (IPC)? Select all that apply.
Options:
A. Shared Memory - Processes communicate by accessing a shared section of
memory,
providing fast communication by avoiding system calls.
B. Pipes - A communication channel that allows one process to send data to another
process in a unidirectional flow.
C. Semaphores - Mechanisms used to control access to a common resource by
multiple
processes to avoid critical section problems.
D. Remote Procedure Calls (RPCs) - A protocol that one program can use to request
a
service from a program located on another computer in a network.
Correct Answers:
A. Shared Memory is a common IPC method allowing direct access to a common
memory
area by multiple processes.
B. Pipes are traditional IPC mechanisms in UNIX-like systems, allowing
unidirectional
communication between processes.
C. Semaphores, while primarily used for synchronisation, indirectly facilitate IPC by
coordinating access to shared resources or communication mediums.
D. RPCs, although they extend beyond the confines of a single system, are a form of
IPC
used in distributed systems to enable processes on different computers to
communicate.

Question 9:
Scenario: You are analyzing the performance of a real-time operating system
(RTOS) that is
used to control robotic machinery. The RTOS is designed to handle a high frequency
of
interrupt-driven tasks, which requires efficient context switching to maintain system
responsiveness and task prioritization.
Considering the scenario, which features should the RTOS's context switching
mechanism
possess to ensure optimal performance in handling high-frequency interrupt-driven
tasks?
Select all that apply.
Options:
A. The context switching mechanism should have minimal overhead to reduce the
time
spent in switching between tasks.
B. The RTOS should prioritize tasks based on their urgency and deadlines, not just
on a
first-come, first-served basis.
C. The context switching process should include extensive memory management
steps to
optimize RAM usage.
D. The RTOS should employ a complex scheduling algorithm that considers the
future
computational needs of tasks to optimize context switching.
Ans:
A. True - Minimizing overhead is crucial for an RTOS to quickly switch between
tasks,
especially in a high-frequency interrupt-driven environment.
B. True - Task prioritization based on urgency and deadlines is essential for real-time
responsiveness and system reliability in an RTOS.

Ques 10: Question: Consider the following statements regarding operating systems
and
identify which aren’t correct?
Options:
A. In a microkernel operating system architecture, the microkernel provides minimal
services, including device drivers and file system management.
B. In a monolithic kernel, all operating system services run along with the main
kernel thread
in a single address space, enhancing performance but potentially decreasing system
reliability.
C. Banker's algorithm is used in operating systems to avoid deadlock situations by
ensuring
that a system does not allocate its resources in a manner that can lead to a
deadlock.
D. Virtual memory allows an operating system to use hard disk space to simulate
extra
memory, but it cannot be used to isolate the address spaces of different processes.
Correct Answers:
A. False - In a microkernel architecture, the microkernel does not typically include
services
like device drivers and file system management; these are executed in user space.
D. False - One of the primary functions of virtual memory is to isolate the address
spaces of
different processes, ensuring that they cannot interfere with each other.
ANSWERS

1. b. Bounded operating systems consume fewer system resources because they


do not need to support dynamic expansion.

2. d. Text Section

3. b. CPU Scheduling Information

4. b. Kernel

5. a. Communication

6. a. To switch the CPU to another process

7. b. Round Robin (RR) Scheduling

8. c. Mutex locks are utilised to protect critical regions and prevent race conditions
by allowing only one thread at a time to access them.

9. b. Control is transferred to the kernel which handles the request

10. d. Shortest-Job-First (SJF) Scheduling

11. c. Process cannot be interrupted till it terminates or switches to waiting state,


d. It relies on processes to release the CPU voluntarily

12. a. Burst time + Waiting time,


d. Completion time - Arrival time

13. a. Hardware layer - Kernel layer - Libraries layer - User layer,


c. Hardware layer - System Call Inference layer - Libraries layer - User Interface layer

14. b. APIs act as an intermediary layer between user-level applications and system
calls., d. APIs define the syntax, semantics, and behavior of functions and data structures
that applications can use to interact with the OS

15. b. To manage all resources,


d. To act as an interface between the user and the computer hardware

16 b. A program responsible for loading the initial instructions of the operating


system into memory and starting its execution,
d. The bootstrap program is typically stored in firmware, such as ROM or
EEPROM.
17. b. A way for applications to request services or resources from the operating
system, c. Interfaces for interaction between applications and the operating
system kernel

18 a. Skip testing and validation,


c. Ignoring user reports

19. a. CreateFile(),
d. Sleep()

20. b. Milliseconds,
c. Microseconds

You might also like