chapter
    Operating System PYQs for GATE CS

    GATE CS Operating System: 1 units and 5 chapters, weightage from 48 previous year questions across 10 papers, a study order by exam weight and 0 practice ques

    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: 1 units and 5 chapters, weightage from 48 previous year questions across 10 papers, a study order by exam weight and 0 practice questions.

    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.

    GATE CS Operating System Unit-wise Weightage from Past Papers

    We counted every GATE CS Operating System previous year question in our bank (48 questions from 10 papers) and grouped them by unit.

    UnitChaptersPYQsShare of sectionAvg per paper
    Operating System548100%4.8

    Suggested Operating System Study Order for GATE CS

    1. Operating System: 100% of past Operating System questions, about 4.8 per paper.

    Start where the marks are. Units at the top of this list have appeared most often in past GATE CS papers.

    Units in GATE CS Operating System

    All Operating System chapters

    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