Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

MCQ 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

OPERATING SYSTEM

1. In what way is an operating system like a government?


A) It seldom functions correctly.
B) It creates an environment within which other programs can do useful work.
C) It performs most useful functions by itself.
D) It is always concerned primarily with the individual's needs.

2. Embedded computers typically run on a ____ operating system.


A) real-time
B) Windows XP
C) Network
D) Clustered

3. A circular queue is the most appropriate data structure for ______ scheduling.
A) RR
B) FCFS
C) SJF
D) Multi-level

4. Turnaround time refers to the amount of time ______ .


A) that CPU utilization is minimized
B) needed to execute a particular process
C) a process has been waiting in the ready queue
D) it takes from when a request was submitted until the first action is produced

5. The major difficulty in designing a layered operating system approach is ____.


A) making sure each layer is easily converted to modules
B) making sure that each layer hides certain data structures, hardware, and operations
from higher-level layers
C) debugging a particular layer
D) appropriately defining the various layers

6. Which of the following is a property of peer-to-peer systems?


A) Clients and servers are not distinguished from one another.
B) Separate machines act as either the client of the server but not both.
C) They do not offer any advantages over traditional client-server systems.
D) They suffer from the server acting as the bottleneck in performance.

Page 1
7. In multiprocessor environments, two copies of the same data may reside in the local
cache of each CPU. Whenever one CPU alters the data, the cache of the other CPU must
receive an updated version of this data. This is called Cache _________ .
A) redundancy
B) integrity
C) coherency
D) normalization

8. Which of the following is not considered a resource that may be allocated by an


operating system?
A) CPU
B) storage device
C) file system
D) memory

9. Two important design issues for cache memory are ____.


A) speed and volatility
B) size and replacement policy
C) power consumption and reusability
D) size and access privileges

10. Most often, application programs access system resources using ______ .
A) system calls
B) kernel threads
C) user threads
D) application program interfaces

11. CPU registers are often used to ________ .


A) pass parameters to the operating system
B) store values for reuse by other user programs
C) save memory for storing programs
D) None of the above responses are correct.

Page 2
12. The resource pyramid, with CPU registers and cache memories at the top and tape drive
storage at the bottom, reflects which of the following problems of computer design and
operating system management?
A) Resource Allocation
B) Speed to Cost tradeoff
C) Expertise to Transparency issue
D) Persistency versus Volatility

13. Which of the following is not an operating system?


A) Linux
B) Solaris
C) Windows XP
D) Oracle

14. Which of the following is an example of a systems program?


A) command interpreter
B) Web browser
C) text formatter
D) database system

15. If a program terminates abnormally, a dump of memory may be examined by a ____ to


determine the cause of the problem.
A) module
B) debugger
C) shell
D) control card

16. A message passing model is ____.


A) easier to implement than a shared memory model for intercomputer communication
B) is faster than the shared memory model
C) a network protocol and does not apply to operating systems
D) is only useful for small simple operating systems

Page 3
17. An advantage to using a higher-level language to implement an operating system is
___________ .
A) the code can be written faster, is more compact, and is easier to understand and
debug
B) modern computer science students do not learn machine language programming
C) an operating system is far easier to port to some other hardware if it is written in a
higher-level language
D) Both A and C are correct responses

18. For a single-processor system __________ .


A) processes spend long times waiting to execute
B) there will never be more than one running process
C) input-output always causes CPU slowdown
D) process scheduling is always optimal

19. Policy ____.


A) determines how to do something
B) determines what will be done
C) is not likely to change across places
D) is not likely to change over time

20. In RR scheduling, the time quantum should be _________ the context-switch time.
A) small with respect to
B) large with respect to
C) the same size as
D) irrelevant to

NOTE: It was reported that a sample midterm had the incorrect answer for this question. The answer
supplied above is correct – lectures and textbook information always takes precedence over mistakes
(even instructor mistakes) so no appeals will be granted on this.

21. Context switching between processes is carried out by the


A) dispatcher
B) short term scheduler
C) interrupt handler
D) thread manager

Page 4
22. An optimal job scheduling scheme is
A) RR
B) FCFS
C) SJF
D) Priority

23. A microkernel is a kernel ____.


A) that is stripped of all nonessential components
B) that is compressed before loading in order to reduce its resident memory size
C) that is compiled to produce the smallest size possible when stored to disk
D) containing many components that are optimized to reduce resident memory size

