0% found this document useful (0 votes)
150 views45 pages

Cs604 Midterm Solved Mcqs by Junaid Malik

The document contains a collection of multiple-choice questions (MCQs) related to operating systems, covering topics such as process management, scheduling algorithms, and system calls. It includes questions about critical sections, communication methods, and various commands in Linux. The content appears to be sourced from midterm papers and is intended for educational purposes, specifically for students studying operating systems.

Uploaded by

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

Cs604 Midterm Solved Mcqs by Junaid Malik

The document contains a collection of multiple-choice questions (MCQs) related to operating systems, covering topics such as process management, scheduling algorithms, and system calls. It includes questions about critical sections, communication methods, and various commands in Linux. The content appears to be sourced from midterm papers and is intended for educational purposes, specifically for students studying operating systems.

Uploaded by

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

CS604-OPERATING

SYSYTEM
(SOLVED MCQs)
FROM MIDTERM PAPERS
LECTURE (1-22)
ajtechinstitute24@gmail. For More Visit: vujunaid.com JUNAID MALIK (0304-
com 1659294)
ÂL-JÛÑÂÎD TÊCH
JOIN OUR GROUP FOR MORE UPDATE
Click Button
CS619 & CS519 ÂL-JÛÑÂÎD TÊCH

1. When a process has undivided access to a shared piece of code


than no other process can execute code, this state is called .
• Race condition
• Progress
• Mutual exclusion Page 98
• Bounded waiting

2. Critical section is a place where certain shared structure is


updated. Its solution required certain precaution: one of them
is the access to critical section by one process at a time only.
What this condition is termed as?
• Progress
• Entry section
• Mutual exclusion Page 97

• 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

0304-1659294 1
ÂL-JÛÑÂÎD TÊCH
• Ctrl-y
Ctrl-z pg#65
5. command in LINUX is used to copy file.
• ls
• cp pg#27
• mv
• mkdir
6. System calls provide the interface between a _ and the Operating System.
• User
• Machine
• Process pg#15
• Kernel

7. In critical section problem requirement illustrates that, “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 this selection cannot be postponed indefinitely. ”
• Mutual exclusion
Progress pg#98
• Bounded waiting
• Slow execution
8. Batch programs are usually _________ programs.
• Interactive
• Non-interactive My Point of View
• Foreground
• Preemptive
9. You can use the mv file1 file2 command to move_________
• File1 to file 2 (Page 27)
• File 2to file 1
• This command will not work for moving files
• None of the option correct

0304-1659294 2
ÂL-JÛÑÂÎD TÊCH
10. The___________ defines an operating system as a bridge between computer user
and hardware for a user’s convenience.
• System-view
• Bottom-up view
• Top-down view ( page 03)
• Layered-view
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

• Starvation (page 83)


• Aging
• Nice value
14. The basic purpose of is to help the users to utilize the hardware
resources for completing different task in a simplified manner.
o Operating system ( page 01)

0304-1659294 3
ÂL-JÛÑÂÎD TÊCH
• Application software
• All software
• All of the given

15. If your processor doesnot have two slots empty in Pre Process file
Descriptor Table, then your system call will fail.
Pipe (page 52)
• 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

17. POSIX is a standard develop by .


• ANSI
IEEE My Point of View
• ISO
• ACM
18. Keeping in mind scheduling algorithm, when you go to any famous fast
food franchise. On entering the store, each customer receive a number.
The customer with a lowest number is served next. This algorithm is
called .
• Dijkstra’s algorithm
• Simple algorithm
• Deadlock algorithm AL-JUNAID INSTITUTE OF GROUP

0304-1659294 4
ÂL-JÛÑÂÎD TÊCH
• Bakery algorithm ( page 102)

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
• None of the given
20. Bounded buffer is a buffer of size.
• Variable

• Fixed (page 41)


21. The wait operation of the Semaphore basically works on the basic system
call.
• Stop()
• Block()
• Hold()

• Wait() (page 111)

23. Priority scheduling cannot be pre-emptive.


