KEMBAR78
OS MCQ-Part-1 | PDF | Scheduling (Computing) | Process (Computing)
0% found this document useful (0 votes)
66 views30 pages

OS MCQ-Part-1

The document provides a comprehensive overview of operating system concepts, including definitions, functions, and types of operating systems, processes, and scheduling algorithms. It covers key topics such as the role of the kernel, system calls, process states, interprocess communication, and process control blocks. Additionally, it discusses various types of schedulers and their functions in managing process execution within an operating system.

Uploaded by

kiran.t22606
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)
66 views30 pages

OS MCQ-Part-1

The document provides a comprehensive overview of operating system concepts, including definitions, functions, and types of operating systems, processes, and scheduling algorithms. It covers key topics such as the role of the kernel, system calls, process states, interprocess communication, and process control blocks. Additionally, it discusses various types of schedulers and their functions in managing process execution within an operating system.

Uploaded by

kiran.t22606
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/ 30

Operating System Questions & Answers – Basics

1. What is an operating system?


a) collection of programs that manages hardware resources
b) system service provider to the application programs
c) interface between the hardware and application programs
d) all of the mentioned

Answer: d

Explanation: An Operating System acts as an intermediary between user/user applications/application


programs and hardware. It is a program that manages hardware resources. It provides services to
application programs.

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

Explanation: To access services of the Operating System an interface is provided by the System Calls.
Generally, these are functions written in C and C++. Open, Close, Read, Write are some of most
prominently used system calls.

3. 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 cannot be loaded in running operating system
d) kernel remains in the memory during the entire computer session

Answer: c

Explanation: Kernel is the first program which 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.

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

Answer: d

Explanation: All the mentioned errors are handled by OS. The OS is continuously monitoring all of its
resources. Also, the OS is constantly detecting and correcting errors.

5. What is the main function of the command interpreter?


a) to get and execute the next user-specified command
b) to provide the interface between the API and application program
c) to handle the files in operating system
d) none of the mentioned

Answer: a
Explanation: The main function of command interpreter is to get and execute the next user-specified
command. Command Interpreter checks for valid command and then runs that command else it will throw
an error.

6. In Operating Systems, which of the following is/are CPU scheduling algorithms?


a) Round Robin
b) Shortest Job First
c) Priority
d) All of the mentioned

Answer: d

Explanation: In Operating Systems, CPU scheduling algorithms are:


i) First Come First Served scheduling
ii) Shortest Job First scheduling
iii) Priority scheduling
iv) Round Robin scheduling
v) Multilevel Queue scheduling
vi) Multilevel Feedback Queue scheduling
All of these scheduling algorithms have their own advantages and disadvantages.

7. If a process fails, most operating system write the error information to a ______
a) log file
b) another running process
c) new file
d) none of the mentioned

Answer: a

Explanation: If a process fails, most operating systems write the error information to a log file. Log file is
examined by the debugger, to find out what is the actual cause of that particular problem. Log file is useful
for system programmers for correcting errors.

8. Which facility dynamically adds probes to a running system, both in user processes and in the kernel?
a) DTrace
b) DLocate
c) DMap
d) DAdd

Answer: a

Explanation: A facility that dynamically adds probes to a running system, both in user process and in the
kernel is called DTrace. This is very much useful in troubleshooting kernels in real-time.

9. Which one of the following is not a real time operating system?


a) VxWorks
b) QNX
c) RTLinux
d) Palm OS

Answer: d

Explanation: VxWorks, QNX & RTLinux are real-time operating systems. Palm OS is a mobile operating
system. Palm OS is developed for Personal Digital Assistants (PDAs).
10. The OS X has ____________
a) monolithic kernel
b) hybrid kernel
c) microkernel
d) monolithic kernel with modules

Answer: b

Explanation: OS X has a hybrid kernel. Hybrid kernel is a combination of two different kernels. OS X is
developed by Apple and originally it is known as Mac OS X.

Operating System Questions & Answers – Processes

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

Explanation: Those systems which allow more than one process execution at a time, are called
multiprocessing systems. Uniprocessing means only one processor.

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

Explanation: In Operating Systems, each process has its own address space which contains code, data,
stack and heap segments or sections. Each process also has a list of files which is opened by the process
as well as all pending alarms, signals and various signal handlers.

3. In Unix, Which system call creates the new process?


a) fork
b) create
c) new
d) none of the mentioned

Answer: a

Explanation: In UNIX, a new process is created by fork() system call. fork() system call returns a process ID
which is generally the process id of the child process created.

4. A process can be terminated due to __________


a) normal exit
b) fatal error
c) killed by another process
d) all of the mentioned

Answer: d
Explanation: A process can be terminated normally by completing its task or because of fatal error or killed
by another process or forcefully killed by a user. When the process completes its task without any error
then it exits normally. The process may exit abnormally because of the occurrence of fatal error while it is
running. The process can be killed or terminated forcefully by another process.

5. What is the ready state of a process?


a) when process is scheduled to run after some execution
b) when process is unable to run until some task has been completed
c) when process is using the CPU
d) none of the mentioned

