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 PYQ2024Operating SystemI/O SchedulingNAT · 2 marks
Consider a 512512 GB hard disk with 3232 storage surfaces. There are 40964096 sectors per track and each sector holds 10241024 bytes of data. The number of cylinders in the hard disk is _________.
Official PYQ2024Operating SystemSystem CallsNAT · 2 marks
Consider the following code snippet using the fork () and wait () system calls. Assume that the code compiles and runs correctly, and that the system calls run successfully without any errors. int x=3; while (x>0){ fork (); printf("hello"); wait (NULL) ; X-- ; } The total number of times the printf statement is executed is __________.
Official PYQ2024Operating SystemMemory Management and Virtual MemoryNAT · 2 marks
Consider a memory management system that uses a page size of 2 KB2 \mathrm{~KB}. Assume that both the physical and virtual addresses start from 00. Assume that the pages 0,1,20,1,2, and 33 are stored in the page frames 1,3,21,3,2, and 00, respectively. The physical address (in decimal format) corresponding to the virtual address 25002500 (in decimal …
Official PYQ2024Operating SystemMemory Management and Virtual MemoryMSQ · 1 mark
​Which of the following tasks is/are the responsibility/responsibilities of the memory management unit (MMU)\text{(MMU)} in a system with paging-based memory management?
Official PYQ2024Operating SystemProcesses and ThreadsMSQ · 1 mark
​​​​Consider a process P\text{P} running on a CPU\text{CPU}. Which one or more of the following events will always trigger a context switch by the OS\text{OS} that results in process P\mathrm{P} moving to a non-running state (e.g., ready, blocked)?
Official PYQ2024Operating SystemCPU SchedulingMCQ · 2 marks
​​​​Consider a single processor system with four processes A, B, C,\text{A, B, C,} and D\text{D}, represented as given below, where for each process the first value is its arrival time, and the second value is its CPU\text{CPU} burst time. A(0,10),B(2,6),C(4,3)\mathrm{A}(0,10), \mathrm{B}(2,6), \mathrm{C}(4,3), and D(6,7)\mathrm{D}(6,7). Which one of the following options …
Official PYQ2024Operating SystemConcurrency and SynchronizationMSQ · 2 marks
​​​​​Consider a multi-threaded program with two threads T1\mathrm{T} 1 and T2\mathrm{T} 2. The threads share two semaphores: s1s1 (initialized to 11) and s2s2 (initialized to 00). The threads also share a global variable x\mathrm{x} (initialized to 00). The threads execute the code shown below. //code of T 1 wait (s1); x = x+1; print (x); …
Official PYQ2024Operating SystemI/O SchedulingNAT · 2 marks
Consider a disk with the following specifications: rotation speed of 60006000 RPM, average seek time of 55 milliseconds, 500500 sectors/track, 512512-byte sectors. A file has content stored in 30003000 sectors located randomly on the disk. Assuming average rotational latency, the total time (in seconds, rounded off to 22 decimal places) to read the …
Official PYQ2024Operating SystemMemory Management and Virtual MemoryNAT · 2 marks
Consider a 3232-bit system with 4 KB4 \mathrm{~KB} page size and page table entries of size 44 bytes each. Assume 1 KB=2101 \mathrm{~KB}=2^{10} bytes. The OS uses a 22-level page table for memory management, with the page table containing an outer page directory and an inner page table. The OS\text{OS} allocates a page for the outer page directory upon …
Official PYQ2023Operating SystemProcesses and ThreadsMSQ · 1 mark
Which one or more of the following need to be saved on a context switch from one thread (T1)\text{(T1)} of a process to another thread (T2)\text{(T2)} of the same process?
Official PYQ2023Operating SystemSystem CallsMSQ · 1 mark
Which one or more of the following options guarantee that a computer system will transition from user mode to kernel mode?
Official PYQ2023Operating SystemCPU SchedulingMSQ · 1 mark
Which one or more of the following CPU\text{CPU} scheduling algorithms can potentially cause starvation?
Official PYQ2023Operating SystemConcurrency and SynchronizationMCQ · 2 marks
Consider the two functions incr\textsf{incr} and decr\textsf{decr} shown below. incr(){ decr(){ wait(s); wait(s); X = X+1; X = X-1; signal(s); signal(s); } } There are 55 threads each invoking incr\textsf{incr} once, and 33 threads each invoking decr\textsf{decr} once, on the same shared variable X\mathrm{X}. The initial value of X\mathrm{X} is …
Official PYQ2023Operating SystemMemory Management and Virtual MemoryNAT · 2 marks
Consider a computer system with 5757-bit virtual addressing using multi-level tree-structured page tables with L\mathrm{L} levels for virtual to physical address translation. The page size is 4 KB(1 KB=1024 B)4 \mathrm{~KB}(1 \mathrm{~KB}=1024 \mathrm{~B}) and a page table entry at any of the levels occupies 88 bytes. The value of L\mathrm{L} is …
Official PYQ2023Operating SystemMemory Management and Virtual MemoryNAT · 2 marks
Consider the following two-dimensional array D\text{D} in the C\text{C} programming language, which is stored in row-major order: int D[128][128]; Demand paging is used for allocating memory and each physical page frame holds 512512 elements of the array D.\text{D}. The Least Recently Used (LRU)\text{(LRU)} page-replacement policy is used by the …
Official PYQ2022Operating SystemConcurrency and SynchronizationMCQ · 1 mark
Consider the following threads, T1,T2,\text{T}_{1}, \text{T}_{2}, and T3\text{T}_{3} executing on a single processor, synchronized using three binary semaphore variables, S1,S2,\text{S}_{1}, \text{S}_{2}, and S3,\text{S}_{3}, operated upon using standard wait()\textsf{wait}() and signal().\textsf{signal}(). The threads can be context switched in any order and at any …
Official PYQ2022Operating SystemDeadlockMSQ · 1 mark
Which of the following statements is/are TRUE\text{TRUE} with respect to deadlocks?
Official PYQ2022Operating SystemMemory Management and Virtual MemoryMCQ · 2 marks
Which one of the following statements is FALSE?\text{FALSE}?
Official PYQ2022Operating SystemCPU SchedulingMCQ · 2 marks
Consider four processes P, Q, R,\text{P, Q, R,} and S\text{S} scheduled on a CPU\text{CPU} as per round robin algorithm with a time quantum of 4 units.4\text{ units.} The processes arrive in the order P, Q, R, S,\text{P, Q, R, S,} all at time t = 0.\text{t = 0}. There is exactly one context switch from S\text{S} to Q,\text{Q}, exactly one context switch from …
Official PYQ2022Operating SystemFile SystemsNAT · 2 marks
Consider two files systems A\text{A} and B\text{B}, that use contiguous allocation and linked allocation, respectively. A file of size 100100 blocks is already stored in A\text{A} and also in B\text{B}. Now, consider inserting a new block in the middle of the file (between 50th50^{th} and 51st51^{st} block), whose data is already available in …