• True
• False Page 83
24. When a process P1 switches from the running state to the waiting state because a
I/O
request is being completed. This scheduling is called .
Non preemptive pg#79
• Switching
• Termination
• Preemptive
25. The priority of a process can be changed using_____command.
• cmd
• cat
• grep

0304-1659294 5
ÂL-JÛÑÂÎD TÊCH
• Nice
26. In addressing, the recipient is not required to name the sender.
• Symmetric
Asymmetric (page 44)
• Both(Symmetric and Asymmetric )
• None
27. An operating system is easily portable between varying hardware designs in
structural approach.
• Virtual Machines
• Simple
• 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?

• Number of threads in a process (page 64)


• CPU Usage
• Top processes
• Nice value
30. processes or thread often need access to shared data and shared
resources.
• Parallel
Concurrent (page 95)
• Single
• Temporary

31. To terminate a process <ctrl-c> is pressed, which signal it actually


passes to process for termination?
• SIGTERM

0304-1659294 6
ÂL-JÛÑÂÎD TÊCH
SIGINT (page 66)
• SIGKILL
• SIGTRAP

32. UNIX System V scheduling uses queues, which run algorithm.


• First Come First Serve
• Round Robin Page 90

• Shortest Job First


• Shortest Remaining Time First
33. Which part of the computer system helps in managing the file and
memory management system?

• Operating system (page 12 & 13)


• Device Drivers
• Application Software
• Hardware

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

35. Performance measures of scheduling algorithms are calculated with


charts, in order to evaluate an algorithm for a particular workload.
• Simulation
• Analytic evaluation
• Deterministic modeling (Page 92)
• Queuing Models

0304-1659294 7
ÂL-JÛÑÂÎD TÊCH
36. In multi-threaded process thread () take two argument, they are used to take
and .
• Program counter value, address space limit.
• New thread ID, process name
• Register count, program counter
• New thread function name, new thread ID Page 68
37. In the Bakery algorithm, processes are prioritized based on highest ticks among
computing processes.
• True
• False Page 102
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

39. How many modes are supported in operating system?


o 1
o • 2 My point of View
• 3
• 4
40. ___Scheduler salects the process from the JOB Pool and put them in main
memory
• Long term (Page 33)
• Short term
• Medium term
• Swapper

AL-JUNAID INSTITUTE OF GROUP

0304-1659294 8
ÂL-JÛÑÂÎD TÊCH
41. A parent process calling system call will be suspended until children
processes terminate.

Wait (Page 36)


• Fork
• Exit
• Exec
42. A time-sharing system is

• Multi user
• Multitasking
• Interactive

• All of these (Page 06)

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?

Cmd1 % cmd2 %...........%cmdN


• Cmd1 | cmd2 |…………| cmdN Page 53
Cmd1 $ cmd2 $...........$ cmdN
• Cmd1 & cmd &………..&cmdN

44. Which is not basic computing hardware?

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

0304-1659294 9
ÂL-JÛÑÂÎD TÊCH
No other process is allowed to execute in its section. This problem is
called _.
• Bakery algorithm

• N-Process Critical Section (Page 102)


• N-Mutual exclusion
• Deadlock algorithm
46. Scheduling can be made into a processor sharing approach.
• First Come First serve
• Round Robin (Page 86)
• Shortest remaining time
• 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
ÂL-JÛÑÂÎD TÊCH
50. A program in execution is called a
• Command
Process pg#12
• Software
• Compiler
51. This layered approach is taken to its logical conclusion in the concept of a
• Virtual Machine pg#19
• Logical Machine AL-JUNAID INSTITUTE OF GROUP
• Physical Machine
• None of the given
52. CPU bound processes are scheduled before short or I/O bound
processes in scheduling therefore, resulting in less CPU
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

0304-1659294 11
ÂL-JÛÑÂÎD TÊCH

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

57. multi-threading model provides full concurancy.


• One-to-Many
• Many-to-Many
• One-to-One pg#71
• 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

59. Which is not a parameter of pthread_create().


• Function
• Return status pg#73
• Thread ID
• Thread attributes
60. Preemptive SJF (Shortest Job First) scheduling is sometimes called
scheduling.
• shortest time-last
shortest remaining-time-first pg#82
• smallest time-first
• biggest time-first

