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
Consider a demand paging system with four page frames (initially empty) and page replacement policy. For the following page reference string the page fault rate, defined as the ratio of number of page faults to the number of memory accesses is …
In the context of operating systems, which of the following statements is/are correct with respect to paging?
Which of the following standard library functions will always invoke a system call when executed from a single-threaded process in a operating system?
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 . Which of the following operations will necessarily require a full scan of …
Three processes arrive at time zero with bursts of and milliseconds. If the scheduler has prior knowledge about the length of the bursts, the minimum achievable average waiting time for these three processes in a non-preemptive scheduler (rounded to nearest integer) is _____________ milliseconds.
Consider the following pseudocode, where is a semaphore initialized to in line and is a shared variable initialized to in line . Assume that the increment operation in line is atomic. 1. int counter = 0; 2. Semaphore S = init(5); 3. void parop(void) 4. { 5. wait(S); 6. …
Which of the following statement(s) is/are correct in the context of scheduling?
Consider the following multi-threaded code segment (in a mix of C and pseudo-code), invoked by two processes and , and each of the processes spawns two threads and : 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 …
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 . The following scheme is used to own a resource instance: function OWNRESOURCE(Resource R) Acquire lock L // a global lock if R …
Consider a three-level page table to translate a bit virtual address to a physical address as shown below: The page size is bytes and page table entry size at every level is bytes. A process is currently using bytes virtual memory which is mapped to …
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?
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?
Each of a set of processes executes the following code using two semaphores and initialized to and , respectively. Assume that is a shared variable initialized to and not used in CODE SECTION P. wait(a); count=count+1; if (count==n) …
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. Assume the head is positioned at cylinder . The scheduler follows Shortest Seek Time First scheduling to service the requests. Which one of the following …
Consider the following set of processes, assumed to have arrived at time . Consider the CPU scheduling algorithms Shortest Job First (SJF) and Round Robin (RR). For RR, assume that the processes are scheduled in the order. …
Consider a paging system that uses -level page table residing in main memory and a for address translation. Each main memory access takes ns and lookup takes ns. Each page transfer to/from the disk takes ns. Assume that the hit ratio is , page fault rate is . …
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 ________________ .
Consider three concurrent processes and as shown below, which access a shared variable that has been initialized to …
Assume that in a certain computer, the virtual addresses are bits long and the physical addresses are bits long. The memory is word addressible. The page size is kB and the word size is bytes. The Translation Look-aside Buffer (TLB) in the address translation path has valid entries. At most how many distinct virtual …
Consider the following snapshot of a system running concurrent processes. Process is holding instances of a resource , . Assume that all instances of are currently in use. Further, for all , process can place a request for at most additional instances of while holding the …