Answer: a

Explanation: Ready state of the process means process has all necessary resources which are required for
execution of that process when CPU is allocated. Process is ready for execution but waiting for the CPU to
be allocated.

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

Answer: b

Explanation: Interprocess Communication (IPC) is a communication mechanism that allows processes to


communicate with each other and synchronise their actions without using the same address space. IPC
can be achieved using shared memory and message passing.

7. A set of processes is deadlock if __________


a) each process is blocked and will remain so forever
b) each process is terminated
c) all processes are trying to kill each other
d) none of the mentioned

Answer: a

Explanation: Deadlock is a situation which occurs because process A is waiting for one resource and holds
another resource (blocking resource). At the same time another process B demands blocking a resource as
it is already held by a process A, process B is waiting state unless and until process A releases occupied
resource.

8. A process stack does not contain __________


a) Function parameters
b) Local variables
c) Return addresses
d) PID of child process

Answer: d

Explanation: Process stack contains Function parameters, Local variables and Return address. It does not
contain the PID of child process.

9. Which system call can be used by a parent process to determine the termination of child process?
a) wait b) exit c) fork d) get

Answer: a
Explanation: wait() system call is used by the parent process to determine termination of child process. The
parent process uses wait() system call and gets the exit status of the child process as well as the pid of the
child process which is terminated.

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

Answer: b
Explanation: The address of the next instruction to be executed by the current process is provided by the
Program Counter. After every instruction is executed, the Program Counter is incremented by 1 i.e. address
of the next instruction to be executed. CPU fetches instruction from the address denoted by Program
Counter and execute it.

Operating System Questions and Answers – Process Control Block

1. A Process Control Block(PCB) does not contain which of the following?


a) Code
b) Stack
c) Bootstrap program
d) Data

Answer: c

Explanation: Process Control Block (PCB) contains information related to a process such as Process State,
Program Counter, CPU Register, etc. Process Control Block is also known as Task Control Block.
Bootstrap program is a program which runs initially when the system or computer is booted or rebooted.

2. The number of processes completed per unit time is known as __________


a) Output
b) Throughput
c) Efficiency
d) Capacity

Answer: b

Explanation: The number of processes completed per unit time is known as Throughput. Suppose there are
4 processes A, B, C & D they are taking 1, 3, 4 & 7 units of time respectively for their executions. For 10
units of time, throughput is high if process A, B & C are running first as 3 processes can execute. If process
C runs first then throughput is low as maximum only 2 processes can execute. Throughput is low for
processes which take a long time for execution. Throughput is high for processes which take a short time
for execution.

3. The state of a process is defined by __________


a) the final activity of the process
b) the activity just executed by the process
c) the activity to next be executed by the process
d) the current activity of the process

Answer: d
Explanation: The state of a process is defined by the current activity of the process. A process state
changes when the process executes. The process states are as New, Ready, Running, Wait, Terminated.

4. Which of the following is not the state of a process?


a) New
b) Old
c) Waiting
d) Running
Answer: b

Explanation: There is no process state such as old. When a process is created then the process is in New
state. When the process gets the CPU for its execution then the process is in Running state. When the
process is waiting for an external event then the process is in a Waiting state.

5. What is a Process Control Block?


a) Process type variable
b) Data Structure
c) A secondary storage section
d) A Block in memory

Answer: b
Explanation: A Process Control Block (PCB) is a data structure. It contains information related to a process
such as Process State, Program Counter, CPU Register, etc. Process Control Block is also known as Task
Control Block.

6. The entry of all the PCBs of the current processes is in __________


a) Process Register
b) Program Counter
c) Process Table
d) Process Unit

Answer: c
Explanation: The entry of all the PCBs of the current processes is in Process Table. The Process Table has
the status of each and every process that is created in OS along with their PIDs.

7. What is the degree of multiprogramming?


a) the number of processes executed per unit time
b) the number of processes in the ready queue
c) the number of processes in the I/O queue
d) the number of processes in memory

Answer: d
Explanation: Multiprogramming means the number of processes are in the ready states. To increase
utilization of CPU, Multiprogramming is one of the most important abilities of OS. Generally, a single
process cannot use CPU or I/O at all time, whenever CPU or I/O is available another process can use it. By
doing this CPU utilization is increased.

8. A single thread of control allows the process to perform __________


a) only one task at a time
b) multiple tasks at a time
c) only two tasks at a time
d) all of the mentioned

Answer: a
Explanation: A single thread of control allows the process to perform only one task at a time. In the case of
multi-core, multiple threads can be run simultaneously and can perform multiple tasks at a time.

9. What is the objective of multiprogramming?


a) Have a process running at all time
b) Have multiple programs waiting in a queue ready to run
c) To increase CPU utilization
d) None of the mentioned

Answer: c
Explanation: The objective of multiprogramming is to increase CPU utilization. Generally, a single process
cannot use CPU or I/O at all time, whenever CPU or I/O is available another process can use it.
Multiprogramming offers this ability to OS by keeping multiple programs in a ready queue.
Operating System Questions and Answers – Process Scheduling Queues