0304-1659294 12
ÂL-JÛÑÂÎD TÊCH
61. The file descriptor for Standard Input (stdin) is
0 pg#52
1
2 AL-JUNAID INSTITUTE OF GROUP
3
62. Rather than maximizing CPU utilization and use of peripheral devices,
systems are for maximizing user convenience and responsiveness.
• Single-user Page 4
• Batch
• Multi-user Batch
• Time-sharing
63. The Operating system isa layer of software between and .
Hardware, software application My Point Of View
• 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

0304-1659294 13
ÂL-JÛÑÂÎD TÊCH
• child process
• parent process
• init process
67. are used to show executions of processes.
• Gantt charts pg#85
• Time slice
• Quantum
• Sequence

68. The ready queue in RR (Round Robin) scheduling algorithm is referred to as


.
• Time Quantum
• Time Slice
• LIFO (Last in First Out)
• Circular Queue pg#85
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

0304-1659294 14
ÂL-JÛÑÂÎD TÊCH
• 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
• 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.

0304-1659294 15
ÂL-JÛÑÂÎD TÊCH
• 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

80. _______algorithm is used for solving n-process critical section problem.


• Bankers
• Bakery page 102
• Babbles
• None of the given
81. The situation in which no context switching is required in multiprocessor system
is
referred to as .
• Busy waiting
• Spin lock pg#110
• Interrupt
• Scheduler
82. system call is used to write to a file or FIFO or any other IPC channel.
• Read
Write pg#45

0304-1659294 16
ÂL-JÛÑÂÎD TÊCH
• Open
• Fork
83. In LINUX/UNIX environment Ali want to know the number of processes running
on the
system and their status, number of CPUs in the system and their usage, amount of
main memory and its usage. Which of the following command will help in this
regard?
• $ ps
• $ gcc
• $ fifo
• $ top Page 64

84. IN the result displayed by ls –l command.5th column shows


• Group of the owner
File size in bytes page 26
• Time last upated
• Owner of the file
85. In Unix/Linux by default the standard input file is attached to the
• Mouse
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

0304-1659294 17
ÂL-JÛÑÂÎD TÊCH
• 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

• Be a duplicate of the parent process Page 36


• Never be a duplicate of the parent process
• Cannot have another program loaded into it
• Never have another program loaded into it

91. FIFO’s(also
known as named pipes)are used for communication between
UNIX/Linux system.
• Related and Unrelated
• Parent-child
• Unrelated processes
• Related processes Page 49

92. Command is used to change the directory.


• Is
• Cp
Cd Page 219
• Mv
93. In Unix/Linux environment, Ayesha wants to know the complete
picture of current processes in her session. Which of the following
command will help her in this regard?

0304-1659294 18
ÂL-JÛÑÂÎD TÊCH
$ ps Page 63
• $ gcc
• $ top
• $ fifo
94. Which of the following conditions must be satisfied to solve the critical section
problem?
• Mutual Exclusion
• Progress
• Bounded waiting
• All of the mentioned Page 98

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

0304-1659294 19
ÂL-JÛÑÂÎD TÊCH
• 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)

• 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

ÂL-JÛÑÂÎD TÊCH
False (Page 41)
103. Command display the status of the process.
• Is
Ps pg#63
• Gcc
• Cat
104. Command display the status of the process.
• Is
Ps pg#63
• Gcc
• Cat
105. For undivided and uninterrupted testing and setting of semaphore,
uni-processor systems tend to .

• Disable interrupts (Page 109)


• Use bakery algorithm
• Use spinlock
• Use signal
106. A___enables a user process to request the operating system to execute a
privileged instruction for it
• Interrupt
• Library call
• System Call

• Trap (page 8)

107. We can terminate a thread explicitly by either returning from the


thread function or by using the call.
• express()
pthread_exit() (page 73)

0304-1659294 21
ÂL-JÛÑÂÎD TÊCH
• win()
• slow() AL-JUNAID INSTITUTE OF GROUP
108. Ali is an operating system designer. One user requirement regarding
OS is easy to debug and modify. In your opinion which one of the
following OS structure Ali needs to follow?
• Simple OS Approach
• Micro kernels

• Layered approach My Point of View+G


• Virtual machine
109. Is not system call in Linux.
• Mkfifo (Page 57)
• Mknod
• Read
• Open

110. is also called swapper .


• Long term
• Short term
• Medium term pg#34
• Swap space
111. After fork() system call is made, parent and child process have their
separate copy
of .
• Environment
• Nice value
• 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

0304-1659294 22
ÂL-JÛÑÂÎD TÊCH
113. Round Robin algorithm is most suitable for .
• Time sharing system (Page 85)
• Real time system and batch systems
• Running batch progress
• Expert system
114. Concurrent processes must be synchronized to prevent .

Mutual exclusion
Race condition (Page 96)
• Critical Section
• Waiting

115. In instruction TestAndSet mutual exclusion implementation is done by


declaring a
Boolean variable lock
• Initialized as zero
• Initialized as true
• Initialized as 1
• Initialized to false (Page 106)
116. The kernel is a computer program that manages request from software
• Input/output My Point of View
• Process
• Hardware
• Software
117. ______is used in real time operating systems.
o Non-preemptive scheduling
o Preemptive scheduling My Point of View
o Dispatching scheduling
o FCFS scheduling
118. Which of the following provide interface to access the services of the
operating
system?
• API
System call (PAGE 15+Google)

0304-1659294 23
ÂL-JÛÑÂÎD TÊCH
• 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
123. The nice value helps in assigning___to process
• Priority My Point of View
• Weight
• Time
• Scheduling

0304-1659294 24
ÂL-JÛÑÂÎD TÊCH
124. In critical section problem ____requirement illustrates that “There exists a
bound on the number of times that other processes are allowed their critical
sections after a process has made a request to enter its critical section and
before that request is granted.”
o Progress
o Mutual Exclusion
o Bounded Waiting Page 98
o Race Condition

125. When process opens its first file explicitly it will get descriptor
number_____
1
2
3 My Point of View
4

126. _____is a solution to critical section problem.


• Lamport’s bakery algorithm My Point Of View
• Safety algorithm
• Dijikstra’s algorithm
• Banker’s algorithm
125. Which of the following is used to show the end of the file in UNIX?
• Ctrl+A
Ctrl+D My Point of View
• Ctrl+O
• Ctrl+E
126. ______is used to request the OS by the process to take an I/O or
initiating child process
▪ Interrupt
▪ Trap
▪ Signal
▪ System call(Page 195)

129. is a segment of code that access a shared resource like


data structure or device that must not be concurrently accessed by

0304-1659294 25
ÂL-JÛÑÂÎD TÊCH
more than one thread of execution.
• Multithreading
• Context switching
Critical section My Point of View
• Pipelining

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

133. A process is if it cannot affect or be affected by any other process


executing in the system.
o Both(independent and dependent)
o None of the given
• Dependent
o Independent Page 41

0304-1659294 26
134.
ÂL-JÛÑÂÎD TÊCH
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
• /etc
139. A signal is generated when a write performed to fifo that no process is

0304-1659294 27
ÂL-JÛÑÂÎD TÊCH
opened for reading.

▪ SIGPIPE (Page 58)


• Named PIPE
• Unnamed PIPE
o SIGFIFO

140. Consider a scenario of CPU protection, is added to the


operating system in order to detect and avoid loop in a user program.
• I/O
• Timer (Page 11)
• Base and limit register
• Turning interrupt enable off

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
number is served next

0304-1659294 28
ÂL-JÛÑÂÎD TÊCH
•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

146. A major problem with priority-scheduling algorithm is

• 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
those processes that are in the main memory and ready to run is updated by

0304-1659294 29
ÂL-JÛÑÂÎD TÊCH
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

151. State of process transits from running to ready because of .


• Fork()
• Scheduler dispatch
• I/O
• Interrupt Page 79

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.

• FCFS (First Come First Serve) (Page 83)


• LIFO (Last in First Out)
• SJF (Shorted Job First)
• SRTF (Shortest Remaining Time First)
154. A/an___ is software generated call caused by error, or when a user request for

0304-1659294 30
ÂL-JÛÑÂÎD TÊCH
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

0304-1659294 31
ÂL-JÛÑÂÎD TÊCH
• Cmd1 & cmd2 & …………. & cmdN

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

0304-1659294 32
ÂL-JÛÑÂÎD TÊCH
• Program

• 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

169. Consider a scenario in which one process P1 enters in its critical


section, no other process is allowed to execute in its critical section. This is
called
• Mutual exclusion (page 98)
• Context switching
• Multithreading
• Progress
170. Multilevel feedback scheduling allows a process to

0304-1659294 33
ÂL-JÛÑÂÎD TÊCH
move between queues.
• List
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

• mkdir (page 26)

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

0304-1659294 34
ÂL-JÛÑÂÎD TÊCH
Pthread_join() (page 73)
• Pthread_exit()
• Pthread_create()
• 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

• Bounded waiting (page 106)


• Assumptions
178. You can use the rm file 1 command to file 1.
• Retrieve

• Remove (page 27)


• Make
• Modify
179. Shared libreries and kernel modules are stored in directory.
• /bin
• /dev
• /boot
/lib (page 23)
180. Use of the semaphore create a 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 35
ÂL-JÛÑÂÎD TÊCH
• Semaphore S
Spinlock (page 109)
• Locking Semaphore
• Mutex
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

• Remainder section (page 98)


• Exit section
183. To prevent a process from keeping CPU for too long, control is shifted
to another ready
process by invoking a timer .
• When running process finishes its task
• Every time a free space is available in main memory

• Every time a process finishes its time slice ( page 11)


• When running process makes a system call
184. -------------- View is that operating system is resource manager.
• Top-down
• Single-up
• Down-up
bottom-up (page 3)

185. Co-operating process sharing a piece of code are executed periodically

0304-1659294 36
ÂL-JÛÑÂÎD TÊCH
to solve
• Waiting problem
o Non-concurrency problem
• Aging problem
o Critical section problem Page 97
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

0304-1659294 37
ÂL-JÛÑÂÎD TÊCH
• 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
• 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

194. OS helps manages the following except


• Application software
• Memory
• Virtual memory
• Bus speed of the system My Point of View

195. In operating system___ command is used to copy files to same location or


different location.

• Copy
• Copi
• Cp

0304-1659294 38
ÂL-JÛÑÂÎD TÊCH
• Both Copy and CP My Point Of View

196. scheduling algorithm can be preemptive or non-preemptive.


• First Come First Serve
• Shortest Job First (Page 82)
• Round Robin
• Priority
197. The main characteristic of real time system is.
• 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)

0304-1659294 39
ÂL-JÛÑÂÎD TÊCH
• 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)
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

205. The correct command for compiling C program named


program.c in LINUX environment is
• gcc -z FirstProgram program.c
• gcc program.c -m FirstProgram

0304-1659294 40
ÂL-JÛÑÂÎD TÊCH
•gcc -o FirstProgram program.c
• gcc program.c -o First Program (Page 28)
206. The Kernel is_____user threads
o Is part of
o Unaware of Page 70
o Aware of
o The creater of
207. scheduling algorithm is sometimes called shortest
remaining time first scheduling algorithm.
• Priority scheduling
• Non-preemptive SJF
Preemptive Shortest Job First (Page 82)
• 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

• Screen (Page 52)


• Printer
• Scanner

0304-1659294 41
ÂL-JÛÑÂÎD TÊCH
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.

• Preemptive Shortest Job First scheduling. (Page 82


• FCFS
• RR Scheduling
212. Processes P1, P2, P3 having burst time P1=3, P2=4, P3=3 and
turnaround times P1=7, P2=10, P3=9 enter the ready queue at Time=0.
With RR scheduling waiting time for process P2 is _.
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

• Short term (Page 79)


• Long term
• Medium term
214. To display all processes option is used with ps command/
• -l
• -a

• -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

0304-1659294 42
ÂL-JÛÑÂÎD TÊCH
• 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
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 43
ÂL-JÛÑÂÎD TÊCH

0304-1659294 44

You might also like