NOTE: It was reported by several students that in the lectures, Dr. Kent had consistently used the
phrase “stripping away” in reference to the size and nature of micro-kernels. This is indeed the case, so
as a result of instructor initiated confusion, either A or B will be accepted as correct – the actual correct
answer is B, however.

24. Which of the following pieces of information is least useful to the SYSGEN program of
an operating system?
A) the CPU being used
B) amount of memory available
C) what applications to install
D) operating-system options such as buffer sizes or CPU scheduling algorithms

25. In a virtual machine, each program believes that it has ____.


A) multiple processors
B) its own memory
C) another "virtual" computer to assist in its operations
D) more memory than is physically available on the machine

26. The two modes of operation of an operating system are called ___________ .
A) process and kernel
B) ready and running
C) interrupt and system
D) kernel and user

Page 5
27. An operating system may be viewed as a resource allocator of such things as CPU time,
memory space, file-storage space, I/O devices, and so on, due to the requirement that
_________ .
A) such things need to allocated to be useful for operating systems to work
B) conflicts of resource usage must not be permitted to happen
C) computer users must be satisfied that resources are available on request
D) resources be used efficiently by users

28. A ____ can be used to prevent a user program from never returning control to the
operating system.
A) portal
B) program counter
C) firewall
D) timer

29. Bootstrap programs must be provided using ________ .


A) volatile memory
B) erasable-programmable memory
C) non-volatile ROM devices
D) special magnetic disk tracks

30. Medium-term scheduling is performed _________ .


A) typically on submitted jobs
B) when processes must be moved from waiting to ready state
C) on processes in the ready queue
D) None of the above are correct.

31. An I/O-bound process _________ .


A) spends equal time seeking I/O operations and doing computational work
B) spends more of its time doing computational work than seeking I/O operations
C) spends more of its time seeking I/O operations than doing computational work
D) spends less of its time seeking I/O operations than doing computational work

32. The ____ of a process contains temporary data such as function parameters, return
addresses, and local variables.
A) text section
B) data section
C) program counter
D) stack

Page 6
33. The following are valid process states.
A) Next, Running, Halting
B) Terminating, Waiting, Threshing
C) Running, Blocked, Waiting
D) None of these responses is correct

NOTE. The answer above is correct and not subject to appeal. Some students asked about the fact that
the 5-state model we focused on does not include Blocked state, however, this and other state
modifications to 7, 8, 9 and up to 11 state process models were discussed. Blocked and Suspended state
modifications were discussed.

34. A CPU-bound process _________ .


A) infrequently requests I/O operations and spends more of its time performing
computational work
B) frequently requests I/O operations and spends more of its time performing
computational work
C) infrequently requests I/O operations and spends less of its time performing
computational work
D) frequently requests I/O operations and spends less of its time performing
computational work

35. A process control block ____.


A) includes information on the process's state
B) stores the address of the next instruction to be processed by a different process
C) determines which process is to be executed next
D) is an example of a process queue

36. The most common secondary storage device is ____.


A) random access memory
B) dynamic random access memory
C) tape drive
D) magnetic disk

NOTE: Dr. Kent reviewed the lectures and textbook – there is sufficient ambiguity in this question
about tape drives versus disks, due to usage in the actual market (circa 2008-2010) that he will permit
correct answers as C or D.

37. A thread control block _______ .


A) is managed by the parent process
B) contains the same information as the process control block
C) has the identical structure as the process control block
D) does not include information about the parent process resource allocation

Page 7
38. The list of processes waiting for a particular I/O device is called a(n) ____.
A) standby queue
B) device queue
C) ready queue
D) interrupt queue

39. When a child process is created, which of the following is a possibility in terms of the
execution or address space of the child process?
A) The child process runs concurrently with the parent.
B) The child process has a new program loaded into it.
C) The child is a duplicate of the parent.
D) All of the above

40. In a(n) ____ temporary queue, the sender must always block until the recipient receives
the message.
A) zero capacity
B) variable capacity
C) bounded capacity
D) unbounded capacity

41. Marshalling refers to ________ .


A) packaging parameters in a form suitable for network transmission
B) initiating a remote procedure call to a networked computer
C) leading the packet train in TCP/IP messaging
D) ordering processes in state queues

42. A program is _________ .


A) another name for a process
B) an active entity
C) a passive entity
D) All of the above responses are correct.

43. Programs are capable of _______ .


A) executing concurrently
B) performing data transfer operations
C) performing logic
D) None of the above responses is correct

