GATE CS Operating System Previous Year Questions

60 solved GATE CS questions on Operating System, drawn from 8 exam years and grouped by year. Every question shows the official answer and a step-by-step solution.

Want to practise this topic and ask follow-up questions? Explore Success Tracker.

Revision companion

Operating System: trace time, memory, and shared state

Draw the state an operating-system problem changes: a ready queue, page mapping, or shared variable. Keep units and policy assumptions visible. These selected foundations lead into a translation calculation and a separate scheduling check; use them to diagnose reasoning errors rather than as an exhaustive topic list.

Our study notes and original examples support the PYQs below; they are not official exam questions or a replacement for the current syllabus.

Before you start

  • Binary representation, powers of two, and byte-to-KiB conversions.
  • Queues, basic computer architecture, and simple program traces.

Concepts to revise before solving

Processes, threads, and state

A process provides an address space and execution environment. Its threads share that address space but maintain separate registers and stacks. A ready thread awaits CPU time; a blocked thread awaits an event such as I/O completion.

Check yourself: Does the event make a task runnable or actually dispatch it?

Scheduling metrics

Turnaround is completion minus arrival time. Response time measures arrival to first CPU dispatch. For one CPU burst without I/O, waiting equals turnaround minus burst time. Draw arrivals, preemptions, idle intervals, and any specified context-switch cost on a timeline.

Check yourself: Have you specified preemption and tie-breaking before selecting the next task?

Synchronization and deadlock

Critical sections protect invariants. Counting semaphores can track available resource units; mutexes protect exclusive access. Deadlock requires mutual exclusion, hold-and-wait, no preemption, and circular wait together. Starvation instead allows others to progress while one task keeps being postponed.

Check yourself: Can interleaved operations violate the invariant despite looking correct individually?

Paging and address fields

In byte-addressed memory with 2^p-byte pages, the lowest p address bits form the offset. Translation replaces the virtual page number with a physical frame number, preserving the offset. Page-table entry size determines table storage, not offset width.

Check yourself: Did you convert page size to bytes before taking its logarithm?

TLB misses and page faults

A TLB caches translations. A miss requires a page-table lookup, not necessarily a page fault: the page may be resident. Weight complete hit and miss paths to calculate effective access time, including page-table levels and fault service only as specified.

Check yourself: Does each timing path include the final data access?

Mistakes to avoid

Treating every TLB miss as disk access.
Distinguish an uncached translation from a nonresident page; their costs differ.
Subtracting arrival time twice when calculating waiting.
Compute completion minus arrival once, then subtract burst time under the no-I/O assumption.
Concluding an unsafe state is already deadlocked.
Unsafe means no safe sequence under maximum claims; current requests may still allow progress.

Original teaching example · not a PYQ

Work through the reasoning

Original mini-example: byte-addressed memory uses 32-bit virtual addresses and 4 KiB pages. TLB lookup costs 10 ns, memory access 100 ns, and hit rate is 90%. Assume a single-level resident page table, no faults, no data cache, and serial, nonoverlapping accesses. Find offset width and effective access time.

  1. 4 KiB = 4096 = 2^12 bytes, so the offset has 12 bits and the virtual page number has 20 bits.
  2. A hit costs 10 ns for translation plus 100 ns for data: 110 ns.
  3. A miss costs 10 ns for lookup, 100 ns for the page-table entry, and 100 ns for data: 210 ns.
  4. Weight the paths: 0.9 × 110 + 0.1 × 210 = 120 ns. Faults are excluded, so add no disk penalty.

12 offset bits, 20 virtual-page-number bits, and 120 ns effective access time.

Try it before reading the answer

On one CPU, nonpreemptive FCFS runs P1 (arrival 0 ms, burst 5 ms) and P2 (arrival 1 ms, burst 2 ms). With no I/O or switching cost, what is average waiting time?

Show answer and reasoning

2 ms.

P1 runs from 0 to 5, waiting 0 ms. P2 runs from 5 to 7, waiting 4 ms. Their average is 2 ms. P2's 6 ms turnaround is not its waiting time.

