GATE CSE & IT
2,749 questions · 40 years · 20 subjects
Public preview: use this branch page to find high-signal topics and keyed questions. Explanations are being added selectively, starting with recent and recurring concepts.
Worked PYQ examples
Open a few full study-layer explanations before signing in.
A short MSQ where the real trap is subspace closure, not calculation.
Shows how to convert graph wording into a reliable solve path.
Separates a common false intuition from the actual invariant.
Good example of wrong-option autopsy for algorithm statements.
Tests whether the standard theorem is being applied precisely.
Subjects
By Year
High-yield topics
All trends →Practice CSE & IT PYQs
80 questions shown in Operating Systems. Filter for cleaner practice sessions.
With respect to deadlocks in an operating system, which of the following statements is/are FALSE?
Consider a system consisting of $k$ instances of a resource $R$, being shared by 5 processes. Assume that each process requires a maximum of two instances of resource $R$ and a pro...
Consider a system that has a cache memory unit and a memory management unit (MMU). The address input to the cache memory is a physical address. The MMU has a translation lookaside...
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 proc...
Which one of the following CPU scheduling algorithms cannot be preemptive?
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...
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 approa...
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 entrie...
Consider contiguous allocation of physical memory to processes using variable partitioning scheme. Suppose there are 8 holes in the memory of sizes $20 \mathrm{~KB}, 4 \mathrm{~KB}...
Consider a hard disk with a rotational speed of 15000 rpm . The time to move the read/ write head from a track to its adjacent track is 1 millisecond. Initially, the head is on tra...
Consider a CPU that has to execute two types of processes. The first type, Actuators (A), requires a CPU burst of 6 seconds. The second type, Controllers (C), requires a CPU burst...
Consider a demand paging memory management system with 32-bit logical address, 20 -bit physical address, and page size of 2048 bytes. Assuming that the memory is byte addressable,...
Suppose in a multiprogramming environment, the following C program segment is executed. A process goes into I/O queue whenever an I/O related operation is performed. Assume that th...
A computer has two processors, $M_1$ and $M_2$. Four processes $P_1, P_2, P_3, P_4$ with CPU bursts of $20,16,25$, and 10 milliseconds, respectively, arrive at the same time and th...
In optimal page replacement algorithm, information about all future page references is available to the operating system (OS). A modification of the optimal page replacement algori...
$P=\left\{P_1, P_2, P_3, P_4\right\}$ consists of all active processes in an operating system. $R=\left\{R_1, R_2, R_3, R_4\right\}$ consists of single instances of distinct types...
Processes $P 1, P 2, P 3, P 4$ arrive in that order at times $0,1,2$, and 8 milliseconds respectively, and have execution times of $10,13,6$, and 9 milliseconds respectively. Short...
A computer system supports a logical address space of 232 bytes. It uses two-level hierarchical paging with a page size of 4096 bytes. A logical address is divided into a b-bit ind...
Which of the following statements about threads is/are TRUE?
Which of the following process state transitions is/are NOT possible?
Consider the following two threads T1 and T2 that update two shared variables a and b. Assume that initially $a = 1$ and $b = 1$. Though context switching between threads can happe...
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 a...
Consider a memory management system that uses a page size of 2 KB. Assume that both the physical and virtual addresses start from 0. Assume that the pages 0, 1, 2, and 3 are stored...
Which of the following tasks is/are the responsibility/responsibilities of the memory management unit (MMU) in a system with paging-based memory management?
Consider a process P running on a CPU. Which one or more of the following events will always trigger a context switch by the OS that results in process P moving to a non-running st...
Consider a single processor system with four processes A, B, C, and D, represented as given below, where for each process the first value is its arrival time, and the second value...
Consider a multi-threaded program with two threads T1 and T2. The threads share two semaphores: s1 (initialized to 1) and s2 (initialized to 0). The threads also share a global var...
Consider a disk with the following specifications: rotation speed of 6000 RPM, average seek time of 5 milliseconds, 500 sectors/track, 512-byte sectors. A file has content stored i...
Consider a 32-bit system with 4 KB page size and page table entries of size 4 bytes each. Assume 1 KB = $2^{10}$ bytes. The OS uses a 2-level page table for memory management, with...
Which one or more of the following need to be saved on a context switch from one thread (T1) of a process to another thread (T2) of the same process?
Which one or more of the following options guarantee that a computer system will transition from user mode to kernel mode?
Which one or more of the following CPU scheduling algorithms can potentially cause starvation?
Consider the two functions incr and decr shown below. incr() { wait(s); X = X+1; signal(s); } decr() { wait(s); X = X-1; signal(s); } There are 5 threads each invoking incr once, a...
Consider the following two-dimensional array D in the C programming language, which is stored in row-major order: int D[128] [128]; Demand paging is used for allocating memory and...
Consider a computer system with 57-bit virtual addressing using multi-level tree-structured page tables with L levels for virtual to physical address translation. The page size is...
Consider the following threads, T 1 , T 2 and T 3 executing on a single processor, synchronized using three binary semaphore variables, S 1 , S 2 and S 3 , operated upon using stan...
Which of the following statements is/are TRUE with respect to deadlocks?
Which one of the following statements is FALSE?
Consider four processes P, Q, R and S scheduled on a CPU as per round robin algorithm with a time quantum of 4 units. The processes arrive in the order P, Q, R, S, all at time t =...
Consider a demand paging system with four page frames (initially empty) and LRU page replacement policy. For the following page reference string 7, 2, 7, 3, 2, 5, 3, 4, 6, 7, 7, 1,...
Consider the following pseudocode, where S is a semaphore intialized to 5 in line#2 an counter is a shared variable intialized to 0 in line#1. Assume that the increment operation i...
Which of the following statement(s) is/are correct in the context of CPU scheduling?
In the context operating systems, which of the following statements is/are correct with respect to paging?
Which of the following standard C library functions will always invoke a system call when executed from a single-threaded process in a UNIX/Linux operating system?
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...
Consider the following multi-threaded code segment (in a mix of C and pseudocode), invoked by two processes P1 and P2, and each of the processes spawns two threads T1 and T2: int x...
Consider the following statements about process state transitions for a system using preemptive scheduling. I. A running process can move to ready state. II. A ready process can mo...
Consider a paging system that uses a 1-level page table residing in main memory and a TLB for address translation. Each main memory access takes 100 ns and TLB lookup takes 20 ns....
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)...
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...
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...
Consider the following snapshot of a system running $n$ concurrent processes. Process $i$ is holding $X_i$ instances of a resource $\mathrm{R}, 1 \leq i \leq n$. Assume that all in...
The index node (inode) of a Unix-like file system has 12 direct, one single-indirect and one double-indirect pointers. The disk block size is 4 kB , and the disk block address is 3...
Assume that in a certain computer, the virtual addresses are 64 bits long and the physical addresses are 48 bits long. The memory is word addressable. The page size is 8 kB and the...
Consider a process executing on an operating system that uses demand paging. The average time for a memory access in the system is $$M$$ units if the corresponding memory page is a...
Consider a system with $$3$$ processes that share $$4$$ instances of the same resource type. Each process can request a maximum of $$K$$ instances. Resource instances can be reques...
In a system, there are three types of resources: $$E, F$$ and $$G.$$ Four processes $${P_0},$$ $${P_1},$$ $${P_2}$$ and $${P_3}$$ execute concurrently. At the outset, the processes...
Consider a storage disk with $$4$$ platters (numbered as $$0, 1, 2$$ and $$3$$), $$200$$ cylinders (numbered as $$0, 1,$$ … , $$199$$), and $$256$$ sectors per track (numbered as $...
Consider a computer system with ten physical page frames. The system is provided with an access sequence $$\left( {{a_1},{a_2},....,{a_{20}},{a_1},{a_2},...,{a_{20}}} \right),$$ wh...
In which one of the following page replacement algorithms it is possible for the page fault rate to increase even when the number of allocated frames increases?
Consider a disk queue with requests for $${\rm I}/O$$ to blocks on cylinders $$47, 38, 121, 191,$$ $$87, 11, 92, 10.$$ The $$C$$-$$LOOK$$ scheduling algorithm is used. The head is...
Consider a computer system with $$40$$-bit virtual addressing and page size of sixteen kilobytes. If the computer system has a one-level page table per process and each page table...
Consider an arbitrary set of $$CPU$$-bound processes with unequal $$CPU$$ burst lengths submitted at the same time to a computer system. Which one of the following process scheduli...
Consider a non-negative counting semaphore $$S.$$ The operation $$P(S)$$ decrements $$S,$$ and $$V(S)$$ increments $$S.$$ During an execution, $$20$$ $$P(S)$$ operations and $$12$$...
Consider the following processes, with the arrival time and the length of the CPU burst given in milliseconds. The scheduling algorithm used is preemptive shortest remaining-time f...
A system has 6 identical resources and N processes competing for them. Each process can request atmost 2 resources. Which one of the following values of N could lead to a deadlock?
The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently. P1( ) { C = B – 1; B = 2 * C; } P2( ) { D = 2 * B; B = D - 1; } The n...
A file is organized so that the ordering of data records is the same as or close to the ordering of data entries in some index. Then that index is called
A computer system implements $$8$$ kilobyte pages and a $$32$$-bit physical address space. Each page table entry contains a valid bit, a dirty bit, three permission bits, and the t...
The maximum number of processes that can be in $$Ready$$ state for a computer system with $$n$$ $$CPUs$$ is
Consider a uniprocessor system executing three tasks T 1 , T 2 and T 3 , each of which is composed of an infinite sequence of jobs (or instances) which arrive periodically at inter...
Consider a main memory with five page frames and the following sequence of page references: 3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3, 6, 2, 1, 3. Which one of the following is true with res...
Consider six memory partitions of sizes $$200$$ $$KB,$$ $$400$$ $$KB,$$ $$600$$ $$KB,$$ $$500$$ $$KB,$$ $$300$$ $$KB$$ and $$250$$ $$KB,$$ where $$KB$$ refers to kilobyte. These pa...
A computer system implements a $$40$$-bit virtual address, page size of $$8$$ kilobytes, and a $$128$$-entry translation look-aside buffer $$(TLB)$$ organized into $$32$$ sets each...
Suppose the following disk request sequence (track numbers) for a disk with 100 tracks is given: 45, 20, 90, 10, 50, 60, 80, 25, 70. Assume that the initial position of the R/W hea...
Consider a system with byte-addressable memory, 32-bit logical addresses, 4 kilobyte page size and page table entries of 4 bytes each. The size of the page table in the system in m...
Consider the following policies for preventing deadlock in a system with mutually exclusive resources. $$\,\,\,\,\,\,\,{\rm I}.$$ $$\,\,\,\,\,\,$$ Processes should acquire all thei...
For the processes listed in the following table, which of the following scheduling schemes will give the lowest average turnaround time? Process Arrival Time Processing Time A 0 3...
A FAT (file allocation table) based file system is being used and the total overhead of each entry in the FAT is $$4$$ bytes in size. Given a $$100\,\, \times \,\,{10^6}$$ bytes di...
Three processes $$A, B$$ and $$C$$ each execute a loop of $$100$$ iterations. In each iteration of the loop, a process performs a single computation that requires $${t_c}\,\,CPU$$...