Operating system test questions for interview, exams, entrance

Operating system test questions for interview, exams, entrance


(1) The use of __________ works on the principle of locality.

(A) Cache memory
(B) Interrupts
(C) Polling
(D) DMA

View Answer / Hide Answer

ANSWER: Cache memory




(2) Consider a computer system with 6 tape drives and n processes completing for them. What is the maximum value of n for the system to be deadlock free assuming each processes may need 3 tape drives?

(A) 3
(B) 2
(C) 4
(D) 7

View Answer / Hide Answer

ANSWER: 2




(3) When size of the memory is increased the page replacement policy that sometimes leads to more page faults is

(A) FIFO
(B) Optimal
(C) LRU
(D) None of the above

View Answer / Hide Answer

ANSWER: FIFO




(4) A program is executing in a pure demand paging system with 100 records per page with 1 free main memory frame. The address sequence that is generated by tracing this program is recorded as follows.

0100, 0200, 0430, 0499, 0510, 0530, 0560, 0120, 0220, 0240, 0260, 0320, 0370.

The number of page faults is

(A) 8
(B) 11
(C) 7
(D) 12

View Answer / Hide Answer

ANSWER: 7




(5) The capacity of a memory unit = The number of words x The number of bits/words. For the memory of 4k x 16 the number of separate address and data lines needed is

(A) 12 address and 16 data lines
(B) 12 address and 12 data lines
(C) 11 address and 6 data lines
(D) 12 address and 8 data lines

View Answer / Hide Answer

ANSWER: 12 address and 16 data lines




(6) A system has m number of resources of same type and 3 processes A, B and C. share these resources. A, B and C have the peak demand of 3, 4 and 6 respectively. Deadlock will not occur if

(A) m = 15
(B) m = 8
(C) m = 13
(D) m = 9

View Answer / Hide Answer

ANSWER: m = 13




(7) In the table shown below P1, P2 and P3 are the three processes



What is the completion order of the 3 processes under the policies FCFS and Round robin (RR2) scheduling with CPU quantum time of 2 units?

(A) FCFS: P1, P2, P3 RR2: P1, P3, P2
(B) FCFS: P1, P3, P2 RR2: P1, P2, P3
(C) FCFS: P1, P3, P2 RR2: P1, P3, P2
(D) FCFS: P1, P2, P3 RR2: P1, P2, P3

View Answer / Hide Answer

ANSWER: FCFS: P1, P2, P3 RR2: P1, P3, P2




(8) When the result of computation depends on the speed of the processes involved there is said to be

(A) A deadlock
(B) A time lock
(C) Cycle stealing
(D) Race condition

View Answer / Hide Answer

ANSWER: Race condition




(9) Consider a counting semaphore which was initialized to 10 and then 6P (wait) operation and 4v (signal) operations were completed on this semaphore. What is the resulting value of semaphore?

(A) 10
(B) 9
(C) 8
(D) 0

View Answer / Hide Answer

ANSWER: 8




(10) Software interrupt is required by the processor to

(A) Return from subroutine
(B) Obtain system services, which need execution of privileged instruction
(C) Test the interrupt system of the processor
(D) Implement co-routines

View Answer / Hide Answer

ANSWER: Obtain system services, which need execution of privileged instruction




(11) How many child processes are created if a process executes the code

fork();
fork();
fork();

(A) 5
(B) 8
(C) 7
(D) 9

View Answer / Hide Answer

ANSWER: 7




(12) If hardware does not support _________ a multi-user, multi-processing operating system cannot be implemented.

(A) At least two modes of CPU execution
(B) Demand paging
(C) DMA for disk transfer
(D) Address translation

View Answer / Hide Answer

ANSWER: Demand paging




(13) On a single processor four jobs are to be executed. At time t = 0+ jobs arrive in the order of A, B, C, D. The burst CPU time requirements are 4, 1, 8, 1 time units respectively.

Under round robin scheduling with time slice of 1 time unit the completion time of A is


(A) 3
(B) 5
(C) 7
(D) 9

View Answer / Hide Answer

ANSWER: 9




