250+ TOP MCQs on Process Creation and Answers

Operating System Interview Questions and Answers on “Process Creation” and will also be useful for interview preparations.

1. Restricting the child process to a subset of the parent’s resources prevents any process from __________
a) overloading the system by using a lot of secondary storage
b) under-loading the system by very less CPU utilization
c) overloading the system by creating a lot of sub-processes
d) crashing the system by utilizing multiple resources

Answer: c
Clarification: Restricting the child process to a subset of the parent’s resources prevents any process from overloading the system by creating a lot of sub-processes. A process creates a child process, child process requires certain resources to complete its task. A child process can demand required resources directly from the system, but by doing this system will be overloaded. So to avoid overloading of the system, the parent process shares its resources among children.

2. A parent process calling _____ system call will be suspended until children processes terminate.
a) wait
b) fork
c) exit
d) exec

Answer: a
Clarification: A parent process calling wait system call will be suspended until children processes terminate. A parameter is passed to wait system call which will obtain exit status of child as well as wait system call returns PID of terminated process.

3. Cascading termination refers to termination of all child processes if the parent process terminates ______
a) Normally
b) Abnormally
c) Normally or abnormally
d) None of the mentioned

Answer: c
Clarification: Cascading termination refers to termination of all child processes if the parent process terminates Normally or Abnormally. Some systems don’t allow child processes to exist if the parent process has terminated. Cascading termination is normally initiated by the operating system.

4. With _____________ only one process can execute at a time; meanwhile all other process are waiting for the processor. With ______________ more than one process can be running simultaneously each on a different processor.
a) Multiprocessing, Multiprogramming
b) Multiprogramming, Uniprocessing
c) Multiprogramming, Multiprocessing
d) Uniprogramming, Multiprocessing

Answer: d
Clarification: With Uniprogramming only one process can execute at a time; meanwhile all other processes are waiting for the processor. With Multiprocessing more than one process can run simultaneously each on different processors. The Uniprogramming system has only one program inside the core while the Multiprocessing system has multiple processes inside multiple cores. The core is one which executes instructions and stores data locally into registers.

5. In UNIX, each process is identified by its __________
a) Process Control Block
b) Device Queue
c) Process Identifier
d) None of the mentioned

Answer: c
Clarification: In Unix, each process is identified by its Process Identifier or PID. The PID provides unique value to each process in the system so that each process can be identified uniquely.

6. In UNIX, the return value for the fork system call is _____ for the child process and _____ for the parent process.
a) A Negative integer, Zero
b) Zero, A Negative integer
c) Zero, A nonzero integer
d) A nonzero integer, Zero

Answer: c
Clarification: In Unix, the return value of the fork system call is Zero for the child process and Non-zero value for parent process. A fork system call returns the PID of a newly created (child) process to the parent and returns Zero to that newly created (child) process.

7. The child process can __________
a) be a duplicate of the parent process
b) never be a duplicate of the parent process
c) cannot have another program loaded into it
d) never have another program loaded into it

Answer: a
Clarification: The child process can be a duplicate of the parent process. The child process created by fork consists of a copy of the address space of the parent process.

8. The child process completes execution, but the parent keeps executing, then the child process is known as __________
a) Orphan
b) Zombie
c) Body
d) Dead

Answer: b
Clarification: The child process completes execution, but the parent keeps executing, then the child process is known as Zombie. When a child process terminates, its resources get deallocated but its entry in the Process Control Block (PCB) remains there until its parent calls wait system call.

250+ TOP MCQs on Deadlock Avoidance and Answers

Operating System Multiple Choice Questions on “Deadlock Avoidance”.

1. Each request requires that the system consider the _____________ to decide whether the current request can be satisfied or must wait to avoid a future possible deadlock.
a) resources currently available
b) processes that have previously been in the system
c) resources currently allocated to each process
d) future requests and releases of each process

Answer: a
Clarification: None.

2. Given a priori information about the ________ number of resources of each type that maybe requested for each process, it is possible to construct an algorithm that ensures that the system will never enter a deadlock state.
a) minimum
b) average
c) maximum
d) approximate

Answer: c
Clarification: None.

3. A deadlock avoidance algorithm dynamically examines the __________ to ensure that a circular wait condition can never exist.
a) resource allocation state
b) system storage state
c) operating system
d) resources

Answer: a
Clarification: Resource allocation states are used to maintain the availability of the already and current available resources.

4. A state is safe, if ____________
a) the system does not crash due to deadlock occurrence
b) the system can allocate resources to each process in some order and still avoid a deadlock
c) the state keeps the system protected and safe
d) all of the mentioned

Answer: b
Clarification: None.

5. A system is in a safe state only if there exists a ____________
a) safe allocation
b) safe resource
c) safe sequence
d) all of the mentioned

Answer: c
Clarification: None.