1. 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
Explanation: PCB queue does not belong to queues for processes. PCB is a process control block which
contains information related to process. Each process is represented by PCB.

2. When the process issues an I/O request __________


a) It is placed in an I/O queue
b) It is placed in a waiting queue
c) It is placed in the ready queue
d) It is placed in the Job queue

Answer: a
Explanation: When the process issues an I/O request it is placed in an I/O queue. I/O is a resource and it
should be used effectively and every process should get access to it. There might be multiple processes
which requested for I/O. Depending on scheduling algorithm I/O is allocated to any particular process and
after completing I/O operation, I/O access is returned to the OS.

3. What will happen when a process terminates?


a) It is removed from all queues
b) It is removed from all, but the job queue
c) Its process control block is de-allocated
d) Its process control block is never de-allocated

Answer: a
Explanation: When a process terminates, it removes from all queues. All allocated resources to that
particular process are deallocated and all those resources are returned back to OS.

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

5. If all processes I/O bound, the ready queue will almost always be ______ and the Short term Scheduler
will have a ______ to do.
a) full, little
b) full, lot
c) empty, little
d) empty, lot

Answer: c
Explanation: If all processes are I/O bound, the ready queue will almost empty and the short-term
scheduler will have a little to do. I/O bound processes spend more time doing I/O than computation.
6. 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

Explanation: A medium-term scheduler selects which process to remove from memory by swapping. The
medium-term scheduler swapped out the process and later swapped in. Swapping helps to free up
memory.

7. What is a short-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: b
Explanation: A short-term scheduler selects a process which has to be executed next and allocates CPU.
Short-term scheduler selects a process from the ready queue. It selects processes frequently.

8. The primary distinction between the short term scheduler and the long term scheduler is __________
a) The length of their queues
b) The type of processes they schedule
c) The frequency of their execution
d) None of the mentioned

Answer: c
Explanation: The primary distinction between the short-term scheduler and the long-term scheduler is the
frequency of their execution. The short-term scheduler executes frequently while the long-term scheduler
executes much less frequently.

9. The only state transition that is initiated by the user process itself is __________
a) block
b) wakeup
c) dispatch
d) none of the mentioned

Answer: a
Explanation: The only state transition that is initiated by the user process itself is block. Whenever a user
process initiates an I/O request it goes into block state unless and until the I/O request is not completed.

10. In a time-sharing operating system, when the time slot given to a process is completed, the process
goes from the running state to the __________
a) Blocked state
b) Ready state
c) Suspended state
d) Terminated state

Answer: b
Explanation: In a time-sharing operating system, when the time slot given to a process is completed, the
process goes from the running state to the Ready State. In a time-sharing operating system unit time is
defined for sharing CPU, it is called a time quantum or time slice. If a process takes less than 1 time
quantum, then the process itself releases the CPU.
11. In a multiprogramming environment __________
a) the processor executes more than one process at a time
b) the programs are developed by more than one person
c) more than one process resides in the memory
d) a single user can execute many programs at the same time

Answer: c
Explanation: In a multiprogramming environment more than one process resides in the memory. Whenever
a CPU is available, one process amongst all present in memory gets the CPU for execution.
Multiprogramming increases CPU utilization.

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

Answer: b
Explanation: Suppose that a process is in “Blocked” state waiting for some I/O service. When the service is
completed, it goes to the ready state. Process never goes directly to the running state from the waiting
state. Only processes which are in ready state go to the running state whenever CPU allocated by
operating system.

13. The context of a process in the PCB of a process does not contain __________
a) the value of the CPU registers
b) the process state
c) memory-management information
d) context switch time

Answer: d
Explanation: The context of a process in the PCB of a process does not contain context switch time. When
switching CPU from one process to another, the current context of the process needs to be saved. It
includes values of the CPU registers, process states, memory-management information.

14. Which of the following need not necessarily be saved on a context switch between processes?
a) General purpose registers
b) Translation lookaside buffer
c) Program counter
d) All of the mentioned

Answer: b
Explanation: Translation Look-aside Buffer (TLB) need not necessarily be saved on a context switch
between processes. A special, small, fast-lookup hardware cache is called Translation Look-aside Buffer.
TLB used to reduce memory access time.

15. Which of the following does not interrupt a running process?


a) A device
b) Timer
c) Scheduler process
d) Power failure

Answer: c

Explanation: Scheduler process does not interrupt a running process. Scheduler process selects an
available process from a pool of available processes and allocates CPU to it.

Operating System Questions & Answers – CPU Scheduling


1. Which module gives control of the CPU to the process selected by the short-term scheduler?
a) dispatcher
b) interrupt
c) scheduler
d) none of the mentioned

Answer: a
Explanation: None.

2. The processes that are residing in main memory and are ready and waiting to execute are kept on a list
called _____________
a) job queue
b) ready queue
c) execution queue
d) process queue
Answer: b
Explanation: None.
3. The interval from the time of submission of a process to the time of completion is termed as
____________
a) waiting time
b) turnaround time
c) response time
d) throughput

