Coursify

Operating System

PYQ Analysis & Exam Preparation — Module 3

40 mins

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

YearQuestionMarksTopicType
2019Q414Race Condition — definition + examples in concurrent processingSubjective
2019Q5a7Semaphore — definition + implementation scheme (wait/signal)Subjective
2019Q5b7Critical Section Problem — definition + solutionSubjective
2022Q4a7Critical Section Problem — requirements a solution must satisfySubjective
2022Q9d7Short Notes: Peterson's SolutionSubjective
2023Q7a6Producer-Consumer Problem + semaphore solution + justify MESubjective
2023Q7b8Critical Section Problem + Peterson's Solution illustratedSubjective
2023Q1f2MCQ: Max processes allowed simultaneously in a CSObjective
2024Q6a7Semaphore definition + Dining Philosophers Monitor AlgorithmSubjective
2024Q1b2MCQ: Direct communication mechanism nameObjective
2024Q1e2MCQ: Which mechanism is NOT used for mutual exclusionObjective
2024Q1h2MCQ: What problem does the Critical Section concept solveObjective
2024Q1j2MCQ: Peterson's — which condition ensures mutual exclusionObjective

Total marks tracked: 73 marks across 5 years.


Topic Heat Map: Where Your Marks Come From

Topic2019202220232024Total Marks
Critical Section + 3 Requirements7M ✅7M ✅8M ✅2M ✅24M
Semaphores (definition + implementation)7M ✅6M ✅7M ✅20M
Peterson's Solution7M ✅8M ✅2M ✅17M
Race Condition14M ✅2M ✅16M
Dining Philosophers + Monitor7M ✅7M
Producer-Consumer6M ✅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 PiP_i, 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:

  1. Definition (2M): Non-deterministic outcome depending on interleaving of concurrent processes accessing shared data.
  2. The counter++ assembly breakdown (4M): Show the 3 instructions (LOAD/ADD/STORE), draw the interleaving table showing counter = 5 becoming 6 incorrectly.
  3. 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.

[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:

  1. Definition of CS and CS Problem (2M): What a critical section is, the 4-part structure.
  2. Requirement 1 — Mutual Exclusion (1M): Only one process in CS at a time.
  3. Requirement 2 — Progress (2M): If CS is free, selection cannot be postponed. Only non-Remainder processes decide. Must complete in finite time.
  4. 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:

  1. Intro (1M): 2-process software solution; assumption of atomic LOAD/STORE.
  2. Two shared variables (1M): int turn, boolean flag[2] — explain what each represents.
  3. Full pseudocode for PiP_i (3M): Entry section (flag[i]=true, turn=j, while loop), CS, Exit section (flag[i]=false).
  4. 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:

  1. Definition (1M): Integer variable accessed only via wait() and signal().
  2. Binary vs Counting (1M): Binary = 0 or 1, for mutual exclusion. Counting = unrestricted, for resource pools.
  3. wait() and signal() pseudocode — blocking version (3M): Include the struct semaphore with value + list, the block() call in wait, the wakeup() call in signal.
  4. Usage pattern — Mutex (1M): Show the wait(mutex) / CS / signal(mutex) pattern.
  5. 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):

  1. Semaphore definition (2M): Definition + wait/signal (brief, since it's combined).
  2. Monitor solution (5M):
    • Declare enum state[5] and condition self[5].
    • Write pickup(i), putdown(i), and test(i) pseudocode.
    • One-line explanation: test() only grants eating if both neighbors are NOT eating.

Knowledge Check

Question 1 of 5
Q1Single choice

[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.

TermPrecise Definition (exam-ready)
Race ConditionA 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 SectionThe 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 ExclusionThe guarantee that if process PiP_i is executing in its CS, no other process is in its CS for the same shared resource.
SemaphoreAn integer variable accessible only through two atomic operations: wait() (decrement; block if negative) and signal() (increment; wake a waiter if any).
MonitorA 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 MemoryA 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