OS 2022 Basic Questions Only
OS 2022 Basic Questions Only
Q1. [MSQ]
Which of the following is/are the functions of operating system?
(a) Sharing hardware among users and allowing users to share data among themselves.
(b) Recovering from errors.
(c) Preventing users from interfering with one another.
(d) Scheduling resources among users.
Q2. [MSQ]
Which of the following instructions is/are privileged (The Instructions that can run only
in Kernel Mode are called Privileged Instructions)?
(a) Set value of timer.
(b) Read the clock.
(c) Clear the Memory or Remove a process from the Memory.
(d) None of the above
Q3. [MSQ]
Which of the following instructions is/are privileged (The Instructions that can run only
in Kernel Mode are called Privileged Instructions)?
(a) Generate any trap instruction.
(b) Turn off all interrupts.
(c) Modify entries in device-status table.
(d) None of the above
Q4. [MSQ]
Which of the following instructions is/are privileged (The Instructions that can run only
in Kernel Mode are called Privileged Instructions)?
(a) Set the system clock.
(b) Read the system clock.
(c) Clear locations in virtual memory
(d) None of the above
Q6. [MSQ]
Which of the following instructions is/are privileged (The Instructions that can run only
in Kernel Mode are called Privileged Instructions)?
(a) Send a character to a printer
(b) Reading the status of Processor
(c) Write a value into the interrupt vector
(d) None of the above
Q12. How did a time-sharing operating system differ from a batch operating system?
(a) The response time was slower on a time-sharing system.
(b) Security was simpler in time-sharing systems.
(c) Time-sharing systems allowed multiple processes to be running simultaneously.
(d) Compared to a batch system many of the scheduling decisions could no longer be
made by the operating system.
Q13. In the following process state transition diagram for a uni-processor system, which of the
arrows is/are invalid transition?
(a) 6 only (b) 4 and 6 only (c) 2, 4 and 5 only (d) 2, 4 and 6 only
Q18. The running process issues an I/O request to the disk. Process X is in which state? ____
Q20. The running process creates a new child process Z. Process X is in which state? ______
Q23. The previously issued I/O request completes. Process X is in which state? _____
P4 80 60 4
P5 85 45 3
Q32. If the CPU scheduling policy is first come first sever, the average turnaround time will
be__________
Q33. If the CPU scheduling policy is round robin with time quantum of 15, the average waiting
time will be__________
Q34. If the CPU scheduling policy is shortest remaining time first, the average waiting time
will be_________
Q35. If the CPU scheduling policy is priority scheduling with preemption, the average
response time will be________
Q38. Using FCFS what is the average turnaround time for the processes?
(a)12.4 (b)11.8 (c)12.6 (d)12.2
Q39. Using SJF, what is the average turnaround time for the processes?
(a)10.2 (b)10 (c)10.4 (d)10.8
Q40. Using SRTF, what is the average turnaround time for the processes?
(a)10 (b)9.8 (c)9.6 (d)9.4
Q41. Using non preemptive priority scheduling, what is the average turnaround time for the
processes?
(a)11 (b)11.2 (c)11.1 (d)10.9
Q42. Using preemptive priority scheduling, what is the average turnaround time for the
processes?
(a)11 (b)11.2 (c)11.1 (d)10.9
Q44. In what order, would these jobs run if the scheduling algorithm were shortest job next?
(a)A,B,C,E,D,
(b)A,C,B,D,E
(c)A,B,C,D,E
(d)A,B,D,C,E
Q45. Consider the following set of processes, with the arrival times and the CPU burst times
given in milliseconds.
Processes Arrival-Time Burst-Time
P1 0 5
P2 1 3
P3 2 3
P4 4 1
What is the average turnaround time for these processes with the preemptive shortest
remaining time first (SRTF) algorithm?
(a) 5.75 (b) 5.50
(c) 6.00 (d) 6.25
P0 0 ms 9ms
P1 1 ms 4ms
P2 2 ms 9ms
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried out
only at arrival or completion of processes. What is the average waiting time for the three
processes?
(a) 5.0 ms
(b) 4.33 ms
(c) 6.33 ms
(d) 7.33 m
Q47. Consider the following set of processes, the length of the CPU burst time given in
milliseconds:
Process Burst Time
P1 6
P2 3
P3 1
P4 7
Assuming the above process being scheduled with the Round-Robin scheduling
algorithm. Which of the following is not true about the average turnaround time?
(a) If the time quantum is 1, then the average turnaround time is 11.
(b) If the time quantum is 2, then the average turnaround time is 11.5.
(c) If the time quantum is 3, then the average turnaround time is 10.75.
(d) If the time quantum is 5, then the average turnaround time is 10.5.
Q56. Consider three CPU-intensive processes, which require 10, 20 and 30 time units and
arrive at times 0, 2 and 6, respectively. How many context switches are needed if the
operating system implements a round robin scheduling algorithm with time quantum of
4? Do not count the context switches at time zero and at the end.__________
Q64. Consider a system where there are 3 processes, A, B, and C. Their details are as follows
Burst Time
Processes Arrival Time
CPU IO CPU IO CPU
A 0 3 4 2 6 6
B 2 2 5 4 5 4
C 4 5 2 3 3 5
Assume that I/O can be overlapped as much as possible. What is the completion time for
C with FCFS scheduling?
(a) 34 (b)35
(c)36 (d)37
Q68. If we have only one process in ready queue with burst time "m", then how many context
switching will happen using round robin scheduling with time quantum q, where q<m.
Assume that dispatching the process first time is not counted as a context switch.
(a) 1 (b) (m/q) – 1 (c) 0 (d) m/q
Q69. [MSQ]
Which of the following is/are true:
(i) Starvation could occur on an OS with non-preemptive scheduling
(ii) Starvation could occur on an OS with preemptive scheduling
(iii) Deadlock could occur on an OS with non-preemptive scheduling
(iv) Deadlock could occur on an OS with preemptive scheduling
Q71. Process waiting time is given with the probability p. There are n processes in the memory
then the CPU utilization is given by,
(a) p/n (b) pn (c)1-pn (d) n-(pn)
Q73. The next CPU burst of the newly arrived process may be shorter than what is left of the
currently executing process. A______will preempt the currently executing process
(a) preemptive priority scheduling algorithm
(b) non-preemptive SJF algorithm
(c) preemptive SJF algorithm
(d) First-Come, First-Served Scheduling
Q75. In Round-Robin scheduling algorithm, If the CPU burst of the currently running process
is longer than 1 time quantum. In this case:
(a) The timer will go off and will cause an interrupt to the operating system. A context
switch will be executed, and the process will be put at the rear of the ready queue, The
CPU scheduler will then select the next process in the ready queue.
(b) the timer will go off and will cause an interrupt to the operating system. A context
switch will be executed, and the process will be put at the front of the ready queue, The
CPU scheduler will then select the next process in the ready queue
(c) the process itself will release the CPU voluntarily. The scheduler will then proceed to
the next process in the ready queue
(d) the process itself will not release the CPU voluntarily. The scheduler will then proceed
to the next process in the ready queue
Q77. [MSQ]
Which of the following statements is always not true about the multilevel feedback queue
Scheduling.
(a) It has better response time than SJF
(b) Like SJF, the starvation is a possible problem.
(c) The short interactive jobs tend to have shorter waiting time than the batch jobs.
(d) It is a combination of priority scheduling and round robin scheduling with different
quantum.
Q78. [MSQ]
Which of the following statement is/are True for Aging
(a) Aging involves gradually increasing the priority of processes that wait in the system
for a long time
(b) Aging involves gradually decreasing the priority of processes that wait in the system
for a long time
(c) Aging involves gradually increasing the priority of processes that wait in the system
for a small time
(d) Aging involves gradually decreasing the priority of processes that wait in the system
for a small time
Q80. Consider an OS with MLFQ scheduling algorithm, the scheduler supports multiple
queues with different priorities. Each queue use Round Robin scheduling, running the
jobs in highest priority queue first (a lower number queue has higher priority), Once
process finish its time quanta, scheduler place the process into the next highest priority
queue, Round robin time slice increases exponentially at lower priorities. A process
scheduled from RQ0 is allowed to execute for one time unit and then is preempted; a
process scheduled from RQ1 is allowed to execute two time units, and so on. In general,
a process scheduled from RQi is allowed to execute 2i time units before preemption. When
a process moves from one queue to next higher queue, it is added to the end of the queue.
Process Arrival Time CPU Burst Time
A 0 3
B 2 6
C 4 4
D 6 5
E 8 2
Assume that all processes arrived in the highest priority queue, and that the scheduler
will run the process at the head of queue. Assume processes spent at most 2i time unit in
RQi queue either it execute partially or continuously. What is the Average Turnaround
Time for the all process? ______________
Q81. When a process creates a new process, which of the following happens?
(a) A child can execute only after its parent has terminated.
(b) The parent continues to execute concurrently with its children.
(c) The parent can execute only after all its children have executed and terminated.
(d) Either (a) or (c)
Q82. When a process is created using the classical fork() system call, which of the following is
not inherited by the child process?
(a) process address space (b) process ID
(c) user ID (d) open files
Q85. [MSQ]
Which statements is/are TRUE about fork ()?
(a) It creates a child process which can share the global variables of parent process.
(b) It creates a child process which shares the address space of the parent process.
(c) It creates a child process which cannot be terminated till parent is terminated.
(d) Child process is automatically terminated if parent is terminated.
(e) fork () returns PID of parent to child and PID of child to parent.
Q86. How many times does the following program print “Hello World”?_______________
#include<stdio.h>
#include<unistd.h>
int main()
{
int i;
for (i = 0; i < 3; i++){ fork();}
printf("Hello World\n");
return 0;
}
Q98. [MSQ]
Which of the following is/are FALSE statements?
(a) The code that changes the system clock runs in user mode.
(b) Without kernel-level support, when a user-level thread blocks, it will block all the
other threads in the same process.
(c) Context switching between two kernel threads has about the same overhead as that
between two user processes.
(d) A thread can be blocked on multiple condition variables simultaneously.
Q101. [MSQ]
Which of the following statements regarding threads is/are true?
(a) Threads are cheaper to create than processes.
(b) All kernel-scheduled threads of a process share the same virtual address space.
(c) Threads are cheaper to context switch than processes.
(d) None of the above
Q102. [MSQ]
Which of the following statements regarding threads is/are true?
(a) Kernel-scheduled threads are cheaper to create than user-level threads.
(b) A blocking kernel-scheduled thread blocks all threads in the process.
(c) Different user-level threads of the same process can have different scheduling
priorities.
(d) None of the above
Q103. A thread shares its resources (like data section, code section, open files, signals) with:
(a) Other process similar to the one that the thread belongs to
(b) Other threads that belong to similar processes
(c) Other threads that belong to the same process
(d) All of the above
Q106. In a 1:1 threading model, what happens to the other threads when one thread makes a
blocking system call?
(a)They may be scheduled
(b) All the other threads will blocked
(c) It’s depend on operating system
(d) can’t say anything
Q107. [MSQ]
Which of the following statements regarding threads is/are true?
(a) In many-to-many model, you can map a user-level thread to more than one
lightweight process, which allows the thread to continue even if a blocking call was
made to one of the kernel threads (mapped to the user-level thread).
(b) In many-to-one model, we have multiple user-level threads mapped to one kernel-
level thread. When a user-level thread makes a blocking system call, the entire process
blocks.
(c) In one-to-one model, we have one user-level threads mapped to one kernel-level
thread. When a user-level thread makes a blocking system call, the entire process
blocks.
(d) None of the above
Q109. What percentage of CPU time will P1 get if the threads are user threads? __________
Q3. Consider the following two-thread program, where initially value of integer counter =
0:
Thread T Thread U
main() main()
{ {
int cnt; int cnt;
cnt = counter; cnt = counter;
cnt = cnt + 1; cnt = cnt + 1;
} print(cnt);
}
What do the above threads print?
(a) it’s always print 0
(b) It’s always print 1
(c) it sometimes print 0 and sometimes print 1
(d) it sometimes print 1 and sometimes print 2
Q5. [MSQ]
Assume that s is the mutex semaphore. Which of the following order of statements
is/are deadlock or violation of mutual exclusion?(assume s=1)
1. Signal(s); critical_section(); Wait(s);
2. Wait(s); critical_section(); Signal(s);
3. critical_section(); Signal(s);
4. Wait(s); critical_section(); Wait(s);
5. Wait(s); Wait(s); critical_section(); Signal(s); Signal(s)
Q6. In a certain application, the initial value of a counting semaphore s is 10. The following
operations were completed on the semaphore in the given order 8P, 5V, 5V, 8P, 5V, 10P,
12V. The new value of counting semaphore s is ____________
Q7. Let S be the counting semaphore variable S = 5 initially. Assume that no blocked
processes exist in the system. The following signal (V), wait (P) operations are
performed: 4 P, 6 V, 9 P, 13 V, and 14 P. The numbers of blocked processes at the end
are _________.
Q8. In a certain application, the initial value of a counting semaphore S is 10. The following
operations were completed on the semaphore in the given order 5P, 20P, 2V, 18P, 5V,
10P, 1V. The new value of counting semaphore is ____________
Q9. What is value of binary semaphore "S" after executing 10 P (Wait) operations and 14 V
(Signal) operations if the initial value of "S" is 1?_________
Q12. Consider the program below, with the three binary semaphores:
Binary semaphore SA = 0, SB = 0, SC =
1;
Process A Process B Process C
While(1) While(1) While(1)
{ { {
wait(SB); wait(SC); wait(SA);
print(A); print(B); print(C);
signal(SC); signal(SA); signal(SB);
} } }
What does the program print?
(a) ABCABCABC… (b) BACBACBAC…
(c) BCABACBCA… (d) BCABCABCA…
Q14. What is the maximum number of times D’s get printed when the set of these processes
runs?
(a) 3 (b) 4 (c) 5 (d) 6
Q17. [MSQ]
Consider that following three concurrent process P1, P2 and P3 are running on the
system. int count = 10;
Semaphore Lock = 1; // initial value is 1
P1 P2 P3
{ { {
// do something // do something // do something
wait(lock); wait(lock); wait(lock);
count++; count−−; printf(‘‘%d’’, count);
signal(lock); signal(lock); signal(lock);
} } }
What are the possible outputs of this program when all three processes terminated?
(a) 9 (b) 10 (c) 11 (d) 12
Q24. [MSQ]
Consider the following two process solution to critical section problem
Boolean flag[2] ={FALSE , FALSE}
Process Pi
do {
while (flag[j]);
flag[i] = TRUE;
critical section
flag [i] = FALSE;
remainder section
} while (TRUE);
Which of the following solution is/are satisfied.
(a) Mutual exclusion (b) Bounded wait
(c) Progress (d) None of these
Process Pi
do {
flag[i] = true;
While (flag[j]);
Critical section
flag [i] = false;
remainder section
}while (1)
Which one of the following statements describes the properties achieved?
(a) Mutual exclusion but not progress
(b) Progress but not mutual exclusion
(c) Neither mutual exclusion nor progress
(d) Both mutual exclusion and progress
(c) (d)
wait(a);count = count + 1 wait(a); count=count+1;
if (count == n) signal(b); if (count==n) signal (b);
wait(b); signal(b); signal (a); wait (b);
signal(a) signal (b);
Data for the next two questions. Consider the following code for accessing a shared - buffer that
contains very large number of elements (i.e. max). There is multiple producer consumer process
access this code concurrently. Assume the initial value of mutex is zero and that buffer is initially
empty. Assume the semaphore empty is initialized to max and fill is initialized to 0. (lock =0
means lock is available)
Producer() { Consumer() {
0. while(true) { 0. while(true) {
1. lock(mutex) // p1 1. lock(mutex) // c1
2. if (buffer == max) // p2 2. if (buffer == 0) // c2
3. wait(empty) // p3 3. wait(fill) // c3
4. do_fill(i) // p4 4. int tmp = do_get(); // c4
5. signal(fill) // p5 5. signal(empty); // c5
6. unlock(mutex) // p6 6. unlock(mutex); // c6
7. } 7. }
Q35. If a producer process P executes all the lines from P1 to P6. Then which line consumer
will not able to execute if it Scheduled after producer?
(a) c1
(b) c3
(c) c5
(d) all lines execute
Q36. [MSQ]
What is/are the problem(s) in this code?
(a) If producer acquire lock when buffer is full then deadlock can occurred.
(b) If consumer acquires lock when buffer is empty then deadlock can occurred.
(c) If producer produce item continuously and consumer doesn’t consume it then
buffer overflow condition is occurred.
(d) None of the above.
wait(mutex);
readcount--;
if(readcount == 0)
signal(wrt);
signal(mutex);
}
What is the problem associated with the above solution?
(a) Mutual Exclusion is not ensured in the above solution.
(b) Writer process cannot proceed, i.e., there is no progress.
(c) Multiple writer process can modify the data.
(d) There is no problem associated with the above solution.
8. wait(mutex);
9. readers_count = readers_count - 1;
10. if(readers_count == 0) signal(data);
11. signal(mutex);
12. }
13. }
What happens when positions of lines 10 and 11 in reader code are interchanged?
(a) No problem, the solution works fine.
(b) Multiple readers and writers or multiple writers are allowed in the database at the
same time.
(c) There is possibility of deadlock.
(d) None of the above
BASIC OPERATING SYSTEM Page 39
Q39. [MSQ]
Which of the following is a valid solution to the Dining Philosopher’s Problem
(guarantees that some philosopher will eat and the solution must be starvation free)?
(a) Number the chopsticks. Pick up the chopstick with the lower value first, then the
higher value
(b) Pick up the left chopstick first, then the right chopstick
(c)Pick up the left chopstick. If the right chopstick is not on the table, set the left
chopstick down.
(d) None of the above
Q40. [MSQ]
Consider the following two scenarios in the dining philosophers problem:
i. First a philosopher has to enter a room with the table that restricts the number of
philosophers to n-1.
ii. There is no restriction on the number of philosophers entering the room.
Which of the following is/are true?
(a) Deadlock is possible in both (i) and (ii).
(b) Deadlock is possible in (ii) only.
(c) Starvation is possible in both (i) and (ii).
(d) Starvation is possible in (i) only.
Q41. Consider a pseudo code semaphore implementation of the Dining Philosophers’
problem. The semaphores are initialized to 1.
while(true) {
status = "waiting"
wait(left)
wait(right)
status = “eating”
signal(left)
signal(right)
status = "thinking"
}
In the above pseudo code solution to the Dining Philosophers’ problem, what could
go wrong?
(a) An unlucky process might never be able to get both left and right forks
simultaneously, even though other processes are eating.
(b) All processes might pick up one fork causing deadlock.
(c) Nothing is wrong; this is a good solution to the problem.
(d) Some processes will get extra turns to eat on a regular basis, violating the principle
of fair treatment.
++
Which process (es) is/are in a deadlock?
(a) P2 only (b) P3 only (c) P2 and P3 only (d) All the above
Q44. [MSQ]
Which process (es) is/are in a deadlock in the following resource allocation graph?
(a) P1 only (b) P2 only (c) No process is/are in deadlock (d) P1, P2 and P3
Q46. Suppose here are n processes in the system and each one needs k instances of a
resources to complete. What would be the minimum number of resources that you
should keep in the system to ensure no deadlock in the system?
(a) n*k (b)n*k-n+1 (c)n*k+1 (d)n*k*k
Q47. A system is having 3 user processes each requiring 2 units of resource R. The minimum
number of units of R such that no deadlock will occur-_________
Q48. A computer has 6 tape drives, with n processes competing for it. Each process may need
2 drives. For which maximum values of n is the system deadlock free?
(a) 4 (b) 5 (c) 6 (d) 7
Q49. A system is having 3 user processes P1, P2 and P3 where P1 requires 2 units of resource
R, P2 requires 3 units of resource R, P3 requires 4 units of resource R. The minimum
number of units of R that ensures no deadlock is _____?
Q50. Consider a system having 𝑝 processes, where each process needs a maximum of 𝑚
instances of resource type R1. Given that there are 𝑟 instances of resource type R1 in
total, what is the minimum value of r to ensure that the system is deadlock-free?
(a) 𝑟 ≥ (𝑚 − 1) + 1 (b) 𝑟 ≥ (𝑚) + 1
(c) 𝑟 ≤ (𝑚 − 1) + 1 (d) 𝑟 ≤ (𝑚 − 1)
From the perspective of deadlock avoidance using Banker’s algorithm, which one of
the following is true?
(a) The system is in safe state
(b) The system is not in safe state, but would be safe if one more instance of B were
available
(c) The system is not in safe state, but would be safe if one more instance of C were
available
(d) The system is not in safe state, but would be safe if one more instance of D were
available
Notes
Suppose that the number of available resources of each type is given in the table. What
is the lowest value of x for which this is a safe state?
(a) 0 (b) 1
(c) 2 (d) System always in deadlock for any value of x
Q57. Consider the following snapshot of a system's states, with three processes and four
allocatable resources. The current allocated and requested resources are as follows:
Current Allocated Current Need Available
Processes
R1 R2 R3 R4 R1 R2 R3 R4 R1 R2 R3 R4
A 2 1 1 1 1 0 0 0 0 0 1 1
B 1 1 0 1 0 2 X 2
C 1 1 Y 1 0 0 1 0
Where, X and Y are two unknowns. What should the relationship between X and Y be
to ensure all three processes can run to completion?
(a) X <= Y – 1 (b) X >= Y – 2
(c) X <= Y + 2 (d) X = Y
Q58. Suppose n processes, P1,…,Pn share m identical resource units, which can be reserved
and released one at a time. The maximum resource requirement of process Pi is si,
where si>0. Which one of the following is a sufficient condition for ensuring that
deadlock does not occur?
(a) ∀i, si<m
(b) ∀i, si<n
(c) ∑𝑛𝑖=1 s𝑖 < (𝑚 + 𝑛)
(d) ∑𝑛𝑖=1 s𝑖 < (𝑚 × 𝑛)
Q60. Which one of the following conditions guarantees that no other process apart from p
and q can complete execution?
(a) Xp+Xq< Min{Yk| 1 ≤ k ≤ n, k ≠ p, k ≠ q}
(b) Xp + Xq < Max{Yk| 1 ≤ k ≤ n, k ≠ p, k ≠ q}
(c) Min(Xp, Xq) ≥ Min{Yk| 1 ≤ k ≤ n, k ≠ p, k ≠ q}
(d) Min(Xp, Xq) ≤ Max{Yk| 1 ≤ k ≤ n, k ≠ p, k ≠ q}
Q3. In ……………….. , there is a inefficient use of processor due to the need for
compaction to counter external fragmentation.
(a) Fixed partitioning (b) Dynamic partitioning
(c) Virtual memory paging (d) Simple segmentation
Q4. [MSQ]
Which of the following statements is/are false?
(a) External fragmentation is a problem with fixed partitioning memory management
techniques.
(b) Internal fragmentation is a problem with variable partitioning memory management
techniques.
(c) Memory compaction is employed to counteract internal fragmentation.
(d) Dynamic relocation requires memory compaction.
Q5. [MSQ]
Which of the following statements is/are TRUE?
1. Memory compaction requires dynamic relocation.
2. First-Fit is a replacement algorithm.
3. Best-Fit generally causes less fragmentation than First-Fit.
4. A function of a linker is to combine several object modules into a single load
module.
Q7. If the placement algorithm is best-fit, then a program with size 13KB is placed in which
of the above free segment?
(a) 17 KB (b) 25 KB (c) 14 KB (d) 12 KB
Q8. If the placement algorithm is worst-fit, then a program with size 13KB is placed in
which of the above free segment?
(a) 17 KB (b) 25 KB (c) 14 KB (d) 12 KB
Q9. If the placement algorithm is next-fit and the last allocated segment is 14KB, then a
program with size 13KB is placed in which of the above free segment?
(a) 17 KB (b) 25 KB (c) 14 KB (d) 12 KB
Q10. Any .................. mechanism must have the flexibility to allow several processes to access
the same portion of main memory.
(a) Relocation (b) protection (c) sharing (d) organization
Data for the next three question. Suppose the free holes in memory is kept in a linked list of
H1(300KB), H2(200KB), H3(600KB), H4(100KB), and H5(500K), in that order. Four processes,
P1(189KB), P2(252KB), P3(433KB) and P4(525KB) arrive in that order. How will the processes
be placed in the free holes according to following three placement algorithms?
Q11. First-fit
(a) P1 in H2, P2 in H3, P3 in H5, P4 cannot be placed.
(b) P1 in H1, P2 in H3, P3 in H5, P4 cannot be placed
(c) P1 in H2, P2 in H4, P3 in H5, P4 in H3
(d) P1 in H1,P2 in H4, P3 in H3, P4 in H5
Q13. Worst-fit
(a) P1 in H2, P2 in H1, P3 in H5, P4 in H3
(b) P1 in H5, P2 in H3, P3 and P4 cannot be placed
(c) P1 in H3, P2 in H5, P3 and P4 cannot be placed
(d) P1 in H1, P2 in H3, P3 in H5, P4 cannot be placed
Q14. A computer provides the user with virtual address space of 230 words or 1G word. Pages
of size 1024 words or 1K word are used for implementing virtual memory where the
byte addressable main memory is equal to 220 bytes or 1MB. If the virtual address is
(11223344)16 and the word size is 32-bits, then the value of page number and page offset
in decimal respectively is
(a) 11223, 344 (b) 280716, 836
(c) 4488C, 344 (d) 70179, 836
Q15. Consider a logical address space of 64 pages of 1024 words each, mapped onto a physical
memory of 32 frames. If the physical memory is word addressable and word size is 32-
bits, then the number of bits is in the logical address and in the physical address
respectively is
(a) 15, 16 (b) 16, 15
(c) 18, 17 (d) 17, 18
Data for the next four questions. Consider the virtual memory system with 42-bit virtual
addresses and 38-physical addresses, in which memory is allocated in 8 KB pages. Suppose a
single-level page table is used, in which you also store three metadata bits for each page:
Writable, Executable and Valid.
Q16. How long, in bits, is a virtual page number? ________
Q19. Assume that page table entries are stored in multiple of 8. How long, in bytes, page
table entry? _______
Q20. A computer provides the user with virtual address space of 232 bytes or 4 GB. Pages of
size 4096 bytes or 4KB are used for implementing virtual memory where the byte
addressable main memory is equal to 220 bytes or 1MB. If the virtual address is
(12345678)16, then the value of page offset in decimal is____________
Q21. A computer provides the user with virtual address space of 232 bytes or 4 GB. Pages of
size 4096 bytes or 4KB are used for implementing virtual memory where the byte
addressable main memory is equal to 220 bytes or 1MB. If the virtual address is
(12345678)16, then the value of page number in decimal is___________
Q22. A computer provides the user with virtual address space of 230 bytes (or 1 GB). Pages
of size 1024 bytes (or 1KB) are used for implementing virtual memory where the byte
addressable main memory is equal to 220 bytes or 1MB. If the virtual address is
(12345678)16, then the value of page offset in decimal is___________
Q23. A computer provides the user with virtual address space of 230 bytes or 1 GB. Pages of
size 1024 bytes or 1KB are used for implementing virtual memory where the byte
addressable main memory is equal to 220 bytes or 1MB. If the virtual address is
(12345678)16, then the value of page number in decimal is_________
Q24. Assume a virtual memory addressing space of 16 GB and a physical memory addressing
space of 4 GB. Let the size of a page be 4 Kbytes. The number of page table entries in the
single level page table is_______
Data for the next two questions. A paging system uses 16-bit address and 4K pages. The
following shows the page tables of two running processes, Process 1 and Process 2. Translate
the logical addresses in the table below to their corresponding physical addresses.
Q25. The physical address corresponding to logical address 11034 generated by process 1(in
decimal)_______
Q31. Consider the virtual memory system with 42-bit virtual addresses and 38-physical
addresses, in which memory is allocated in 8 KB pages. Suppose a single-level page table
is used, in which you also store three metadata bits for each page: Writable, Executable
and Valid. How many pages are required to store the page table of each process?
____________
Q33. Consider a machine with a physical memory of 8 GB, a page size of 8 KB, and a page
table entry size of 4 bytes. How many levels of page tables would be required to map a
46-bit virtual address space if every page table fits into a single page? ___________.
Data for the next five questions. Consider the virtual memory system with 32-bit virtual
addresses, 25-bits physical addresses and a page size of 4 KB or 4096 bytes. Suppose a single-
level page table is used, and each entry of page table store three metadata bits for each page.
Assume that page table entries are always byte aligned.
Q34. How many bits of each virtual address are needed to represent the page number? ___.
Q35. How many bits of each physical address are needed to represent the frame number? _.
Q36. How many bits of each virtual address are needed to represent the page offset? ______
Q37. How many bytes are required to represent page table entry? ________
Q38. How much memory is required to store single level page table of each process?
(a) 1 MB (b) 2 MB (c) 3 MB (d) 4 MB
Data For the next two questions, consider a virtual memory system with the following
properties:
12-bit virtual byte address
256-byte pages
65536 bytes of physical memory
The system uses a single level page table. The contents of the page table are partially shown
below (where VPN: Virtual page number and PPN: Physical page number)
Q39. What is the total size of the page table(in byte) for each process on this machine,
assuming that the valid, protection, dirty, and use bits take a total of 4 bits and that all
the virtual pages are in use?________
Data for the next four questions. Consider a paged virtual memory system. Suppose the page
table for the process currently executing on the processor looks like the following.
All numbers are decimal, everything is numbered starting from zero, and all addresses are
memory byte addresses. The page size is 1024 bytes.
Q41. If the virtual address is 4000, then the physical address in decimal is
(a) 928 (b) 7341
(c) 3130 (d) page fault
Q42. If the virtual address is 2221, then the physical address in decimal is
(a) 928 (b) 7341
(c) 3130 (d) page fault
Q43. If the virtual address is 1052, then the physical address in decimal is
(a) 928 (b) 7341
(c) 3130 (d) page fault
Q44. If the virtual address is 52, then the physical address in decimal is
(a) 928 (b) 7341
(c) 3124 (d) 3130
Data for the next two questions. A CPU generates 40 - bit virtual addresses which is converted
into 32 - bits physical address using TLB. The page size is 8 KB. The processor has a translation
look-aside buffer (TLB) which can hold a total of 64 page table entries and is 16-way set
associative.
Q45. Assume that the TLB tag does not store any process id. The minimum length of the TLB
tag in bits is:________
Data for the next two questions. Imagine a system has the following parameters:
Virtual addresses are 18 bits wide.
Physical addresses are 16 bits wide.
The page size is 1024 bytes.
The TLB is 4-way set associative with 16 total entries.
The contents of the TLB and the first 32 entries of the page table are shown as follows. All
numbers are given in hexadecimal.
Q47. For the given virtual addresses 0x1FAA4, what is the value of TLB index in
binary?_____ Solution: Page size = 1024 bytes number of bit required for it 10 bit
Q48. What is physical address corresponding to the virtual address? (in decimal)__________
Q49. Which of the following virtual addresses result into TLB Miss?
(a) 0x0FFF (b) 0x7A28
(c) 0x3DAD (d) 0x3A98
Q50. Which of the following virtual addresses result into page fault?
(a) 0x3DAD (b) 0x3A98
(c) 0x1C19 (d) 0x7000
Data for the next three questions. Consider processor with 32-bit virtual addresses. The
memory management unit expects a two-level page table. Each process has a page directory,
each entry of which can point to a page table. The upper 6 bits of an address determine the page
directory index, the next 10 bits determine the index in the second-level page table, and the
bottom 16 bits determine the offset.
Q51. How many entries are in a page directory? ___________
(a) 64 (b) 1024 (c) 65536 (d) none of the above
Q55. What is the size of memory (in bytes) required for storing the all page tables for a process
that requires 1 MB of memory?
Data for the next two questions. Consider a processor has virtual address 50-bits, the physical
address is 32 bits and the page size is 16KB. Each individual table at any level of the page table
occupies a single page of physical memory. Using multilevel paging, consider page table entry
requires additional 14 bits for the special purpose?
Q56. Which of the following is the correct division of virtual address?
(a) <12, 12, 12, 14 > (b) <6, 10, 10, 10, 14 >
(c) <10, 12, 14, 14 > (d) <14, 12, 10, 14>
Q57. How many entries are there in each individual page table?_____________
For the next six questions, consider an architecture using segmentation with paging. In this
architecture, the 32-bit virtual address is divided into fields as follows:
4 bit segment number 12 bit page number 16 bit offset
Here are the relevant tables (all values in hexadecimal):
Segment Table Page Table A Page Table B
0 Page Table A 0 CAFE 0 F000
1 Page Table B 1 DEAD 1 D8BF
X (rest invalid) 2 BEEF X (rest invalid)
3 BA11
x (rest invalid)
Q60. Number of segments
(a) 4 (b) 8 (c) 16 (d) 32
Q61. Maximum size of each segment
(a) 4 MB (b) 64 MB (c) 256 MB (d) 32 MB
Q62. Size of each page
(a) 4 KB (b) 64 KB (c) 256 KB (d) 32 KB
Q63. Maximum number of pages per segment.
(a) 4 K (b) 64 K (c) 256 K (d) 32 K
Q65. Find the physical address corresponding to each of the following virtual addresses
(answer "bad virtual address" if the virtual address is invalid):
Virtual addresses: i. 00000000 ii. 20022002 iii. 10015555
Physical addresses: a. 0xD8BF5555 b. 0xCAFE0000 c. bad virtual address
(a) i-a, ii-b, iii-c
(b) i-b, ii-c, iii-a
(c) i-b, ii-a, iii-c
(d) None of these
Q66. A machine has 48-bit virtual addresses and 32-bit physical addresses. Pages are 8K. How
many entries are needed for an inverted page table?
(a) 219 (b) 235
(c) 232 (d) 24
For the next two questions, consider the following information:
32-bit virtual address space
4 KB page size
4 GB physical memory
16 bits for process ID
12 bits of access information
4 byte page table entry size
Each single-level page table entry stores bits for access information and physical page
number.
Each inverted page table entry stores bits for access information, process ID and virtual page
number.
Assume that page table entries are always byte aligned.
Q67. How much space (in MB) is needed in memory for a single-level page table? _____
Q68. How much space (in MB) is needed in memory for an inverted page table? _______
Q70. If we add TLB, and 75% of all page-table references are found in the TLB, what is the
effective memory reference time? (Assume that finding a page-table entry in the TLB
takes zero time, if the entry is there.)_________ns.
Q71. What if the time to access the TLB is actually 2 ns and 75% of all page references are found
in TLB? _______ns.
Q72. Consider a paging system with the single level page table, which is stored in memory. A
memory reference takes 200 nanoseconds to access a page in memory, and a page fault
takes 400 nanoseconds. If 75% of all page-table references are found in the physical
memory, what is the effective address translation time?_________ns.
Q73. A computer system has a page fault rate is 60% and page fault service time is 25
milliseconds and a memory access time is 100 ns, the effective access time with single
level page table in ms is____________
Q75. What is the total access time if the page is not found in the TLB but is found in the page
table?
(a) 20 ns (b) 100 ns (c) 120 ns (d) 220 ns
Q76. What is the total access time if a page is not found in the TLB and the page table
(assume that all pages currently in memory are dirty)?
(a) 10000120 ns (b) 10000200 ns (c) 10000020 ns (d) 5000220 ns
Q78. Assume that a main memory access takes 100 ns. If we are using a two-level page table
and have a 50% TLB hit ratio, the effective memory access time is (assume no memory
cache and no page faults):
(a) 100 ns (b) 200 ns (c) 300 ns (d) 400 ns
Q79. Let TLB hit ratio is 80% and assume memory access time is 100 ns. One TLB miss requires
extra memory access to the page table for the frame number. The Effective Access Time
to read a virtual address is ______ % slowdown, compared to no-paging.
Q80. What is the probability of a page fault, using demand paging, if the effective access time
is 10microseconds, the RAM access time is 250 nanoseconds, and the page fault time is
200 milliseconds? Assume that accessing the page table entry takes no time.
(a) 0.0049 % (b) 1 % (c) 0.00025 % (d) 0.5 %
Q82. Consider a computer that has a page size of 1024 bytes. Consider the following virtual
address reference string for a
process:350,2054,3320,2441,2220,1321,3764,2944,5200,410,5011,4090,3550,25,100.
The number of page faults generated for this string when the page replacement policy is
optimal and there are three page frames are allocated to process is__________
Q83. What is the minimum number of page faults for an optimal page-replacement strategy
for the reference string 1,2,3,4,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2 with four page
frames?____________
Q84. What is the minimum number of page faults for a FIFO page-replacement strategy
for the reference string 1,2,3,4,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2 with three page
frames?____________
Q85. What is the minimum number of page faults for a LRU page-replacement strategy
For the reference string 1,2,3,4,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2 with four page
frames?___________
Q87. What is the minimum number of page faults for a Second Chance (clock) page-
replacement strategy for the reference string 1,2,3,4,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2 with
three page frames?__________
For next two questions you are given the following reference string for a process:
0123413123123121341341210
Q92. For the clock page replacement algorithm, let the number of page hits is x and the page
fault is y then what is the value of x+ y? If frame size is 3.
(a) 19 (b) 15 (c) 20 (d) 25
Q93. What is the working set (WS) at the end of the execution if Δ(window size) = 4)?
(a) {0,1,2} (b) {1,2,3,4} (c) {0,1,2,3} (d){4,1,2}
Q2. [MSQ]
Which of the following statement is/are correct?
(a) A contiguous allocation is the best allocation policy.
(b) An indexed allocation policy affords faster information retrieval than the chained
allocation policy.
(c) Absolute path names begin by identifying path from the root.
(d) None of the above
Q3. Which two schemes are commonly used to manage disk free-space?
(a) Hash and linked list (b) Hash and bit-vector
(c) FIFO and bit-vector (d) Bit vector and linked list
Q4. The FAT approach is an optimization of which other approach? What optimization
does it perform?
(a) Linked (b) Indexed
(c) Contiguous (d) Extent-based
Q5. Extent-based allocation allows a file to consist of multiple contiguous regions instead
of just a single contiguous region. Therefore, when the file grows, if there is no free
space at the end of the last region, a new extent can be added.Extent-based allocations
allow files to grow more easily than which other allocation policy?
(a) Linked (b) Contiguous
(c) FAT (d) Multi-level Indexed
Q8. Which allocation schemes may limit the maximum size of a file to less than that of the
entire disk even when this is the only file on the disk?
(a) Linked (b) Contiguous
(c) FAT (d) Multi-level Indexed
Q9. Match the file allocation algorithm with the meta-data that it requires to track where all
of the file-data is located. Select the single best answer and use each response only once.
1. Linked a. Single pointer to file-data and its size
2. Indexed b. Array containing multiple pointers and their sizes
3. Contiguous c. Pointer to first block of file
4. Extent-based d. Array containing pointers to every block of file
(a) 1 – c, 2 – d, 3 – a, 4 – b (b) 1 – a, 2 – d, 3 – c, 4 – b
(c) 1 – c, 2 – a, 3 – d, 4 – b (d) 1 – a, 2 – d, 3 – b, 4 – c
Q10. Similarities exist between policies for allocating blocks on disk to files and policies for
allocating physical memory to processes. Match the file allocation policy with the most
similar memory allocation policy; note that each memory allocation policy may be used
more than once.
1. Linked a. Base and Bounds
2. Multi-level Indexed b. Paging
3. Contiguous c. Segmentation
4. Extent-based d. None of the above
5. FAT
(a) 1 – d, 2 – b, 3 – a, 4 – c, 5 – d (b) 1 – d, 2 – b, 3 – c, 4 – c, 5 – b
(c) 1 – d, 2 – b, 3 – c, 4 – a, 5 – b (d) 1 – b, 2 – b, 3 – c, 4 – c, 5 – b
Q12. Consider an index-based file system with a 2-level indexing. Assume that each index
takes 4 bytes. What is the maximum file size (in bytes) under this arrangement, if a disk
block is 1024 bytes?
(a) 218 (b) 226 (c) 216 (d) 228
Data for the next three questions. Consider a file system on a disk that has both logical and
physical block sizes of 512 bytes. Assume the information about each file is already in
memory. For each of the three allocation strategies (linked, contiguous, and indexed).
Suppose we are currently at logical block 10 (the last block assessed was block 10) and want
to access logical block 4. How many physical blocks must be read from the disk?
Q13. How many physical blocks must be read from the disk if the contiguous allocation
strategy is used?___________
Q14. How many physical blocks must be read from the disk if the indexes allocation strategy
is used?___________
Q15. Given a file of 100 blocks, what is the minimum number of disk I/O operations to insert
a block in the middle of the file if contiguous allocation is used (assume the block to be
inserted is already in memory)?
(a) 2 (b) 52 (c) 101 (d) 151
Q16. Given a file of 100 blocks, what is the minimum number of disk I/O operations needed
to insert a block in the middle of the file if linked list allocation is used (assume the
block to be inserted is already in the memory)?
(a) 2 (b) 52 (c) 101 (d) 151
For the next four questions, Consider an indexed file allocation using index nodes (Inodes).
An Inode contains among other things, 14 direct indexes, one indirect index, two double
indexes, and three triple indexes. If the system contains the 10485 files, size of disk is 1 PB and
disk sector is 1 Kbytes.
Q17. What is the size of Inode in this allocation scheme? _________Bytes
Q21. A UNIX file system has 2-KB blocks and 8-byte disk addresses. The Inode of file ‘X’
requires 10 direct entries and an indirect block which is half full. How large is the file
in blocks?
(a) 138 (b) 264
(c) 520 (d) 1032
Q22. A Unix-style i-node has 12 direct pointers and one single, one double and one triple
indirect pointers. Disk block size is 8 Kbyte and disk block address is 64 bits
used. Assume that i-node table is in the main memory. How many disk I/O is required
to read the byte 16,000,000 of a file? ________
Q23. Consider a UNIX file system with 12 direct pointers, 1 indirect pointer, 1 double-
indirect pointer, and 1 triple-indirect pointer in the i-node. Assume that disk blocks are
1K bytes and that each pointer to a disk block requires 4 bytes. What is the largest
possible file (in GB) that can be supported with this design?_________(Rounded off to
two decimal place)
Q24. Consider a file system with 4096 byte blocks and 32-bit disk and file block pointers.
Each file has 13 direct pointers, 4 singly-indirect pointers, a doubly-indirect pointer,
and a triply-indirect pointer.What is the maximum disk size (in TB) that can be
supported?
For the next two questions, an engineer has designed a FAT-like system and he has used 24
bits for each entry. For a 32-GB disk.
Q25. What is the minimum size of a file allocation in this system?_______KB.
Q26. What is the smallest amount of memory that could possibly be used for the FAT?
________
Data for next four questions. Consider a file system that uses an FAT. The state of the
directory is
File name First block Size in bytes
AA 5 1350
BB 7 2200
(The other information in the directory is omitted)
The current state of the FAT is:
0 Free
1 Free
2 -1
3 4
4 -1
5 2
6 Free
7 3
8 Free
System uses a block of size 1K (and 1K=1024 bytes)
Q28. What is the last block of file AA? ______
Q36. C-SCAN:_______
Q37. C-LOOK:_______
Data for the next two questions. At time XZ, the request queue for a disk contains the
following requests in[track:sector] form: [10:5], [22:9], [20:21], [21:9], [2:10], [40:45], [6:7], [38:9]
…. (in this order).Assume that the disk head is currently positioned over cylinder 20. What is
the sequence of readsunder the following head scheduling algorithms?
Q38. Shortest Seek Time First:
Q41. An OS uses the LOOK algorithm to schedule the disk-arm. I/O requests are currently
pending for blocks on tracks 1, 3, 8, 11, 15, and 16. The disk arm is currently at track 9
and moving upwards. In what order will these requests be handled?
(a) 11, 15, 16, 8, 3, 1
(b) 1,3,8 ,11,15,16
(c) 8,3,1 ,11,15,16
(d) 11, 15, 16, 1,3,8
Q42. Let there be the following requests for data blocks in tracks number 100, 175, 51, 133, 8,
140, 73, and 77 and let the head position be in track number 63 moving towards higher
tracks. Assuming that track number ranges between 0 to 200, what is the number of
tracks that will be traversed with the LOOK disk scheduling algorithm?
(a) 646
(b) 279
(c) 280
(d) 329
Q43. Which of the following disk scheduling strategies is likely to give the best throughput?
(a) Farthest cylinder next
(b) Nearest cylinder next
(c) First come first served
(d) Elevator algorithm