Go deeper with free learning resources

Supplemental reading, not an official GATE reading list or an endorsement of these notes.

  • Operating Systems: Three Easy Pieces

    Free supplemental textbook chapters by University of Wisconsin–Madison authors. Explore CPU scheduling, paging, TLBs, and concurrency for fuller explanations and exercises.

Apply this to the previous-year questions

Previous-year questions by year

This page shows 60 recent questions from the released archive, newest first. For older questions and complete papers, browse all GATE CS papers. Questions can carry more than one subject tag; counts are not marks weightage.

GATE CS 202611 questions

  1. Set 1 Q29With respect to deadlocks in an operating system, which of the following statements is/are FALSE?MSQ · +1 marks · Medium
  2. Set 1 Q31In the context of relational database normalization, which of the following statements is/are true?MSQ · +1 marks · Medium
  3. Set 1 Q35Consider a system consisting of kk instances of a resource RR, being shared by 5 processes. Assume that each process requires a maximum of two instances of…NAT · +1 marks · Medium
  4. Set 1 Q54Consider a system that has a cache memory unit and a memory management unit (MMU). The address input to the cache memory is a physical address. The MMU has a…MSQ · +2 marks · Medium
  5. Set 1 Q63Consider the following program snippet. Assume that the program compiles and runs successfully. Further, assume that the fork() system call is always…NAT · +2 marks · Medium
  6. Set 1 Q64Consider a CPU that has to execute two types of processes. The first type, Actuators (A), requires a CPU burst of 6 seconds. The second type, Controllers (C),…NAT · +2 marks · Medium
  7. Set 2 Q23Which one of the following CPU scheduling algorithms cannot be preemptive?MCQ · +1 marks · Easy
  8. Set 2 Q51Consider three processes P1, P2, and P3 running identical code, as shown in the pseudocode below. A and B are two binary semaphores initialized to 1 and 0,…MSQ · +2 marks · Hard
  9. Set 2 Q53To keep track of free blocks in a file system, one of the two approaches is generally used – using bitmaps (bit vectors) or using linked lists. Consider that…NAT · +2 marks · Hard
  10. Set 2 Q54A system has a Translation Lookaside Buffer (TLB) that has a reach of 1 MB. TLB reach is defined as the total amount of physical memory that can be accessed…NAT · +2 marks · Hard
  11. Set 2 Q55Consider contiguous allocation of physical memory to processes using variable partitioning scheme. Suppose there are 8 holes in the memory of sizes 20 KB, 4…NAT · +2 marks · Medium

GATE CS 202510 questions

  1. Set 1 Q11Suppose a program is running on a non-pipelined single processor computer system. The computer is connected to an external device that can interrupt the…MCQ · +1 marks · Easy
  2. Set 1 Q14Consider a demand paging memory management system with 32-bit logical address, 20-bit physical address, and page size of 2048 bytes. Assuming that the memory…MCQ · +1 marks · Easy
  3. Set 1 Q29Suppose in a multiprogramming environment, the following C program segment is executed. A process goes into I/O queue whenever an I/O related operation is…NAT · +1 marks · Medium
  4. Set 1 Q38A computer has two processors, M1M_1 and M2M_2. Four processes P1,P2,P3,P4P_1, P_2, P_3, P_4 with CPU bursts of 20,16,25,20, 16, 25, and 1010 milliseconds, respectively,…MCQ · +2 marks · Hard
  5. Set 1 Q51A disk of size 512M512\text{M} bytes is divided into blocks of 64K64\text{K} bytes. A file is stored in the disk using linked allocation. In linked allocation,…NAT · +2 marks · Medium
  6. Set 1 Q54In optimal page replacement algorithm, information about all future page references is available to the operating system (OS). A modification of the optimal…NAT · +2 marks · Medium
  7. Set 2 Q26Processes P1,P2,P3,P4P_1, P_2, P_3, P_4 arrive in that order at times 0, 1, 2, and 8 milliseconds respectively, and have execution times of 10, 13, 6, and 9…MCQ · +1 marks · Medium
  8. Set 2 Q47Consider a demand paging system with three frames, and the following page reference string: 1 2 3 4 5 4 1 6 4 5 1 3 2. The contents of the frames are as…MSQ · +2 marks · Medium
  9. Set 2 Q48P={P1,P2,P3,P4}P = \{P_1, P_2, P_3, P_4\} consists of all active processes in an operating system. R={R1,R2,R3,R4}R = \{R_1, R_2, R_3, R_4\} consists of single instances of distinct…MSQ · +2 marks · Medium
  10. Set 2 Q58A computer system supports a logical address space of 2322^{32} bytes. It uses two-level hierarchical paging with a page size of 4096 bytes. A logical address…NAT · +2 marks · Medium