Answer: b
Explanation: None.

4. Which scheduling algorithm allocates the CPU first to the process that requests the CPU first?
a) first-come, first-served scheduling
b) shortest job scheduling
c) priority scheduling
d) none of the mentioned

Answer: a

Explanation: None.

5. In priority scheduling algorithm ____________


a) CPU is allocated to the process with highest priority
b) CPU is allocated to the process with lowest priority
c) Equal priority processes can not be scheduled
d) None of the mentioned

Answer: a

Explanation: None.

6. In priority scheduling algorithm, when a process arrives at the ready queue, its priority is compared with
the priority of ____________
a) all process
b) currently running process
c) parent process
d) init process

Answer: b
Explanation: None.
7. Which algorithm is defined in Time quantum?
a) shortest job scheduling algorithm
b) round robin scheduling algorithm
c) priority scheduling algorithm
d) multilevel queue scheduling algorithm

Answer: b
Explanation: None.

8. Process are classified into different groups in ____________


a) shortest job scheduling algorithm
b) round robin scheduling algorithm
c) priority scheduling algorithm
d) multilevel queue scheduling algorithm

Answer: d
Explanation: None.

9. In multilevel feedback scheduling algorithm ____________


a) a process can move to a different classified ready queue
b) classification of ready queue is permanent
c) processes are not classified into groups
d) none of the mentioned

Answer: a
Explanation: None.

10. Which one of the following can not be scheduled by the kernel?
a) kernel level thread
b) user level thread
c) process
d) none of the mentioned

Answer: b
Explanation: User level threads are managed by thread library and the kernel is unaware of them.

Operating System Questions & Answers – CPU Scheduling - Benefits

1. CPU scheduling is the basis of ___________


a) multiprocessor systems
b) multiprogramming operating systems
c) larger memory sized systems
d) none of the mentioned

Answer: b
Explanation: None.

2. With multiprogramming ______ is used productively.


a) time
b) space
c) money
d) all of the mentioned

Answer: a
Explanation: None.

3. What are the two steps of a process execution?


a) I/O & OS Burst
b) CPU & I/O Burst
c) Memory & I/O Burst
d) OS & Memory Burst

Answer: b
Explanation: None.

4. An I/O bound program will typically have ____________


a) a few very short CPU bursts
b) many very short I/O bursts
c) many very short CPU bursts
d) a few very short I/O bursts

Answer: c
Explanation: None.

5. A process is selected from the ______ queue by the ________ scheduler, to be executed.
a) blocked, short term
b) wait, long term
c) ready, short term
d) ready, long term

Answer: c
Explanation: None.

6. In the following cases non – preemptive scheduling occurs?


a) When a process switches from the running state to the ready state
b) When a process goes from the running state to the waiting state
c) When a process switches from the waiting state to the ready state
d) All of the mentioned

Answer: b
Explanation: There is no other choice.

7. The switching of the CPU from one process or thread to another is called ____________
a) process switch
b) task switch
c) context switch
d) all of the mentioned

Answer: d
Explanation: None.

8. What is Dispatch latency?


a) the speed of dispatching a process from running to the ready state
b) the time of dispatching a process from running to ready state and keeping the CPU idle
c) the time to stop one process and start running another one
d) none of the mentioned

Answer: c
Explanation: None.

9. Scheduling is done so as to ____________


a) increase CPU utilization
b) decrease CPU utilization
c) keep the CPU more idle
d) none of the mentioned
Answer: a
Explanation: None.

10. Scheduling is done so as to ____________


a) increase the throughput
b) decrease the throughput
c) increase the duration of a specific amount of work
d) none of the mentioned

Answer: a
Explanation: None.

11. What is Turnaround time?


a) the total waiting time for a process to finish execution
b) the total time spent in the ready queue
c) the total time spent in the running queue
d) the total time from the completion till the submission of a process

Answer: d
Explanation: None.

12. Scheduling is done so as to ____________


a) increase the turnaround time
b) decrease the turnaround time
c) keep the turnaround time same
d) there is no relation between scheduling and turnaround time

Answer: b
Explanation: None.

13. What is Waiting time?


a) the total time in the blocked and waiting queues
b) the total time spent in the ready queue
c) the total time spent in the running queue
d) the total time from the completion till the submission of a process

Answer: b
Explanation: None.

14. Scheduling is done so as to ____________


a) increase the waiting time
b) keep the waiting time the same
c) decrease the waiting time
d) none of the mentioned

Answer: c
Explanation: None.

15. What is Response time?


a) the total time taken from the submission time till the completion time
b) the total time taken from the submission time till the first response is produced
c) the total time taken from submission time till the response is output
d) none of the mentioned

Answer: b
Explanation: None.

Operating System Questions and Answers – CPU Scheduling Algorithms-1

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

Answer: b
Explanation: None.

2. With round robin scheduling algorithm in a time shared system ____________


