0% found this document useful (0 votes)
38 views10 pages

OS MCQ Sample With Answers

The document consists of multiple-choice questions (MCQs) related to operating systems, covering topics such as scheduling algorithms, memory management, and process synchronization. Each question presents a scenario or concept, followed by several answer options. The document also includes the correct answers for each question, providing a comprehensive overview of key operating system principles.

Uploaded by

thomaspappa0123
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)
38 views10 pages

OS MCQ Sample With Answers

The document consists of multiple-choice questions (MCQs) related to operating systems, covering topics such as scheduling algorithms, memory management, and process synchronization. Each question presents a scenario or concept, followed by several answer options. The document also includes the correct answers for each question, providing a comprehensive overview of key operating system principles.

Uploaded by

thomaspappa0123
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/ 10

Operating System MCQ

1. Round robin scheduling falls under the category of ____________


a) Non-preemptive scheduling
b) Preemptive scheduling
c) All of the mentioned
d) None of the mentioned

2. With round robin scheduling algorithm in a time shared system ____________


a) using very large time slices converts it into First come First served scheduling
algorithm
b) using very small time slices converts it into First come First served scheduling
algorithm
c) using extremely small time slices increases performance
d) using very small time slices converts it into Shortest Job First algorithm

3. The portion of the process scheduler in an operating system that dispatches


processes is concerned with ____________
a) assigning ready processes to CPU
b) assigning ready processes to waiting queue
c) assigning running processes to blocked queue
d) all of the mentioned

4. Complex scheduling algorithms ____________


a) are very appropriate for very large computers
b) use minimal resources

TRACE KTU
c) use many resources
d) all of the mentioned

5. What is FIFO algorithm?


a) first executes the job that came in last in the queue
b) first executes the job that came in first in the queue
c) first executes the job that needs minimal processor
d) first executes the job that has maximum processor needs

6. The strategy of making processes that are logically runnable to be temporarily


suspended is called ____________
a) Non preemptive scheduling
b) Preemptive scheduling
c) Shortest job first
d) First come First served

7. What is Scheduling?
a) allowing a job to use the processor
b) making proper use of processor
c) all of the mentioned
d) none of the mentioned

8. There are 10 different processes running on a workstation. Idle processes are waiting
for an input event in the input queue. Busy processes are scheduled with the
Round-Robin time sharing method. Which out of the following quantum times is the best
value for small response times, if the processes have a short runtime, e.g. less than
10ms?
a) tQ = 15ms
b) tQ = 40ms
c) tQ = 45ms
d) tQ = 50ms

9. Orders are processed in the sequence they arrive if _______ rule sequences the jobs.
a) earliest due date
b) slack time remaining
c) first come, first served
d) critical ratio

10. Which of the following algorithms tends to minimize the process flow time?
a) First come First served
b) Shortest Job First
c) Earliest Deadline First
d) Longest Job First

11. Under multiprogramming, turnaround time for short jobs is usually ________ and that
for long jobs is slightly ___________
a) Lengthened; Shortened
b) Shortened; Lengthened
c) Shortened; Shortened
d) Shortened; Unchanged

12. Which of the following statements are true?

TRACE KTU
I. Shortest remaining time first scheduling may cause starvation

II. Preemptive scheduling may cause starvation

III. Round robin is better than FCFS in terms of response time

a) I only
b) I and III only
c) II and III only
d) I, II and III
13. Which is the most optimal scheduling algorithm?
a) FCFS – First come First served
b) SJF – Shortest Job First
c) RR – Round Robin
d) None of the mentioned

14. The real difficulty with SJF in short term scheduling is ____________
a) it is too good an algorithm
b) knowing the length of the next CPU request
c) it is too complex to understand
d) none of the mentioned

15. The FCFS algorithm is particularly troublesome for ____________


a) time sharing systems
b) multiprogramming systems
c) multiprocessor systems
d) operating systems

16. Consider the following set of processes, the length of the CPU burst time given in
milliseconds.

Process Burst time


P1 6
P2 8
P3 7
P4 3
Assuming the above process being scheduled with the SJF scheduling algorithm.
a) The waiting time for process P1 is 3ms
b) The waiting time for process P1 is 0ms
c) The waiting time for process P1 is 16ms
d) The waiting time for process P1 is 9ms

17. Preemptive Shortest Job First scheduling is sometimes called ____________


a) Fast SJF scheduling
b) EDF scheduling – Earliest Deadline First
c) HRRN scheduling – Highest Response Ratio Next
d) SRTN scheduling – Shortest Remaining Time Next

18. An SJF algorithm is simply a priority algorithm where the priority is ____________
a) the predicted next CPU burst
b) the inverse of the predicted next CPU burst

