Practice tests · GATE
GATE operating systems: 5 practice questions with answers
On this page
Operating System is one of the ten sections of the GATE CS paper, and one of the most predictable. Most questions are numerical: simulate a scheduling algorithm, count page faults, compute an effective access time or add up disk head movement. If you can trace the algorithm without slips, these are safe marks. The five original questions below are of that kind.
What GATE tests in operating systems
Operating System is a listed section of the 2027 CS paper, and the topic list was revised, so confirm it on the official syllabus page. The standard content is processes and threads, synchronisation, deadlocks, CPU and I/O scheduling, paging and virtual memory, and file systems. The numerical questions cover scheduling (FCFS, SJF, SRTF, round robin, priority), page replacement (FIFO, LRU, optimal), page-table and TLB calculations, disk scheduling and deadlock reasoning. The real paper also has MSQ and NAT questions; all five below are MCQ.
Practice questions
Question 1
Four processes arrive and need CPU time as shown. Scheduling is by shortest remaining time first (preemptive SJF), and a tie is broken in favour of the process that arrived earlier.
| Process | Arrival time (ms) | Burst time (ms) |
|---|---|---|
| P1 | 0 | 7 |
| P2 | 2 | 4 |
| P3 | 4 | 1 |
| P4 | 5 | 4 |
The average waiting time in ms is:
- A. 2.5
- B. 3.0
- C. 3.5
- D. 4.0
Question 2
A system has three processes, each of which needs at most 4 units of a single resource type, and units are requested one at a time. The minimum number of units the system must have so that deadlock can never occur is:
- A. 7
- B. 8
- C. 9
- D. 10
Question 3
A process makes the following page references: 3, 2, 4, 1, 4, 5, 1, 2, 4, 1, 5, 3. It is given 3 frames, all initially empty, with LRU replacement. The number of page faults is:
- A. 7
- B. 8
- C. 9
- D. 10
Question 4
A paged system has a TLB lookup time of 10 ns and a memory access time of 100 ns. The TLB hit ratio is 90%, and the page table is a single level in memory. The effective memory access time is:
- A. 120 ns
- B. 110 ns
- C. 130 ns
- D. 210 ns
Question 5
A disk has cylinders numbered 0 to 199. The head is at cylinder 50 and moving towards higher cylinders. The pending requests are for cylinders 82, 170, 43, 140, 24, 16 and 190. In the SCAN (elevator) algorithm, the head travels to the last cylinder of the disk before reversing. The total head movement in cylinders is:
- A. 314
- B. 340
- C. 358
- D. 332
Answers and explanations
- B. P1 runs from 0. At 2 ms P2 (4) is shorter than P1's remaining 5, so it preempts. At 4 ms P3 (1) preempts P2 (2 left) and ends at 5. Then P2 finishes at 7, P4 runs 7 to 11 and P1 runs 11 to 16. Waiting time = completion − arrival − burst, which is 9, 1, 0 and 2 for P1 to P4. The total is 12, so the average is 3.0.
- D. The worst case is each process holding 3 units while waiting for a fourth. That is 3 × 3 = 9 units held, and with only 9 units in the system nobody can proceed. One extra unit lets one process finish. The formula is n(m − 1) + 1 = 3 × 3 + 1 = 10.
- C. The first three references (3, 2, 4) fault into empty frames. Page 1 faults and evicts 3. Then page 5 evicts 2, page 2 evicts 4, page 4 evicts 5, page 5 evicts 2 and page 3 evicts 4, each a fault. The references to pages 4, 1 and 1 (5th, 7th and 10th) are hits. That is 9 faults.
- A. A hit costs 10 + 100 = 110 ns. A miss costs 10 (TLB) + 100 (page table) + 100 (data) = 210 ns. EMAT = 0.9 × 110 + 0.1 × 210 = 99 + 21 = 120 ns.
- D. The head first moves up from 50 to the end at 199, a distance of 149. It then reverses and travels down to the lowest request at 16, a distance of 183. The total is 149 + 183 = 332. If the head turned at the last request instead (the LOOK variant), the total would be 140 + 174 = 314.
How to prepare operating systems
- Make a grid for each scheduling problem: a Gantt chart, then a table of arrival, burst, completion, turnaround (completion − arrival) and waiting (turnaround − burst).
- Practise page replacement on several strings. Do FIFO, LRU and optimal on the same string, and learn Belady's anomaly for FIFO.
- Memorise the address-translation formulas: page-table size = number of pages × entry size, and a multi-level table needs the offset bits first.
- Learn the semaphore patterns for producer-consumer, readers-writers and dining philosophers, and what a wrong order of wait and signal does.
- For deadlock, know the four necessary conditions and the n(m − 1) + 1 rule, and practise the Banker's algorithm on small matrices. Read the definition of SCAN or any tie-break in the question, because the answer changes with the convention.
The GATE CSE preparation guide places OS in the subject order, and computer organisation practice covers the cache and memory calculations that sit next to paging.
Take the full topic test on PrepMatic
PrepMatic's topic tests run about 15 questions in 30 minutes, a realistic pace for simulation-heavy OS questions. The free assessment shows your weakest subjects first.
Turn the GATE syllabus into a plan you can finish
Take a free GATE assessment on PrepMatic. It shows where you stand in your branch, turns the syllabus into a plan around the hours you actually have, and builds mock tests focused on your weak subjects.
Start free assessment →Free forever plan · No credit card · 2-minute setupRelated
- GATE computer organization practiceFive GATE-style computer organization MCQs on cache tag bits, pipeline CPI, expanding opcodes, DMA cycle stealing and memory access time, with worked answers.
- GATE DBMS practiceFive GATE-style database MCQs on candidate keys, normal forms, SQL NULL handling, conflict serializability and foreign-key joins, with worked answers and tips.
- GATE computer networks practiceFive GATE-style computer networks MCQs on subnetting, CSMA/CD frame size, Go-Back-N, TCP congestion control and IP fragmentation, with step-by-step solutions.
- GATE CSE preparationPlan GATE CS 2027: the revised syllabus section by section, the order to study the nine core subjects, standard books and a 26-week plan from first pass to mocks.
More in GATE
- GATE machine learning practiceFive GATE Data Science and AI machine learning MCQs on ridge regression, least squares, naive Bayes, cross-validation and Gini impurity, with solutions.
- GATE power systems practiceFive GATE EE power systems MCQs on per-unit base change, surge impedance loading, fault MVA, symmetrical components and economic dispatch, with full solutions.
- GATE linear algebra practiceFive GATE-level linear algebra MCQs on consistency, eigenvalues, determinants, eigenvectors and LU decomposition, with worked solutions and a preparation plan.
- GATE probability and statistics practiceFive GATE-level probability MCQs on Bayes' theorem, the Poisson and exponential distributions, variance rules and conditional probability, with solutions.
- GATE geotechnical engineering practiceFive GATE CE geotechnical engineering MCQs on phase relations, effective stress, shear strength, consolidation time and bearing capacity, with worked solutions.
- GATE quantitative aptitude practiceFive GATE-level quantitative aptitude MCQs, covering percentages, work, permutations, probability and data interpretation, each with a full worked solution.
- GATE fluid mechanics practiceFive GATE fluid mechanics MCQs on a venturimeter, hydrostatic force, laminar pipe loss, Froude model scaling and jet force, with worked solutions for ME and CE.
- GATE signals and systems practiceFive GATE-style signals and systems MCQs on convolution, signal power, causality, stability, the Nyquist rate and signal energy, with worked solutions.