Operating system mcq

 

Multiple choice questions on 

Operating system services


1. What are the services operating System provides to both the users and to the programs

A. File System manipulation

B. Error Detection

C. Program execution

D. Resource Allocation

View Answer


Ans : C



2. Which of the following few common services provided by an operating system?


A. Protection

B. Program execution

C. I/O operations

D. All of the above

View Answer


Ans : D


3. Which of the following are examples of storage media?


A. magnetic disk

B. optical disk

C. Both A and B

D. None of the above

View Answer


Ans : C


4. Which of the following is true about Program execution?


A. Restrict to load a program into memory.

B. Provides a mechanism for process synchronization.

C. Do not provides a mechanism for process communication.

D. Do not provides a mechanism for deadlock handling.

View Answer


Ans : B


 

5. Which of the following is false about I/O Operation?


A. Operating system does not provides the access to the I/O device

B. I/O operation means read or write operation

C. An I/O subsystem comprises of I/O devices

D. None of the above

View Answer


Ans : A



6. Which of the following is false about File system manipulation?


A. Computers can store files on the disk (Primary storage), for long-term storage purpose

B. Program needs to read a file or write a file.

C. Operating System provides an interface to the user to create/delete files.

D. Operating System provides an interface to create the backup of file system.

View Answer


Ans : A



7. Which of the following is true about Communication?


A. The OS handles routing and connection strategies, and the problems of contention and security.

B. Two processes often require data to be transferred between them

C. Communication may be implemented by two methods, either by Shared Memory or by Message Passing.

D. All of the above

View Answer


Ans : D


8. Which of the following is true about Communication?


A. Errors can occur anytime and anywhere.

B. An error may occur in CPU, in I/O devices or in the memory hardware.

C. OS constantly checks for possible errors.

D. All of the above

View Answer


Ans : D



9. The OS ensures that all access to system resources is controlled.The major activities of an operating system with respect to?


A. Error handling

B. Resource Management

C. Protection

D. Communication

View Answer


Ans : C

.



10. Two processes often require data to be transferred between them. The major activities of an operating system with respect to?


A. Error handling

B. Resource Management

C. Protection

D. Communication

View Answer


Ans : D

Process  Management

1.which of the following is true about Process?


A. A process is basically a program in execution

B. The execution of a process must progress in a sequential fashion.

C. A process is defined as an entity which represents the basic unit of work to be implemented in the system.

D. All of the above

View Answer


Ans : D




2. This is dynamically allocated memory to a process during its run time.


A. Heap

B. Stack

C. Queue

D. Data

View Answer


Ans : A



3. This section contains the global and static variables.


A. Heap

B. Stack

C. Data

D. Text

View Answer


Ans : C




4. A part of a computer program that performs a well-defined task is known as ?


A. algorithm

B. software

C. program

D. task

View Answer


Ans : A




 

5. How many state are there in Process Life Cycle?


A. 4

B. 5

C. 6

D. 7

View Answer


Ans : B




6. PCB stands for?


A. Process Current Block

B. Parent Control Block

C. Parent Current Block

D. Process Control Block

View Answer


Ans : D



7.  A collection of computer programs, libraries and related data are referred to as?


A. algorithm

B. software

C. PCB

D. Process

View Answer


Ans : B




8. In which state, processor executes its instructions?


A. Ready

B. Waiting

C. Running

D. Start

View Answer


Ans : C




9. In PCB, This is required to allow/disallow access to system resources.


A. Process State

B. Process privileges

C. Program Counter

D. CPU Scheduling Information

View Answer


Ans : B




10. In PCB, This includes the amount of CPU used for process execution, time limits, execution ID etc.


A. IO status information

B. CPU Scheduling Information

C. CPU registers

D. Accounting information

View Answer


Ans : D

Process Scheduling

1. The OS maintains all PCBs in?


A. Process Scheduling Queues

B. Job queue

C. Ready queue

D. Device queues

View Answer


Ans : A



2. The processes which are blocked due to unavailability of an I/O device constitute this queue.


