Computer Science and Information Technology
GATE CSE Operating System PYQs
Build your understanding with focused practice from past exam papers.
Questions 11–20 of 65. Imported answers require independent review unless marked reviewed.
Question 29
Open questionCSNAT1 markNeeds review
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 there will always be a context switch whenever a process requests for an I/O, and also whenever the process returns from an I/O. The number of times the process will enter the ready queue during its life time (not counting the time the process enters the ready queue when it is run initially) is ______. (Answer in integer)
int main()
{
int x=0,i=0;
scanf("%d",&x);
for(i=0; i<20; i++)
{
x = x+20;
printf("%d\n",x);
}
return 0;
}
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 38
Open questionCSMCQ2 marksNeeds review
A computer has two processors,
and
. Four processes
,
,
,
with CPU bursts of 20, 16, 25, and 10 milliseconds, respectively, arrive at the same time and these are the only processes in the system. The scheduler uses non-preemptive priority scheduling, with priorities decided as follows:•
uses priority of execution for the processes as,
, i.e.,
and
have highest and lowest priorities, respectively.
•
uses priority of execution for the processes as,
, i.e.,
and
have highest and lowest priorities, respectively.A process
is scheduled to a processor
, if the processor is free and no other process
is waiting with higher priority. At any given point of time, a process can be allocated to any one of the free processors without violating the execution priority rules. Ignore the context switch time. What will be the average waiting time of the processes in milliseconds?Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 47
Open questionCSMSQ2 marksNeeds review
Consider a demand paging system with three frames, and the following page reference string: 1 2 3 4 5 4 1 6 4 5 1 3 2. The contents of the frames are as follows initially and after each reference (from left to right):
initial | after |
|---|---|
- | 1* 2* 3* 4* 5* 4 1 6* 4 5 1* 3* 2* |
- | 1 1 1 1 1 1 1 6 6 6 6 6 2 |
- | - 2 2 4 4 4 4 4 4 4 4 1 1 |
- | - - 3 3 5 5 5 5 5 5 5 3 3 |
The *-marked references cause page replacements.
Which one or more of the following could be the page replacement policy/policies in use?
Your answerSelect all correct options. You can choose more than one.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 48
Open questionCSMSQ2 marksNeeds review
consists of all active processes in an operating system.
consists of single instances of distinct types of resources in the system.The resource allocation graph has the following assignment and claim edges.
Assignment edges:
,
,
,
(the assignment edge
means resource
is assigned to process
, and so on for others)Claim edges:
,
,
,
,
(the claim edge
means process
is waiting for resource
, and so on for others)Which of the following statement(s) is/are CORRECT?
Your answerSelect all correct options. You can choose more than one.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 51
Open questionCSNAT2 marksNeeds review
A disk of size 512M bytes is divided into blocks of 64K bytes. A file is stored in the disk using linked allocation. In linked allocation, each data block reserves 4 bytes to store the pointer to the next data block. The link part of the last data block contains a NULL pointer (also of 4 bytes). Suppose a file of 1M bytes needs to be stored in the disk. Assume, 1K =
and 1M =
. The amount of space in bytes that will be wasted due to internal fragmentation is _____. (Answer in integer)Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 54
Open questionCSNAT2 marksNeeds review
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 algorithm is as follows:
The OS correctly predicts only up to next 4 page references (including the current page) at the time of allocating a frame to a page.
A process accesses the pages in the following order of page numbers:
1, 3, 2, 4, 2, 3, 1, 2, 4, 3, 1, 4.
If the system has three memory frames that are initially empty, the number of page faults that will occur during execution of the process is ______. (Answer in integer)
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 24
Open questionCS1MSQ1 markNeeds review
Which of the following statements about threads is/are TRUE?
Your answerSelect all correct options. You can choose more than one.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 25
Open questionCS1MSQ1 markNeeds review
Which of the following process state transitions is/are NOT possible?
Your answerSelect all correct options. You can choose more than one.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 25
Open questionCSMSQ1 markNeeds review
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 state (e.g., ready, blocked)?
Your answerSelect all correct options. You can choose more than one.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 37
Open questionCSMCQ2 marksNeeds review
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 is its CPU burst time.
A (0, 10), B (2, 6), C (4, 3), and D (6, 7).
Which one of the following options gives the average waiting times when preemptive Shortest Remaining Time First (SRTF) and Non-Preemptive Shortest Job First (NP-SJF) CPU scheduling algorithms are applied to the processes?
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer