• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

50 Operating System MCQs with Answers

Question 31

Which of the following is NOT a valid deadlock prevention scheme? (GATE CS 2000)
  • Release all resources before requesting a new resource
  • Number the resources uniquely and never request a lower numbered resource than the last one requested.
  • Never request a resource after releasing any resource
  • Request and all required resources be allocated before execution.

Question 32

Consider the following proposed solution for the critical section problem. There are n processes: P0 ...Pn−1. In the code, function pmax returns an integer not smaller than any of its arguments. For all i, t[i] is initialized to zero. deadlock Which one of the following is TRUE about the above solution?
  • At most one process can be in the critical section at any time
  • The bounded wait condition is satisfied
  • The progress condition is satisfied
  • It cannot cause a deadlock

Question 33

An operating system contains 3 user processes each requiring 2 units of resource R. The minimum number of units of R such that no deadlocks will ever arise is
  • 3
  • 5
  • 4
  • 6

Question 34

Two shared resources R1 and R2 are used by processes P1 and P2. Each process has a certain priority for accessing each resource. Let Tij denote the priority of Pi for accessing  Rj. A process Pi can snatch a resource Rh from process Pj if Tik is greater than Tjk. Given the following :
  1. T11 > T21
  2. T12 > T22
  3. T11 < T21
  4. T12 < T22
Which of the following conditions ensures that P1 and P2 can never deadlock?  
  • (I) and (IV)
  • (II) and (III)
  • (I) and (II)
  • None of the above

Question 35

Which of the following commands or sequences of commands will rename a file x to file y in a Unix system? I. mv y, x II. mv x, y III. cp y, x (rm x) IV. cp x, y (rm x)
  • II and III
  • II and IV
  • l and III
  • II only

Question 36

The shell command
find -name passwd -print
is executed in /etc directory of a computer system running Unix. Which of the following shell commands will give the same information as the above command when executed in the same directory?  
  • ls passwd
  • cat passwd
  • grep name passwd
  • grep print passwd

Question 37

Consider the following statements : 

(a) UNIX provides three types of permissions 
* Read 
* Write 
* Execute 

(b) UNIX provides three sets of permissions 
* permission for owner 
* permission for group 
* permission for others 

Which of the above statement/s is/are true?

  • only (a)

  • only (b)

  • Both (a) and (b)

  • Neither (a) nor (b)

Question 38

The linux command “mknod myfifo b 4 16”
  • Will create a character device if the user is root
  • Will create a named pipe FIFO if the user is root
  • Will create a block device if the user is root
  • None of the above

Question 39

Unix command to change the case of first three lines of file “shortlist” from lower to upper
  • $ tr ‘[a – z]’ ‘[A – Z]’ shortlist ¦ head-3
  • $ head-3 shortlist ¦ tr ‘[a – z]’ ‘[A – Z]’
  • $ tr head -3 shortlist ‘[A – Z]’ ‘[a – z]’
  • $ tr shortlist head -3 ‘[a – z]’ ‘[A – Z]’

Question 40

Which of the following information about the UNIX file system is not correct?
  • Super block contains the number of i-nodes, the number of disk blocks, and the start of the list of free disk blocks.
  • An i-node contains accounting information as well as enough information to locate all the disk blocks that holds the file’s data.
  • Each i-node is 256-bytes long.
  • All the files and directories are stored in data blocks.

There are 50 questions to complete.

Last Updated :
Take a part in the ongoing discussion