Practice Set -1
Sub: Operating system(R1UC403B)
1. List any two differences between time-sharing and real-time operating systems.
2. Compare batch and multitasking operating systems. batch and multitasking operating
systems.
3. Name various system components of operating system.
4. Compare the advantages and disadvantages of different operating system architectures (e.g.,
Monolithic, Microkernel, Hybrid).
5. Name two types of user interfaces provided by operating systems
6. Differentiate between multitasking and multiprocessing as provided by the operating system.
7. Define device management in an operating system? List two related functions.
8. Apply the concept of process management to explain how an OS switches between multiple
running programs.
9. Assess the importance of memory management in real-time operating systems. Justify your
views with suitable scenarios.
10. Define the context switching, and why is it important in process management?
11. Explain the purpose of the fork() system call in UNIX-like operating systems.
12. How many processes are created?
fork();
fork();
fork();
13. Calculate total number of child process for the following code.
int i;
for(i = 0; i < 3; i++)
fork();
14. How does a user program interact with the kernel using system calls?
15. Explain the different types of queues used in process management within an operating
system. Describe the role of each queue (such as the Job Queue, Ready Queue, and Device
Queue), how processes move between them, and how they contribute to overall CPU
16. Explain the various states of a process as represented in a Process State Transition Diagram.
Describe how a process transitions between these states and give real-world examples of
events that can cause these transitions.
17. What is the difference between a process and a program in the context of an operating
system?
18. Apply the concept of process management to explain how an OS switches between multiple
running programs.
19. Define the role of system calls in OS structure?
20. Differentiate between a monolithic kernel and a microkernel?
21. Explain the layered architecture of an operating system.
22. Explain in detail the concept of threads and their management in modern operating systems.
Your answer should include:
23. Explain the advantages and disadvantages of a layered operating system structure?
24. Describe the primary function of a scheduler in an operating system?
25. Explain how the medium-term scheduler helps in improving system performance through
swapping.
26. Why is the long-term scheduler also known as the job scheduler, and what impact does it
have on system load?
27. Compare and contrast long-term scheduling and short-term scheduling in terms of their
frequency and impact on system performance.
28. Define pre-emptive CPU scheduling give any two examples.
29. Differentiate between pre-emptive and non-pre-emptive CPU scheduling with an example.
30. Explain how context switching occurs in pre-emptive CPU scheduling.
31. Consider the following processes with their arrival and burst times. Apply Shortest Job First
(SJF) scheduling and calculate the average turnaround time.
Process Arrival Time Burst Time
P1 0ms 7ms
P2 2ms 4ms
P3 4ms 1ms
P4 5ms 4ms
32. Using Priority Scheduling, calculate the average waiting time for the following processes.
Process Arrival Time Priority Burst Time
P1 0ms 3 6ms
P2 1ms 1(L) 8ms
P3 2ms 2 7ms
P4 3ms 4(H) 3ms
33. Simulate pre-emptive Round Robin scheduling with a time quantum of 3 ms for the following
processes. Show Gantt chart and calculate average turnaround.
Process Arrival Time Burst Time
P1 0ms 7ms
P2 2ms 4ms
P3 4ms 1ms
P4 5ms 4ms
34. Draw a Gantt chart and calculate average waiting time using SRTF scheduling for the
following processes.
Process Arrival Time(ms) Burst Time
P1 0 2ms
P2 1 4ms
P3 2 8ms
35. Given the following processes, apply pre-emptive Priority Scheduling. Draw the Gantt chart,
calculate average waiting time, turnaround time.
Process Arrival Time Burst Time Priority
P1 0ms 7ms 6
P2 1ms 9ms 8
P3 3ms 11ms 7
P4 4ms 10ms 5(L)
P5 6ms 8ms 9
P6 11ms 4ms 10(H)
36. Given the following set of processes, compare and analyze the performance of the following
three pre-emptive CPU scheduling algorithms:
Round Robin (Time Quantum = 4 ms)
Shortest Remaining Time First (SRTF)
Process Arrival Time Burst Time
P1 5ms 5ms
P2 4ms 6ms
P3 3ms 7ms
P4 1ms 9ms
P5 2ms 2ms
P6 6ms 3ms
Draw Gantt charts for each of the two algorithms.
Calculate for each algorithm:
o Average Waiting Time (AWT)
o Average Turnaround Time (ATAT)
o Average Response Time (ART)
37. How is concurrency different from parallel processing?
38. How does OS ensure Mutual Exclusion in concurrent processes?
39. Explain the race condition with the help of suitable example?
40. How do you define critical section in concurrent programing? Explain with help of suitable
example and diagram
41. Explain the concept of Race Condition with the help of a simple example involving two
processes incrementing a shared variable.
42. Describe the Critical Section Problem? List the three necessary conditions that a solution to
the critical section problem must satisfy.
43. Describe how a simple mutex lock mechanism can be used to solve the critical section
problem. Support your explanation with a small pseudocode snippet.
44. Explain concepts of CPU scheduling,
45. Compare between CPU bound process and I/o bound process.
46. Explain various scheduling criteria for CPU scheduling with suitable computation .
47. consider three processes with arrival time {0,1,2} and burst time{5,3,6} Compute
Throughput, Response Time, and Turnaround Time.
48. Consider three process with arrival time {0,1,2} and burts time{5,3,6} Compute avg waiting
time and avg Turnaround Time.
49. Define "Non-Preemptive CPU Scheduling". List two non-preemptive scheduling algorithms.
50. Explain "Convoy Effect" .
51. Make a Gantt chart and calculate Average TAT and WT for the processes given in following
table while applying FCFS CPU Scheduling Algorithm. Process[P1-P2-P3-P4] Arrival Time [0-1-
2-3] Burst Time [10-4-8-5].
52. Make a Gantt chart and calculate Average TAT and WT for the processes given in following
table while applying Non-Preemptive SJF CPU Scheduling Algorithm. Process[P1-P2-P3-P4]
Arrival Time [0-1-3-5] Burst Time[8-5-3-4].
53. Make a Gantt chart and calculate Average TAT and WT for the processes given in following
table while applying Non-Preemptive SJF CPU Scheduling Algorithm. Process[P1-P2-P3-P4-
P5] Arrival Time [0-1-3-5-2] Burst Time[8-5-3-4-10].
54. What is context switching in an operating system, and why is it necessary?
55. List any two components of a process's context that are saved during a context switch.
56. Compare context switching in preemptive and non-preemptive scheduling. Which type
typically incurs more context switches and why?
57. What information is typically stored during a context switch? Categorize it into CPU-related
and memory-related information.
58. With the help of a neat diagram, describe the steps involved in a context switch between
two processes (P1 and P2).
59. Describe in detail the steps involved in a context switch. Explain how the operating system
ensures process isolation and data consistency during a context switch.
60. A system uses Round Robin scheduling with the following parameters: Number of
processes: 5 Time quantum: 10 ms Context switch time: 2 ms (1 ms to save the
current process and 1 ms to load the next process) Each process requires 25 ms of
CPU time (no I/O or blocking) All processes arrive at time = 0 Q: a) Draw a Gantt
chart showing the execution order of processes. b) Calculate the total context
switching time for the complete execution. c) What is the CPU utilization
(percentage of time the CPU is doing useful work)?
61. Compare context switching in the following scenarios:
a) Preemptive vs. non-preemptive scheduling
b) User-level threads vs. kernel-level threads
c) Single-core vs. multi-core systems
62. Define context switching. Discuss the following aspects with appropriate examples: a) Role
of Process Control Block (PCB) b) Difference between thread and process context switching c)
How context switching enables multitasking
63. List the basic states of a process in a state transition diagram.
64. What is the 'Ready' state in a process life cycle?
65. Explain the difference between the 'Ready' and 'Running' states in a process state transition
diagram.
66. Describe the conditions under which a process transitions from the 'Waiting' state to the
'Ready' state.
67. Apply the concept of the state transition diagram to explain how a process moves from
creation to termination in a multitasking operating system
68. Explain the complete process state transition diagram used in operating systems. Illustrate
each state (New, Ready, Running, Waiting, Terminated) and the transitions between them
with the help of a well-labeled diagram.
69. Explain the structure and role of a Process Control Block (PCB) in an operating system.
70. What information is typically stored in a PCB, and how does the OS use it during context
switching?
71. What information does a PCB store for a process in an operating system?
72. Define multithreading.
73. What is thread synchronization?
74. Mention three differences between user-level and kernel-level threads.
75. Explain any three states of a thread.
76. Differentiate between thread and process with at least four points.
77. Explain Dekker's algorithm .
78. What are the key challenges in thread management?
79. Explain in detail the concept of threads and their management in modern operating systems.
Your answer should include:
80. What are the key variables used in peterson algorithm?
81. What are the potential drawbacks of using Dekker's algorithm for process synchronization in
operating systems?
82. Write a pseudocode implementation of Peterson's algorithm for two processes.
83. Can Peterson's and Dekker's algorithms be extended to more than two processes? If so,
how? If not, why?
84. Are Dekker's and Peterson's algorithms commonly used in modern operating systems for
process synchronization? Why or why not?
85. Describe Dekker's algorithm for mutual exclusion. How does it ensure that two processes do
not enter their critical sections simultaneously?
86. Compare and contrast Dekker's and Peterson's algorithms in terms of their approach to
mutual exclusion, efficiency, and practical use in modern operating systems.
87. In what scenarios is Peterson's algorithm preferred over other synchronization mechanisms?
Discuss its advantages and limitations.
88. Analyze whether deadlock is possible either peterson or dekkers's [Link]
justification for your answer with a scenario or logical explanation.
89.
90. Calculate the average turnaround time for the following cpu schedulingb algorithms where
Time quantum =2ms
91. Consider the set of 5 processes whose arrival time and burst time are given below.