TRACE KTU
c) the current CPU burst
d) anything the user wants
19. Choose one of the disadvantages of the priority scheduling algorithm?
a) it schedules in a very complex manner
b) its scheduling takes up a lot of time
c) it can lead to some low priority process waiting indefinitely for the CPU
d) none of the mentioned
20. What is ‘Aging’?
a) keeping track of cache contents
b) keeping track of what pages are currently residing in memory
c) keeping track of how many times a given page is referenced
d) increasing the priority of jobs to ensure termination in a finite time
21. A solution to the problem of indefinite blockage of low – priority processes is
____________
a) Starvation
b) Wait queue
c) Ready queue
d) Aging

22. Which of the following statements are true?

i) Shortest remaining time first scheduling may cause starvation

ii) Preemptive scheduling may cause starvation


iii) Round robin is better than FCFS in terms of response time

a) i only
b) i and iii only
c) ii and iii only
d) i, ii and iii

23. Which of the following scheduling algorithms gives minimum average waiting time?
a) FCFS
b) SJF
c) Round – robin
d) Priority
24. Concurrent access to shared data may result in ____________
a) data consistency
b) data insecurity
c) data inconsistency
d) none of the mentioned

25. A situation where several processes access and manipulate the same data
concurrently and the outcome of the execution depends on the particular order in which
access takes place is called ____________
a) data consistency
b) race condition
c) aging
d) starvation

TRACE KTU
26. The segment of code in which the process may change common variables, update
tables, write into files is known as ____________
a) program
b) critical section
c) non – critical section
d) synchronizing

27. Which of the following conditions must be satisfied to solve the critical section
problem?
a) Mutual Exclusion
b) Progress
c) Bounded Waiting
d) All of the mentioned

28. Mutual exclusion implies that ____________


a) if a process is executing in its critical section, then no other process must be
executing in their critical sections
b) if a process is executing in its critical section, then other processes must be executing
in their critical sections
c) if a process is executing in its critical section, then all the resources of the system
must be blocked until it finishes execution
d) none of the mentioned

29. Bounded waiting implies that there exists a bound on the number of times a process
is allowed to enter its critical section ____________
a) after a process has made a request to enter its critical section and before the request
is granted
b) when another process is in its critical section
c) before a process has made a request to enter its critical section
d) none of the mentioned

;30. A minimum of _____ variable(s) is/are required to be shared between processes to


solve the critical section problem.
a) one
b) two
c) three
d) four
31. In the bakery algorithm to solve the critical section problem ____________
a) each process is put into a queue and picked up in an ordered manner
b) each process receives a number (may or may not be unique) and the one with the
lowest number is served next
c) each process gets a unique number and the one with the highest number is served
next
d) each process gets a unique number and the one with the lowest number is served
next
Answers
1. B
2. A
3. A
4. A
5. B
6. B
7. A
8. A
9. C
10. B
TRACE KTU
11. B
12. D
13. B
14. B
15. B
16. A
17. D
18. A
19. C
20. D
21. D
22. D
23. B
24. C
25. B
26. B
27. D
28. A
29. A
30. B
31. B
32. Consider a system with five processes P0 through P4 and three resource types
R1, R2 and R3. Resource type R, has 10 instances, R2 has 5 instances and R3 has
7 instances. Suppose that at time T0, the following snapshot of the system has been
taken :
Allocation
R1 R2 R3
p0 0 1 0
p1 2 0 0
p2 3 0 2
p3 2 1 1
p4 0 2 2

Max
R1 R2 R3
7 5 3
3 2 2
9 0 2
2 2 2
4 3 3

Available
R1 R2 R3
3 3 2

(A) Ready”state
TRACE KTU
Assume that now the process P1 requests one additional instance of type R1 and
two instances of resource type R3. The state resulting after this allocation will be
(B) Safe state (C) Blocked state (D) Unsafe
state

33. Match the following


List -1 List – II
a. Contiguous allocation i. This scheme supports very large file sizes.
b. Linked allocation ii. This allocation technique supports only sequential files.
c. Indexed allocation iii. Number of disks required to access file is minimal.
d. Multi- level indexed iv. This technique suffers from maximum wastage of space
in storing pointers.
Codes:
abcd
(A) iii iv ii i
(B) iii ii iv i
(C) i ii iv iii
(D) i iv ii iii

34. Consider a disk queue with request for input/output to block on cylinders
98, 183, 37, 122, 14, 124, 65, 67
in that order. Assume that disk head is initially positioned at cylinder 53 and moving
towards cylinder number 0. The total number of head movements using Shortest
Seek Time First (SSTF) and SCAN algorithms are respectively
(A) 236 and 252 cylinders
(B) 640 and 236 cylinders
(C) 235 and 640 cylinders
(D) 235 and 252 cylinders

35. Linux operating system uses


(A) Affinity Scheduling
(B) Fair Preemptive Scheduling
(C) Hand Shaking
(D) Highest Penalty Ratio Next