A. Process Scheduling Queues

B. Job queue

C. Ready queue

D. Device queues

View Answer


Ans : D



3. Two-state process model refers to?


A. running states

B. non-running states

C. Both A and B

D. None of the above

View Answer


Ans : C



4. Which is not a type of Schedulers?


A. Long-Term Scheduler

B. Short-Term Scheduler

C. Medium-Term Scheduler

D. None of the above

View Answer


Ans : D





 

5. Which scheduler is also called a job scheduler?


A. Long-Term Scheduler

B. Short-Term Scheduler

C. Medium-Term Scheduler

D. All of the above

View Answer


Ans : A



6. When the suspended process is moved to the secondary storage. This process is called?


A. process mix.

B. swapping

C. Swap-In

D. Swap-Out

View Answer


Ans : B




7. Which scheduler Speed is fastest?


A. Long-Term Scheduler

B. Short-Term Scheduler

C. Medium-Term Scheduler

D. Swapping

View Answer


Ans : B



8. Which Schedular is a part of Time sharing systems?


A. Long-Term Scheduler

B. Short-Term Scheduler

C. Medium-Term Scheduler

D. Swapping

View Answer


Ans : C




9. A_________ is the mechanism to store and restore the state


A. PCB

B. Program Counter

C. Scheduling information

D. context switch

View Answer


Ans : D




10. Which of the following information is stored when the process is switched?


A. I/O State information

B. Accounting information

C. Base and limit register value

D. All of the above

View Answer


Ans : D 

Process Scheduling Algorithms

1. The algorithms are ________.


A. non-preemptive

B. preemptive

C. Both A and B

D. None of the above

View Answer


Ans : C



2. Which of the following is process scheduling algorithms?


A. FCFS

B. SJN

C. RR

D. All of the above

View Answer


Ans : D


3. Which of the following algorithms work based on priority?


A. non-preemptive

B. preemptive

C. Both A and B

D. None of the above

View Answer


Ans : B


4. Which of the following is false regarding First Come First Serve (FCFS)?


A. FCFS performance is high

B. average wait time is high.

C. Its implementation is based on FIFO queue.

D. FCFS is easy to understand and implement.

View Answer


Ans : A


 

5. Shortest Job Next is also known as?


A. Batch job

B. Advance job

C. shortest job first

D. shortest job last

View Answer


Ans : C


6. Which of the following is non-preemptive algorithm?


A. Priority Based Scheduling

B. Shortest Remaining Time

C. FCFS

D. shortest job first

View Answer


Ans : A


7. In Round Robin Scheduling, Each process is provided a fix time to execute, it is called a?


A. Batch Time

B. Job Time

C. quantum

D. Period

View Answer


Ans : C


8. Which of the following is preemptive algorithm?


A. Round Robin Scheduling

B. Shortest Remaining Time

C. Multiple-Level Queues Scheduling

D. Both A and B

View Answer


Ans : D


9. __________ is used to save states of preempted processes.


A. Context switching

B. Quantam

C. Process Period

D. Batch Jobs

View Answer


Ans : A


10. In Priority Based Scheduling, if Processes have same priority then which Scheduling algorithm is used?


A. SJN

B. FCFS

C. SRT

D. Round Robin

View Answer


Ans : B

Memory Management

1. What is true about memory management?


A. Memory management keeps track of each and every memory location

B. It decides which process will get memory at what time.

C. It tracks whenever some memory gets freed or unallocated and correspondingly it updates the status.

D. All of the above

View Answer


Ans : D


2. In Process Address Space, The loader generates these addresses at the time when a program is loaded into main memory is ?


A. Symbolic addresses

B. Relative addresses

C. Physical addresses

D. None of the above

View Answer


Ans : C

.



3. In Process Address Space, The variable names, constants, and instruction labels are the basic elements of ____________.


A. Symbolic addresses

B. Relative addresses

C. Physical addresses

D. None of the above

View Answer


Ans : A



4. The set of all physical addresses corresponding to these logical addresses is referred to as?