Page 8
44. ____ scheduling is approximated by predicting the next CPU burst with an exponential
average of the measured lengths of previous CPU bursts.
A) Multilevel queue
B) RR
C) FCFS
D) SJF

45. The ____ scheduling algorithm is designed especially for time-sharing systems.
A) SJF
B) FCFS
C) RR
D) Multilevel queue

46. Which of the following scheduling algorithms must be nonpreemptive?


A) SJF
B) RR
C) FCFS
D) priority algorithms

47. A process control block should contain __________ .


A) the process ID
B) locations to store register values
C) a list of all open files
D) All of these responses are correct

48. Pthreads refers to ____.


A) the POSIX standard.
B) an implementation for thread behavior.
C) an algorithm for thread behavior.
D) an API for process creation and synchronization.

49. The ____ multithreading model multiplexes many user-level threads to a smaller or
equal number of kernel threads.
A) many-to-one model
B) one-to-one model
C) many-to-many model
D) many-to-some model

Page 9
50. Thread-specific data is data that ____.
A) is not associated with any process
B) has been modified by the thread but not yet updated to the parent process
C) is generated by the thread independent of the thread's process
D) is copied and not shared with the parent process

51. The Producer-Consumer problem is related to _________ .


A) the handling of process control blocks
B) the scheduling of process states
C) the allocation of resources to process states
D) Both A and C are correct answers.

52. Which of the following is true of cooperative scheduling?


A) It requires a timer.
B) A process keeps the CPU until it releases the CPU either by terminating or by
switching to the waiting state.
C) It incurs a cost associated with access to shared data.
D) A process switches from the running state to the ready state when an interrupt
occurs.

53. ____ is the number of processes that are completed per time unit.
A) CPU utilization
B) Response time
C) Turnaround time
D) Throughput

54. When a process performs I/O, its PCB is moved to the ________ .
A) Ready queue
B) Wait queue
C) Terminate queue
D) Running queue

55. When a process is accessing its heap space, it exists in the _________ .
A) Running state
B) Waiting state
C) Terminating state
D) Ready state

Page 10
56. Long-term scheduling is performed _________ .
A) typically on submitted jobs
B) when processes must be moved from waiting to ready state
C) on processes in the ready queue
D) All of the above are correct.

57. Which of the following is true of multilevel queue scheduling?


A) Processes can move between queues.
B) Each queue has its own scheduling algorithm.
C) A queue cannot have absolute priority over lower-priority queues.
D) It is the most general CPU-scheduling algorithm.

58. In scheduling, the term Aging involves ___________ .


A) higher priority processes preventing low-priority processes from ever getting the
CPU.
B) gradually increasing the priority of a process so that a process will eventually
execute.
C) processes that are ready to run but stuck waiting indefinitely for the CPU.
D) processes being stuck in ready queues so long that they die.

59. Assume the following processes, each with their arrival time and burst time.

Process Arrival Time Burst Time


P1 0.0 7
P2 2.0 4
P3 4.0 1
P4 5.0 4

For SJF Non-Preemptive job scheduling, the average waiting time is


A) 3
B) 4
C) 7.5
D) 10

Page 11
60. Assume the following processes, each with their arrival time and burst time.

Process Arrival Time Burst Time


P1 0.0 7
P2 2.0 2
P3 4.0 1
P4 5.0 4

For FCFS job scheduling, the average waiting time is _______ .


A) 4.25
B) 4.75
C) 3.75
D) 5

Page 12
The remaining questions 61 and 62 all refer to the process state diagram below.

NEW
TERMINATED

READY RUNNING

WAITING

61. The state transition from READY to RUNNING happens when a process _____ .
A) is interrupted
B) performs an I/O or event handling
C) completes an I/O or event handling
D) is dispatched by the scheduler

62. The state transition from RUNNING to WAITING happens when a process _____ .
A) is interrupted
B) performs an I/O or event handling
C) completes an I/O or event handling
D) is dispatched by the scheduler

Page 13
1. Two short methods that implement the simple semaphore wait() and signal() operations
on global variable S include:

signal (S) {
S++;
}

and _______________ .
A) wait (S) {
while (S <= 0);
S--;
}
B) wait (S) {
while (S >= 0);
S--;
}
C) wait (S) {
S--;
while (S <= 0);
}
D) None of these are correct solutions.

2. Race conditions are prevented by requiring that critical regions be protected by