a) using very large time slices converts it into First come First served scheduling algorithm
b) using very small time slices converts it into First come First served scheduling algorithm
c) using extremely small time slices increases performance
d) using very small time slices converts it into Shortest Job First algorithm

Answer: a
Explanation: All the processes will be able to get completed.

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

Answer: a
Explanation: None.

4. Complex scheduling algorithms ____________


a) are very appropriate for very large computers
b) use minimal resources
c) use many resources
d) all of the mentioned

Answer: a
Explanation: Large computers are overloaded with a greater number of processes.

5. What is FIFO algorithm?


a) first executes the job that came in last in the queue
b) first executes the job that came in first in the queue
c) first executes the job that needs minimal processor
d) first executes the job that has maximum processor needs

Answer: b
Explanation: None.

6. The strategy of making processes that are logically runnable to be temporarily suspended is called
____________
a) Non preemptive scheduling
b) Preemptive scheduling
c) Shortest job first
d) First come First served

Answer: b
Explanation: None.

7. What is Scheduling?
a) allowing a job to use the processor
b) making proper use of processor
c) all of the mentioned
d) none of the mentioned

Answer: a
Explanation: None.

8. There are 10 different processes 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 out 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

Answer: a
Explanation: None.

9. Orders are processed in the sequence they arrive if _______ rule sequences the jobs.
a) earliest due date
b) slack time remaining
c) first come, first served
d) critical ratio

Answer: c
Explanation: None.

10. Which of the following algorithms tends to minimize the process flow time?
a) First come First served
b) Shortest Job First
c) Earliest Deadline First
d) Longest Job First

Answer: b
Explanation: None.

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

Answer: b
Explanation: None.

12. Which of the following statements are true? (GATE 2010)

I. Shortest remaining time first scheduling may cause starvation

II. Preemptive scheduling may cause starvation

III. Round robin is better than FCFS in terms of response time

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

Answer: d
Explanation: I) Shortest remaining time first scheduling is a preemptive version of shortest job scheduling. It
may cause starvation as shorter processes may keep coming and a long CPU burst process never gets
CPU.
II) Preemption may cause starvation. If priority based scheduling with preemption is used, then a low
priority process may never get CPU.
III) Round Robin Scheduling improves response time as all processes get CPU after a specified time.

Operating System Questions and Answers – The Critical Section (CS) Problem and Solutions

1. Concurrent access to shared data may result in ____________


a) data consistency
b) data insecurity
c) data inconsistency
d) none of the mentioned

Answer: c
Explanation: None.

2. A situation where several processes access and manipulate the same data concurrently and the
outcome of the execution depends on the particular order in which access takes place is called
____________
a) data consistency
b) race condition
c) aging
d) starvation

Answer: b
Explanation: None.

3. The segment of code in which the process may change common variables, update tables, write into files
is known as ____________
a) program
b) critical section
c) non – critical section
d) synchronizing

Answer: b
Explanation: None.

4. Which of the following conditions must be satisfied to solve the critical section problem?
a) Mutual Exclusion
b) Progress
c) Bounded Waiting
d) All of the mentioned

Answer: d
Explanation: None.

5. 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
Answer: a
Explanation: None.

6. Bounded waiting implies that there exists a bound on the number of times a process is allowed to enter
its critical section ____________
a) after a process has made a request to enter its critical section and before the request is granted
b) when another process is in its critical section
c) before a process has made a request to enter its critical section
d) none of the mentioned

Answer: a
Explanation: None.

7. A minimum of _____ variable(s) is/are required to be shared between processes to solve the critical
section problem.
a) one
b) two
c) three
d) four

Answer: b
Explanation: None.

8. In the bakery algorithm to solve the critical section problem ____________


a) each process is put into a queue and picked up in an ordered manner
b) each process receives a number (may or may not be unique) and the one with the lowest number is
served next
c) each process gets a unique number and the one with the highest number is served next
d) each process gets a unique number and the one with the lowest number is served next

Answer: b
Explanation: None.

Operating System Questions and Answers – Semaphores – 1

1. An un-interruptible unit is known as ____________


a) single
b) atomic
c) static
d) none of the mentioned

Answer: b
Explanation: None.

2. TestAndSet instruction is executed ____________


a) after a particular process
b) periodically
c) atomically
d) none of the mentioned

Answer: c
Explanation: None.

3. Semaphore is a/an _______ to solve the critical section problem.


a) hardware for a system
b) special program for a system
c) integer variable
d) none of the mentioned

Answer: c
Explanation: None.
4. What are the two atomic operations permissible on semaphores?
a) wait
b) stop
c) hold
d) none of the mentioned

Answer: a
Explanation: None.

5. What are Spinlocks?


a) CPU cycles wasting locks over critical sections of programs
b) Locks that avoid time wastage in context switches
c) Locks that work better on multiprocessor systems
d) All of the mentioned

Answer: d
Explanation: None.

6. What is the main disadvantage of spinlocks?


a) they are not sufficient for many process
b) they require busy waiting
c) they are unreliable sometimes
d) they are too complex for programmers

Answer: b
Explanation: None.