A. Logical address space.

B. Physical address space.

C. MMU address space

D. Virtual address space.

View Answer


Ans : B




 

5. With ________, the absolute program (and data) is loaded into memory in order for execution to start.


A. Static loading

B. Dynamic Loading

C. Static Linking

D. Dynamic Linking

View Answer


Ans : A



6. when ________ is used, the linker combines all other modules needed by a program into a single executable program to avoid any runtime dependency.


A. Static loading

B. Dynamic Loading

C. Static Linking

D. Dynamic Linking

View Answer


Ans : C



7. Swapping is also known as a


A. technique for memory management

B. technique for memory compaction

C. technique for memory addresse

D. technique for dynamic linking

View Answer


Ans : B



8. How many types of Fragmentation are there?


A. 2

B. 3

C. 4

D. 5

View Answer


Ans : A




9. In which type of Fragmentation, Memory block assigned to process is bigger. Some portion of memory is left unused, as it cannot be used by another process.


A. External fragmentation

B. Internal fragmentation

C. Both A and B

D. None of the above

View Answer


Ans : B



10. __________ is a memory management technique in which process address space is broken into blocks of the same size


A. Fragmentation

B. Frames

C. Paging

D. Address Translation

View Answer


Ans : C

Deadlock handling

1. The wait-for graph is a deadlock detection algorithm that is applicable when ____________

a) all resources have a single instance

b) all resources have multiple instances

c) all resources have a single 7 multiple instances

d) all of the mentioned

View Answer


Answer: a



2. An edge from process Pi to Pj in a wait for graph indicates that ____________

a) Pi is waiting for Pj to release a resource that Pi needs

b) Pj is waiting for Pi to release a resource that Pj needs

c) Pi is waiting for Pj to leave the system

d) Pj is waiting for Pi to leave the system

View Answer


Answer: a


3. If the wait for graph contains a cycle ____________

a) then a deadlock does not exist

b) then a deadlock exists

c) then the system is in a safe state

d) either deadlock exists or system is in a safe state

View Answer


Answer: b


4. If deadlocks occur frequently, the detection algorithm must be invoked ________

a) rarely

b) frequently

c) rarely & frequently

d) none of the mentioned

View Answer


Answer: b


5. What is the disadvantage of invoking the detection algorithm for every request?

a) overhead of the detection algorithm due to consumption of memory

b) excessive time consumed in the request to be allocated memory

c) considerable overhead in computation time

d) all of the mentioned

View Answer


Answer: c


6. A deadlock eventually cripples system throughput and will cause the CPU utilization to ______

a) increase

b) drop

c) stay still

d) none of the mentioned

View Answer


Answer: b


7. Every time a request for allocation cannot be granted immediately, the detection algorithm is invoked. This will help identify ____________

a) the set of processes that have been deadlocked

b) the set of processes in the deadlock queue

c) the specific process that caused the deadlock

d) all of the mentioned

View Answer


Answer: a


8. A computer system has 6 tape drives, with ‘n’ processes competing for them. Each process may need 3 tape drives. The maximum value of ‘n’ for which the system is guaranteed to be deadlock free is?

a) 2

b) 3

c) 4

d) 1

View Answer


Answer: a


9. A system has 3 processes sharing 4 resources. If each process needs a maximum of 2 units then, deadlock ____________

a) can never occur

b) may occur

c) has to occur

d) none of the mentioned

View Answer


Answer: a



10. ‘m’ processes share ‘n’ resources of the same type. The maximum need of each process doesn’t exceed ‘n’ and the sum of all their maximum needs is always less than m+n. In this setup, deadlock ____________

a) can never occur

b) may occur

c) has to occur

d) none of the mentioned

View Answer


Answer: a


5. Which one of the following is the deadlock avoidance algorithm?

a) banker’s algorithm

b) round-robin algorithm

c) elevator algorithm

d) karn’s algorithm

View Answer


Answer: a



6. What is the drawback of banker’s algorithm?

a) in advance processes rarely know how much resource they will need

