Operating System (BSc CSIT, CSC259): the questions likely to come
30 analyzed questions from 7 past papers (2074-2081), grouped by syllabus unit — each with its probability, how often it's been asked, and where to study the answer.
Explain the Critical Section problem. Describe Peterson's solution and the use of semaphores to achieve process synchronization.
Critical Section Problem
When multiple processes share data, each process has a segment of code called the critical section (CS) in which it accesses the shared resource. The problem is to design a protocol so that no two processes execute their critical sections at the same time.
A correct solution must satisfy three requirements:
- Mutual Exclusion – if a process is in its CS, no other process may be in its CS.
- Progress – if no process is in its CS, only the processes not in their remainder section participate in deciding who enters next, and the decision cannot be postponed indefinitely.
- Bounded Waiting – there is a bound on the number of times other processes can enter their CS after a process has requested entry and before that request is granted (no starvation).
General structure of a process:
do {
entry section
critical section
exit section
remainder section
} while (true);
Peterson's Solution (two processes)
A classic software solution for two processes and . It uses two shared variables:
int turn;– whose turn it is to enter.boolean flag[2];–flag[i]is true if wants to enter.
// Process Pi (j = the other process)
do {
flag[i] = true;
turn = j;
while (flag[j] && turn == j); // busy wait
/* critical section */
flag[i] = false;
/* remainder section */
} while (true);
Why it works: enters only when the other process does not want to enter (flag[j]==false) or it is 's turn (turn==i). Since turn can hold only one value, only one process passes the while test → mutual exclusion. Progress and bounded waiting also hold because a waiting process is admitted as soon as the other leaves. (Limitation: works for only 2 processes and assumes no instruction reordering.)
Semaphores
A semaphore is an integer variable accessed only through two atomic operations:
wait(S): while (S <= 0); // busy-wait (or block)
S--;
signal(S): S++;
Mutual exclusion using a binary semaphore (initialised to 1):
wait(mutex);
// critical section
signal(mutex);
// remainder
The first process to call wait(mutex) makes mutex = 0; any other process blocks until the first calls signal(mutex). To avoid busy waiting, the OS implementation blocks the process on a waiting queue and wakes it on signal. Counting semaphores (initial value = number of available resources) generalise this to control access to a pool of identical resources.
Conclusion: The critical-section problem requires mutual exclusion, progress and bounded waiting. Peterson's solution provides a correct software solution for two processes, while semaphores offer a general, hardware-supported synchronization primitive usable for any number of processes.
Process Synchronization and Deadlocks
Explain the Critical Section problem. Describe Peterson's solution and the use of semaphores to achieve process synchronization.
What is a resource allocation graph? Explain the process of detecting deadlock when there is a single instance of each resource type with a suitable example.
What is a deadlock? Explain the four necessary conditions for deadlock and describe deadlock avoidance using the Banker's algorithm with an example.
What is a semaphore? Differentiate between binary and counting semaphores.
Explain the concept of a monitor in process synchronization.
What is the producer-consumer problem? Explain in brief.
Explain the Dining Philosophers problem.
Distinguish between starvation and deadlock.
Can deadlock occur in the case of preemptive resources? List the conditions for deadlock.
Sit a probable paper
A full mock exam built from the most likely questions, mirroring the real paper's structure. Every slot is a real past question.
Most Probable Paper
Mirrors the real structure · 60 marks · based on 7 past papers
- 1.[10 marks]
Explain paging as a memory management technique. Discuss how logical addresses are translated to physical addresses using a page table and TLB.
This question has recurred in 3 of 7 years; so far only in internal assessments, not the board; and its topic (Memory Management) appears in 86% of years.
- 2.[10 marks]
Explain the Critical Section problem. Describe Peterson's solution and the use of semaphores to achieve process synchronization.
This question has recurred in 2 of 7 years; so far only in internal assessments, not the board; and its topic (Process Synchronization and Deadlocks) appears in 100% of years.
- 3.[10 marks]
What is a resource allocation graph? Explain the process of detecting deadlock when there is a single instance of each resource type with a suitable example.
This question has recurred in 2 of 7 years; so far only in internal assessments, not the board; and its topic (Process Synchronization and Deadlocks) appears in 100% of years.
- 1.[5 marks]
What is thrashing? How can it be prevented?
This question has recurred in 5 of 7 years; so far only in internal assessments, not the board; and its topic (Memory Management) appears in 86% of years.
- 2.[5 marks]
What is a semaphore? Differentiate between binary and counting semaphores.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic (Process Synchronization and Deadlocks) appears in 100% of years.
- 3.[5 marks]
Explain the concept of a monitor in process synchronization.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic (Process Synchronization and Deadlocks) appears in 100% of years.
- 4.[5 marks]
What is the producer-consumer problem? Explain in brief.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic (Process Synchronization and Deadlocks) appears in 100% of years.
- 5.[5 marks]
Explain the Dining Philosophers problem.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic (Process Synchronization and Deadlocks) appears in 100% of years.
- 6.[5 marks]
Distinguish between starvation and deadlock.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic (Process Synchronization and Deadlocks) appears in 100% of years.
- 7.[5 marks]
Differentiate between logical and physical address space.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic (Memory Management) appears in 86% of years.
- 8.[5 marks]
Explain segmentation as a memory management scheme.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic (Memory Management) appears in 86% of years.
- 9.[5 marks]
What is RAID? Explain any two RAID levels.
This question has recurred in 4 of 7 years; so far only in internal assessments, not the board; and its topic recurs in 4 of 7 years.
Behind the numbers
The raw evidence the predictions are computed from: marks per unit per year, syllabus weights, trends, and coverage.
Show the heatmap, topic table and coverage analysis
The receipt: marks per unit, per year
Each row is a syllabus unit, each column an exam year, each cell the marks that unit earned that year. Click any cell to see the actual questions behind it.
| # | Syllabus unit | Probability | Appeared | Avg marks | Syllabus weight | Exam vs syllabus | Trend | Questions |
|---|---|---|---|---|---|---|---|---|
| 1 | U3Process Synchronization and Deadlocks | Very likely100% | 25 | 20%9 lecture hrs | Over-examinedexam 33% · syllabus 20% | Steady | 9 recurring9 total | |
| 2 | U4Memory Management | Very likely86% | 22.5 | 20%9 lecture hrs | Over-examinedexam 26% · syllabus 20% | Steady | 6 recurring6 total | |
| 3 | U2Process Management | Very likely100% | 12.1 | 18%8 lecture hrs | Balancedexam 16% · syllabus 18% | Steady | 4 recurring6 total | |
| 4 | U1Operating System Overview | Likely57% | 13.8 | 9%4 lecture hrs | Balancedexam 10% · syllabus 9% | Steady | 3 recurring4 total | |
| 5 | U6I/O Systems and Mass-Storage Management | Likely57% | 12.5 | 11%5 lecture hrs | Balancedexam 10% · syllabus 11% | Steady | 3 recurring3 total | |
| 6 | U5File Management and Implementation | Possible43% | 8.3 | 13%6 lecture hrs | Under-examinedexam 5% · syllabus 13% | Steady | 1 recurring2 total | |
| 7 | U7Protection, Security and Case Studies | Occasional0% | 0 | 9%4 lecture hrs | Under-examinedexam 0% · syllabus 9% | Steady | None |
Study smart, not hard
Drag the slider: studying the top 4 units in priority order covers ~86% of all observed marks.
- ~80% line
Lecture time vs exam marks
Where the exam pays more than the curriculum spends: ● lectures vs ● exam marks, as a share of the whole course. A long teal-leading bar = high-yield unit.