6. All unsafe states are ____________
a) deadlocks
b) not deadlocks
c) fatal
d) none of the mentioned

Answer: b
Clarification: None.

7. A system has 12 magnetic tape drives and 3 processes : P0, P1, and P2. Process P0 requires 10 tape drives, P1 requires 4 and P2 requires 9 tape drives.

Process    
P0            
P1                             
P2                             
 
Maximum needs (process-wise: P0 through P2 top to bottom)    
10             
4   
9
 
Currently allocated (process-wise)
5
2
2

Which of the following sequence is a safe sequence?
a) P0, P1, P2
b) P1, P2, P0
c) P2, P0, P1
d) P1, P0, P2

Answer: d
Clarification: None.

8. If no cycle exists in the resource allocation graph ____________
a) then the system will not be in a safe state
b) then the system will be in a safe state
c) all of the mentioned
d) none of the mentioned

Answer: b
Clarification: None.

9. The resource allocation graph is not applicable to a resource allocation system ____________
a) with multiple instances of each resource type
b) with a single instance of each resource type
c) single & multiple instances of each resource type
d) none of the mentioned

Answer: a
Clarification: None.

10. The Banker’s algorithm is _____________ than the resource allocation graph algorithm.
a) less efficient
b) more efficient
c) equal
d) none of the mentioned

Answer: a
Clarification: None.

11. The data structures available in the Banker’s algorithm are ____________
a) Available
b) Need
c) Allocation
d) All of the mentioned

Answer: d
Clarification: None.

12. The content of the matrix Need is ____________
a) Allocation – Available
b) Max – Available
c) Max – Allocation
d) Allocation – Max

Answer: c
Clarification: None.

13. A system with 5 processes P0 through P4 and three resource types A, B, C have A with 10 instances, B with 5 instances, and C with 7 instances. At time t0, the following snapshot has been taken:

Process
P0               
P1               
P2           
P3           
P4       
 
Allocation (process-wise : P0 through P4 top TO bottom) 
A   B   C
0   1   0
2   0   0
3   0   2
2   1   1
0   0   2
 
MAX (process-wise: P0 through P4 top TO bottom)
A   B   C
7   5   3
3   2   2
9   0   2
2   2   2
4   3   3
 
Available
A   B   C
3   3   2

The sequence <P1, P3, P4, P2, P0> leads the system to ____________
a) an unsafe state
b) a safe state
c) a protected state
d) a deadlock

Answer: b

250+ TOP MCQs on Real Time System Implementing RT Operating Systems

Tough Operating System Questions and Answers on “Real Time System – Implementing RT Operating Systems”.

1. In a real time system the computer results ____________
a) must be produced within a specific deadline period
b) may be produced at any time
c) may be correct
d) all of the mentioned

Answer: a
Clarification: None.

2. In a safety critical system, incorrect operation ____________
a) does not affect much
b) causes minor problems
c) causes major and serious problems
d) none of the mentioned

Answer: c
Clarification: None.

3. Antilock brake systems, flight management systems, pacemakers are examples of ____________
a) safety critical system
b) hard real time system
c) soft real time system
d) safety critical system and hard real time system

Answer: d
Clarification: None.

4. In a ______ real time system, it is guaranteed that critical real time tasks will be completed within their deadlines.
a) soft
b) hard
c) critical
d) none of the mentioned

Answer: b
Clarification: None.

5. Some of the properties of real time systems include ____________
a) single purpose
b) inexpensively mass produced
c) small size
d) all of the mentioned

Answer: d
Clarification: None.

6. The amount of memory in a real time system is generally ____________
a) less compared to PCs
b) high compared to PCs
c) same as in PCs
d) they do not have any memory

Answer: a
Clarification: None.

7. What is the priority of a real time task?
a) must degrade over time
b) must not degrade over time
c) may degrade over time
d) none of the mentioned

Answer: b
Clarification: None.

8. Memory management units ____________
a) increase the cost of the system
b) increase the power consumption of the system
c) increase the time required to complete an operation
d) all of the mentioned

Answer: d
Clarification: None.

9. The technique in which the CPU generates physical addresses directly is known as ____________
a) relocation register method
b) real addressing
c) virtual addressing
d) none of the mentioned

Answer: b

250+ TOP MCQs on Threads and Answers

Operating System Multiple Choice Questions on “Threads”.

1. Which one of the following is not shared by threads?
a) program counter
b) stack
c) both program counter and stack
d) none of the mentioned

Answer: c
Clarification: None.

2. A process can be ___________
a) single threaded
b) multithreaded
c) both single threaded and multithreaded
d) none of the mentioned

Answer: c
Clarification: None.

3. If one thread opens a file with read privileges then ___________
a) other threads in the another process can also read from that file
b) other threads in the same process can also read from that file
c) any other thread can not read from that file
d) all of the mentioned

Answer: b
Clarification: None.