36. Let the page fault service time be 10 millisecond(ms) in a computer with average
memory access time being 20 nanosecond(ns). If one page fault is generated for
every 106 memory accesses, what is the effective access time for memory ?
(A) 21 ns
(B) 23 ns
(C) 30 ns
(D) 35 ns
37. Q32. Given memory partitions of 100 K, 500 K, 200 K, 300 K and 600 K (in order)
and processes of 212 K, 417 K, 112 K, and 426 K (in order), using the first-fit
algorithm, in which partition would the process requiring 426 K be placed ?
(A) 500 K
(B) 200 K
(C) 300 K
(D) 600 K

TRACE KTU
38.Consider a logical address space of 8 pages of 1024 words mapped with memory
of 32 frames. How many bits are there in the physical address ?
(A) 9 bits (B) 11 bits (C) 13 bits (D) 15 bits
39. Q57. Match the following :
(a) Disk scheduling 1. Round-robin
(b) Batch processing 2. SCAN
(c) Time sharing 3. LIFO
(d) Interrupt processing 4. FIFO
Codes :
(a) (b) (c) (d)
(A) 3 4 2 1
(B) 4 3 2 1
(C) 2 4 1 3
(D) 1 4 3 2

40.In a paged memory management algorithm, the hit ratio is 70%. If it takes 30
nanoseconds to search Translation Look-aside Buffer (TLB) and 100 nanoseconds
(ns) to access memory, the effective memory access time is
(A) 91 ns (B) 69 ns (C) 200 ns (D) 160 ns
41. Two processes, P1 and P2, need to access a critical section of code. Consider the
following synchronization construct used by the processes.

Process P1 :
while(true)
{
w1 = true;
while(w2 == true);
Critical section
w1 = false;
}
Remainder Section

Process P2 :
while(true)
{
w2 = true;
while(w1 == true);
Critical section
w2 = false;
}
Remainder Section

Here, w1 and w2 have shared variables, which are initialized to false. Which one of the
following statements is TRUE about the above construct?
a) It does not ensure mutual exclusion
b) It does not ensure bounded waiting
c) It requires that processes enter the critical section in strict alternation
d) It does not prevent deadlocks but ensures mutual exclusion

Ans d

42. Consider a direct mapped cache of size 16 KB with block size 256 bytes. The size of

TRACE KTU
main memory is 128 KB. Find-
1. Number of bits in tag
2. Tag directory size

43. Consider a direct mapped cache with block size 4 KB. The size of main memory is
16 GB and there are 10 bits in the tag. Find-
1. Size of cache memory
2. Tag directory size

44. Consider the following four schedules due to three transactions (indicated by
the subscript) using read and write on a data item X, denoted by r(X) and w(X)
respectively. Which one of them is con ict serializable?
fl
S1 : r1(X); r2(X); w1(X); r3(X); w2(X)
S2 : r2(X); r1(X); w2(X); r3(X); w1(X)
S3 : r3(X); r2(X); r1(X); w2(X); w1(X)
S4 : r2(X); w2(X); r3(X); r1(X); w1(X)

a.S1

b.S2

c.S3
d.S4

Ans d

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

a.LOOK

b.SCAN

c. C-SCAN

d.C-LOOK

Ans c
46. A virtual memory based memory management algorithm partially swaps out a
process. This is an example of
(A) short term scheduling
(B) long term scheduling
(C) medium term scheduling

TRACE KTU
(D) mutual exclusion
47. Assuming that the disk head IS located initially at 32, find the number of disk
moves required with FCFS if the disk queue of I/O block requests are 98, 37, 14,
124,65,67 :
(A) 310
(B) 324
(C) 320
(D) 321
48. Let the page fault service time be 10 millisecond(ms) in a computer with average
memory access time being 20 nanosecond(ns). If one page fault is generated for
every 106 memory accesses, what is the effective access time for memory ?
(A) 21 ns
(B) 23 ns
(C) 30 ns
(D) 35 ns

49.Cached and interleaved memories are ways of speeding up memory access


between CPU’s and slower RAM. Which memory models are best suited (i.e.
improves the performance most) for which programs ?
(i) Cached memory is best suited for small loops.
(ii) Interleaved memory is best suited for small loops
(iii) Interleaved memory is best suited for large sequential code.
(iv) Cached memory is best suited for large sequential code.
(A) (i) and (ii) are true.
(B) (i) and (iii) are true.
(C) (iv) and (ii) are true.
(D) (iv) and (iii) are true.
50. Consider the following page trace:
4,3, 2, 1, 4, 3, 5, 4, 3, 2, 1, 5
Percentage of page fault that would occur if FIFO page replacement algorithm is
used with number of frames for the JOB m = 4 will be
(A) 8
(B) 9
(C) 10
(D) 12

TRACE KTU

You might also like