Skip to content

GATE CS Operating System questions

Practise Operating System questions for GATE CS. Explore official PYQs and original subject-wise quizzes, check answers and view available solutions. Free, no sign-in.

Trace the state changes explicitly. For scheduling, memory and synchronisation questions, record the given policy before calculating the result.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

20 on this page
Official PYQ2022Operating SystemMemory Management and Virtual MemoryNAT · 2 marks
Consider a demand paging system with four page frames (initially empty) and LRU\text{LRU} page replacement policy. For the following page reference string 7,2,7,3,2,5,3,4,6,7,7,1,5,6,17, 2, 7, 3, 2, 5, 3, 4, 6, 7, 7, 1, 5, 6, 1 the page fault rate, defined as the ratio of number of page faults to the number of memory accesses (rounded off to one decimal place)\textit{(rounded off to one decimal place)} is …
Official PYQ2021Operating SystemMemory Management and Virtual MemoryMSQ · 1 mark
In the context of operating systems, which of the following statements is/are correct with respect to paging?
Official PYQ2021Operating SystemSystem CallsMSQ · 1 mark
Which of the following standard CC library functions will always invoke a system call when executed from a single-threaded process in a UNIX/Linux\text{UNIX/Linux} operating system?
Official PYQ2021Operating SystemFile SystemsMSQ · 1 mark
Consider 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 the file metadata, such as the list of pointers to the data blocks. Consider a given directory foo\textsf{foo}. Which of the following operations will necessarily require a full scan of foo\textsf{foo} …
Official PYQ2021Operating SystemCPU SchedulingNAT · 1 mark
Three processes arrive at time zero with CPU\text{CPU} bursts of 16,  2016,\;20 and 1010 milliseconds. If the scheduler has prior knowledge about the length of the CPU\text{CPU} bursts, the minimum achievable average waiting time for these three processes in a non-preemptive scheduler (rounded to nearest integer) is _____________ milliseconds.
Official PYQ2021Operating SystemConcurrency and SynchronizationMSQ · 2 marks
Consider the following pseudocode, where S\textsf{S} is a semaphore initialized to 55 in line #2\#2 and counter\textsf{counter} is a shared variable initialized to 00 in line #1\#1. Assume that the increment operation in line #7\#7 is not\textit{not} atomic. 1. int counter = 0; 2. Semaphore S = init(5); 3. void parop(void) 4. { 5. wait(S); 6. …
Official PYQ2021Operating SystemCPU SchedulingMSQ · 1 mark
Which of the following statement(s) is/are correct in the context of CPU\text{CPU} scheduling?
Official PYQ2021Operating SystemProcesses and ThreadsMSQ · 2 marks
​​​​​​Consider the following multi-threaded code segment (in a mix of C and pseudo-code), invoked by two processes P1P_1 and P2P_2, and each of the processes spawns two threads T1T_1 and T2T_2: int x = 0; // global Lock L1; // global main () { create a thread to execute foo(); // Thread T1 create a thread to execute foo(); // Thread T2 wait for the …
Official PYQ2021Operating SystemDeadlockMSQ · 2 marks
Consider 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. Owning and freeing of resources are done by holding a global lock (L)(L). The following scheme is used to own a resource instance: function OWNRESOURCE(Resource R) Acquire lock L // a global lock if R …
Official PYQ2021Operating SystemMemory Management and Virtual MemoryNAT · 2 marks
Consider a three-level page table to translate a 39−39-bit virtual address to a physical address as shown below: The page size is 4 KB  (1KB=210\text{4 KB} \;(1\text{KB}=2^{10} bytes)) and page table entry size at every level is 88 bytes. A process PP is currently using 2GB  (1GB=2302\text{GB}\;(1 \text{GB}=2^{30} bytes)) virtual memory which is mapped to …
Official PYQ2020Operating SystemMemory Management and Virtual MemoryMCQ · 1 mark
Consider 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, a new hole of smaller size will be created if allocation is made in any of the existing holes. Which one of the following statement is TRUE?
Official PYQ2020Operating SystemCPU SchedulingMCQ · 1 mark
Consider the following statements about process state transitions for a system using preemptive scheduling. A running process can move to ready state. A ready process can move to running state. A blocked process can move to running state. A blocked process can move to ready state. Which of the above statements are TRUE?
Official PYQ2020Operating SystemConcurrency and SynchronizationMCQ · 2 marks
Each of a set of nn processes executes the following code using two semaphores aa and bb initialized to 11 and 00, respectively. Assume that count\text{count} is a shared variable initialized to 00 and not used in CODE SECTION P. CODE SECTION P\begin{array}{|c|} \hline \textbf{CODE SECTION P} \\ \hline \end{array} wait(a); count=count+1; if (count==n) …
Official PYQ2020Operating SystemI/O SchedulingMCQ · 2 marks
Consider the following five disk access requests of the form (request id, cylinder number) that are present in the disk scheduler queue at a given time. (P,155),(Q,85),(R,110),(S,30),(T,115)(P, 155), (Q,85), (R,110),(S, 30), (T,115) Assume the head is positioned at cylinder 100100. The scheduler follows Shortest Seek Time First scheduling to service the requests. Which one of the following …
Official PYQ2020Operating SystemCPU SchedulingNAT · 2 marks
Consider the following set of processes, assumed to have arrived at time 00. Consider the CPU scheduling algorithms Shortest Job First (SJF) and Round Robin (RR). For RR, assume that the processes are scheduled in the orderP1,P2,P3,P4P_1, P_2, P_3, P_4. …
Official PYQ2020Operating SystemMemory Management and Virtual MemoryNAT · 2 marks
Consider a paging system that uses 11-level page table residing in main memory and a TLB\textsf{TLB} for address translation. Each main memory access takes 100100 ns and TLB\textsf{TLB} lookup takes 2020 ns. Each page transfer to/from the disk takes 50005000 ns. Assume that the TLB\textsf{TLB} hit ratio is 95%95 \%, page fault rate is 10%10 \%. …
Official PYQ2019Operating SystemSystem CallsNAT · 1 mark
The following C program is executed on a Unix/Linux system : #include<unistd.h> int main() { int i; for(i=0; i<10; i++) if(i%2 == 0) fork(); return 0; } The total number of child processes created is ________________ .
Official PYQ2019Operating SystemConcurrency and SynchronizationNAT · 1 mark
Consider three concurrent processes P1,P2P_1, P_2 and P3P_3 as shown below, which access a shared variable DD that has been initialized to 100.100. P1P2P3::::::D=D+20D=D−50D=D+10::::::\begin{array}{|c|c|c|} \hline P_1 & P_2 & P_3 \\ \hline : & : & : \\ : & : & : \\ D=D+20 & D=D-50 & D=D+10 \\ : & : & : \\ : & : & : \\ \hline \end{array} …
Official PYQ2019Operating SystemMemory Management and Virtual MemoryMCQ · 2 marks
Assume that in a certain computer, the virtual addresses are 6464 bits long and the physical addresses are 4848 bits long. The memory is word addressible. The page size is 88 kB and the word size is 44 bytes. The Translation Look-aside Buffer (TLB) in the address translation path has 128128 valid entries. At most how many distinct virtual …
Official PYQ2019Operating SystemDeadlockMCQ · 2 marks
Consider the following snapshot of a system running nn concurrent processes. Process ii is holding XiX_i instances of a resource RR, 1≤i≤n1 \leq i \leq n. Assume that all instances of RR are currently in use. Further, for all ii, process ii can place a request for at most YiY_i additional instances of RR while holding the XiX_i …