Friday, April 23, 2021

OS Unit II & part of Unit 3 - II periodic test

 OS II Periodic Test - Unit II from Thread except Process scheduling Unit III up to Page replacement algorithms. As per your request the OS test will be on Sunday 25/4/2021.  workout more problems.

Unit II Slides - click the link below

https://drive.google.com/file/d/1gGc16HEnNu-OakisvtNO125yXS8qNBhl/view?usp=sharing

Unit III Slides - click the link below

https://drive.google.com/file/d/1yEw-AJYTgaO6G6GjdGAisIsNgMQyKSaj/view?usp=sharing

Wednesday, April 14, 2021

I Periodic Test QP (Operating Systems) with Answers

 1.In a time-sharing operating system, when the time slot given to a process is completed, the process goes from the RUNNING state to 

A READY state

B BLOCKED state

C TERMINATED state

D SUSPENDED state (A)


2 In Pre-emptive scheduling, the strategy of temporarily suspending a running process

A when it requests (I/O)

B to allow starving processes to run

C before the CPU time slice expires

D when interrupt occurs (C)


3.  In RR scheduling, as the time quantum is increased, the average turn around

A remains constant

B varies irregularly

C increases

D decreases (B)


4.Kernel is

A the software which monitors the operating system

B the set of primitive functions upon which the rest of operating system functions are built up

C considered as the critical part of the operating system

D designed to protect memory from user process   (B)


5. Mode bit is added to _______ of the computer to indicate the current mode: user mode or supervised mode.

a. hardware

b. software

c. firmware

d. operating system (a)


6. Which of the following is not a system utility

a. File modification

b. Communication

c. background services

d. interrupt service routine (d)


7. Which interface is used to access the services of OS?

a. Application Program Interface

b. System Library

c. System Utility

d. Assembly instructions (c)


8. The technique that was introduced because a single job could not keep both the CPU and the I/O devices busy is

a.Time-sharing

b.Spooling 

c.Preemptive scheduling

d.Multiprogramming  (d)


9. The foremost job of OS is

a. Command Resources

b. Manage Resources

c. Provide Utilities

d. provide user friendly environment (b)


10. The purpose of placing kernal of OS in main memory because

a. it is mostly called

b. it manages all interrupt calls

c. it controls all operations in process

d. it is high level Process (a)


11. Multi-programming systems ________. 

a. are easier to develop

b. execute each job faster

c. execute more jobs in the same time

d. are used only on large scale main frame systems

(c)


12. What is the first step in performing an operating system upgrade ? 

a. partition the drive

b. format the drive

c. backup critical data

d. back up old operating system version

(c)


13. A critical region is 

a. a piece of code which only one process executes at a time

b. a region prone to deadlock

c. a piece of code which only a finite number of processes execute

d. found only in advanced OS

(a)


14. ________ is the software that deals with the running of the actual computer & not with programming issues.

a. Operating system

b. System Program

c. Object program

d. Source program (b)


15. 3 processes arriving at time 0,1 & 2 ms and have execution time 30,20 & 10 ms  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 SRTF 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?

a. 14.22

b. 14.24

c. 14.26

d. 14.28 (d)


16. 4 processes - all arrives at time 0 are in RR scheduling. The burst time of first process is 1 ms and it increases in addition of 3 ms than the previous process for other processes. If the time quantum is 2 ms, what is the percentage of waiting time  for 4th process in the total waiting time.

a) 61.9

b) 63.6

c) 66.7

d) 68.2 (b)


17. 4 process arriving at 0,1,2 & 6 ms having burst time of 6,3,1 & 3 ms are in Preemptive version of SJF scheduling. What percentage  turnaround time of the first process is more than second process? 

a. 260

b. 325

c. 217

d. 310 (b)


18.Well known port no is

a) 1025

b) 1625

c) 1013

d) 1513 (c)


19. Socket involves

a) IP address & port No.

b) IP address & Client No.

c) IP address & machine No.

d) IP address & Server No. (a)


