SCHOOL OF COMPUTER SCIENCE AND ENGINEERING
Continuous Assessment Test -1
CSE2005 – Operating Systems
F1 - Slot
ANSWER KEY
Multiple Choice Questions: 20 × 1 = 20 Marks
1. A program running in the computer all the time is…
(a) Application program (b) Device driver (c) Kernel Program (d) Firewall
(drop-down option) CO1
Ans: (c) Kernel Program
2. “I/O bound processes have usually many short CPU burst” while “CPU bound processes
have longer I/O burst”. Following these statements...
(a) True and False (b) True and True (c) False and False (d) False and True
Ans: (a) True and False CO1
3. Which is not a part of PCB…
(a) Accounting information (b) I/O status information (c) Scheduling information (d)
All of the given (e) None
Ans: (e) None CO2
4.
Answer : 3200e-80 CO1
5. Which module of operating system is responsible for transferring CPU switch from one
process to the other?
(a) Short-term Scheduler (b) Linker (c) Swapper (d) Dispatcher (e) Long-term
Scheduler
CO3
Ans: (d) Dispatcher
6. Consider three CPU-intensive processes, which require 7, 3 and 2 time units and arrive at
times 0, 3 and 6, respectively. How many context switches are needed if the operating system
implements a shortest remaining time first scheduling algorithm? And also count the context
switches at time zero and at the end.
(Filling the blank) CO3
Ans: 5
7. Which of the following is/are not shared by the threads of the same process?
(a) Program counter (b) Logical Address space (c) Stack (d) Registers (e) Virtual
Address space (f) File descriptor table (g) Message queue (h) Code
1. (a), (b) and (e)
2. (a), (c) and (f)
3. (a), (c) and (h)
4. (a), (c) and (d)
5. (a), (c) and (g)
6. (a), (b) and (d)
CO2
Ans: 4. (a), (c) and (d)
8.
CO1
Ans: 1. (b), (c), (d), (a)
9. Assume jobs are waiting to be run. Their expected run times are 1, 2, 6 , 5, x, y ,.........n.
In what order should they be run to minimize the average waiting time?
(a) decreasing (a) random (c) increasing (d) First-come-first-serve
CO3
(drop-down option)
Ans: (c) increasing
10.
CO1
ANSWER: B
11. Assume, you are planning to use the CPU scheduling algorithm with the execution times
in an ascending order and also considering the same order as priority. Now pickup which of
the given algorithms are seems to be identical…
(a) FCFS, Priority (b) SJF, Priority (c) Round robin, Priority (d) SRTF, Priority
CO3
Ans: (b) SJF, Priority
12. The next CPU burst of a process is predicted using…
(a) Aging (b) Poisson distribution (c) Logarithmic averaging (d) Exponential
averaging (e) Exponential powering
CO3
(drop-down option)
Ans: (d) Exponential averaging
13. Assume, you want to retrieve the process id of a terminated child to the parent. Which
system call will you use?
(a) fork() (b) wait() (c) exit() (d) get() (e) exec()
CO2
(drop-down option)
Ans: (b) wait()
14. The appearance of all processes with their PCB residing in primary memory can be found
in
(a) Job queue (b) Process table (c) CPU register (d) Cache memory
(drop-down option)
CO2
Ans: (b) Process table
15. Which of the following systems is suitable for fault-tolerance
(a) Real-time systems (b) Hand-held (c) Multiprocessor (d) Main-frame
CO1
(drop-down option)
Ans: (c) Multiprocessor
16.
CO1
Ans: (d) multitasking, multiprogramming
17. The degree of multiprogramming is managed and controlled by…
(a) Short-term scheduler (b) Long-term scheduler (c) Medium-term scheduler
(d) Dispatcher
CO3
(drop-down option)
Ans: (b) Long-term scheduler
18.
How many “SCOPE”s are printed?, how many “SCOPE”s are printed by only child
processes?
(a) 5, 2 (b) 5, 3 (c) 5, 4 (d) 5, 1
(drop-down option) CO2
Ans: (c) 5, 4
19. To make a process as Zombie, which process needs to be delayed (sleep()) its execution
either the parent or child and pick up the right choice
(a) parent to sleep for a while, child normal execution (b) child to sleep for a while,
parent normal execution (c) parent and child both normal execution (d) parent and
child both to sleep for a while
CO2
Ans: (a) parent to sleep for a while, child normal execution
20.
(a) 4th queue (b) 5th queue (c) 6th queue (d)7th queue
CO3
(drop-down option)
Ans: 6th queue
Two mark questions: 2 × 2 = 4 Marks
21. Assume at time 6ms onwards the processes J1, J3, J5, J7 and J8 are trying to use only the
computer resources as processor and memory.
Now consider the following events happen at different execution time in (ms):
At time 6: J1 executes a command to read from disk unit 3.
At time 14: J5's time quantum expires.
At time 17: J7 executes a command to write to disk unit 3.
At time 19: J3 executes a command to read a content from disk unit 2.
At time 24: J5 executes a command to write a content to disk unit 3.
At time 32: An interrupt arises from disk unit 2: J3's read is complete.
At time 36: An interrupt arises from disk unit 3: J1's read is complete.
At time 37: J8 terminates.
At time 39: An interrupt arises from disk unit 3: J5's write is complete.
At time 47ms: An interrupt occurs from disk unit 3: J7's write is complete.
Find at times 22ms and 47ms, the state of the processes J1, J3, J5, J7 and J8. [1M+1M]
Ans: (Short answer) CO3
At time 22ms:
Process J1: blocked
Process J3: blocked
Process J5: running
Process J7: blocked
Process J8: ready
At time 47ms:
Process J1: ready/running
Process J3: ready/running
Process J5: ready
Process J7: blocked
Process J8: terminated
22.
Ans: (Short answer) CO2
As far as we can see, there are two state transitions that are not possible and there are valid
reasons for why they not maintained. They are:
(a) blocked ⇒ running: For a blocked process to run, it must be present in the READY queue
first. And since any blocked process is out of the READY queue, it cannot run unless it is
enqueued first i.e. becoming in the ready state.
(b) ready ⇒ blocked: No ready process can be blocked to move in to device queue since it is
not running any of its instructions. It is simply waiting for its turn to be run by the CPU.
Six mark question: 1 × 6 = 6 Marks
23. Assume, you are trying to execute the following jobs J1, J2, J3 and J4 with execution times
shown. The varying arrival time of the jobs and priority of the jobs are also given. If you apply
pre-emptive priority algorithm for these jobs, what will be the individual turnaround-times and
waiting times of each jobs? Compute the average turnaround-time and average wating time
also. [TATs of 4 Jobs × 0.5 marks + WTs of 4 Jobs × 0.5 + Avg. TAT × 0.5mark + Avg. WT
× 0.5mark = 6 Marks]
Note: Lowest number in priority denotes the highest priority
Jobs: Burst_Time (ms): Arrival_Time (ms): Priority
J1: 5 : 2 : 2
J2: 4 : 1 : 3
J3: 6 : 0 : 4
J4: 3 : 3 : 1
(Long answer)
CO3
Ans:
TATs: J1 = 8ms; J2 = 12ms; J3 = 18ms; J4 = 3ms
WTs: J1 = 3ms; J2 = 8ms; J3 = 12ms; J4 = 0ms
Avg TAT = 10.25ms
Avg WT = 5.75ms