GATE CS 202410 questions

  1. Set 1 Q24Which of the following statements about threads is/are TRUE?MSQ · +1 marks · Easy
  2. Set 1 Q25Which of the following process state transitions is/are NOT possible?MSQ · +1 marks · Easy
  3. Set 1 Q40Consider the following two threads T1 and T2 that update two shared variables a and b. Assume that initially a = b = 1. Though context switching between…MCQ · +2 marks · Medium
  4. Set 1 Q57Consider the following code snippet using the fork() and wait() system calls. Assume that the code compiles and runs correctly, and that the system calls…NAT · +2 marks · Hard
  5. Set 1 Q62Consider a memory management system that uses a page size of 2 KB2\text{ KB}. Assume that both the physical and virtual addresses start from 00. Assume that the…NAT · +2 marks · Easy
  6. Set 2 Q24Which of the following tasks is/are the responsibility/responsibilities of the memory management unit (MMU) in a system with paging-based memory management?MSQ · +1 marks · Medium
  7. Set 2 Q25Consider a process P running on a CPU. Which one or more of the following events will always trigger a context switch by the OS that results in process P…MSQ · +1 marks · Medium
  8. Set 2 Q37Consider a single processor system with four processes A, B, C, and D, represented as given below, where for each process the first value is its arrival time,…MCQ · +2 marks · Medium
  9. Set 2 Q46Consider a multi-threaded program with two threads T1 and T2. The threads share two semaphores: s1 (initialized to 1) and s2 (initialized to 0). The threads…MSQ · +2 marks · Medium
  10. Set 2 Q64Consider a 32-bit system with 4 KB page size and page table entries of size 4 bytes each. Assume 1 KB = 2102^{10} bytes. The OS uses a 2-level page table for…NAT · +2 marks · Hard

GATE CS 20236 questions

  1. Set 1 Q22Which one or more of the following need to be saved on a context switch from one thread (T1T_1) of a process to another thread (T2T_2) of the same process?MSQ · +1 marks · Medium
  2. Set 1 Q23Which one or more of the following options guarantee that a computer system will transition from user mode to kernel mode?MSQ · +1 marks · Medium
  3. Set 1 Q27Which one or more of the following CPU scheduling algorithms can potentially cause starvation?MSQ · +1 marks · Medium
  4. Set 1 Q38Consider the two functions incr and decr shown below. [code] [code] There are 5 threads each invoking incr once, and 3 threads each invoking decr once,…MCQ · +2 marks · Hard
  5. Set 1 Q57Consider the following two-dimensional array D in the C programming language, which is stored in row-major order: [code] Demand paging is used for…NAT · +2 marks · Hard
  6. Set 1 Q58Consider a computer system with 57-bit virtual addressing using multi-level tree-structured page tables with L levels for virtual to physical address…NAT · +2 marks · Medium