(14) Usually _____________ invokes the system calls

(A) A privileged instruction
(B) An indirect jump
(C) A software interrupt
(D) Polling

View Answer / Hide Answer

ANSWER: A software interrupt




(15) Consider a Unix-style I-node that has 10 direct pointers, 1 single, 1 double and 1 triple indirect pointers. What is the maximum possible file size if disk block size of 1kbyte, disk block address of 32 bit and 48 bit integers are used?

(A) 234 byte
(B) 232 byte
(C) 264 byte
(D) 224 byte

View Answer / Hide Answer

ANSWER: 234 byte




(16) The spooled device is

(A) A graphic display device
(B) A line printer used to print the output of a number of jobs
(C) A terminal used to enter input data to a running program
(D) A secondary storage device in a virtual memory system

View Answer / Hide Answer

ANSWER: A line printer used to print the output of a number of jobs




(17) For time-shared operating systems the most suitable scheduling policy is

(A) Shortest job first
(B) Elevator
(C) First come first served
(D) Round robin

View Answer / Hide Answer

ANSWER: Round robin




(18) We have a system with a two level paging scheme whose description is given below:

Regular memory access time = 150ns,
Page fault servicing time = 8ms,
TLB hit ratio = 90%,
Page fault rate is one in every 10,000 instructions.
An average instruction takes 100ns of CPU time and two memory accesses.

The effective average instruction execution time is

(A) 700ns
(B) 1500ns
(C) 1230ns
(D) 1000ns

View Answer / Hide Answer

ANSWER: 1230ns




(19) The compute time burst of three processes with process id 0, 1, 2 is 2, 4 and 8 time units. All processes arrive at time 0 and the Longest Remaining Time First (LRTF) scheduling algorithm is used. In LRTF giving priority to the process with the lowest process id breaks ties. What is the average turn around time?

(A) 13unit
(B) 17unit
(C) 21unit
(D) 19unit

View Answer / Hide Answer

ANSWER: 13unit




(20) if (fork()==0)
{
a = a + 5, printf(“%d, %d\n”, a, &a),
}
else
{
a = a – 5, printf(“%d, %d\n”, a, &a),
}

The values printed by the parent process is denoted by u and v and the values printed by the child process is denoted by x and y. The statement that holds true is

(A) u +10 = x and v = y
(B) u +10 = x and v ≠ y
(C) u = x + 10 and v ≠ y
(D) u = x + 10 and v = y

View Answer / Hide Answer

ANSWER: u = x + 10 and v = y




(21) Consider a uniprocessor computer system that has 2 processes and both of them alternate 10ms CPU bursts with 90ms IN/OUT bursts. Both the processes were created at nearly the same time and the IN/OUT of both the processes can proceed in parallel. For this system the scheduling strategies that will result in the least CPU utilization (over a long period of time) is

(A) Round robin scheduling with a time quantum of 5ms
(B) First come first served scheduling
(C) Shortest remaining time first
(D) Static priority scheduling with different priorities for the two processes

View Answer / Hide Answer

ANSWER: First come first served scheduling




(22) The average time to service a page fault is 10ms and the time taken to access the memory is 1µs. A 99.99% hit ratio results in average memory access time of

(A) 1.9999μs
(B) 1.9999ms
(C) 1ms
(D) 9.99μs

View Answer / Hide Answer

ANSWER: 1.9999μs




(23) From the statement given below the one, which is not valid for deadlock prevention scheme, is

(A) Number the resources uniquely and never request a lower numbered resource than the last one requested
(B) Request and all required resources be allocated before execution
(C) Release all resources before requesting a new resource
(D) Never request a resource after releasing any resource

View Answer / Hide Answer

ANSWER: Never request a resource after releasing any resource




(24) In C, a two-dimensional array declaration is given below:
char c [100][100];


What will be the address of c[40][50] if it is assumed that the main memory is byte addressable and that the array is stored starting from memory address 0?

(A) 5050
(B) 5040
(C) 4050
(D) 4040

View Answer / Hide Answer

ANSWER: 4050




(25) A machine has a physical memory of 64Mbyte and virtual address space of 32-bit. The page size is 4kbyte and the page table size is approximately

