Why Operating Systems is both hard and highly scoring
The Operating Systems paper in B.Tech CSE semester 4 contains a mix of theory definitions (which test understanding) and numerical problems (which test calculation). The numerical questions are highly predictable and reward methodical practice far more than raw intelligence. A student who has solved ten previous-year scheduling or page replacement questions will score consistently higher than a student who has read the entire textbook but never worked through a numerical.
The most important topic in OS: Process Scheduling
CPU scheduling algorithms appear in virtually every B.Tech CSE OS paper. You must be able to calculate turnaround time, waiting time, and average waiting time for each of the following algorithms:
- FCFS (First Come First Served): Non-preemptive. Service in arrival order. Calculate completion time → turnaround time (completion − arrival) → waiting time (turnaround − burst).
- SJF (Shortest Job First): Non-preemptive version. Pick the process with the shortest burst time from the ready queue at each scheduling decision.
- SRTF (Shortest Remaining Time First): Preemptive version of SJF. At every time unit, if a new process arrives with a shorter remaining burst time than the running process, preempt.
- Round Robin (RR): Preemptive. Each process gets a fixed time quantum. If it doesn't finish, it goes to the back of the ready queue. Show the Gantt chart explicitly.
- Priority Scheduling: Both preemptive and non-preemptive versions. Lower number = higher priority in most university papers (confirm with the question).
Exam technique for scheduling questions
Always draw the Gantt chart first — it gives you 3-4 marks even if your arithmetic is wrong. Then calculate waiting time and turnaround time from the chart. State the formula before applying it.
Deadlocks and the Banker's Algorithm
Deadlock questions are the second most predictable topic in OS papers. The Banker's Algorithm safe sequence question appears in almost every paper that covers deadlocks. The method: (1) calculate Need matrix = Max − Allocation for each process, (2) find a process whose Need ≤ Available, (3) run it (add its Allocation to Available), (4) repeat until all processes are run or you get stuck. If all processes run, the state is safe and write the safe sequence.
Page replacement algorithms — a predictable 10-mark question
Page replacement questions give you a reference string and a number of frames and ask which algorithm (FIFO, LRU, or Optimal) causes fewer page faults. Trace all three for the given string, show the frame state after each reference, and count the page faults.
- FIFO: Replace the page that has been in memory the longest. Keep track of which page was loaded first.
- LRU (Least Recently Used): Replace the page that was used least recently. Keep a usage timestamp or order for each frame.
- Optimal: Replace the page that will not be used for the longest time in the future. This requires knowing the future reference string — only possible in exam problems, not in real systems.
File systems and disk scheduling — what to memorise
File system questions are usually definition-based (5 marks each). Know the difference between contiguous, linked, and indexed allocation. Know the inode structure. Disk scheduling numericals (FCFS, SSTF, SCAN, C-SCAN, LOOK) follow the same pattern as CPU scheduling questions — draw the head movement on a number line and count the total cylinders traversed.
Four-week preparation plan
Week 1: Scheduling algorithms — solve 10 numerical problems (FCFS, SJF, RR, Priority). Week 2: Deadlocks (Banker's Algorithm) and memory management (paging, segmentation). Week 3: Page replacement algorithms and virtual memory. Week 4: File systems, disk scheduling, and complete previous-year paper under exam conditions.