________ .

A) clocks
B) semaphores
C) locks
D) monitors

3. The local variables of a monitor can be accessed by ___________ .

A) only the operating system kernel threads


B) only the local procedures
C) signals
D) licensed developers

Page 14
4. The first readers-writers problem ____.

A) requires that, once a writer is ready, that writer performs its write as soon as
possible.
B) is not used to test synchronization primitives.
C) requires that no reader will be kept waiting unless a writer has already obtained
permission to use the shared database.
D) requires that no reader will be kept waiting unless a reader has already obtained
permission to use the shared database.

5. The second readers-writers problem _____________ .

A) requires that, once a writer is ready, that writer performs its write as soon as
possible.
B) is not used to test synchronization primitives.
C) requires that no reader will be kept waiting unless a writer has already obtained
permission to use the shared database.
D) requires that, once a writer is ready, that writer performs its write as soon as
possible.

NOTE: Either A or D are correct. Noted in class to ignore D, however.

6. A deadlocked state occurs whenever ____.


A) a process is waiting for I/O to a device that does not exist
B) the system has no available free resources
C) every process in a set is waiting for an event that can only be caused by another
process in the set
D) a process is unable to release its request for a resource after use

7. One necessary condition for deadlock is ____, which states that at least one resource
must be held in a non-sharable mode.
A) hold and wait
B) mutual exclusion
C) circular wait
D) no preemption

8. In a system resource-allocation graph, ____.


A) a directed edge from a process to a resource is called an assignment edge
B) a directed edge from a resource to a process is called a request edge
C) a directed edge from a process to resource is called a request edge
D) None of the above

Page 15
9. A cycle in a resource-allocation graph is ____.
A) a necessary and sufficient condition for deadlock in the case that each resource has
more than one instance
B) a necessary and sufficient condition for a deadlock in the case that each resource
has exactly one instance
C) a sufficient condition for a deadlock in the case that each resource has more than
once instance
D) is neither necessary nor sufficient for indicating deadlock in the case that each
resource has exactly one instance

10. Which of the following is most often used by operating systems to handle deadlocks?
A) Pretend that deadlocks never occur
B) Use protocols to prevent or avoid deadlocks
C) Detect and recover from deadlocks
D) None of the above

11. Which of the following statements is true?


A) A safe state is a deadlocked state.
B) A safe state may lead to a deadlocked state.
C) An unsafe state is necessarily, and by definition, always a deadlocked state.
D) An unsafe state may lead to a deadlocked state.

12. Suppose that there are 10 resources available to three processes. At time 0, the following
data is collected. The table indicates the process, the maximum number of resources
needed by the process, and the number of resources currently owned by each process.
Which of the following correctly characterizes this state?

Process Maximum Needs Currently Owned


P0 10 4
P1 3 1
P2 6 4
A) It is safe.
B) It is not safe.
C) The state cannot be determined.
D) It is an impossible state.

13. The circular-wait condition for a deadlock implies the hold-and-wait condition.
A) True
B) False

Page 16
14. If a resource-allocation graph has a cycle, the system must be in a deadlocked state.
A) True
B) False

15. In some circumstances, a system can be in a frozen state but not in a deadlocked state.
A) True
B) False

16. In order to solve the critical section problem it is necessary to satisfy the condition that
________ .
A) A thread may be executing in its critical section if another thread is currently
executing in its critical section.
B) Only those threads that are executing in their critical sections can participate in the
decision on which process will enter its critical section next.
C) A bound must exist on the number of times that other threads are allowed to enter
their critical state after a thread has made a request to enter its critical state.
D) All of the above.

17. _______ refers to the situation where, for a set of processes, every process in the set
must be waiting for an event that can be caused only be another process in the set.
A) Deadlock
B) Starvation
C) Locking
D) Blocking

18. One way to ensure that a circular-wait condition never holds is to _________ ?
A) apply a deadlock prevention policy.
B) impose a total ordering of all resource types and to require that each process
requests resources in an increasing order of enumeration.
C) assign each resource type a unique integer number to distinguish those occurring at
the same time in the ordering.
D) None of these responses is correct.

Page 17
19. A system has two types of resources, R1 and R2, both of which have two instances of
their respective resource types. There are four processes competing for resources.
Assume that the following system state exists:

P1 : R1 is requested, R2 is allocated
P2 : R1 is allocated
P3 : R1 is allocated, R2 is requested
P4 : R2 is allocated

