chapter
    Operating System PYQs for GATE CS

    GATE CS Operating System: 5 chapters, 48 previous year questions (100% of Operating System), 0 practice questions and one solved question from each chapter.

    A question from this chapter

    Question 1
    2026 Slot Set1 PYQ
    Consider the following program snippet. Assume that the program compiles and runs successfully. Further, assume that the fork() system call is always successful in creating a process.

    int main () {
       int i;
       for (i = 0; i < 3; i++){
          if (fork() == 0){
            continue;
          }
          break;
       }
       printf("Hello!");
       return 0;
    }

    The total number of times that the printf statement gets executed is ________. (answer in integer)
    Question 2
    2026 Slot Set2 PYQ

    Which one of the following CPU scheduling algorithms cannot be preemptive?

    Question 3
    2026 Slot Set2 PYQ
    Consider 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, respectively. X is a shared variable initialized to 0. Each line in the pseudocode is executed atomically.

    Pseudocode of P1, P2, and P3

    Wait(A);
    Print(*);
    X = X+1;
    If (X == 2)
       {
          Print($);
          Signal(B);
       }
    Signal(A);
    Wait(B);
    Print(#);
    Signal(B);

    Assume that any of the three processes can start to execute first and context switching can happen between these processes at any arbitrary time and in any arbitrary order.

    Which of the following patterns is/are possible to be generated as an outcome of the execution of these three processes?
    Question 4
    2026 Slot Set2 PYQ
    A 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 through the TLB entries. The paging system uses pages of size 4 KB. The virtual address space is 64 GB and physical address space is 1 GB. If each TLB entry stores a 4-bit process id, page number, frame number, and a 2-bit control field, then the size of the TLB (in bytes) is ___________. (answer in integer)

    Note: , ,
    Question 5
    2026 Slot Set2 PYQ
    To 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 the linked list approach is used to keep track of free blocks in a file system. Assume that the disk size is 16 GB, block size is 2 KB, and block numbers used are 32-bit long. A single pointer of size 4 bytes is used in each block of the list to point to the next block of the list. The number of blocks required to hold the free disk block numbers is ____________. (answer in integer)

    Note: and
    Free preview ends here

    Login to view the complete previous-year questions and solutions

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Operating System PYQs for GATE CS

    GATE CS Operating System: 5 chapters, 48 previous year questions (100% of Operating System), 0 practice questions and one solved question from each chapter.

    About Operating System Previous Year Questions (PYQs)

    48 previous year questions from Operating System in GATE CS, grouped by chapter with the exam year, answer key and step-by-step solution for each.

    Operating System Weightage in GATE CS

    Operating System accounts for 48 of 48 Operating System previous year questions in our bank (100%), about 4.8 per paper across 10 papers.

    Operating System Chapter Matrix

    ChapterTopicsPYQsShare of unit PYQsPractice questions
    Processes, Threads, System Calls and Context SwitchingProcess States, Ready Queues and Context Switching, Threads and Thread Context, System Calls and User-Kernel Mode Transitions, Process Creation using Fork and Wait919%0
    CPU SchedulingSJF and SRTF Scheduling Metrics, Scheduling Properties, Preemption and Starvation, Round Robin Scheduling and Context-Switch Sequences, Priority and Multiprocessor Scheduling919%0
    Concurrency, Synchronization and DeadlocksConcurrent Interleavings and Shared-State Outcomes, Semaphore Synchronization, Ordering and Critical Sections, Deadlock Conditions, Resource Graphs and Avoidance, Lock-Based Resource Ownership, Livelock and Starvation1225%0
    Memory Management, Paging and Virtual MemoryPaging, Page Tables, Address Translation and TLBs, Page Replacement, Page Faults and Locality, Contiguous Memory Allocation and Fragmentation1429%0
    File Systems and Storage AllocationContiguous and Linked File Allocation, Directory Search and File Operations, Free-Space Management48%0

    More from Operating System

    One Solved Question from Each Operating System Chapter

    Question 1 · Processes, Threads, System Calls and Context Switching · 2026_Set1 NAT
    Consider the following program snippet. Assume that the program compiles and runs successfully. Further, assume that the fork() system call is always successful in creating a process.

    int main () {
       int i;
       for (i = 0; i < 3; i++){
          if (fork() == 0){
            continue;
          }
          break;
       }
       printf("Hello!");
       return 0;
    }

    The total number of times that the printf statement gets executed is ________. (answer in integer)
    Question 2 · CPU Scheduling · 2026_Set2 MCQ

    Which one of the following CPU scheduling algorithms cannot be preemptive?

    1. A.

      Shortest Remaining Time First (SRTF) Scheduling

    2. B.

      First Come First Serve (FCFS) Scheduling

    3. C.

      Round Robin Scheduling

    4. D.

      Priority Scheduling

    Question 3 · Concurrency, Synchronization and Deadlocks · 2026_Set2 MSQ
    Consider 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, respectively. X is a shared variable initialized to 0. Each line in the pseudocode is executed atomically.

    Pseudocode of P1, P2, and P3

    Wait(A);
    Print(*);
    X = X+1;
    If (X == 2)
       {
          Print($);
          Signal(B);
       }
    Signal(A);
    Wait(B);
    Print(#);
    Signal(B);

    Assume that any of the three processes can start to execute first and context switching can happen between these processes at any arbitrary time and in any arbitrary order.

    Which of the following patterns is/are possible to be generated as an outcome of the execution of these three processes?
    1. A.

      **$*###

    2. B.

      **$#*##

    3. C.

      **$##*#

    4. D.

      ***$###

    Question 4 · Memory Management, Paging and Virtual Memory · 2026_Set2 NAT
    A 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 through the TLB entries. The paging system uses pages of size 4 KB. The virtual address space is 64 GB and physical address space is 1 GB. If each TLB entry stores a 4-bit process id, page number, frame number, and a 2-bit control field, then the size of the TLB (in bytes) is ___________. (answer in integer)

    Note: , ,
    Question 5 · File Systems and Storage Allocation · 2026_Set2 NAT
    To 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 the linked list approach is used to keep track of free blocks in a file system. Assume that the disk size is 16 GB, block size is 2 KB, and block numbers used are 32-bit long. A single pointer of size 4 bytes is used in each block of the list to point to the next block of the list. The number of blocks required to hold the free disk block numbers is ____________. (answer in integer)

    Note: and