(A) 24Mbyte
(B) 16Mbyte
(C) 2Mbyte
(D) 8Mbyte

View Answer / Hide Answer

ANSWER: 8Mbyte




For questions 26 and 27 refer to the data given below:

We have a process that has been allocated 3 page frames and initially none of the pages of the process are available in the memory. The following sequence of page references (reference

string) is made by the process

1, 2, 1, 3, 7, 4, 5, 6, 3, 1

(26) The number of page faults that will occur for the above reference string if optimal page replacement policy is used is

(A) 7
(B) 8
(C) 9
(D) 6

View Answer / Hide Answer

ANSWER: 7




(27) How many more number of page faults occur for the above reference string with Least recently used page replacement policy than with the optimal page replacement policy?

(A) 3
(B) 2
(C) 1
(D) 0

View Answer / Hide Answer

ANSWER: 2




(28) Consider a processor, which uses 36-bit physical address and 32-bit virtual address with 4kbyte page frame. Size of each page table entry is 4 byte. For virtual to physical address translation a three level page table has been used. The virtual address is used as follows:

Bit 30-31 are used to index into the first level page table
Bit 21-29 are used to index into the second level page table
Bit 12-20 are used to index into the third level page table
Bit 0-11 are used as offset within the page

In the page table entry of the first, second and third level page table the number of bits required for addressing the next level page table (or page frame) respectively are

(A) 20, 24 and 25
(B) 25, 25 and 20
(C) 24, 24 and 24
(D) 20, 20 and 20

View Answer / Hide Answer

ANSWER: 24, 24 and 24




(29) A computer system supports virtual address and physical address each of 32 bits. The operating system designer decides to get rid of the virtual memory entirely as the virtual address space is the same as that of physical address space. Which one of the following statement holds true?

(A) For memory management hardware support is no longer needed
(B) CPU scheduling can be made more efficient now.
(C) The processor cache organization can be made more efficient now
(D) Efficient implementation of multi-user support is no longer possible

View Answer / Hide Answer

ANSWER: For memory management hardware support is no longer needed




(30) We have three processes P0, P1 and P2 whose arrival time and burst time are given below:



The average waiting for the three processes, if the pre-emptive shortest job first scheduling algorithm is carried out only at arrival or completion of processes, is

(A) 7.33ms
(B) 6.33ms
(C) 5.33ms
(D) 4.33ms

View Answer / Hide Answer

ANSWER: 4.33ms




(31) For the deadlock prevention and deadlock avoidance schemes the statement that does not hold true is

(A) Deadlock avoidance is less restrictive than deadlock prevention
(B) In deadlock prevention, the request for resources is always granted, if the resulting state is safe
(C) It is the priority to have the knowledge of resource requirements for deadlock avoidance
(D) In deadlock avoidance, the request for resources is always granted, if the resulting state is safe

View Answer / Hide Answer

ANSWER: In deadlock prevention, the request for resources is always granted, if the resulting state is safe




(32) We have a CPU that generates virtual addresses of 32 bits and the page size is of 4kbyte. Transition look aside buffer (TLB) of the processor can hold a total of 128 page table entries and is 4-way set associative. What is the minimum size of the TLB tag?

(A) 16 bit
(B) 20 bit
(C) 11 bit
(D) 15 bit

View Answer / Hide Answer

ANSWER: 11 bit




(33) Consider a virtual memory system that uses First In First Out (FIFO) page replacement policy and allocates a fixed number of frames to a process.

a: Sometimes the page fault rate is increased if the number of page frames allocated is increased

b: Some programs do not exhibit Locality of reference

(A) a is false and b is true
(B) Both a and b are false
(C) Both a and b are true but b is not the reason for a
(D) Both a and b are true and b is the reason for a

View Answer / Hide Answer

ANSWER: Both a and b are true but b is not the reason for a




(34) The code given below is executed by a process:

for (j=0; j
How many child processes are created?

(A) 2n - 1
(B) 2n
(C) 2n+1 - 1
(D) 2n+1

View Answer / Hide Answer

ANSWER: 2n - 1




(35) For translating virtual address to physical address a multilevel page table is preferred in comparison to a single level page table because

(A) It is required by the translation look-aside buffer
(B) It helps to reduce the memory access time to read or write a memory location
(C) It helps to reduce the number of page faults in page replacement algorithm
(D) It helps to reduce the size of page table needed to implement the virtual address space of a process

View Answer / Hide Answer

ANSWER: It helps to reduce the size of page table needed to implement the virtual address space of a process




(36) Consider a system that has n number of resources R0, ……, R(n-1) and k number of processes P0, ……P(k-1). The code given below is for the implementation of the resources request logic

of each process:

if (j%2 ==0)
{
if (j request Rj;
if (j +2 < n)
request R(j+2);
}
else
{
if (j request R(n-j);
if (j+2 request R(n-j-2);
}

Deadlock is possible is the situation in which

(A) n = 12, k = 41
(B) n = 40, k = 26
(C) n = 21, k = 12
(D) n = 41, k = 14

View Answer / Hide Answer

ANSWER: n = 21, k = 12




(37) An application loads 100 libraries at startup and to load each library exactly one disk access is required. 10ms is the seek time of the disk to a random location and 6000rpm is the rotational speed of the disk. Neglect the time to transfer data from the disk block once the head has been positioned at the start of the block. The time taken by the application to load all the libraries if all 100 libraries are loaded from random location on the disk is

(A) 1.50s
(B) 1.00s
(C) 1.87s
(D) 0.74s

View Answer / Hide Answer

ANSWER: 1.50s




(38) We have a FIFO page replacement policy for a virtual memory system. Increase the number of page frames in the main memory for an arbitrary page access pattern. This will

(A) Sometimes increase the number of page faults
(B) Always increase the number of page faults
(C) Always decrease the number of page faults
(D) Never affect the number of page faults

View Answer / Hide Answer

ANSWER: Sometimes increase the number of page faults




(39) The program given below consists of three concurrent processes P0, P1, P2 and three binary semaphores with the values S0 = 1, S1 = 0, S2 = 0.



The process P0 will print print ‘0’

(A) Atleast thrice
(B) Exactly thrice
(C) Atleast twice
(D) Exactly twice

View Answer / Hide Answer

ANSWER: Atleast twice




(40) In a virtual memory environment the minimum number of page frames that must be allocated to a running process is determined by

(A) The number of processes in the memory
(B) The instruction set architecture
(C) The page size
(D) The physical memory size

View Answer / Hide Answer

ANSWER: The instruction set architecture




(41) A disk system has 100 cylinders and the request to access the cylinders occur in the sequence given below:

4, 34, 10, 7, 19, 73, 2, 15, 6, 20

The head is currently at cylinder 50. It takes 1ms to move from one cylinder to adjacent one. If shortest seek time first policy is used then the time taken to satisfy all the requests is

(A) 150ms
(B) 210ms
(C) 276ms
(D) 119ms


View Answer / Hide Answer

ANSWER: 119ms




(42) We have an operating system, which is capable of loading and executing a single sequential user process at a time. If the disk head scheduling algorithm which is initially First come first served (FCFS) is replaced by shortest seek time first (SSTF) claimed by the vendor to give 50% better benchmark results then what is expected improvement in the IN/OUT performance of

user programs?


(A) 0%
(B) 25%
(C) 50%
(D) 75%

View Answer / Hide Answer

ANSWER: 0%




(43) What is the effect of using a larger block size in a fixed block size file system?

(A) It leads to poorer disk throughput and poorer disk space utilization
(B) It leads to poorer disk throughput but better disk space utilization
(C) It leads to better disk throughput and better disk space utilization
(D) It leads to better disk throughput and poorer disk space utilization

View Answer / Hide Answer

ANSWER: It leads to poorer disk throughput and poorer disk space utilization




(44) With respect to user-level threads and kernel-supported threads consider the following statements given below:

a. With the use of kernel supported threads context switch is faster.
b. The entire process can be blocked by the system for user-level threads.
c. Kernel supported threads can be scheduled independently
d. User level threads are transparent to the kernel

Which of the above statements are true?

(A) a and d
(B) a and b
(C) b and c
(D) a and c

View Answer / Hide Answer

ANSWER: b and c




(45) Consider a system with 32 bit virtual addresses and 1kbyte page size. It is not possible to use one-level page tables for virtual to physical address translation because of

(A) The amount of external fragmentation
(B) The amount of internal fragmentation
(C) The large computation overhead in the translation process
(D) The large memory overhead in maintaining page tables

View Answer / Hide Answer

ANSWER: The large memory overhead in maintaining page tables




(46) We have a uniprocessor machine where a set of n tasks with known runtimes r1, r2, r3, …. rn are to be run. The processor scheduling algorithm that will result in the maximum throughput is

(A) Shortest job first
(B) First come first served
(C) Round Robin
(D) Highest response ratio next

View Answer / Hide Answer

ANSWER: Shortest job first




(47) Three CPU intensive processes requires 10, 20 and 30 time units and arrive at times 0, 2 and 6 respectively. The operating system implements a shortest remaining time first scheduling algorithm. Considering that the context switches at time zero and at the end are not counted the number of context switches needed is

(A) 4
(B) 3
(C) 2
(D) 1

View Answer / Hide Answer

ANSWER: 2




(48) The scheduling algorithm, which is non-pre-emptive, is

(A) Multilevel queue scheduling with feedback
(B) Multilevel queue scheduling
(C) First-in-first-out
(D) Round Robin

View Answer / Hide Answer

ANSWER: First-in-first-out




(49) The swap space reside in the ___________

(A) Disk
(B) ROM
(C) RAM
(D) On-chip cache

View Answer / Hide Answer

ANSWER: Disk




(50) A system that uses FIFO page replacement policy has 4 page frames with no pages loaded initially. 100 distinct pages are accessed by the system in some order and then the same 100 pages are accessed in the reverse order. The number of page faults that may occur is

(A) 193
(B) 194
(C) 195
(D) 196

View Answer / Hide Answer

ANSWER: 196




(51) Which one of the following is the essential content in each entry of a page table?

(A) Page frame number
(B) Virtual page number
(C) Access right information
(D) Both page frame number and virtual page number

View Answer / Hide Answer

ANSWER: Page frame number




(52) Match the following:


List I List II

a. Gang scheduling p. Guaranteed scheduling
b. Rate monotonic scheduling q. Real-time scheduling
c. Fair share scheduling r. Thread scheduling

(A) a – p, b – r, c - q
(B) a – r, b – q, c - p
(C) a – p, b – q, c - r
(D) a – q, b – r, c - p

View Answer / Hide Answer

ANSWER: a – r, b – q, c - p




(53) Which page is selected by the optimal page replacement algorithm?

(A) The page that has been used for maximum
(B) The page that has been used minimum
(C) The page that has not been used for the longest time in the past
(D) The page that will not be used for the longest time in the future

View Answer / Hide Answer

ANSWER: The page that will not be used for the longest time in the future




(54) In the Unix file system the data blocks of a very large file are allocated using

(A) Indexed allocation
(B) Contiguous allocation
(C) An extension of indexed allocation
(D) Linked allocation

View Answer / Hide Answer

ANSWER: An extension of indexed allocation




(55) Let P1 and P2 be the two processes and S1 and S2 be the two shared Boolean variables. The initial values of S1 and S2 are randomly assigned. For accessing the critical sections of P1 and P2 the methods used by them are given below:

Method used by P1
While (S1==S2);
Critical section
S1=S2;

Method used by P2
While (S1! =S2)
Critical section
S2=not (S1);

The statement that describes the properties achieved is

(A) Progress but not mutual exclusion
(B) Mutual exclusion but not progress
(C) Both mutual exclusion and progress
(D) Neither mutual exclusion nor progress

View Answer / Hide Answer

ANSWER: Mutual exclusion but not progress




(56) Belady’s anomaly may occur in

(A) LRU page replacement policy
(B) MRU page replacement policy
(C) Optimal page replacement policy
(D) FIFO page replacement policy

View Answer / Hide Answer

ANSWER: FIFO page replacement policy




(57) An operating system maintains smaller data structures for a thread than for a process, as a thread is usually defined as a ‘light weight process’. On per thread basis the operating system,

(A) Does not maintain a separate stack
(B) Maintains only CPU register state.
(C) Does not maintain a virtual memory state
(D) Maintains only scheduling and accounting information

View Answer / Hide Answer

ANSWER: Maintains only CPU register state




(58) Which of the following statements are true?

(A) Shortest remaining time first scheduling may cause starvation
(B) Starvation may be caused by pre-emptive scheduling.
(C) In terms of response time robin round is better than FCFS
(D) All of the above statements are true

View Answer / Hide Answer

ANSWER: All of the above statements are true




(59) The system call, which is responsible for sending of SYN packets, is

(A) Bind
(B) Socket
(C) Connect
(D) Listen

View Answer / Hide Answer

ANSWER: Connect




(60) If t1 is the time taken to switch between user and kernel modes of execution and t2 is the time to switch between two processes then the relation between t1 and t2 is

(A) t1< t2
(B) t1 > t2
(C) t1 = t2
(D) No relation exists between t1 and t2

View Answer / Hide Answer

ANSWER: t1< t2




(61) Which one of the following statement is true for the dirty page in a page table?

(A) Helps maintain LRU information
(B) Allows only read on a page
(C) Helps avoid unnecessary writes on paging device
(D) None of the above

View Answer / Hide Answer

ANSWER: Helps avoid unnecessary writes on paging device




(62) To get the best throughput the disk scheduling strategy that comes into picture is

(A) First come first served
(B) Elevator algorithm
(C) Farthest cylinder next
(D) Nearest cylinder next

View Answer / Hide Answer

ANSWER: Nearest cylinder next




(63) The device that should get the highest priority in assigning interrupts is

(A) Floppy disk
(B) Hard disk
(C) Printer
(D) Keyboard

View Answer / Hide Answer

ANSWER: Hard disk




(64) In a resident-OS computer ___________ must reside in the main memory under all situation

(A) Linker
(B) Loader
(C) Assembler
(D) Compiler

View Answer / Hide Answer

ANSWER: Loader




(65) Match the following


a. DMA I/O 1. High speed RAM
b. Cache 2. Disk
c. Interrupt I/O 3. Printer
d. Condition code register 4. ALU

(A) a – 2, b – 1, c – 3, d - 4
(B) a – 4, b – 1, c – 3, d - 2
(C) a – 2, b – 3, c – 1, d - 4
(D) a – 3, b – 4, c – 2, d - 1

View Answer / Hide Answer

ANSWER: a – 2, b – 1, c – 3, d - 4




(66) What is the use of thrashing?

(A) It improves system performance
(B) It implies excessive page I/O
(C) It decreases the degree of multiprogramming
(D) It reduces page I/O

View Answer / Hide Answer

ANSWER: It decreases the degree of multiprogramming




(67) When we format a floppy disk

(A) Identification information is written on all tracks and sectors
(B) The system area is deleted
(C) Data is written
(D) Data is arranged on the disk in contiguous fashion

View Answer / Hide Answer

ANSWER: Data is arranged on the disk in contiguous fashion




(68) What should be the size of ROM if it is used to store the table for multiplication of two 8-bit unsigned integers?

(A) 64k x 8
(B) 64k x 16
(C) 4k x 8
(D) 64k x 16

View Answer / Hide Answer

ANSWER: 64k x 8




(69) What will a simple two pass assembler do in the first pass?

(A) It will allocate space for the literals
(B) It will generate the code for all the load and store register instruction
(C) It will build the symbol table for the symbols and their values
(D) It will compute the total length of the program

View Answer / Hide Answer

ANSWER: It will allocate space for the literals




(70) Where is the root directory of a disk should be placed?

(A) Anywhere on the disk
(B) At a fixed location on the system disk
(C) At a fixed address in main memory
(D) None of the above

View Answer / Hide Answer

ANSWER: At a fixed location on the system disk


Post your comment

You may like