7. The wait operation of the semaphore basically works on the basic _______ system call.
a) stop()
b) block()
c) hold()
d) wait()

Answer: b
Explanation: None.

8. The signal operation of the semaphore basically works on the basic _______ system call.
a) continue()
b) wakeup()
c) getup()
d) start()

Answer: b
Explanation: None.

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

Answer: a
Explanation: None.

10. 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
Answer: c
Explanation: None.

11. The following program consists of 3 concurrent processes and 3 binary semaphores. The semaphores
are initialized as S0 = 1, S1 = 0, S2 = 0.

Process P0
while(true)
{
wait(S0);
print '0';
release(S1);
release(S2);
}

Process P1
wait(S1);
release(S0);

Process P2
wait(S2);
release(S0);
How many times will P0 print ‘0’?
a) At least twice
b) Exactly twice
c) Exactly thrice
d) Exactly once

Answer: a
Explanation: None.

12. Each process Pi, i = 0,1,2,3,……,9 is coded as follows.

repeat
P(mutex)
{Critical Section}
V(mutex)
forever
The code for P10 is identical except that it uses V(mutex) instead of P(mutex). What is the largest number
of processes that can be inside the critical section at any moment (the mutex being initialized to 1)?
a) 1
b) 2
c) 3
d) None of the mentioned

Answer: c
Explanation: Any one of the 9 processes can get into critical section after executing P(mutex) which
decrements the mutex value to 0. At this time P10 can enter critical section by incrementing the value to 1.
Now any of the 9 processes can enter the critical section by again decrementing the mutex value to 0.
None of the remaining processes can get into their critical sections.

13. Two processes, P1 and P2, need to access a critical section of code. Consider the following
synchronization construct used by the processes.

Process P1 :
while(true)
{
w1 = true;
while(w2 == true);
Critical section
w1 = false;
}
Remainder Section

Process P2 :
while(true)
{
w2 = true;
while(w1 == true);
Critical section
w2 = false;
}
Remainder Section
Here, w1 and w2 have shared variables, which are initialized to false. Which one of the following
statements is TRUE about the above construct?
a) It does not ensure mutual exclusion
b) It does not ensure bounded waiting
c) It requires that processes enter the critical section in strict alternation
d) It does not prevent deadlocks but ensures mutual exclusion

Answer: d
Explanation: None.

Operating System Questions and Answers – Memory Management – Swapping Processes – 1


1. What is Address Binding?
a) going to an address in memory
b) locating an address with the help of another address
c) binding two addresses together to form a new address in a different memory space
d) a mapping from one address space to another

Answer: d
Explanation: None.

2. Binding of instructions and data to memory addresses can be done at ____________


a) Compile time
b) Load time
c) Execution time
d) All of the mentioned

Answer: d
Explanation: None.

3. If the process can be moved during its execution from one memory segment to another, then binding
must be ____________
a) delayed until run time
b) preponed to compile time
c) preponed to load time
d) none of the mentioned

Answer: a
Explanation: None.

4. What is Dynamic loading?


a) loading multiple routines dynamically
b) loading a routine only when it is called
c) loading multiple routines randomly
d) none of the mentioned

Answer: b
Explanation: None.
5. What is the advantage of dynamic loading?
a) A used routine is used multiple times
b) An unused routine is never loaded
c) CPU utilization increases
d) All of the mentioned

Answer: b
Explanation: None.

6. The idea of overlays is to ____________


a) data that are needed at any given time
b) enable a process to be larger than the amount of memory allocated to it
c) keep in memory only those instructions
d) all of the mentioned

Answer: d
Explanation: None.

7. The ___________ must design and program the overlay structure.


a) programmer
b) system architect
c) system designer
d) none of the mentioned

Answer: a
Explanation: None.

8. The ___________ swaps processes in and out of the memory.


a) Memory manager
b) CPU
c) CPU manager
d) User

Answer: a
Explanation: None.

9. If a higher priority process arrives and wants service, the memory manager can swap out the lower
priority process to execute the higher priority process. When the higher priority process finishes, the lower
priority process is swapped back in and continues execution. This variant of swapping is sometimes called?
a) priority swapping
b) pull out, push in
c) roll out, roll in
d) none of the mentioned

Answer: c
Explanation: None.

10. If binding is done at assembly or load time, then the process _____ be moved to different locations after
being swapped out and in again.
a) can
b) must
c) can never
d) may

Answer: c
Explanation: None.

11. In a system that does not support swapping ____________


a) the compiler normally binds symbolic addresses (variables) to relocatable addresses
b) the compiler normally binds symbolic addresses to physical addresses
c) the loader binds relocatable addresses to physical addresses
d) binding of symbolic addresses to physical addresses normally takes place during execution

Answer: a
Explanation: None.

12. Which of the following is TRUE?


a) Overlays are used to increase the size of physical memory
b) Overlays are used to increase the logical address space
c) When overlays are used, the size of a process is not limited to the size of the physical memory
d) Overlays are used whenever the physical address space is smaller than the logical address space

Answer: c
Explanation: None.