GATE CS 20226 questions

  1. Set 1 Q19Consider the following threads, T1,T2T_1, T_2, and T3T_3 executing on a single processor, synchronized using three binary semaphore variables, S1,S2S_1, S_2, and…MCQ · +1 marks · Medium
  2. Set 1 Q26Which of the following statements is/are TRUE with respect to deadlocks?MSQ · +1 marks · Medium
  3. Set 1 Q38Which one of the following statements is FALSE?MCQ · +2 marks · Medium
  4. Set 1 Q42Consider four processes P, Q, R, and S scheduled on a CPU as per round robin algorithm with a time quantum of 4 units. The processes arrive in the order P, Q,…MCQ · +2 marks · Hard
  5. Set 1 Q63Consider two files systems AA and BB, that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in A…NAT · +2 marks · Hard
  6. Set 1 Q64Consider a demand paging system with four page frames (initially empty) and LRU page replacement policy. For the following page reference string…NAT · +2 marks · Medium

GATE CS 20219 questions

  1. Set 1 Q21In the context of operating systems, which of the following statements is/are correct with respect to paging?MSQ · +1 marks · Medium
  2. Set 1 Q24Which of the following standard C library functions will always invoke a system call when executed from a single-threaded process in a UNIX/Linux operating…MSQ · +1 marks · Medium
  3. Set 1 Q25Consider a linear list based directory implementation in a file system. Each directory is a list of nodes, where each node contains the file name along with…MSQ · +1 marks · Medium
  4. Set 1 Q35Three processes arrive at time zero with CPU bursts of 16, 20 and 10 milliseconds. If the scheduler has prior knowledge about the length of the CPU bursts, the…NAT · +1 marks · Easy
  5. Set 1 Q56Consider the following pseudocode, where SS is a semaphore initialized to 5 in line#2 and counter is a shared variable initialized to 0 in line#1. Assume…MSQ · +2 marks · Hard
  6. Set 2 Q24Which of the following statement(s) is/are correct in the context of CPU scheduling?MSQ · +1 marks · Medium
  7. Set 2 Q52Consider the following multi-threaded code segment (in a mix of C and pseudo-code), invoked by two processes P1 and P2, and each of the processes spawns two…MSQ · +2 marks · Medium
  8. Set 2 Q53Consider a computer system with multiple shared resource types, with one instance per resource type. Each instance can be owned by only one process at a time.…MSQ · +2 marks · Hard
  9. Set 2 Q58Consider a three-level page table to translate a 39-bit virtual address to a physical address as shown below. [figure] The page size is 4KB…NAT · +2 marks · Hard

GATE CS 20205 questions

  1. Set 1 Q21Consider allocation of memory to a new process. Assume that none of the existing holes in the memory will exactly fit the process’s memory requirement. Hence,…MCQ · +1 marks · Medium
  2. Set 1 Q22Consider the following statements about process state transitions for a system using preemptive scheduling. I. A running process can move to ready state. II. A…MCQ · +1 marks · Easy
  3. Set 1 Q44Each of a set of nn processes executes the following code using two semaphores aa and bb initialized to 1 and 0, respectively. Assume that count is a…MCQ · +2 marks · Medium
  4. Set 1 Q60Consider the following set of processes, assumed to have arrived at time 0. Consider the CPU scheduling algorithms Shortest Job First (SJF) and Round Robin…NAT · +2 marks · Medium
  5. Set 1 Q63Consider a paging system that uses 1-level page table residing in main memory and a TLB for address translation. Each main memory access takes 100 ns and TLB…NAT · +2 marks · Hard

GATE CS 20193 questions

  1. Set 1 Q27The following C program is executed on a Unix/Linux system: [code] The total number of child processes created is _______.NAT · +1 marks · Medium
  2. Set 1 Q33Consider three concurrent processes P1, P2 and P3 as shown below, which access a shared variable D that has been initialized to 100. | P1 | P2 | P3 | | :--- |…NAT · +1 marks · Hard
  3. Set 1 Q43Assume that in a certain computer, the virtual addresses are 64 bits long and the physical addresses are 48 bits long. The memory is word addressable. The page…MCQ · +2 marks · Medium

Other GATE CS topics

Continue learning with Success Tracker

Keep working on Operating System

Reading a solution is a useful start. In Success Tracker, you can attempt questions yourself, review mistakes and return to the topics that need another pass.

AI-powered practice· Unlimited practice on eligible plans
PYQs with solutions
Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
Practice that adapts
Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
AI doubt support
Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.

Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.

This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.