Operating System MCQs
Operating System MCQs
1. small
2. Large
1. True
2. False
1. interactive
2. Non-interactive
3. Fore ground
4. Preemptive
1. Non-preemptive scheduling
2. Preemptive scheduling
3. Dispatching scheduling
4. FCFS scheduling
The procedure “The time at which the process finished working MINUS the arrival time of
the process MINUS CPU burst for that process” will help calculate the _________.
1. Non-preemptive Shortest Job First scheduling
2. Preemptive Shortest Job First scheduling.
3. FCFS
4. RR Scheduling
1. Kernel
2. User
First _______ entries in Per Process File Descriptor Table are used as soon as the process is
created.
1
2
3
4
1. True
2. False
When process opens its first file explicitly it will get descriptor number _________
1
2
3
4
Taking the CPU from one process and giving the CPU to another process is termed as
1. Context switching
2. Dispatching
3. Swapping
4. Tracking
The correct command for compiling C program named program.c in Linux environment is
Same
Different
Kernel threads
Kernel threads are supported directly by the operating system. The kernel performs the
scheduling, creation, and management in —— Command displays the status of a process.
ls
ps
gcc
cat
In Unix/ Linux, by default the standard output file is attached to the ___________
1. File
2. Screen
3. Printer
4. Scanner
1. nice
2. cmd
3. cat
4. grep
ls
cs
top
cd
___________ is the basis of queuing theory which is branch of mathematics used to analyze
systems involving queues and servers.
1. Little’s Formula
2. Deterministic Modeling
3. Queuing Theory
4. Queuing analysis
The process id returned to the child process after successful fork system call execution is
______.
0
1
2
3
Priority
Weight
Time
Scheduling
None of these
Kernel threads
In Unix/ Linux, by default the standard input file is attached to the ___________
Mouse
Keyboard
Light pen
Joystick
Deadlock
Aging
Starvation
None of these
A solution to the critical section problem must satisfy the following three requirements: Mutual
Exclusion
Progress
Bounded Waiting
________ scheduling algorithm is sometimes called shortest remaining time first scheduling
algorithm.
Non-preemptive SJF
Priority Scheduling
FCFS
In Unix/ Linux, by default the standard output file is attached to the ___________
1. File
2. Screen
3. Printer
4. Scanner
When process opens its first file explicitly it will get descriptor number _________
1
2
3
4
Expert system
If your processor does not have two slots empty in Per Process File Descriptor Table, then your
_________ system call will fail.
1. Pipe
2. Read
3. Write
4. Open
1. ANSI
2. IEEE
3. ISO
4. ACM
1. Starvation
2. Deadlock
3. Aging
4. None of the these
_____ system call is used to write to a file or FIFO or any other IPC channel.
1. read
2. write
3. open
4. fork
_________________ scheduling allows a process to move between queues.
1. Round Robin
2. First Come First Serve
3. Multilevel Feedback Queue
4. Shortest Remaining Time First
The hardware mechanism that enables a device to notify CPU is called an ————-
► Interrupt
► Signal
► Trap
► Process
You can display the contents (names of files and directories) of a directory in UNIX/Linux
directory structure with the ————— command.
►ll
►s
► ls
► fork
► wait
► exec
► exit
► Symmetric
► Asymmetric
► ps
► top
► who
► ls
Question6 ( Marks: 1 ) – Please choose one
► fg
► bg
► jobs
► kill
You can use the ————- command to display the status of suspended and background
processes
► fg
► bg
► jobs
► kill
► <Ctrl-A>
► <Ctrl-C>
► <Ctrl-Z>
► Multi tasking
► Interactive
► All of these
► Multi user
► Efficiency
► Usability
► /dev
► /boot
► /lib
Question12 ( Marks: 1 ) – Please choose one
scheduler selects the process from the job pool and put them in main memory.
► Long term
► Short term
► Medium term
► Swapper
In indirect inter process communication, a sender mention the name of the recipient.
► do
► do not
► Semaphore
► Monitor
► Critical region
► Critical section
► Spinlock
► Monitor
► Critical region
► Critical section
► True
► False
The performance of Round Robin algorithm does NOT depends heavily on the size of the time
quantum.
► True
► False
The following requirement for solving critical section problem is known as _. “There exists
a bound on the number of times that other processes are allowed to enter their critical sections
after a process has made a request to enter its critical section and before that request is granted.”
► Progress
► Bounded Waiting
► Mutual Exclusion
► Critical Region
► Swap space
10243 bytes
1000000 bytes
User interface
Hardware
Kernel
DOS
Windows
UNIX
rmdir
mkdir
cp
gcc
Files that start with a ——– in UNIX/Linux directory structure are known as hidden files .
. (dot)
# ( hash )
/ (slash)
~ (tilt)
The creating process is called a————— process while the new processes are called the
————– of that process
Children, parent
Parent, children
Zombie, single
Bounded
Unbounded
Bounded
Unbounded
Pipes
BSD Sockets
File descriptor
Input Redirection
Output Redirection
FIFO
ps
top
who
ls
You can display all of the signals supported by your system, along with their numbers, by using
the ———–command
<Ctrl-A>
fg
jobs
kill -l
The time it takes for the dispatcher to stop one process and start another running is known as the
———–.
Dispatch latency
Scheduling
Context switching
preemptive
non-preemptive
Preemptive only
non-preemptive only
preemptive or non-preemptive.
None of the given options
First-Come-First-Served (FCFS)
Round-Robin
The basic purpose of ________________is to help the users to utilize the hardware
Operating system
Application software
All Software
Application software
Memory
Virtual memory
__________ scheduler selects the process from the job pool and put them in main
memory.
Long term
Short term
Medium term
Swapper
terminates.
wait
fork
exit
exec
Deterministing modeling
Analytic evaluation
None of above
8. Utilities used for system administration (halt, ifconfig, fdisk, etc.) are stored in
_____________ directory.
a) /dev
b) /boot
c) /lib
d) /sbin
10. You can use the mv file1 file2 command to move ______________
a) file1 to file2.
b) file 2 to file 1
c) this command will not work for moving files
d) None of the option is correct.
e) Both option a and b are correct
11. Taking the CPU from one process and giving the CPU to another process is termed as
a) Context Switching
b) Dispatching
c) Swapping
d) Tracking
13. A Process A that has finished working, as well as its parent process has also finished its
execution. In this state the process A will be called as _________ process.
a) Child
b) Thread
c) Zombie
d) Fork
15. In ________ communication the process which wants to communicate with the other process
must explicitly name the recipient and the sender.
a) Direct
b) Indirect
c) Automatic
d) Self
16. In indirect inter process communication, a sender ________ mention the name of the
recipient.
a) does
b) does not
19. When a process opens its first file explicitly it will get descriptor number _________
a) 1
b) 2
c) 3
d) 4
20. In Unix/ Linux, by default the standard input file is attached to the ___________
a) Mouse
b) Keyboard
c) Light pen
d) Joystick
Question
The hardware mechanism that enables a device to notify CPU is called an ————-
► Interrupt
► Signal
► Trap
► Process
Question
You can display the contents (names of files and directories) of a directory in UNIX/Linux
directory structure with the ————— command.
►ll
►s
► ls
Question
► Fork
► Wait
► Exec
► Exit
Question
► Symmetric
► Asymmetric
Question
——– command gives a snapshot of the current processes.
► ps
► top
► who
► ls
Question
► fg
► bg
► jobs
► kill
Question
You can use the ————- command to display the status of suspended and background
processes
► fg
► bg
► jobs
► kill
Question
► <Ctrl-A>
► <Ctrl-C>
► <Ctrl-Z>
Question
► Multi tasking
► Interactive
► All of these
► Multi user
Question
► Efficiency
► Usability
Question
/bin
► /dev
► /boot
► /lib
Question
———— scheduler selects the process from the job pool and put them in main memory.
► Long term
► Short term
► Medium term
► Swapper
Question
In indirect inter process communication, a sender mention the name of the recipient.
► do
► do not
Question
A ————— is an integer variable that, apart from initialization is accessible only through
two standard atomic operations: wait and signal.
► Semaphore
► Monitor
► Critical region
► Critical section
Question
► Spinlock
► Monitor
► Critical region
► Critical section
Question
► True
► False
Question
The performance of Round Robin algorithm does NOT depends heavily on the size of the time
quantum.
► True
► False
Question
The following requirement for solving critical section problem is known as —–_. “There exists a
bound on the number of times that other processes are allowed to enter their critical sections after
a process has made a request to enter its critical section and before that request is granted.”
► Progress
► Bounded Waiting
► Mutual Exclusion
► Critical Region
Question
The critical section problem can not be solved by the following except
► Swap space
Question
I MB or 1 megabyte is equivalent to—-
1024 bytes
10243 bytes
1000000 bytes
Question
User interface
Hardware
Kernel
Question
DOS
Windows
UNIX
Question
rmdir
mkdir
cp
gcc
Question
Files that start with a ——– in UNIX/Linux directory structure are known as hidden files .
. (dot)
# ( hash )
/ (slash)
~ (tilt)
Question
The creating process is called a————— process while the new processes are called the
————– of that process
Children, parent
Parent, children
Zombie, single
Question
Bounded
Unbounded
Pipes
BSD Sockets
Question
File descriptor
Input Redirection
Output Redirection
FIFO
Question
top
who
ls
Question
You can display all of the signals supported by your system, along with their numbers, by using
the ———–command
<Ctrl-A>
fg
jobs
kill -l
Question
The time it takes for the dispatcher to stop one process and start another running is known as the
———–.
Dispatch latency
Scheduling
Context switching
Question
First-Come, First-Served (FCFS) is a ————–scheduling algorithm.
preemptive
non-preemptive
Question
Preemptive only
non-preemptive only
preemptive or non-preemptive.
None of the given options
Question
First-Come-First-Served (FCFS)
Round-Robin
Question
The basic purpose of ________________is to help the users to utilize the hardware
Operating system
Application software
All Software
Question
Application software
Memory
Virtual memory
Question
__________ scheduler selects the process from the job pool and put them in main
memory.
Long term
Short term
Medium term
Swapper
Question
A parent process calling __________ system call will be suspended until children process
terminates.
wait
fork
exit
exec
Question
Deterministing modeling
Analytic evaluation
None of above
a) Efficiency
b) Large Virtual Memory
c) Large secondary storage device
d) Usability
a) True
b) False
a) 1
b) 2
c) 3
d) 4
Utilities used for system administration (halt, ifconfig, fdisk, etc.) are stored in _____________
directory.
a) /dev
b) /boot
c) /lib
d) /sbin
a) Create
b) Move
c) Remove
d) Modify
a) file1 to file2.
b) file 2 to file 1
c) this command will not work for moving files
d) None of the option is correct.
e) Both option a and b are correct
Taking the CPU from one process and giving the CPU to another process is termed as
a) Context Switching
b) Dispatching
c) Swapping
d) Tracking
a) Long term
b) Short term
c) Medium term
d) Swap space
A Process A that has finished working, as well as its parent process has also finished its
execution. In this state the process A will be called as _________ process.
a) Child
b) Thread
c) Zombie
d) Fork
15. In ________ communication the process which wants to communicate with the other process
must explicitly name the recipient and the sender.
a) Direct
b) Indirect
c) Automatic
d) Self
16. In indirect inter process communication, a sender ________ mention the name of the
recipient.
a) does
b) does not
Operating system
Application software
All Software
All of the given
/bin
/dev
/boot
/etc
True
False
Question # 7 of 10 ( Start time: 05:10:58 PM ) Total Marks: 1
A time sharing system is
Select correct option:
Multi user
Multi tasking
Interactive
All of these
Command
Process
Software
Compiler
ls
cp
cd
mv
► OS/2
► Windows
► Unix
► None of the above
►. (dot)
► # ( hash )
► / (slash)
► ~ (tilt)
► System Call
► Command
► Directory
► None of Above
► ps
► top
► who
► ls
► CPU Burst
► IO Burst
► Time Slice
► None of Above
► context switching
► scheduling
► quantum period
► latency
► /bin
► /boot
► /dev
► /etc
► Non-preemptive SJF
► Priority Scheduling
► Preemptive Shortest Job First
► FCFS
► Spinlock
► Monitor
► Critical region
► Critical section
► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options
► True
► False
► Command
► Process
► Software
► Compiler
► User interface
► Hardware
► Kernel
► None of the given options
CS604 – Operating System – Question16 ( M a r k s: 1 ) .
The manual pages can be read in Linux using ____ command.
Select correct option:
► man
► wan
► desc
► help
Same
Different
Kernel threads
Kernel threads are supported directly by the operating system. The kernel performs the
scheduling, creation, and management in —— command display the status of a process.
ls
ps
gcc
cat
First _______ entries in Per Process File Descriptor Table are used as soon as the process is
created.
In Unix/ Linux, by default the standard output file is attached to the ___________
File
Screen
Printer
Scanner
cmd
cat
grep
The procedure �The time at which the process finished working MINUS the arrival time of the
process MINUS CPU burst for that process� will help calculate the _________.
FCFS
RR Scheduling
Round Robin
None of these
cs
top
cd
___________ is the basis of queuing theory which is branch of mathematics used to analyze
systems involving queues and servers.
Little�s Formula
Deterministic Modeling
Queuing Theory
Queuing analysis
Kernel
User
First _______ entries in Per Process File Descriptor Table are used as soon as the process is
created.
Priority
Weight
Time
Scheduling
None of these
Kernel threads
In Unix/ Linux, by default the standard input file is attached to the ___________
Mouse
Keyboard
Light pen
Joystick
Deadlock
Aging
Starvation
None of these
_______ scheduling algorithm is sometimes called shortest remaining time first scheduling
algorithm.
Non-preemptive SJF
Priority Scheduling
FCFS
___________ is the basis of queuing theory which is branch of mathematics used to analyze
systems involving queues and servers.
Little�s Formula
Deterministic Modeling
Queuing Theory
Queuing analysis
In Unix/ Linux, by default the standard output file is attached to the ___________
File
Screen
Printer
Scanner
When process opens its first file explicitly it will get descriptor number _________
If your processor does not have two slots empty in Per Process File Descriptor Table, then your
_________ system call will fail.
Pipe
Read
Write
Open
Round Robin
Priority
ANSI
IEEE
ISO
ACM
___________ is a solution to the problem of indefinite blockage of low-priority processes.
Starvation
Deadlock
Aging
_____ system call is used to write to a file or FIFO or any other IPC channel.
read
write
open
fork
List and define the different metrics by which might evaluate a scheduler (List at least 4). 5
marks
2. Write brief the multilevel feedback queue scheduling. 5 marks
3. Assumption made while formulating a solution to the critical section problem. 2 marks
4. There are many commands. Write the method through which these commands can
communicate with each other. 3 marks
5. Write Difference between SJF and Shortest Remaining Time First Scheduling algorithm. 3
marks
6. Write formula for calculating waiting time in preemptive Shortest Job First Algorithm. 2
marks
7. Define race condition and how prevent this condition. 2 marks
int number[n];
CS604 – Operating System – Question19 ( M a r k s: 2 )
How a pipe can be created?
Ans: The pipe() system call creates a pipe and returns two file descriptors, one for
reading and second for writing. The files associated with these
file descriptors are streams and are both opened for reading and writing. Naturally, to use
such a channel properly, one needs to form some kind of protocol in which data is sent
If no process is executing in its critical section and some processes wish to enter their
critical sections, then only those processes that are not executing in their remainder
section can participate in the decision on which will enter its critical section next, and
3. Bounded Waiting
There exists a bound on the number of times that other processes are allowed to enter
their critical sections after a process has made a request to enter its critical section and
starvation). A process that is ready to run but lacking the CPU can be considered
Flag[i] = True;
Turn = j;
do{
while(Flag[j] = True && turn==j);
critical section
Flag[i] = False;
remainder section
} While(1)
Ans: To prove mutual exclusion, note that Pi enters its critical section only if either
flag[j]=false or turn=i. Also, if both processes were executing in their critical sections at
the same time, then flag[0]= = flag[1]= = true. These two observations suggest that P0 and
P1 could not have found both conditions in the while statement true at the same time,
since the value of ‘turn’ can either be 0 or 1. Hence only one process say P0 must have
do
{
while (TestAndSet(lock)) ;
Critical section
lock=false;
Remainder section
} while(1);