The system state _______ .

A) contains a cycle, and it is deadlocked


B) contains a cycle but it is not deadlocked
C) contains no cycles and is not deadlocked
D) contains no cycles and is deadlocked

20. A race condition ____.


A) results when several threads try to access the same data concurrently
B) results when several threads try to access and modify the same data concurrently
C) will result only if the outcome of execution does not depend on the order in which
instructions are executed
D) None of the above

21. An instruction that executes atomically ____.


A) must consist of only one machine instruction
B) executes as a single, uninterruptible unit
C) cannot be used to solve the critical section problem
D) All of the above

22. A semaphore ____.


A) can be modified simultaneously by multiple threads
B) is accessed through only one standard operation
C) is essentially an integer variable
D) cannot be used to control access to a thread's critical sections

23. A spinlock ____.


A) is never advantageous for thread scheduling management
B) will ultimately result in a context switch when a process must wait on a lock
C) does not require a context switch when a process must wait on a lock
D) is useful when locks are expected to be held for long amounts of time

Page 18
24. In Peterson's solution, the ____ variable indicates if a process is ready to enter its
critical section.
A) turn
B) lock
C) flag[i]
D) turn[i]

25. A(n) ___ type presents a set of programmer-defined operations that are provided mutual
exclusion within the set.
A) transaction
B) signal
C) binary
D) monitor

26. A transaction ____.


A) performs multiple logical functions
B) is a single instruction
C) is a single operation
D) performs a single logical function

27. Suppose that there are 15 resources available to three processes. At time 0, the following
data is collected. The table indicates the process, the maximum number of resources
needed by the process, and the number of resources currently owned by each process.
Which of the following correctly characterizes this state?

Process Maximum Needs Currently Owned


P0 15 10
P1 5 3
P2 10 7
A) It is safe.
B) It is not safe.
C) The state cannot be determined.
D) It is an impossible state.

28. A claim edge of a resource allocation graph __________ .


A) is identical to a request edge
B) resembles an allocation edge in direction but is represented in the graph by a dashed
line
C) indicates that a process may request a resource at some time in the future
D) requires that the claiming process be given high priority in scheduling

Page 19
29. Which of the following statements is true?

A) A safe state is a deadlocked state.


B) A safe state may lead to a deadlocked state.
C) An unsafe state is necessarily, and by definition, always a deadlocked state.
D) An unsafe state may lead to a deadlocked state.

NOTE: This question is identical to Q11 – you should not have answered this, but will not be penalized
twice if you did.

30. Which of the following scheduling algorithms must be nonpreemptive?

A) SJF
B) RR
C) FCFS
D) priority algorithms

31. The ____ scheduling algorithm is designed especially for time-sharing systems.

A) SJF
B) FCFS
C) RR
D) Multilevel queue

32. Which of the following is true of multilevel queue scheduling?

A) Processes can move between queues.


B) Each queue has its own scheduling algorithm.
C) A queue cannot have absolute priority over lower-priority queues.
D) It is the most general CPU-scheduling algorithm.

33. One way to ensure that a circular-wait condition never holds is to _________ ?

A) apply a deadlock prevention policy.


B) assign each resource type a unique integer number to distinguish those occurring at
the same time in the ordering.
C) impose a total ordering of all resource types and to require that each process
requests resources in an increasing order of enumeration.
D) None of these responses is correct.

NOTE: This question is identical to Q18 (except for order of responses). You should not have
answered this question, but if you did, there is no penalty.

Page 20
34. The Producer-Consumer problem is related to _________ .

A) the handling of process state queues


B) the scheduling of process states
C) the allocation of resources to process states
D) Both A and C are correct answers.

35. A process control block should contain __________ .

A) the process ID
B) locations to store register values
C) a list of all open files
D) All of these responses are correct

36. Protocols to prevent hold-and-wait conditions typically also prevent starvation.


A) True
B) False

37. A deadlock-free solution eliminates the possibility of starvation.


A) True
B) False

38. Turnaround time refers to the amount of time ______ .


A) that CPU utilization is minimized
B) to execute a particular process
C) a process has been waiting in the ready queue
D) it takes from when a request was submitted until the first action is produced

39. A thread does not share with its peer threads its ______
A) code section
B) data section
C) operating-system resources
D) semaphore

Page 21
40. Synchronization of message passing between processes is assured by using ______
A) buffering
B) queuing
C) blocking
D) mutexing

Page 22

You might also like