CS604 MIDTERM SOLVED MCQS by Rafiqe
CS604 MIDTERM SOLVED MCQS by Rafiqe
Bounded waiting
3. Which of the following is not a major advantage of multiprogramming
system is
More than one jobs can be processed at a given time
CPU utilization can be increases
Jobs can be completed quickly
If more process can exist, the rest must wait until the
CPU is free and can be rescheduled page 31
4. We can suspend a foreground process by pressing which
sends a STOP/SUSPEND signal to the process.
Ctrl-w
Ctrl-x
Ctrl-y
Ctrl-z pg#65
5. command in LINUX is used to copy file.
ls
cp pg#27
0304-1659294 1
AL-JUNAID TECH INSTITUTE
mv
mkdir
6. System calls provide the interface between a _ and the Operating System.
User
Machine
Process pg#15
Kernel
0304-1659294 2
AL-JUNAID TECH INSTITUTE
11. The section of code before the
critical section is called .
o Entry section (Page 97)
o Remainder section
Exit section
Crystal section AL-JUNAID INSTITUTE OF GROUP
12. are used by shell commands to pass data from one shell
pipeline to another, without creating temporary files.
Pipes
Message queues
BSD sockets
FIFOs (Page 58)
13. system call is used to create a child process.
Fork ( page 48)
Parent
Child
None of them
13. The problem with priority scheduling algorithm is .
Deadlock
15. If your processor does not have two slots empty in Pre Process file
Descriptor Table, then your system call will fail.
Pipe (page 52)
0304-1659294 3
AL-JUNAID TECH INSTITUTE
Read
Write
Open
16. Which of the following are TRUE for direct communication?
A communication link can be associated with N number of
process(N=maximum number of processes supported by system)
A communication link can be associated with exactly two processes (pg 44)
Exactly N/2 links exist between each pair of
processes(N=maximum number of processes supported by
system)
Exactly two links exist between each pair of processes
19. Which scheduling algorithm allocates the CPU first to the process that
request the CPU first?
First come First served scheduling (page 80)
Shortest job scheduling
Priority scheduling
0304-1659294 4
AL-JUNAID TECH INSTITUTE
None of the given
20. Bounded buffer is a buffer of size.
Variable
0304-1659294 5
AL-JUNAID TECH INSTITUTE
Layered
Micro kernels Page
28. The approach include the ease of extending the OS.
Macro Kernels AL-JUNAID INSTITUTE OF GROUP
Small Kernel
Monolithic Kernel
Micro Kernel (page 19)
29. Which of the following information is not displayed with top command?
0304-1659294 6
AL-JUNAID TECH INSTITUTE
Shortest Remaining Time First
33. Which part of the computer system helps in managing the file and
memory management system?
34. CPU bound processes are scheduled before short or I/O bound
processes in __________scheduling, therefore, resulting in less CPU
and device utilization.
First Come First Serve (Page 81)
Round Robin
Shortest Job First
Shortest Remaining Time First
0304-1659294 7
AL-JUNAID TECH INSTITUTE
38. The solution type where in critical section we use “entry section and “exit
section” is
called kind of .
Hardware solution
Assumption
Software Solution (Page 98)
Operating System Solution
41. A parent process calling system call will be suspended until children
processes terminate.
Multi user
0304-1659294 8
AL-JUNAID TECH INSTITUTE
Multitasking
Interactive
43. Pipes simply used on the command line to connect the standard input of
one process to the standard input of another. Which of the following
syntax is correct use of command line Linux/UNIX pipes?
CPU
Memory
Compact Disc (Page 1)
I/O Devices
45. Consider a system of N processes (Po, P1……..Pn-1). Each process in its
critical section and process may be changing common, updating a table.
No other process is allowed to execute in its section. This problem is
called _.
Bakery algorithm
0304-1659294 9
AL-JUNAID TECH INSTITUTE
Shortest Job First
47. Linux uses___directory to store system configuration files.
/bin
/dev
/boot
/etc (page 23)
48. A thread shares its resources (like data section, code section, open
files, signal) with
Other process similar to the one that the thread belongs to
Other threads that belong to similar processes
Other thread that belong to the same processes pg#69+Google
All of the mentioned
49. is a piece of code in a cooperating process in which the process
may update shared data (variable, file, database, etc).
Critical Analysis
Critical Section pg#97
Critical Path
Critical Code
0304-1659294 10
AL-JUNAID TECH INSTITUTE
and device utilization.
Shortest Job First
Shortest Remaining Time first
First Come First Serve (page 80)
Round-Robin
53. Using system, we can create a new process in Linux.
Fork pg#36
Exec
Wait
Exit
54. A shell command mkfifo can be used to create a/an _
Named pipe pg57
Message queue
Pipe
Unnamed pipe
55. While using the read /write system call which data type is used to return
the size of file to buffer from file descriptor fd?
Pipefd
SSIZE-MaX pg#45
FIFO
Ssize_t
56. For reading input, which of the following system call is used?
write
rd
read pg#45
change
0304-1659294 11
AL-JUNAID TECH INSTITUTE
Many-to-One
58. A solution to the critical section must satisfy the following requirements
except
Progress
Mutual Exclusion
Bounded Waiting
Race Condition pg#98
0304-1659294 12
AL-JUNAID TECH INSTITUTE
Kernel, hardware
Dos, Windows
Windows, Kernel
64. You can have a thread wait for another thread with the same process by using the
system call.
pthread_join() pg#73
pthread_exit()
pthread_create()
pthread_terminate()
65. In indirect communication between processes P and Q
There is another process R to handle and pass on the messages between P and
Q.
There is another machine between the two processes to help communication
There is mailbox to help communication between P and Q Page
44
A link is associated with exactly two processes
66. Which process can be affected by other processes executing in the system?
cooperating process pg#41+Google
child process
parent process
init process
67. are used to show executions of processes.
Gantt charts pg#85
Time slice
Quantum
Sequence
0304-1659294 13
AL-JUNAID TECH INSTITUTE
69. Linux redirection features can be used to and attach other files with them
for a single execution of a command.
detach the default files from stdin and stdout
detach the default files from stdin and stderr
detach the default files from stdin, stdout and stderr pg 55
detach the default files from stdout, and stderr
70. Linux redirection features can be used to and attach other files with them
for a single execution of a command.
detach the default files from stdin and stdout
detach the default files from stdin and stderr
detach the default files from stdin, stdout and stderr pg 55
detach the default files from stdout, and stderr
71. A is an integer variable that, apart from initialization is accessible only
through standard atomic operations.
Mutual Exclusion
Semaphore pg#108
Mutex
Busy waiting
72. _______displays information about the top processes.
Is
Cs
Top Page 64
Cd
73. In critical section problem, each process must first request permission to
enter its critical section. The section of code implementing this request is
called the .
Remainder section
Entry section page 97
Exit section
Sub section
74. scheduling allows a process to move between queues.
Round Robin
First Come First Serve
Multilevel Feedback Queue page 89
0304-1659294 14
AL-JUNAID TECH INSTITUTE
Shortest Remaining Time First
75. To terminate a process <ctrl-c> is pressed, which signal it actually pass to
process for
termination?
SIGTERM
SIGINT pg#66
SIGKILL
SIGTRAP
76. The time it takes for the dispatcher to stop one process and start another
running is
known as the
Dispatch latency Page 79
Dispatch time
Stop time
Sleep time
77. In inter process communication, a sender mention the name of a
recipient.
Indirect
Direct pg#43
Automatic
Synchronous
78. Consider three processes in scheduling. Here are the waiting time for
three processes P1=5,P2=10,P3=3.Which one of the following is
correct average waiting time per process?
3
2
18
6 My Point of View
79. The priorities of processes in the_____group remain fixed
Kernel pg#90
User
0304-1659294 15
AL-JUNAID TECH INSTITUTE
Bankers
Bakery page 102
Babbles
None of the given
0304-1659294 16
AL-JUNAID TECH INSTITUTE
Keyboard pg#52
Light pen
Joystick
86. In which of the following system multiple user are allowed to used
the computer simultaneously?
Single user
Two user
Three user
Multi user Page 6
87. In the layered approach of operating system .
Bottom Layer(0) is the user interface
Highest layer(N)is the user interface pg#18
Bottom Layer(N) is the hardware
Highest Layer(N) is the hardwar
88. A heavy weight process .
Has multiple threads of execution
Has a single thread of execution pg#67
Multiple or single thread
None of the mentioned
89. Is a solution of the problem of indefinite blockage of low-priority processes.
Starvation
Deadlock
Aging pg#84
None of these
90. The child process can
0304-1659294 17
AL-JUNAID TECH INSTITUTE
Unrelated processes
Related processes Page 49
95. The process creates two FIFOs, FIFO2, and opens FIFO1 for
reading and FIFO2 writing
Server Page 60
Client
Both server and client AL-JUNAID INSTITUTE OF GROUP
None of the given options
96. Use of semaphore create problem of busy waiting , this wastes CPU
cycle that some other process may be able to use productively. This
type of semaphore is also called
.
0304-1659294 18
AL-JUNAID TECH INSTITUTE
semaphore S
spinlock Page 109
locking semaphore
mutex
97. Kernel is responsible for scheduling the user level threads
True
False Page 70
98. Which of the following of two operations are provided by the IPC facility?
Write & Delete message
Delete & Receive message
Send & Delete message
Receive & send message My Point of View
99. Access of variable semaphore is possible only through two atomic operation
and
TestAndSet, Swap
Lock, Key
Boolean, integer
Wait, signal pg#108
100. Kill command is used to terminate a process. The syntax of the
command is kill {- signal}PID when executed without a signal number,
the command sends the
signal to the process.
SIGINT
SIGKILL
SIGTERM pg#66
None of the given option
101. Given below to statement can be categorized in some sort of
message passing technique. This type is named as
1.Send (A message)
2.Receive (B message)
0304-1659294 19
AL-JUNAID TECH INSTITUTE
Synchronization
Direct communication pg#43
Explicit buffering
Send by copy communication
102. Cooperating processes never share any data, code, memory or state.
True
0304-1659294 20
AL-JUNAID TECH INSTITUTE
Trap (page 8)
0304-1659294 21
AL-JUNAID TECH INSTITUTE
File mode creation mask
File descriptors pg#38
112. Critical section problem is to___ the concurrent execution of
cooperating process.
Update
Srialize My Point of View
Stop
Start
Mutual exclusion
Race condition (Page 96)
Critical Section
Waiting
0304-1659294 22
AL-JUNAID TECH INSTITUTE
o FCFS scheduling
118. Which of the following provide interface to access the services of the
operating
system?
API
System call (PAGE 15+Google)
Library call
Assembly Instructions
119. In process management some of the jobs can be suspended for some time in
order
to give other job a chance to be in execution. Which command can be used to place
back a suspended command?
fg (Page 65)
top
ps AL-JUNAID INSTITUTE OF GROUP
bg
120. ~symbol in the pathname ~/docs/cs604/handouts represented .
Root directory
Login directory pg#22
Parent directory
Child directory
121. Which of the following statement is not true regarding the cooperating
processes?
It provides an environment to allow concurrent user to access same resources.
It provide an environment to run parallel processes to speedup computation.
It construct the system in a modular fashion, dividing the system
functions into separate processes or threads.
It may affect or be affected by any other process
executing in the system. (Page 41)
122. A process ‘A’ that has finished working but its parent process has also
finished its
execution. In this state the process ‘A’ will be called as process.
Child
Thread
Zombie My Point of View
Fork
0304-1659294 23
AL-JUNAID TECH INSTITUTE
123. The nice value helps in assigning___to process
Priority My Point of View
Weight
Time
Scheduling
125. When process opens its first file explicitly it will get descriptor
number_____
1
2
3 My Point of View
4
0304-1659294 24
AL-JUNAID TECH INSTITUTE
System call (Page 195)
130. Under once the CPU has been allocated to a process the process
keeps
the CPU until either it switches to the waiting state, finishes its CPU burst, or
terminates.
o Non-preemptive scheduling pg#79
o Preemptive scheduling
o Force scheduling
o Dynamic scheduling
131. The round-robin RR scheduling algorithm is designed especially for____
Single-user systems
Nice systems
Batch system
Time-sharing system pg#85
132. In producer-consumer problem synchronization is required. On which shared
area
this synchronization actually effect?
Entry section
Exit section
Counter
Buffer Page 94
0304-1659294 25
AL-JUNAID TECH INSTITUTE
o None of the given
Dependent
o Independent Page 41
134. Command-line interpreter is also called____ in some operating system
o Shell My Point of View
o Signal
o API
o Kernel
AL-JUNAID INSTITUTE OF GROUP
135. When processes are generated using fork () system call and then after they
are
coordinated with each other using IPC channel. They are utilizing a separate
address space for each process (parent. child) .Kernel resources and IPC channel.
This makes it a more heavy. Which strategy can be used to make it light?
Termination of child process when these become more
Scheduling of each process
Use of batch systems
Use of threads (Page 67)
136. All UNIX and LINUX systems have one thing in common which is .
Set of system calls My Point Of View
Set of commands
Set of instructions
Set of text editors
First
137. entries in pre-process file descriptor table are used as soon as the
process is created.
1
2
3 Page 52
4
138. ______directory includes essential system boot files including the kernel
image
/bin
/boot Page 23
/dev
0304-1659294 26
AL-JUNAID TECH INSTITUTE
/etc
139. A signal is generated when a write performed to fifo that no process is
opened for reading.
141. The process id returned to the child process after successful fork
system call execution is .
0 (Page 37)
1
2
3
142. Semaphore S is a/an____ type of variable to use as synchronization tool.
Integer (Page 108)
Boolean
Double
Float
143. In the bakery algorithm to solve the critical section problem .
Each process is put into a queue and picked up in an ordered manner
Each process receives a number(may or may not be
unique) and the one with the lowest number is served next
(Page 102)
Each process gets a unique number and the one with the highest
0304-1659294 27
AL-JUNAID TECH INSTITUTE
number is served next
Each process gets a unique number and the one with the lowest
number is served next
144. The BSD sockets are used for communication between related or unrelated
processes on the same system or on different systems.
Unrelated processes (Page 50)
Related processes
Both(related and unrelated)
Sibling process
145. While a process executes its critical section, other entering processes loop in a
continual function in their entry sections, thus causing .
o Bounded waiting
Race condition
Mutual exclusion
Busy waiting Page 109
Conclusion
Aging
Termination
Starvation (Page 83)
147. The manual pages can be read in Linux using command.
Man (Page 24)
wan
desc
help
148. The creating process is called a process while the new process
are called the of the process.
Children, parent
Zombie, single
None of the given
Parent,children Page 35
149. UNIX system V Scheduling algorithm in every second, the priority number
of all
0304-1659294 28
AL-JUNAID TECH INSTITUTE
those processes that are in the main memory and ready to run is updated by
using the following formula:
Priority # = Threshold priority + nice
Priority # = (Recent CPU Usage)/2 + nice
Priority # = (Recent CPU Usage)/2 + Threshold priority
Priority #=(Recent CPU Usage)/2+Threshold priority+nice Page 90
150. An operating system is a /an___ that manages the execution of user
programs to prevent errors and improper use of a computer
o Disk
o Application program
o Control program Page 03
Physical unit
152. Taking the CPU from one process and giving the CPU to
another process is termed as
Context Switching (Page 31)
Dispatching
Swapping
Tracking
153. In priority-scheduling algorithm equal priority processes are scheduled
in order.
154. A/an___ is software generated call caused by error, or when a user request for
0304-1659294 29
AL-JUNAID TECH INSTITUTE
an operating system service
Trap (Page 7)
Interrupt
Signal
System call
155. Critical section problem can be solved by using how many ways?
o 4
o 3 Page 97
o 2
o 1
156. The write() system call may not fail for____reason(s)
o Invalid argument
o File size limit for process or for system would exceed
o Disk is full
o Valid argument Page 51
157. If a parent exits terminating its children processes, these children are handed
over
process.
Init Page 37
Root
Daemon
Sibling
159. The system call suspends the calling process until one of the
immediate children terminate.
Wait (Page 39)
Signal
Trap
Interrupt
160. The correct command when pipes are used on the command line to connect the
standard input of one process to the standard input of another is.
Cmd1 % cmd2% …………. %cmdN
Cmd1 | cmd2 | …………. | cmdN (Page 53)
Cmd1 $ cmd2 $ …………. $ cmdN
Cmd1 & cmd2 & …………. & cmdN
0304-1659294 30
AL-JUNAID TECH INSTITUTE
161. A system has well defined, fixed time constraints, and if the system
does not produce output for an input within the time constraints, the system fail.
Operating
Real-time Page 7
Limited
Andriod
162. In round-robin (RR) scheduling algorithm the CPU scheduler goes around
the
ready queue, allocating the CPU to each process for time interval of up to time
quantum.
4 AL-JUNAID INSTITUTE OF GROUP
3
2
1 (Page 85)
163. In hardware multiprocessor environment two instructions are
executed
which are swap and TestAndSet.
Atomically (Page 105)
Automatically
Manually
By force
164. We can perform the solution to critical section problem by allowing
only one process to enter at a time but another solution hold some
instruction use. One of them is TSL, how it is written in program?
TestAndSet (Boolean &target) (Page 105)
Testandset(Bolean &target)
TSL (Bolean &target)
TSL ()
165. The segment of code in which the process may change common
variables, update tables, write into files is known as
Program
0304-1659294 31
AL-JUNAID TECH INSTITUTE
Critical section (Page 102)
Non-critical section
Synchronizing
166. When sender never block because it has an infinite length storage
area, then it means it is holding a queue of capacity.
Zero
Unbounded (Page 45)
Defined
Bounded
167. are lowest prioritized processes for scheduling in Kernel
Group.
User processes (Page 90)
Character I/O device control processes
Block I/O control processes
File manipulation processes
168. In round-robin (RR) scheduling algorithm, in case the time quantum
is very large (infinite), the RR policy remains the same as the policy.
LIFO (Last in First Out)
FCFS (First Come First Served) (Page 86)
SJF(Shorted Job First)
SRTF (Shortest Remaining Time First
0304-1659294 32
AL-JUNAID TECH INSTITUTE
Queue (page 89)
Array
Time
171. The link between two processes P and Q to send and receive messages is
called
Communication link (page 43)
Message-Passing link
Synchronization link
All of the mentioned
172. command in Linux helps to create a new directory
ls
cp
mv
173. ______is the basis of queuing theory which is branch of mathematics used to
analyze systems involving queues and servers.
Little’s Formula (page 93)
Deterministic Modeling
Queuing Theory
Queuing Analysis
174. TSL based solution can implement mutual exclusion, it abbreviates
TestAndSet Instruction (page 106)
Test Swap Instruction
Trap Set Solution
Test Set Instrument
175. You can have a thread wait for another thread within the same process
by using the
system call
Pthread_join() (page 73)
Pthread_exit()
Pthread_create()
0304-1659294 33
AL-JUNAID TECH INSTITUTE
Pthread_terminate()
176. A signal is an event generated to get attention of
Hard disk
Process (page 7)
Trap
Interrupts
177. Both in two atomic instructions TestAndSet and swap two critical
section requirements are satisfied but not
Mutual exclusion
Progress AL-JUNAID INSTITUTE OF GROUP
0304-1659294 34
AL-JUNAID TECH INSTITUTE
181. As a result of <Ctrl-C>, a SIGINT signal is sent to a process.
Signal number for SIGINT is
15
1
9
2 (page 66)
182. The section of code after the critical section is called .
Crystal section
Entry section
Waiting problem
o Non-concurrency problem
Aging problem
o Critical section problem Page 97
0304-1659294 35
AL-JUNAID TECH INSTITUTE
186. Software section to critical section problem can run only in environment
Multiprocessor
Multithreading
Uniprocessor Page 105
Separate address spacing
187. _____command displays the contents of current working directory.
Is Page 25
Cs
Mv
Cp
188. When processes communicate with each other, they perform communication
through
synchronization and utilizing separate address spaces. This action is termed as
Process management
Synchronization
Direct/indirect Communication
Inter Process Communication Page 43
189. We can use semaphore to deal with the number of process critical
section problem. AL-JUNAID INSTITUTE OF GROUP
1
n (Page 108)
n-1
2n
190. Which is not considered a role of an operating system?
Memory allocation and de-allocation of a process
Synchronization of cooperating processes My Point of View
Program execution
Protection of a user’s file and directories
191. In system call that creates a pipe for IPC. If one of the operation from
read/write
would fail then what will be returned as result?
-1+1
0304-1659294 36
AL-JUNAID TECH INSTITUTE
1
-1 Page 46
0
192. Which of the following is not true for a time-sharing system?
Multi user
Iterative
CPU sit idle when process requires I/O operation
Rigid time requirements My Point of View
193. Which could not be the advantage of thread?
Separate address space (Page 69)
Quick response
Economical
Best in multiprocessing environment
Copy
Copi
Cp
Both Copy and CP My Point Of View
0304-1659294 37
AL-JUNAID TECH INSTITUTE
Efficiency
Large virtual memory
Large secondary storage device
Usability My Point of View
198. Processes P1,P2,P3,P4 enter the ready queue at time 0,3,3,11 with burst
times
P1=8, P2=2, P3=1, P4=1. With shortest remaining time first , process is given
CPU at time=3.
P1
P2
P3 My Point of View
P4
199. If size of a process is 376052 bytes and its smallest physical memory
address is
242785.Its address space cannot exceed beyond .
376053
376051
618836
618837 My Point of View
200. Which of the following is a correct command line for running in
background?
cat code.c | grep print %
cat code.c | grep print & (Page 62)
cat code.c | grep print #
cat code.c | grep print @
201. Which of the following command is used to read data from file named
academics?
con<academics
socket>academics
ran>academics
cat<academics (Page 55)
0304-1659294 38
AL-JUNAID TECH INSTITUTE
202. Using hardware solution to synchronization for complex problems, introduce
a
new synchronization tool known as .
Trap
Semaphore (Page 108)
SWAP
TestAndSet
203. In LINUX directory structure, there is root directory.
1 Page 23
2
4 AL-JUNAID INSTITUTE OF GROUP
3
204. The time interval from submission of a process to the time
when its output is generated is termed as .
Turnaround time (Page 80)
CPU burst
Responsive time
Throughput
0304-1659294 39
AL-JUNAID TECH INSTITUTE
FCFS
208. You can use the bg command to put the current or a suspended
process into the background. What is the correct syntax of bg command
from the following?
bg [%id]
bg [job#]
bg [id#]
bg [%job_id] (Page 65)
209. The region in the memory that a process is allowed to
access is known as .
Address space (Page 10)
Instruction
Operation
Register
210. In Unix/Linux by default the standard output file is attached to the
File
211. 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
.Non-preemptive Shortest Job First scheduling.
0304-1659294 40
AL-JUNAID TECH INSTITUTE
4 AL-JUNAID INSTITUTE OF GROUP
0
3
6 My Point of View
213. Scheduler takes the process from the ready queue and
assigns the CPU with the help of Dispatcher.
Swapper
-e (Page 63)
-u
215. Clock interrupt handler is an example of kernel level thread that is
not executed for serving a request by a user thread. It is named as .
EINVAL
EAGAIN
LWP (Page 72)
POSIX
216. Consider three processes in scheduling. Here are the waiting times for three
process P1=4,P2=2,P3=6.Which one of the following is correct average
waiting time.
2
4 My Point of View
3
6
217. Processes P1,P2,P3 having burst time P1=3,P2=4,P3=3 and turnaround time
P1=7,P2=10,P3=9 enter the ready queue at T=0 waiting time for process P2 is .
o 3
0304-1659294 41
AL-JUNAID TECH INSTITUTE
o 4
o 6 My Poit of View
o 0
218. P1,P2,P3,P4,P5 are five processes with tick numbers
P1=1,P2=2,P3=4,P4=2,P5=4
then considering Lamport’s bakery algorithm_____ process enters critical
section after P1.
P2 My Point of View
P3
P4
P5
219. Four processes P1, P2, P3, P4 enter the ready queue at time 0 with
burst times P1=3, P2=10, P3=4. Waiting time of P3 would be .
12
13 My Point of View
14
17
0304-1659294 42