PYQ Analysis & Exam Preparation — Module 3
A strategic, data-driven analysis of 12 exam questions across 2019–2024. Pinpoint the three topics that alone account for 60+ marks of exam history, and practice with actual MCQs from past papers.
Learning Goals
- Identify the three guaranteed high-yield topics: Critical Section, Peterson's Solution, and Semaphores.
- Practice with actual MCQ questions lifted directly from 2023 and 2024 papers.
- Know the exact structure of answers for 7-mark and 14-mark subjective questions.
The Exam Blueprint: Module 3 PYQ Deep Analysis (2019–2024)
An analysis of 12 exam questions spanning 2019 to 2024 reveals that Module 3 (IPC) is one of the most heavily examined modules in the entire OS course. In 2019 alone, it carried 28 marks. In 2024, examiners asked 4 MCQs + a 7-mark subjective — testing both breadth and depth.
Complete PYQ Table
| Year | Question | Marks | Topic | Type |
|---|---|---|---|---|
| 2019 | Q4 | 14 | Race Condition — definition + examples in concurrent processing | Subjective |
| 2019 | Q5a | 7 | Semaphore — definition + implementation scheme (wait/signal) | Subjective |
| 2019 | Q5b | 7 | Critical Section Problem — definition + solution | Subjective |
| 2022 | Q4a | 7 | Critical Section Problem — requirements a solution must satisfy | Subjective |
| 2022 | Q9d | 7 | Short Notes: Peterson's Solution | Subjective |
| 2023 | Q7a | 6 | Producer-Consumer Problem + semaphore solution + justify ME | Subjective |
| 2023 | Q7b | 8 | Critical Section Problem + Peterson's Solution illustrated | Subjective |
| 2023 | Q1f | 2 | MCQ: Max processes allowed simultaneously in a CS | Objective |
| 2024 | Q6a | 7 | Semaphore definition + Dining Philosophers Monitor Algorithm | Subjective |
| 2024 | Q1b | 2 | MCQ: Direct communication mechanism name | Objective |
| 2024 | Q1e | 2 | MCQ: Which mechanism is NOT used for mutual exclusion | Objective |
| 2024 | Q1h | 2 | MCQ: What problem does the Critical Section concept solve | Objective |
| 2024 | Q1j | 2 | MCQ: Peterson's — which condition ensures mutual exclusion | Objective |
Total marks tracked: 73 marks across 5 years.
Topic Heat Map: Where Your Marks Come From
| Topic | 2019 | 2022 | 2023 | 2024 | Total Marks |
|---|---|---|---|---|---|
| Critical Section + 3 Requirements | 7M ✅ | 7M ✅ | 8M ✅ | 2M ✅ | 24M |
| Semaphores (definition + implementation) | 7M ✅ | — | 6M ✅ | 7M ✅ | 20M |
| Peterson's Solution | — | 7M ✅ | 8M ✅ | 2M ✅ | 17M |
| Race Condition | 14M ✅ | — | — | 2M ✅ | 16M |
| Dining Philosophers + Monitor | — | — | — | 7M ✅ | 7M |
| Producer-Consumer | — | — | 6M ✅ | — | 6M |
The Three Guaranteed Topics
If you only have time to study three things from Module 3, these are them:
1. 🔴 Critical Section Problem + 3 Requirements (24M — appeared in EVERY year)
- Tested in 2019, 2022, 2023, and 2024 — 4 years in a row, in both subjective and MCQ form.
- In 2023, a single question (Q7b, 8 marks) covered both the CS problem and Peterson's solution — they were combined.
- Must know: The formal definition, the 4-part structure (Entry/CS/Exit/Remainder), and all three requirements with explanations: Mutual Exclusion, Progress, and Bounded Waiting.
2. 🟠 Semaphores (20M — appeared in 2019, 2023, 2024)
- In 2019, a full 7-mark question asked for the implementation scheme — they wanted
wait()/signal()pseudocode, not just definitions. - In 2024, the 7-mark question combined Semaphore definition + Dining Philosophers with Monitors — one question, two topics.
- Must know: Definition,
wait()/signal()pseudocode (both busy-wait and blocking versions), binary vs counting, the deadlock scenario with two semaphores.
3. 🟡 Peterson's Solution (17M — appeared in 2022, 2023, 2024)
- In 2022 (Q9d, 7 marks) it was a standalone "Short Notes" question.
- In 2023 (Q7b, 8 marks) it was asked as an "illustration" — meaning they want the code + explanation, not just a description.
- Must know: Both variables (
turn,flag[]), the full pseudocode for , and the proof that it satisfies all 3 requirements.
The 2024 Danger Trend: Combined Questions
The 2024 paper introduced a new pattern — bundling two concepts into a single 7-mark answer:
"What is Semaphore? Explain with algorithm the Dining-Philosophers Solution using Monitors."
This means you must be able to define Semaphore AND write the full monitor-based Dining Philosophers solution (with state[], condition self[], pickup(), putdown(), test()) — all within a 7-mark answer. Practice writing a concise but complete monitor solution in under 20 lines of pseudocode.
High-Yield Subjective Bank: What to Write for Each Question
Prepare a written answer for each of these. Estimates of expected answer depth are given.
[2019 Q4 — 14 Marks] Race Condition
"What do you understand by race condition? Give a few examples of arising of race condition in concurrent processing."
Answer structure for 14 marks:
- Definition (2M): Non-deterministic outcome depending on interleaving of concurrent processes accessing shared data.
- The
counter++assembly breakdown (4M): Show the 3 instructions (LOAD/ADD/STORE), draw the interleaving table showingcounter = 5becoming6incorrectly. - Examples (8M — give 3 examples at ~2-3M each):
- Example 1: Shared counter (the classic
counter++/counter--scenario). - Example 2: Two processes writing to the same file — last-write wins, first write is lost.
- Example 3: Bank account: two ATMs simultaneously reading and writing the same balance — both see Rs. 10,000 and both deduct Rs. 5,000, but balance becomes Rs. 5,000 instead of Rs. 0.
- Example 1: Shared counter (the classic
[2022 Q4a / 2019 Q5b / 2023 Q7b — 7–8 Marks] Critical Section Problem
"Discuss the requirements that a solution to the critical section problem must satisfy."
Answer structure for 7 marks:
- Definition of CS and CS Problem (2M): What a critical section is, the 4-part structure.
- Requirement 1 — Mutual Exclusion (1M): Only one process in CS at a time.
- Requirement 2 — Progress (2M): If CS is free, selection cannot be postponed. Only non-Remainder processes decide. Must complete in finite time.
- Requirement 3 — Bounded Waiting (2M): Finite bound on how many times others can enter before a waiting process gets in.
Exam tip: Examiners specifically look for the phrase "only processes not in the Remainder Section may participate" in the Progress requirement. Write it exactly.
[2022 Q9d / 2023 Q7b — 7–8 Marks] Peterson's Solution
"Write short notes on Peterson's solution." / "Illustrate the classic software-based solution known as Peterson's solution."
Answer structure for 7 marks:
- Intro (1M): 2-process software solution; assumption of atomic LOAD/STORE.
- Two shared variables (1M):
int turn,boolean flag[2]— explain what each represents. - Full pseudocode for (3M): Entry section (flag[i]=true, turn=j, while loop), CS, Exit section (flag[i]=false).
- Proof of correctness (2M): Brief statement of how it satisfies all 3 requirements (1 sentence each). Mention the hardware limitation (instruction reordering).
[2019 Q5a / 2023 Q7a / 2024 Q6a — 6–7 Marks] Semaphores
"Define semaphore. Give a scheme for implementation of semaphore primitives."
Answer structure for 7 marks:
- Definition (1M): Integer variable accessed only via
wait()andsignal(). - Binary vs Counting (1M): Binary = 0 or 1, for mutual exclusion. Counting = unrestricted, for resource pools.
wait()andsignal()pseudocode — blocking version (3M): Include thestruct semaphorewith value + list, theblock()call in wait, thewakeup()call in signal.- Usage pattern — Mutex (1M): Show the
wait(mutex) / CS / signal(mutex)pattern. - Deadlock risk (1M): Briefly mention the S/Q swap scenario.
[2024 Q6a — 7 Marks] Dining Philosophers Monitor Solution
"What is Semaphore? Explain with algorithm the Dining-Philosophers Solution using Monitors."
Answer structure (combined question):
- Semaphore definition (2M): Definition + wait/signal (brief, since it's combined).
- Monitor solution (5M):
- Declare
enum state[5]andcondition self[5]. - Write
pickup(i),putdown(i), andtest(i)pseudocode. - One-line explanation: test() only grants eating if both neighbors are NOT eating.
- Declare
Knowledge Check
[2024 Q1b] Under direct communication, each process that wants to communicate must explicitly name the recipient or sender. This mechanism is known as:
The 2-Mark Vocabulary Traps: Memorize These Definitions
The MCQ questions are designed to test precise vocabulary. A vague understanding will cost you marks. Memorize these word-for-word.
| Term | Precise Definition (exam-ready) |
|---|---|
| Race Condition | A situation where the final outcome depends on the relative order (interleaving) of execution of concurrent processes — the system "races" and the result is non-deterministic. |
| Critical Section | The segment of code in a process where it accesses and potentially modifies shared resources. Only one process may be in its CS at a time. |
| Mutual Exclusion | The guarantee that if process is executing in its CS, no other process is in its CS for the same shared resource. |
| Semaphore | An integer variable accessible only through two atomic operations: wait() (decrement; block if negative) and signal() (increment; wake a waiter if any). |
| Monitor | A high-level ADT that encapsulates shared data and procedures, providing automatic mutual exclusion — only one process may be active inside it at a time. |
| Direct Communication (Naming) | A communication scheme where processes must explicitly name the recipient or sender (e.g., send(P, msg) and receive(Q, msg)). |
| Indirect Communication (Mailbox) | A communication scheme where messages are sent to and received from a shared mailbox rather than directly to a named process. |
| Virtual Memory | A memory management technique (not a synchronization mechanism) that provides an abstraction of more memory than physically exists by using disk as an extension of RAM. |
The Virtual Memory trap (2024 Q1e): Examiners listed it alongside valid synchronization mechanisms. Virtual memory is purely about address space management — it does not prevent any process from accessing shared data. Never confuse memory management with process synchronization.
To view the complete PYQ for Module 3, go here: https://pyqdeck.in/it/it_sem5/it_sem5_106503/practice/chapter