Operating System Questions & Answers – Memory Management

1. CPU fetches the instruction from memory according to the value of ____________
a) program counter
b) status register
c) instruction register
d) program status word

Answer: a
Explanation: None.

2. A memory buffer used to accommodate a speed differential is called ____________


a) stack pointer
b) cache
c) accumulator
d) disk buffer

Answer: b
Explanation: None.

3. Which one of the following is the address generated by CPU?


a) physical address
b) absolute address
c) logical address
d) none of the mentioned

Answer: c
Explanation: None.

4. Run time mapping from virtual to physical address is done by ____________


a) Memory management unit
b) CPU
c) PCI
d) None of the mentioned

Answer: a
Explanation: None.
5. Memory management technique in which system stores and retrieves data from secondary storage for
use in main memory is called?
a) fragmentation
b) paging
c) mapping
d) none of the mentioned

Answer: b
Explanation: None.

6. The address of a page table in memory is pointed by ____________


a) stack pointer
b) page table base register
c) page register
d) program counter

Answer: b
Explanation: None.

7. Program always deals with ____________


a) logical address
b) absolute address
c) physical address
d) relative address

Answer: a
Explanation: None.

8. The page table contains ____________


a) base address of each page in physical memory
b) page offset
c) page size
d) none of the mentioned

Answer: a
Explanation: None.

9. What is compaction?
a) a technique for overcoming internal fragmentation
b) a paging technique
c) a technique for overcoming external fragmentation
d) a technique for overcoming fatal error

Answer: c
Explanation: None.

10. Operating System maintains the page table for ____________


a) each process
b) each thread
c) each instruction
d) each address

Answer: a
Explanation: None.

Operating System Questions and Answers – Memory Management – Paging – 1

1. Physical memory is broken into fixed-sized blocks called ________


a) frames
b) pages
c) backing store
d) none of the mentioned

Answer: a
Explanation: None.

2. Logical memory is broken into blocks of the same size called _________
a) frames
b) pages
c) backing store
d) none of the mentioned

Answer: b
Explanation: None.

3. Every address generated by the CPU is divided into two parts. They are ____________
a) frame bit & page number
b) page number & page offset
c) page offset & frame bit
d) frame offset & page offset

Answer: b
Explanation: None.

4. The __________ is used as an index into the page table.


a) frame bit
b) page number
c) page offset
d) frame offset

Answer: b
Explanation: None.
5. The _____ table contains the base address of each page in physical memory.
a) process
b) memory
c) page
d) frame

Answer: c
Explanation: None.

6. The size of a page is typically ____________


a) varied
b) power of 2
c) power of 4
d) none of the mentioned

Answer: b
Explanation: None.

7. If the size of logical address space is 2 to the power of m, and a page size is 2 to the power of n
addressing units, then the high order _____ bits of a logical address designate the page number, and the
____ low order bits designate the page offset.
a) m, n
b) n, m
c) m – n, m
d) m – n, n

Answer: d
Explanation: None.
8. With paging there is no ________ fragmentation.
a) internal
b) external
c) either type of
d) none of the mentioned

Answer: b
Explanation: None.

9. The operating system maintains a ______ table that keeps track of how many frames have been
allocated, how many are there, and how many are available.
a) page
b) mapping
c) frame
d) memory

Answer: c
Explanation: None.

10. Paging increases the ______ time.


a) waiting b) execution c) context – switch d) all of the mentioned

Answer: c
Explanation: None.

11. Smaller page tables are implemented as a set of _______


a) queues
b) stacks
c) counters
d) registers

Answer: d
Explanation: None.

12. The page table registers should be built with _______


a) very low speed logic
b) very high speed logic
c) a large memory space
d) none of the mentioned

Answer: b
Explanation: None.

13. For larger page tables, they are kept in main memory and a __________ points to the page table.
a) page table base register
b) page table base pointer
c) page table register pointer
d) page table base

Answer: a
Explanation: None.

14. For every process there is a __________


a) page table
b) copy of page table
c) pointer to page table
d) all of the mentioned

Answer: a
Explanation: None.
15. Time taken in memory access through PTBR is ____________
a) extended by a factor of 3
b) extended by a factor of 2
c) slowed by a factor of 3
d) slowed by a factor of 2

Answer: d
Explanation: None.

Operating System Questions & Answers – Virtual Memory – Demand Paging

1. Virtual memory allows ____________


a) execution of a process that may not be completely in memory
b) a program to be smaller than the physical memory
c) a program to be larger than the secondary storage
d) execution of a process without being in physical memory

Answer: a
Explanation: None.

2. The instruction being executed, must be in ____________


a) physical memory
b) logical memory
c) physical & logical memory
d) none of the mentioned

Answer: a
Explanation: None.

3. Error handler codes, to handle unusual errors are ____________


a) almost never executed
b) executed very often
c) executed periodically
d) none of the mentioned

Answer: a
Explanation: None.

4. The ability to execute a program that is only partially in memory has benefits like ____________
a) The amount of physical memory cannot put a constraint on the program
b) Programs for an extremely large virtual space can be created
c) Throughput increases
d) All of the mentioned