20.Direct communication in message passing system involves ______ establised between pair of processes

a) exactly one link that automatically 

b) exactly one link that manually e

c) atleast one link that automatically 

d) atlest one link that manually (a)


21. which of the following requirs device driver?

a) DMA

b) Cache

c) Main memory

d) Disk (d)


22. A Program in execution is called

a) code

b) job

c) process

d) segment (c)


23. 4 process with arrival time 0,1,3 & 5 unit has the burst time 4,3,2 & 1 ms are in SJF scheduling. The average waiting time is 

a) 2

b) 1

c) 3

d) None of the above (a)


25. When we have a rendezvous between sender and receiver

a) Send() is blocking

b) receiver() is blocking

c) both sender() & receiver() is blocking

d)both sender() & receiver() is non-blocking (c) 


26. mailbox() is associated with 

a) shared memory systems

b) direct communication

c) indirect communication

d) synchronized communication (b)


27. Parameter marshalling is converting the parameters into the form that can be

a) transmitted over a network

b) accepted by the server program

c) accepted by the subroutine

d) all the above


28. Swapping is done in

a) Short term scheduler

b) Long term scheduler

c) medium term scheduler

d) CPU scheduler


29.Which of the following is not in PCB?

a. Program Counter

b. memory limits

c. list of open files

d. computation information


30. Cascading termination occurs when

a. child terminates followed by parent terminates

b. parent terminates followed by child terminates

c. child termination makes parent to terminate

d. parent termination makes child to terminate (d)


31.Which one of the following is not shared by threads?

a) program counter

b) stack

c) both program counter and stack

d) none of the above (c)


32.When the event for which a thread is blocked occurs?

a) thread moves to the ready queue

b) thread remains blocked

c) thread completes

d) a new thread is provided (a)


33.  Termination of the process terminates ___________

a) first thread of the process

b) first two threads of the process

c) all threads within the process

d) no thread within the process (c)


34. One thread immediately terminates the target thread is

a. synchronous cancellation

b. asynchronous cancellation

c. deffered cancellation

d. immediate cancellation (b)


35. Two level model is a type of 

a. many to one model

b. one to one model

c. many to many model

d. user - kernel model (c)


36. Which one of the following is false in case of zero capacity buffer?

a. Queue's maximum length is 0

b. Queue length is 0

c. message system with no buffer

d. message system with very limited buffer (d)


37. Which one of the following is true in case of ordinary pipes?

a. can be accessed from outside the process created it

b. cannot be accessed from outside the process created it

c. on UNIX system they are called as ananymous pipes

d. they are bidirectional (b)


38. When a process switches from running state to waiting state, it is

a. Preemptive scheduling

b. non preemptive scheduling

c. CPU burst

d. I/O burst (b)


39. Locking is an example for

a) synchronization software

b) synchronization hardware

c) counting semaphore

d) binary semaphore


40. 4 process all arriving at time 0 having CPU burst 6,3,1 & 3 and priority 3,1,4 & 2 respectively. If the priority is reversed, the ratio between the first & second average waiting times will be

a) 10:9

b) 6:7

c) 7:6

d) 9:10 (c)


41. Which one of the following scheduling alogithm suffers from starvation?

a) FCFS

b) SJF

c) RR

d) Priority (d)


42. Which one is fair share scheduling?

a) FCFS

b) SJF

c) RR

d) Priority (c)


43. Which one of the following is false regarding spinlocks?

a) loop continuously to acquire locks

b) suffers from busy waithing

c) no context switch 

d) useful in case of multiprogramming system (d)


44. Synchronization occurs 

a) only in cooperating process

b) only in independent process

c) both cooperating and independent process

d) either in cooperating or independent process (a)


45. OS in iPad is an example of ______ OS structure

a) modular 

b) Microkernal

c) Hybrid

d) layered (c)

Python observation Program list 2

  Write aim, algorithm and python program and draw flowchart for the following. 1. Calculate the number of vowels and spaces inbetween words...