Sample Question - OS
Sample Question - OS
GROUP – A
Module 2
(i) Which of the following is not a condition that causes deadlock?
(a) Mutual Exclusion
(b) Pre-emption
(c) Hold and wait
(d) Circular wait
(ii) Banker's algorithm is used?
(a) To prevent deadlock
(b) To avoid deadlock
(c) To detect deadlock
(d) To recover deadlock
(iii) Where are placed the list of processes that are prepared to be executed and waiting?
(a) Job queue
(b) ready queue
(c) device queue
(d) suspended queue
(iv) Which among the following can’nt create a new process?
(a) fork
(b) excelp
(c) execve
(d) execp
(v) Which of the following are two types of atomic operations performed by semaphores?
(a) wait and post
(b) wait and signal
(c) signal and stop
(d) wait and stop
(vi) If fork is called n times successfully how many child process executed simultaneously?
(a) n
(b) 2n -1
(c) 2n
(d) n-1
(vii) FCFS scheduling suffers from
(a) Aging
(b) Convoy effect
(c) Starvation
(d) Deadlock
(viii) What type of scheduling is round-robin scheduling?
(a) Non pre-emptive
(b) Pre-emptive
(c) Pre-emptive FCFS
(d) Non linear data scheduling
Module 3
(i) If a page number is not found in the translation lookaside buffer, then it is known as a?
(a) Translation look aside buffer miss
(b) Translation look aside buffer hit
(c) Page hit
(d) Page miss
(ii) The term used for the mapping of logical addresses to physical addresses is:
(a) Address resolution
(b) Address translation
(c) Memory mapping
(d) Paging
(iii) Which of the following is an advantage of segmentation?
(a) Simplicity
(b) Efficient use of memory
(c) Ease of implementation
(d) Supports modular programming
(iv) What does a page fault indicate?
(a) The page is already in memory.
(b) The page needs to be fetched from disk.
(c) The memory is full.
(d) A logical address is invalid.
(v) In paging, the size of a page is typically measured in:
(a) Bytes
(b) Bits
(c) Kilobytes
(d) Megabytes
(vi) Which address is generated by the CPU?
(a) Physical address
(b) Logical address
(c) Virtual address
(d) Real address
(vii) Thrashing occurs when:
(a) The system is overloaded with processes.
(b) There are insufficient page frames in memory.
(c) The CPU spends more time swapping pages than executing processes.
(d) All of the above.
(viii) The process of loading pages into memory when they are needed is known as:
(a) Preloading
(b) Demand Paging
(c) Segmentation
(d) Paging
Module 4
(i) What is the full name of FAT?
(a) File attribute table
(b) File allocation table
(c) Format allocation table
(d) Font attribute table
(ii) What is the use of directory structure in the operating system?
(a) The directory structure is used to solve the problem of network connection in OS
(b) It is used to store the folders and files hierarchically
(c) It is used to store the program in file format
(d) All of these
(iii) Which buffer holds the output for a device?
(a) Spool
(b) Output
(c) Status
(d) Magnetic Tape
(iv) DMA stands for
(a) Digital Memory Access
(b) Dual Memory Access
(c) Direct Memory Access
(d) Duplex Memory Access
(v) Elevator algorithm is another name of
(a) SCAN
(b) SSTF
(c) FCFS
(d) LOOK
(vi) C-scan, C stands for
(a) Common
(b) Circular
(c) Control
(d) Commit
(vii) Seek time given by the equation
(a) Ts=mn+S
(b) Ts= m + nS
(c) Ts = m-nS
(d) Ts = m*S
(viii) ACL stands for
(a) Absolute Control List
(b) Access Control List
(c) Abrupt Control List
(d) None of the above
FILL IN THE GAPS
1. The OS running on virtual machine is sometimes called guest OS is known as ______________ .
2. _____________________ OS architecture is also known as client-server architecture.
3. Long term scheduling has direct relationship with degree of __________________________.
4. The base and limit registers are updated for every process in _____________________ mode.
5. An edge from process to resource is known as ____________________________ .
6. RAG is useful tool to represent a _______________________ in a system.
7. The operation that cannot be overlapped or interleaved with execution of any other operation are known
as ____________________.
8. If time quantum is too short RR scheduling suffers from ________________________.
9. The ________ is the address used by the CPU to access a particular memory location, while the ________ is the
actual location in physical memory.
10. In a segmentation system, a program is divided into segments of ________ length, such as functions or data
arrays.
11. The ________ page replacement algorithm replaces the least recently used page in memory.
12. When multiple processes are running simultaneously and continuously swapping pages in and out of
memory, the system experiences ________.
13. A path name that starts at root directory is __________________________________.
14. Searching on a single flat directory requires _______________________________ comparisons.
15. The time required to move the disk arm to the required track is known as _____________________.
16. In ________________ scheme of bus arbitration all devices are given unique static priority according to their
positions on Bus Grant line.
GROUP – B
5. (a) What is the Access Matrix? What are the 3 techniques to represent the Access Matrix? Describe
them in detail.
[(CO6)(Summarize/LOCQ)]
(b) What is Domain and Object?
[(CO6)(Summarize/LOCQ)]
8 + 4 = 12
6. (a) Compare and contrast the different types of Operating Systems
i. Client Server v/s Clustered
ii. Parallel Processing v/s Distributed
[(CO1)(Compare/LOCQ)]
(b) “In Real-Time Systems, deadlines may occasionally be missed.” Justify your answer.
[(CO1)(Summarize/LOCQ)]
8 + 4 = 12
9. (a) Write short notes on User Level Thread and Kernel Level thread.
[(CO1)(Remember/LOCQ)]
(b) How is Parallelism achieved using Threads? How much Speedup can be achieved for a 60%
serial, 40% parallel process by shifting from single to four cores.
[(CO1)(Apply/IOCQ)]
(c) Write name of functions to create a new process.
[(CO1)(Remember/LOCQ)]
4 + 6 + 2 = 12
GROUP – C
12. (a) What is a critical section. What are the requirements that need to be satisfied to solve the
critical section problem.
[(CO3)(Analyse/LOCQ)]
(b) Although Petersons solutions satisfies all the conditions for critical section problem but still it is
not followed to synchronize the processes. Why?
[(CO3) (Remember/HOCQ)]
(c) Explain Producer-Consumer problem and how it can be solved using both binary and counting
semaphore.
[(CO3)(Apply/IOCQ)]
4 + 2 + 6 = 12
13. (a) What is busy-waiting? How you can overcome this problem?
[(CO3)(Remember/HOCQ)]
(b) Explain all the possible methods which you can follow to recover from deadlock?
[(CO3)(Remember/LOCQ)]
(c) A system has 9 tape drives. The current allocation and maximum requirement of tape drives for
three processes are shown below:
14. (a) Consider the following resource-allocation policy. Requests for and releases of resources are
allowed at any time. If a request for resources cannot be satisfied because the resources are not
available, then we check any threads that are blocked waiting for resources. If a blocked thread
has the desired resources, then these resources are taken away from it and are given to the
requesting thread. The vector of resources for which the blocked thread is waiting is increased
to include the resources that were taken away.
For example, a system has three resource types, and the vector Available is initialized to (4,2,2).
If thread T0 asks for (2,2,1), it gets them. If T1 asks for (1,0,1), it gets them. Then, if T0 asks for
(0,0,1), it is blocked (resource not available). If T2 now asks for (2,0,0), it gets the available one
(1,0,0), as well as one that was allocated to T0 (since T0 is blocked). T0’s Allocation vector goes
down to (1,2,1), and its Need vector goes up to (1,0,1).
Can deadlock occur in this system? If you answer “yes,” give an example. If you answer “no,”
specify which necessary condition cannot occur.
Can indefinite blocking occur? Explain your answer.
[(CO3)(Decide/HOCQ)]
(b) Suppose that you have coded the Deadlock Avoidance safety algorithm that determines if a
system is in a safe state or not, and now have been asked to implement the Deadlock Detection
algorithm. Can you do so by simply using the safety algorithm code and redefining Max i =
Waitingi + Allocationi, where Waitingi is a vector specifying the resources for which thread i is
waiting and Allocationi is as discussed in the standard banker’s Algorithm? Explain your answer.
[(CO3)(Apply /IOCQ)]
7 + 5 = 12
15. (a) Explain how deadlock can be detected in a single instance RAG with an example.
[(CO3)(Analyse/LOCQ)]
(b) For preventing deadlocks we need to violate either one or all the four necessary conditions. Is it
practically possible to violate all the four conditions? If not then which one of them can be
violated and why?
[(CO3) (Remember/HOCQ)]
(c) What do you mean by a safe state and unsafe state? What is needed to avoid a deadlock and how
the deadlock can be avoided in single instance RAG.
[(CO3) (Remember/IOCQ)]
3 + 4 + 5 = 12
16. (a) Briefly describe the Dining Philosophers problem as a synchronization problem and solve it
with semaphore.
[(CO3)(Analyse/LOCQ)]
(b) State whether a deadlock situation will occur in Dining Philosophers problem and if yes then
how it can be solved using semaphore.
[(CO3)(Remember/HOCQ)]
(c) Consider a non-negative counting semaphore S as 10. The operation P(S) decrements S, and
V(S) increments S. During an execution, 20 P(S) operations and 12 V(S) operations are issued in
some order. What will be the final value of S.
[(CO2)(Apply/IOCQ)]
5 + 5 + 2 = 12
17. (a) Explain convoy effect with the help of a suitable example. Which algorithm suffers from this
problem?
[(CO2)(Analyse/IOCQ)]
(b) “SJF overcomes the convoy effect”. Is this statement is true. If not then explain it with an
example.
[(CO3)(Remember/HOCQ)]
(c) State the advantages of preemptive SJF over its non-preemptive version.
[(CO2)(Apply/LOCQ)]
5 + 4 + 3 = 12
18. (a) Consider three process, all arriving at time 0,1 and 3 with total execution time of 15, 8 and 10
units respectively. Each process spends the first 10% of execution time doing I/O, the next 50%
of time doing computation then 25% doing I/O again and finally remaining 15% doing
computations again. The operating system uses pre-emptive FCFS and schedules a new process
either when the running process gets blocked on I/O or when the running process finishes
execution. Find the no. of context switches that is taking place and also determine the CPU
utilization.
[(CO2)(Analyse/HOCQ)]
(b) Consider the set of 4 processes whose arrival time and burst time are given below:
19. (a) How deadlock can be prevented? “Cycle in a multi-instance resource allocation graph is a
necessary but not a sufficient condition for deadlock” State whether the statement is true or
false. If true then justify it with the help of a suitable example.
[(CO3)(Analyse/HOCQ)]
(b) Explain Multilevel Queue Scheduling Algorithm. How starvation problem in Multilevel Queue
Scheduling Algorithm can be removed.
[(CO2)(Remember/LOCQ)]
(c) Why we need to schedule the processes.
[(CO2)(Apply/IOCQ)]
(2+3)+ (3+2) + 2 = 12
20. (a) Consider three processes, all arriving at time zero, with total execution time of 10, 20 and 30
units respectively. Each process spends the first 20% of execution time doing I/O, the next 70%
of time doing computation, and the last 10% of time doing I/O again. The operating system uses
a shortest remaining compute time first scheduling algorithm and schedules a new process
either when the running process gets blocked on I/O or when the running process finishes its
compute burst. Assume that all I/O operations can be overlapped as much as possible. For what
percentage of does the CPU remain idle?
[(CO2)(Analyse/HOCQ)]
(b) Consider the table given below which contains information about different processes:
What is the content of the need matrix? Is the system is in safe state? Find the safety sequence.
[(CO3)(Remember/HOCQ)]
(b) If a request from process P1 arrives for instances <0,4,2,0>, then what is the new content of the
need matrix.? Is this state, a safe system state? Explain
[(CO2)(Remember/LOCQ)]
(3+2+3)+(4)=12
GROUP – D
24. (a) Suppose our process is allocated three (0 - 2) page frames in physical memory. The process
consists of nine (0 - 8) pages that are referenced. Below is the order in which pages are
referenced in program execution:
Complete the table given above using FIFO page replacement algorithm. Report the total
number of page faults. [Mark the page faults with an * (asterisk) in the table as shown]
[(CO4)(Analyse/HOCQ)]
(b) Find the size of the memory if its address consists of 22 bits. Assume the memory is 2-byte
addressable.
[(CO4)(Remember/LOCQ)]
(c) Consider a single level paging scheme. The virtual address space is 256 MB and page table entry
size is 4 bytes. What is the minimum page size possible such that the entire page table fits well
in one page?
[(CO4)(Apply/IOCQ)]
5 + 3 + 4 = 12
25. (a) Compare and contrast fixed partitioning and variable partitioning in contiguous memory
allocation.
[(CO4)(Analyse/HOCQ)]
(b) Compare the memory organization schemes of contiguous memory allocation, pure
segmentation and pure paging with respect to the following issues:
(i) External fragmentation
(ii) Internal fragmentation.
[(CO4)(Remember/LOCQ)]
(c) Calculate the number of bits required in the address for memory having size of 16 GB. Assume
the memory is 4-byte addressable.
[(CO4)(Apply/IOCQ)]
4 + 6 + 2 = 12
27. (a) Calculate the number of page faults for the following reference string using FIFO and optimal
scheduling algorithm with frame size as 3.
[(CO4)(Analyse/IOCQ)]
(b) What is the effective memory access time, given the TLB hit ratio to be 80 percent and it takes
100 nanoseconds to access memory also assume page table lookup takes one memory access?
[(CO4)(Remember/LOCQ)]
(c) Discuss strategies to prevent or mitigate thrashing in a computer system.
[(CO4)(Apply/IOCQ)]
6 + 3 + 3 = 12
28. (a) Consider a computer system with a 32-bit logical address and 4-KB page size. The system
supports up to 512 MB of physical memory. How many entries are there in a conventional,
single-level page table?
[(CO4)(Apply/IOCQ)]
(b) Under what circumstances do page faults occur? Describe the actions taken by the operating
system when a page fault occurs.
[(CO4)(Understand/LOCQ)]
(c) Consider the following page reference string: 1, 0, 2, 3, 1, 2, 5, 0, 1, 6, 7, 7, 1, 0, 5, 4, 6, 2
Assuming demand paging with three frames, how many page faults would occur for the
following replacement algorithms? (i) LRU replacement (ii) FIFO replacement (iii) Optimal
replacement.
[(CO4)(Apply/IOCQ)]
2 + 4 + 6 = 12
29. (a) Consider a system with physical address 256MB, Logical address space 4GB, frame size is 4KB
and each page table entry is 2B and there is a 4-entry TLB. TLB access time is 10ns and
memory access time is 100 ns, TLB hit ratio is 0.4
(i) How many level of paging scheme is required?
(ii) How many bits are required for page offset?
(iii) How much memory in bytes is required for outer and inner page table?
(iv) What is the average memory access time?
[(CO4)(Understand/HOCQ)]
(b) Consider the following logical address for page size 1KB. 1025, 2099, 4057, 4090, 2049,
2020, 5150, 7100, 3000, 1029, 3050, 4001, 7190, 7100, 3098, 2065, 1000, 1029, 3061,
3066, 6279. Generate reference string for memory reference. How many page fault occurs for
the following replacement algorithm assuming number of frames=4. LRU and Optimal.
[(CO4)(Understand/IOCQ)]
(c) What is Belady’s Anomaly?
[(CO4)(Understand/LOCQ)]
6 + (1+2+2) + 1 = 12
30. (a) Consider the following sequence of memory references generated by a single program in a pure
paging system:
10, 11, 104, 104, 170, 173, 177, 309, 245, 246, 247, 458, 364.
Determine the number of page faults for each of the following page replacement policies
assuming 3(three) page frames are available and all are initially empty.
The size of a page is 100 words:
i) LRU
ii) FIFO
iii) Optimal Page Replacement.
[(CO4)(Analyse/HOCQ)]
(b) Is Segmentation possible without paging? Justify your answer.?
[(CO4)(Remember/LOCQ)]
(3+3+3) + 3 = 12
31. (a) Explain what is Indexed Allocation of file space on disk.? What are the advantages and
disadvantages of contiguous allocation?
[(CO4)(Analyse/HOCQ)]
(b) Write down the merits and demerits of a Virtual Memory System.
[(CO4)(Remember/LOCQ)]
(c) What is Thrashing?
[(CO4)(Apply/IOCQ)]
(2+4) + 4 + 2 = 12
GROUP – E
32. (a) What are the different parameters to calculate disc performance? Describe seek time, latency
time.
[(CO5)(Analyse/IOCQ)]
(b) Write the formula of data transfer time and average access time for disc performance.
[(CO5)(Remember/LOCQ)]
(c) Why is rotational latency usually not considered in disk scheduling?
[(CO5)(Analyse/HOCQ)]
6+3+3 = 12
33. (a) What is the average access time for transferring 512 bytes of data with the following
specifications-
Average seek time = 5 msec
Disk rotation = 6000 RPM
Data rate = 40 KB/sec
Controller overhead = 0.1 msec
[(CO5)(Apply/HOCQ)]
(b) Write short note on Disc structure with diagram
[(CO5)(Remember/LOCQ)]
(c) What is boot block?.
[(CO5)(Apply/IOCQ)]
5 +4 + 3 = 12
35. (a) Consider a disk queue with requests for I/O to blocks on cylinders 98, 183, 41, 122, 14, 124, 65,
67. The LOOK and C-LOOK scheduling algorithm is used. The head is initially at cylinder number
53 moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered
from 0 to 199. What is the total head movement (in number of cylinders) incurred while
servicing these requests?
[(CO5)(Analyse/IOCQ)]
(b) Describe different file attributes from user point of view.
[(CO5)(Remember/LOCQ)]
(c) What are the functions of file management system?
[(CO5)(Remember/LOCQ)]
(3+3) +3 +3 = 12
36. (a) Describe direct access method of file with diagram. Write advantages and disadvantages of this
technique.
[(CO5)(Analyse/IOCQ)]
(b) Describe indexed sequential access method of file with diagram. Write advantages and
disadvantages of this technique.
[(CO5)(Remember/LOCQ)]
6 + 6 = 12
37. (a) What do you mean by sequential File access technique? Write advantages and disadvantages of
this technique.
[(CO5)(Analyse/LOCQ)]
(b) What are the different types of file?
[(CO5)(Remember/LOCQ)]
(c) What are the different directory structures? Explain two level directory structure with diagram.
[(CO5)(Remember/LOCQ)]
6 + 3 + 3 = 12
38. (a) Draw and explain the Programmed driven and Interrupt driven I/O for data transfer?
[(CO5)(Analyse/IOCQ)]
(b) What are the different roles of the Kernel I/O subsystem? Define each of them.
[(CO5)(Remember/LOCQ)]
(3+3) + 6 = 12
40. (a) Draw and explain DMA architecture. Write pros and cons of DMA data transfer technique.
[(CO5)(Analyse/HOCQ)]
(b) Define buffering? How does it save I/O cycle?
[(CO5)(Remember/LOCQ)]
(c) Define spooling. How is it different from buffering?
[(CO5)(Apply/LOCQ)]
6 +3 + 3=12