Answer: d
Explanation: None.

5. In virtual memory. the programmer __________ of overlays.


a) has to take care
b) does not have to take care
c) all of the mentioned
d) none of the mentioned

Answer: b
Explanation: None.

6. Virtual memory is normally implemented by ________


a) demand paging
b) buses
c) virtualization
d) all of the mentioned

Answer: a
Explanation: None.

7. Segment replacement algorithms are more complex than page replacement algorithms because
____________
a) Segments are better than pages
b) Pages are better than segments
c) Segments have variable sizes
d) Segments have fixed sizes

Answer: c
Explanation: None.

8. A swapper manipulates ___________ whereas the pager is concerned with individual _______ of a
process.
a) the entire process, parts
b) all the pages of a process, segments
c) the entire process, pages
d) none of the mentioned

Answer: c
Explanation: None.

9. Using a pager ____________


a) increases the swap time
b) decreases the swap time
c) decreases the swap time & amount of physical memory needed
d) increases the amount of physical memory needed

Answer: c
Explanation: None.

10. The valid – invalid bit, in this case, when valid indicates?
a) the page is not legal
b) the page is illegal
c) the page is in memory
d) the page is not in memory

Answer: c
Explanation: None.

11. A page fault occurs when?


a) a page gives inconsistent data
b) a page cannot be accessed due to its absence from memory
c) a page is invisible
d) all of the mentioned

Answer: b
Explanation: None.

12. When a page fault occurs, the state of the interrupted process is ____________
a) disrupted
b) invalid
c) saved
d) none of the mentioned

Answer: c
Explanation: None.
13. When a process begins execution with no pages in memory?
a) process execution becomes impossible
b) a page fault occurs for every page brought into memory
c) process causes system crash
d) none of the mentioned

Answer: b
Explanation: None.

14. If the memory access time is denoted by ‘ma’ and ‘p’ is the probability of a page fault (0 <= p <= 1).
Then the effective access time for a demand paged memory is ____________
a) p x ma + (1-p) x page fault time
b) ma + page fault time
c) (1-p) x ma + p x page fault time
d) none of the mentioned

Answer: c
Explanation: None.

15. When the page fault rate is low ____________


a) the turnaround time increases
b) the effective access time increases
c) the effective access time decreases
d) turnaround time & effective access time increases

Answer: c
Explanation: None.

16. Locality of reference implies that the page reference being made by a process ____________
a) will always be to the page used in the previous page reference
b) is likely to be one of the pages used in the last few page references
c) will always be one of the pages existing in memory
d) will always lead to page faults

Answer: b
Explanation: None.

Operating System Questions & Answers – Virtual Memory – Page Replacement Algorithms – 2

1. When using counters to implement LRU, we replace the page with the ____________
a) smallest time value
b) largest time value
c) greatest size
d) none of the mentioned

Answer: a
Explanation: Whenever a reference to a page is made, the contents of the clock register are copied into the
time-of-use field in the page-table entry for that page. In this way, we always have the time of the last
reference to each page.

2. In the stack implementation of the LRU algorithm, a stack can be maintained in a manner ____________
a) whenever a page is used, it is removed from the stack and put on bottom
b) the bottom of the stack is the LRU page
c) the top of the stack contains the LRU page and all new pages are added to the top
d) none of the mentioned

Answer: b
Explanation: None.

3. There is a set of page replacement algorithms that can never exhibit Belady’s Anomaly, called
____________
a) queue algorithms
b) stack algorithms
c) string algorithms
d) none of the mentioned

Answer: b
Explanation: None.

4. Applying the LRU page replacement to the following reference string.


12452124
The main memory can accommodate 3 pages and it already has pages 1 and 2. Page 1 came in before
page 2.
How many page faults will occur?
a) 2 b) 3 c) 4 d) 5
Answer: c
Explanation: None.
5. Increasing the RAM of a computer typically improves performance because ____________
a) Virtual memory increases
b) Larger RAMs are faster
c) Fewer page faults occur
d) None of the mentioned

Answer: c
Explanation: None.

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

Answer: b
Explanation: None.

7. The minimum number of page frames that must be allocated to a running process in a virtual memory
environment is determined by ____________
a) the instruction set architecture
b) page size
c) physical memory size
d) number of processes in memory

Answer: a
Explanation: None.

8. What is the reason for using the LFU page replacement algorithm?
a) an actively used page should have a large reference count
b) a less used page has more chances to be used again
c) it is extremely efficient and optimal
d) all of the mentioned

Answer: a
Explanation: None.

9. What is the reason for using the MFU page replacement algorithm?
a) an actively used page should have a large reference count
b) a less used page has more chances to be used again
c) it is extremely efficient and optimal
d) all of the mentioned

Answer: b
Explanation: None.
10. The implementation of the LFU and the MFU algorithm is very uncommon because ____________
a) they are too complicated
b) they are optimal
c) they are expensive
d) all of the mentioned

Answer: c
Explanation: None.

You might also like