4. The time required to create a new thread in an existing process is ___________
a) greater than the time required to create a new process
b) less than the time required to create a new process
c) equal to the time required to create a new process
d) none of the mentioned

Answer: b
Clarification: None.

5. When the event for which a thread is blocked occurs?
a) thread moves to the ready queue
b) thread remains blocked
c) thread completes
d) a new thread is provided

Answer: a
Clarification: None.

6. The jacketing technique is used to ___________
a) convert a blocking system call into non blocking system call
b) create a new thread
c) communicate between threads
d) terminate a thread

Answer: a
Clarification: None.

7. Termination of the process terminates ___________
a) first thread of the process
b) first two threads of the process
c) all threads within the process
d) no thread within the process

Answer: c
Clarification: None.

8. Which one of the following is not a valid state of a thread?
a) running
b) parsing
c) ready
d) blocked

Answer: b
Clarification: None.

9. The register context and stacks of a thread are deallocated when the thread?
a) terminates
b) blocks
c) unblocks
d) spawns

Answer: a
Clarification: None.

10. Thread synchronization is required because ___________
a) all threads of a process share the same address space
b) all threads of a process share the same global variables
c) all threads of a process can share the same files
d) all of the mentioned

Answer: d

250+ TOP MCQs on File System Interface Access Methods and Answers

Operating System online test on “File System Interface Access Methods”.

1. The UNIX sytem uses a/an ________ stored at the beginning of a some files to indicate roughly the type of file.
a) identifier
b) extension
c) virtual number
d) magic number

Answer: d

2. The larger the block size, the ______ the internal fragmentation.
a) greater
b) lesser
c) same
d) none of the mentioned

Answer: a

3. In the sequential access method, information in the file is processed ____________
a) one disk after the other, record access doesnt matter
b) one record after the other
c) one text document after the other
d) none of the mentioned

Answer: b

4. Sequential access method ______ on random access devices.
a) works well
b) doesnt work well
c) maybe works well and doesnt work well
d) none of the mentioned

Answer: a

5. The direct access method is based on a ______ model of a file, as _____ allow random access to any file block.
a) magnetic tape, magnetic tapes
b) tape, tapes
c) disk, disks
d) all of the mentioned

Answer: c

6. For a direct access file ____________
a) there are restrictions on the order of reading and writing
b) there are no restrictions on the order of reading and writing
c) access is restricted permission wise
d) access is not restricted permission wise

Answer: b
Clarification: None.

7. A relative block number is an index relative to ____________
a) the beginning of the file
b) the end of the file
c) the last written position in file
d) none of the mentioned

Answer: a
Clarification: None.

8. The index contains ____________
a) names of all contents of file
b) pointers to each page
c) pointers to the various blocks
d) all of the mentioned

Answer: c
Clarification: None.

9. For large files, when the index itself becomes too large to be kept in memory?
a) index is called
b) an index is created for the index file
c) secondary index files are created
d) all of the mentioned

Answer: b

250+ TOP MCQs on Swap Space Management and Answers

Operating System Multiple Choice Questions on “Swap Space Management”.

1. Virtual memory uses disk space as an extension of _________
a) secondary storage
b) main memory
c) tertiary storage
d) none of the mentioned

Answer: b
Clarification: None.

2. Using swap space significantly _________ system performance.
a) increases
b) decreases
c) maintains
d) does not affect

Answer: b
Clarification: Disk access is much slower than memory access.

3. Linux __________ the use of multiple swap spaces.
a) allows
b) does not allow
c) may allow
d) none of the mentioned

Answer: a
Clarification: Putting these swap spaces on separate disks reduces the load places on the I/O system.

4. A single swap space ______ reside in two places.
a) can
b) cannot
c) must not
d) none of the mentioned

Answer: a
Clarification: None.

5. If the swap space is simply a large file, within the file system, ____________ used to create it, name it and allocate its space.
a) special routines must be
b) normal file system routines can be
c) normal file system routines cannot be
d) swap space storage manager is

Answer: b
Clarification: None.

6. For swap space created in a separate disk partition where no file system or directory structure is placed, _____________ used to allocate and deallocate the blocks.
a) special routines must be
b) normal file system routines can be
c) normal file system routines cannot be
d) swap space storage manager is

Answer: d
Clarification: None.

7. When a fixed amount of swap space is created during disk partitioning, more swap space can be added only by?
I) repartitioning of the disk
II) adding another swap space elsewhere
a) only I
b) only II
c) both I and II
d) neither I nor II

Answer: c
Clarification: None.

8. In UNIX, two per process ________ are used by the kernel to track swap space use.
a) process tables
b) swap maps
c) memory maps
d) partition maps

Answer: b
Clarification: None.

9. It is __________ to reread a page from the file system than to write it to swap space and then to reread it from there.
a) useless
b) less efficient
c) more efficient
d) none of the mentioned

Answer: c