Technical: Exam Summary (GO Classes CS Test Series 2025 - Operating Systems - Subject Wise Test 1)
Technical: Exam Summary (GO Classes CS Test Series 2025 - Operating Systems - Subject Wise Test 1)
php
Summary in Graph
Incorrect
Attempts:
0 Resultant Marks: 0
0+0 0+0
Total Questions: 30
15 + 15
Total Marks: 45
15 + 30
Technical
int main() {
int x = 1;
fork();
5. x = x + 1;
fork();
printf("%d ", x);
10. return 0;
}
A. 2 2 2 2
B. 1 2 3 4
C. 1 2
D. 2 2
[Link] 1/11
2/6/25, 5:59 PM [Link]/quiz/[Link]
Your Answer: Correct Answer: A Not Attempted Time taken: 00min 00sec Discuss
Consider a machine with a page size of 1024 bytes. There are 8 KB of physical memory and 8 KB of virtual
memory. The TLB is a fully associative cache with space for 4 entries that is currently empty. Assume that the
physical page number is always one more than the virtual page number. This is a sequence of memory
address accesses for a program we are writing: 0x294, 0xA76, 0x5A4, 0x923, 0xCFF, 0xA12, 0xF9F, 0x392,
0x341.
Here is the current state of the page table:
A. 2
B. 3
C. 5
D. 6
Your Answer: Correct Answer: c Not Attempted Time taken: 00min 04sec Discuss
Assume the address space size is 128 bytes, but the page size is 32 bytes. Here is the page table for a process,
where the leftmost bit is the valid bit, and the rightmost 4 bits are the PFN.
0 × 8000000c
0 × 00000000
0 × 00000000
0 × 80000006
Using the page table above translate the virtual address 0 × 64.
A. 0×46
B. 0×04
C. 0×c4
D. 0×64
Your Answer: Correct Answer: C Not Attempted Time taken: 00min 00sec Discuss
In a recent NASA discovery, the planet Mars has three-handed philosophers. Consider a table with five three-
handed philosophers and a pile of N chopsticks in the middle of the table. Each philosopher needs 3
chopsticks to eat. What is the smallest N such that deadlock is impossible?
[Link] 2/11
2/6/25, 5:59 PM [Link]/quiz/[Link]
Your Answer: Correct Answer: 11 Not Attempted Time taken: 00min 00sec Discuss
A. In the banker's algorithm, the number of resources available to allocate must be known in advance.
B. Once a system is in an unsafe state (as the term is used in the banker's algorithm) there is at least one
sequence of process requests that will unavoidably lead to deadlock.
C. Once a deadlock is detected, the problem can be solved by suspending one or more of the deadlocked
processes.
D. None of the above.
Your Answer: Correct Answer: A;B Not Attempted Time taken: 00min 00sec Discuss
Consider a system with four processes P1, P2, P3, and P4, and two resources, R1, and R2, respectively. Each
resource has two instances. Furthermore:
- P1 allocates an instance of R2, and requests an instance of R1
- P2 allocates an instance of R1 and doesn't need any other resource
Your Answer: Correct Answer: A Not Attempted Time taken: 00min 00sec Discuss
Suppose a processor uses a prioritized round robin scheduling policy. New processes are assigned an initial
quantum of length q. Whenever a process uses its entire quantum without blocking, its new quantum is set to
twice its current quantum. If a process blocks before its quantum expires, its new quantum is reset to q. For
the purposes of this question, assume that every process requires a finite total amount of CPU time.
Scenario (a): Suppose the scheduler gives higher priority to processes with larger quanta.
Scenario (b): Suppose the scheduler gives higher priority to processes with smaller quanta.
Which of the following is correct regarding the possibility of starvation in the system?
Your Answer: Correct Answer: B Not Attempted Time taken: 00min 00sec Discuss
[Link] 3/11
2/6/25, 5:59 PM [Link]/quiz/[Link]
Assume you have the following process table (list of active processes):
[ Process A base:100 bounds:10]
[ Process B base:1000 bounds:20 ]
Assume process A is running on a CPU. After the switch to process B, which of the following is a physical
address that process B might legally refer to?
A. 0
B. 20
C. 500
D. 1015
Your Answer: Correct Answer: D Not Attempted Time taken: 00min 00sec Discuss
Fill in the underlined areas in Reader() to make it a complete solution to the readers-writers problem. Your
solution should allow multiple concurrent readers, but only one writer, to access the shared database
simultaneously.
A. P: readcount == 1
B. Q: P(wrt);
C. R: readcount == 0
D. S: V(wrt);
Your Answer: Correct Answer: A;B;C;D Not Attempted Time taken: 00min 00sec Discuss
Consider the following different possible pseudo-code taken from two processes, where A, B are blocks of
code, and S is a semaphore initialized to 0.
[Link] 4/11
2/6/25, 5:59 PM [Link]/quiz/[Link]
Process 1: Process 2:
A; up(S);
A.
down(S); B;
Process 1: Process 2:
A; down(S);
B.
up(S); B;
Process 1: Process 2:
down(S); down(S);
C. A; B;
up(S); up(S);
Process 1: Process 2:
D. up(S); down(S);
A; B;
Your Answer: Correct Answer: B Not Attempted Time taken: 00min 00sec Discuss
I. If all jobs have identical run lengths, a RR(RoundRobin) scheduler (with a time-slice much shorter
than the jobs' run lengths) provides better average turnaround time than FIFO.
II. We can practically implement a scheduling algorithm that achieves the optimal average waiting time.
III. Round-robin scheduling ensures no starvation.
Your Answer: Correct Answer: C Not Attempted Time taken: 00min 00sec Discuss
Consider the following requests to read data from cylinders of a hard drive, where the current position of the
head is at cylinder 73 and the head is moving towards cylinder 0. What is the order in which the cylinders in
the queue would be serviced using the SCAN disk scheduling algorithm?
84, 17, 25, 102, 92, 1, 72, 56, 89, 143, 91, 50, 95, 32
A. 72, 56, 50, 32, 25, 17, 1, 84, 89, 91, 92, 95, 102, 143
B. 72, 56, 50, 32, 25, 17, 1, 143, 102, 95, 92, 91, 89, 84
C. 84, 89, 91, 92, 95, 102, 143, 72, 56, 50, 32, 25, 17, 1
D. 84, 89, 91, 92, 95, 102, 143, 1, 17, 25, 32, 50, 56, 72
Your Answer: Correct Answer: A Not Attempted Time taken: 00min 00sec Discuss
[Link] 5/11
2/6/25, 5:59 PM [Link]/quiz/[Link]
Your Answer: Correct Answer: B Not Attempted Time taken: 00min 00sec Discuss
In a system with two processes, P and P , each with one thread, P performs a system call. How is P 's
A B A A
A. The context is stored in the MMU, and the MMU restores it automatically.
B. P 's registers are saved in its trap frame (kernel stack), and after the system call, the context is restored
A
from the
trap frame.
C. The context is saved in the ready queue and restored when P re-enters it. A
D. The context is saved in a global system register and restored automatically after the system call.
Your Answer: Correct Answer: B Not Attempted Time taken: 00min 00sec Discuss
Consider the following allocation of a resource. Assume that there are a total of 10 instances of this resource:
If P requests one more instance of the resource, does this lead to a safe or unsafe state, and why?
4
A. Safe, because after the allocation, all processes can be allocated enough resources to finish.
B. Unsafe, because after the allocation, there won't be enough free resources to give the maximum
required resources to any process.
C. Safe, because P is the largest consumer, and giving one more instance will not affect the system.
4
Your Answer: Correct Answer: B Not Attempted Time taken: 00min 00sec Discuss
Consider the Least Completed Next (LCN) Preemptive Scheduling policy that schedules the process that has
consumed the least CPU time. Consider the following five processes that run using the LCN policy:
Process P1 P2 P3 P4 P5
Admission Time 0 2 3 4 8
Service Time 3 3 5 2 3
[Link] 6/11
2/6/25, 5:59 PM [Link]/quiz/[Link]
In the event of a tie, it employs the First-Come-First-Served (FCFS) rule to select the process. Let X represent
the average turnaround time and Y denotes the average response time. In this case, the sum of X and Y
would be:?
Your Answer: Correct Answer: 8.8 Not Attempted Time taken: 00min 00sec Discuss
Assume there are N processes in a ready queue in decreasing order with respect to their CPU burst length.
The length of process k is k time units ( 1 <= k <= N ). Process N is head and process 1 is tail. What is the
average waiting time for the FCFS scheduling algorithm?
A. (N 2
− 1) /3
B. (N 2
+ 1) /3
C. (N − 1) (N
2
+ 1) /3N
D. (N − 1) (N
2
− 1) /3N
Your Answer: Correct Answer: A Not Attempted Time taken: 00min 00sec Discuss
Suppose that two processes, P and P , are running in a uniprocessor system. P has three threads. P has
a b a b
two threads. All threads in both processes are CPU-intensive, i.e., they never block for I/O. The operating
system uses simple round-robin scheduling.
(i) Suppose that all of the threads are user-level threads and that user-level threads are implemented using a
single kernel thread per process. Let x be the fraction of the processor's time will be spent running P 's a
threads.
(ii) Suppose instead that all of the threads are kernel threads. Let y be the fraction of the processor's time that
will be spent running P 's threads.
a
Your Answer: Correct Answer: 1.1 Not Attempted Time taken: 00min 00sec Discuss
Consider a process that uses a user-level threading library to spawn 10 user-level threads. The library maps
these 10 threads to 2 kernel threads. The process is executed on an 8 -core system. What is the maximum
number of threads of a process that can be executed in parallel?
Your Answer: Correct Answer: 2 Not Attempted Time taken: 00min 00sec Discuss
Consider a memory architecture using two-level paging for address translation. The format of the virtual
address, physical address, and PTE (page table entry) are bellow:
Virtual Address:-
[Link] 7/11
2/6/25, 5:59 PM [Link]/quiz/[Link]
Physical Address:-
10 bits 14 bits
Physical page# offset
PTE:-
10 bits 6 bits
Physical Page# perm. bits
What is the total memory (in Bytes) needed for storing all page tables of a process that uses the entire virtual
memory?
Your Answer: Correct Answer: 525312 Not Attempted Time taken: 00min 00sec Discuss
If an instruction takes 1 microsecond and a page fault takes an extra n microseconds, what is the formula for
the effective instruction time if page faults occur every k instructions (on average)?
A. 1 + k/n
B. 1 + n/k
C. 1/k + n
D. k + 1/n
Your Answer: Correct Answer: B Not Attempted Time taken: 00min 00sec Discuss
Given below are descriptions of different entries in the page table of a process, with respect to which bits are
set and which are not set. Accessing which of the page table entries below will always result in the MMU
generating a trap to the OS during address translation?
Your Answer: Correct Answer: B;C Not Attempted Time taken: 00min 00sec Discuss
Consider five single-unit resources, A, B, C, D, and E. They all were initially available. Consider also three
threads, T1, T2, and T3. Each of them needs some resources as follows:
T1: A at Time 1, C at Time 2, B at Time 3
T2: E at Time 1, D at Time 2, C at Time 3
T3: B at Time 1, A at Time 3
Whenever a thread requests a resource, the request shall be granted if the resource is available. Some threads
will eventually be stuck in a deadlock at Time 3. Which of these threads will be in deadlock?
A. T1
B. T2
[Link] 8/11
2/6/25, 5:59 PM [Link]/quiz/[Link]
C. T3
D. There will be no deadlock
Your Answer: Correct Answer: A;B;C Not Attempted Time taken: 00min 00sec Discuss
Consider the system's current state, which has been identified as an unsafe condition under the Banker's
Algorithm framework.
How could the state be made safe again? Answer all that apply:
A. Process 2 could finish without using more than its current allocation.
B. Process 3 could finish without using more than its current allocation.
C. Process 0 could request ( 1, 1, 1 ), be granted this request, and the resulting state would be safe.
D. Process 3 could request ( 1, 0, 0 ), be granted this request, and the resulting state would be safe.
Your Answer: Correct Answer: B Not Attempted Time taken: 00min 00sec Discuss
Consider a virtual memory system that uses 2 -level paging. The page size in this system is 256 (2 2 ) bytes. 8
Each individual page table fits exactly into one memory frame, and the size of each page table entry (PTE) is 8
bytes.
Suppose that there is a process with a virtual address space of the maximum size. How many bytes of
memory are occupied by the page tables for this process?
Your Answer: Correct Answer: 8448 Not Attempted Time taken: 00min 00sec Discuss
Suppose we have a multiprogrammed computer where each job has identical characteristics: Each job runs N
computational periods of length T, where half of that time is spent on I/O and half on computation. Jobs are
dispatched in a simple round-robin manner and I/O activity can overlap with CPU operations.
Compute the average turnaround time (average total time to complete each job) if there are four
simultaneous jobs running for time T.
Each period T is distributed as follows:
[Link] 9/11
2/6/25, 5:59 PM [Link]/quiz/[Link]
A. (2 N + 7/8)T
B. (3 N + 2)T
C. (3 N − 2)T
D. (2 N − 7/8)T
Your Answer: Correct Answer: C Not Attempted Time taken: 00min 00sec Discuss
Two processes, P and P , require C units of execution time each. The system uses a preemptive round-robin
1 2
scheduler with quantum q, and a context switch overhead of w(w < q). Assume that the execution time C
includes the context switch overhead w within itself.
Both processes become runnable at t = 0, with P running first. What is the expression for N , the number
1 1
A. N 1 = ⌊
C
q
⌋
B. N 1 = ⌈
C
q
⌉ − 1
C. N
C+w
1 = ⌊ ⌋
q
D. N 1 =
C
q+w
Your Answer: Correct Answer: B Not Attempted Time taken: 00min 00sec Discuss
Given a machine with 33-bit virtual addresses and a page size of 32 KB (32768 bytes), the TLB contains the
following entries (in octal):
If the system attempts to load from virtual address 61252127604 (in octal), how will the MMU translate the
virtual address to a physical address?
A. The virtual address will result in a TLB miss because the VPN does not match any entry.
B. The virtual address will be translated to the physical address 076543227604 using the TLB entry for VPN
612521.
C. The virtual address will cause a page fault because the TLB entry for 61252 has a valid bit set to 0 .
D. The virtual address will be translated to the physical address 012345627604 using the TLB entry for VPN
6125 .
Your Answer: Correct Answer: B Not Attempted Time taken: 00min 00sec Discuss
[Link] 10/11
2/6/25, 5:59 PM [Link]/quiz/[Link]
A. Threads that are part of the same process share the same stack.
B. Threads that are part of the same process can access the same TLB entries.
C. With kernel-level threads, multiple threads from the same process can be scheduled on multiple CPUs
simultaneously.
D. A thread can hold only one lock at a time.
Your Answer: Correct Answer: B;C Not Attempted Time taken: 00min 00sec Discuss
Consider a system running ten I/O-bounds tasks and one CPU-bound task. Assume that the I/O bound tasks
issue an I/O operation once for every millisecond of CPU computing and that each I/O operation takes 10
milliseconds to complete. Also, assume that the context-switching overhead is 0.1 millisecond and all
processes are long-running tasks. What is the approx CPU utilization for a round-robin scheduler when the
time quantum is 10 milliseconds?
A. 94%
B. 91%
C. 90%
D. 96%
Your Answer: Correct Answer: A Not Attempted Time taken: 00min 00sec Discuss
[Link] 11/11