b) the number of processes changes as time progresses

c) resource once available can disappear

d) all of the mentioned

View Answer


Answer: d


7. For an effective operating system, when to check for deadlock?

a) every time a resource request is made

b) at fixed time intervals

c) every time a resource request is made at fixed time intervals

d) none of the mentioned

View Answer


Answer: c


8. A problem encountered in multitasking when a process is perpetually denied necessary resources is called ____________

a) deadlock

b) starvation

c) inversion

d) aging

View Answer


Answer: b


9. Which one of the following is a visual ( mathematical ) way to determine the deadlock occurrence?

a) resource allocation graph

b) starvation graph

c) inversion graph

d) none of the mentioned

View Answer


Answer: a


10. To avoid deadlock ____________

a) there must be a fixed number of resources to allocate

b) resource allocation must be done only once

c) all deadlocked processes must be aborted

d) inversion technique can be used

View Answer


Answer: a

File System


1. ______ is a unique tag, usually a number identifies the file within the file system.

a) File identifier

b) File name

c) File type

d) None of the mentioned

View Answer


Answer: a


2. To create a file ____________

a) allocate the space in file system

b) make an entry for new file in directory

c) allocate the space in file system & make an entry for new file in directory

d) none of the mentioned

View Answer


Answer: c

3. By using the specific system call, we can ____________

a) open the file

b) read the file

c) write into the file

d) all of the mentioned

View Answer


Ans d


4. File type can be represented by ____________

a) file name

b) file extension

c) file identifier

d) none of the mentioned

View Answer


Answer: b


5. Which file is a sequence of bytes organized into blocks understandable by the system’s linker?

a) object file

b) source file

c) executable file

d) text file

View Answer

Answer: a

E


letsfindcourse

Operating System MCQ Topics


Operating System Reference


Other Reference




 


 


 

×Learn Programming For FREE, Click Here to Visit Our Youtube Channel.

Operating System MCQ - File System

File System MCQs : This section focuses on "File System" in Operating System. These Multiple Choice Questions (MCQ) should be practiced to improve the Operating System skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exams and other competitive examinations.


1. A file is a sequence of?


A. bits

B. bytes

C. lines

D. All of the above

View Answer


Ans : D

Explanation: A file is a sequence of bits, bytes, lines or records whose meaning is defined by the files creator and user.



2. __________ is a sequence of bytes organized into blocks that are understandable by the machine.


A. object file

B. source file

C. text file

D. None of the above

View Answer


Ans : A

Explanation: An object file is a sequence of bytes organized into blocks that are understandable by the machine.



3. _________ is a sequence of procedures and functions.


A. object file

B. source file

C. text file

D. None of the above

View Answer


Ans : B

Explanation: A source file is a sequence of procedures and functions.



4. What is true about Ordinary files?


A. These are the files that contain user information.

B. These files contain list of file names and other information related to these files.

C. These files represent physical device like disks, terminals, printers, networks, tape drive etc.

D. All of the above

View Answer C 



 

5. What is true about Directory files?


A. These files represent physical device like disks, terminals, printers, networks, tape drive etc. 

B. These may have text, databases or executable program.

C. These files contain list of file names and other information related to these files.

D. All of the above

View Answer


Ans : C




6. Special files : These files are also known as?


A. Character special files

B. Block special files

C. device files

D. Data files

View Answer


Ans : C



7. In Space Allocation, Which of the following ways are correct to allocate disk space to files?


A. Contiguous Allocation

B. Linked Allocation

C. Indexed Allocation

D. All of the above

View Answer


Ans : D




8. What is the real disadvantage of a linear list of directory entries?


A. size of the linear list in memory

B. linear search to find a file

C. it is not reliable

D. All of the above

View Answer


Ans : B



9. What is raw disk?


A. disk without file system

B. empty disk

C. disk lacking logical file system

D. disk having file system

View Answer


Ans : A




10. In ___________ writes, the data is stored in the cache.


A. Asynchronous

B. Regular

C. Synchronous

D. Irregular

View Answer


Ans : A


Io Disk Scheduling 

1. Whenever a process needs I/O to or from a disk it issues a ______________

a) system call to the CPU

b) system call to the operating system

c) a special procedure

d) all of the mentioned

View Answer


Answer: b


2. If a process needs I/O to or from a disk, and if the drive or controller is busy then ____________

a) the request will be placed in the queue of pending requests for that drive

b) the request will not be processed and will be ignored completely

c) the request will be not be placed

d) none of the mentioned

View Answer


Answer: a


3. Consider a disk queue with requests for I/O to blocks on cylinders.

98 183 37 122 14 124 65 67

Considering FCFS (first cum first served) scheduling, the total number of head movements is, if the disk head is initially at 53 is?

a) 600

b) 620

c) 630

d) 640

View Answer


Answer: d


4. Consider a disk queue with requests for I/O to blocks on cylinders.

98 183 37 122 14 124 65 67

Considering SSTF (shortest seek time first) scheduling, the total number of head movements is, if the disk head is initially at 53 is?

a) 224

b) 236

c) 245

d) 240

View Answer


Answer: b


5. Random access in magnetic tapes is _________ compared to magnetic disks.

a) fast

b) very fast

c) slow

d) very slow

View Answer


Answer: d


6. Magnetic tape drives can write data at a speed ________ disk drives.

a) much lesser than

b) comparable to

c) much faster than

d) none of the mentioned

View Answer


Answer: b


7. On media that use constant linear velocity (CLV), the _____________ is uniform.

a) density of bits on the disk

b) density of bits per sector

c) the density of bits per track

d) none of the mentioned

View Answer


Answer: c



8. SSTF algorithm, like SJF __________ of some requests.

a) may cause starvation

b) will cause starvation

c) does not cause starvation

d) causes aging

View Answer


Answer: a


9. In the ______ algorithm, the disk arm starts at one end of the disk and moves toward the other end, servicing requests till the other end of the disk. At the other end, the direction is reversed and servicing continues.

a) LOOK

b) SCAN

c) C-SCAN

d) C-LOOK

View Answer


Answer: b



10. In the _______ algorithm, the disk head moves from one end to the other, servicing requests along the way. When the head reaches the other end, it immediately returns to the beginning of the disk without servicing any requests on the return trip.

a) LOOK

b) SCAN

c) C-SCAN

d) C-LOOK

View Answer


Answer: c


11. In the ______ algorithm, the disk arm goes as far as the final request in each direction, then reverses direction immediately without going to the end of the disk.

a) LOOK

b) SCAN

c) C-SCAN

d) C-LOOK

View Answer


Answer: a


Process Synchronisation

1.
A binary semaphore

Has the values one or zero

Is essential to binary computers

Is used only for synchronization

is used only for mutual exclusion


2.
Inter process communication can be done through __________.

Mails

Messages

System calls

Traps


3.
Mutual exclusion

if one process is in a critical region others are excluded

Prevents deadlock

Requires semaphores to implement

Is found only in the Windows NT operating system


4.
The section of code which accesses shared variables is called as __________.

Critical section

Block v

Procedure

Semaphore


5.
Semaphore can be used for solving __________.

Wait & signal

Deadlock

Synchronization

Priority 

6.When several processes access the same data concurrently and the outcome of the execution depends on the particular order in which the access takes place, is called

Dynamic condition

Race condition

Essential condition

Critical condition

7.
If a process is executing in its critical section, then no other processes can be executing in their critical section. This condition is called

Mutual exclusion

Critical exclusion

Synchronous exclusion

Asynchronous exclusion

8.
Which one of the following is a synchronization tool?

Thread

Pipe

Semaphore

Socket

9.
A semaphore is a shared integer variable

That can not drop below zero

That can not be more than zero

That can not drop below one

That can not be more than one

10.
Mutual exclusion can be provided by the

Mutex locks

Binary semaphores

Both (a) and (b)

None of the mentioned




 


 

No comments:

Post a Comment