Operating Systems — Exam Template & Patterns Politecnico di Torino · Stefano Scanzio · reverse-engineered from 25 past exams (2019–2025, 293 exercises)

~12
exercises / exam
~31
points total
5
topics in every exam
~50%
marks from 4 task types

1 · Overall shape

The format changed in mid-2020. Everything from 2022 onward follows one stable online template — that is what you will sit.

EraExamsFormat
2019 – early 20203 papersOld paper format: 6 long open-ended exercises, no per-question points. (obsolete — skip)
mid-2020 – 202522 papersCurrent online format: 10–16 short exercises, ~31 pts, mix of multiple-choice + a few large write-code / write-script tasks.
⚠️ Multiple-choice questions carry a wrong-answer penalty ("risposte errate implicano una penalità"). Only tick options you are confident about — guessing has negative expected value.

2 · The backbone — 5 topics in (almost) every exam

These appear in 22–24 of the 25 exams. The first four are large hand-written tasks worth ~16 of ~31 points — half the exam in four predictable question types.

TopicFrequencyFormatAvg pts
Concurrent program — semaphores / precedence graph23 / 25WRITE CODE4.8
Bash script — text / file processing24 / 25WRITE SCRIPT4.7
fork/exec/system output — "count the chars"22 / 25TRACE3.5
CPU scheduling — Gantt + avg waiting time23 / 25OPEN3.3
Deadlock — Banker's or resource-allocation graph~1 / examOPEN / MCQ1.5

3 · Question-by-question template

The 2025 sessions (20250217, 20250612, 20250917) are nearly identical in shape. This is the layout to expect:

1
File system MCQ
Allocation bitmap (contiguous/linked/indexed) · or text/ASCII/Unicode/binary · or ls -l / links
2.0
2
fork/exec/system trace TRACE
Count how many times a character is printed by nested processes
3.5
3
Process / signals theory MCQ
zombie · orphan · PCB · exec family · SIGCHLD
2.0
4
Pipes / IPC MCQ
blocking, atomicity (PIPE_BUF), SIGPIPE, multiple readers/writers
2.0
5
Threads theory MCQ
pthread_join/exit/return · user vs kernel threads · race on shared pointer
2.5
6
Regex / filters trace TRACE
egrep … | tr -s | cut or find -regex/-perm → which lines print?
2.5
7
Synchronization theory MCQ
TestAndSet / ticket lock / critical-section properties · or reader-writer code analysis
2.5
8
Bash script WRITE SCRIPT
Parse ls -l/ps, count words/lines, find+filter+rename files
5.0
9
Concurrent program WRITE CODE
Precedence graph → semaphores · or implement a primitive (counting sem, barrier, rendezvous)
5.5
10
Classic sync analysis MCQ
producer/consumer · reader/writer · dining philosophers
2.0
11
CPU scheduling OPEN
Draw the Gantt chart (SRTF / RR / Priority), compute average waiting / turnaround
3.0
12
Banker's algorithm OPEN
"Can request {x,y,z} be granted?" → give the safe sequence or NO
3.0
write code write script trace output open / compute multiple choice
📌 Positional tells: the exam almost always opens with a file-system or fork-trace question and closes with Scheduling → Banker's as the final two slots. Budget your time so you reach those two — they're guaranteed, mechanical points.

4 · Where the marks actually are

Points-weighted across the 22 scored exams (avg points contributed per exam). Study top-down.

TopicAvg points per exam
Concurrent code (semaphores)
4.84
Bash script
4.73
fork/exec output trace
3.45
CPU scheduling
3.27
Synchronization theory
2.34
Signals
1.95
Pipes / IPC
1.86
Regex / filters
1.77
Process theory (zombie/orphan/PCB)
1.77
File system (links/encoding/syscalls)
1.64
Threads theory
1.55
Deadlock — Banker's
1.55
Classic sync (prod/cons, R/W)
1.45
Deadlock — resource graph
1.07
File allocation (bitmap)
0.93

5 · The MCQ rotation

136 of 293 exercises are multiple-choice. They recycle a fixed concept pool — same ideas, reworded each session. Know these cold and the cheap points are free:

Process & signals

  • zombie vs orphan — who reaps, when is the PCB freed
  • what the PCB does / doesn't store
  • exec family (l/v/p/e variants)
  • signal(SIGCHLD, SIG_IGN), kill vs shell kill, pause

Threads

  • pthread_join / pthread_exit / return
  • user-level vs kernel-level threads
  • race when passing &i to a thread

IPC & pipes

  • read/write blocking, full pipe behaviour
  • atomicity up to PIPE_BUF, SIGPIPE
  • multiple readers/writers on a pipe

Sync & file system

  • TestAndSet / ticket lock — mutual exclusion properties
  • reader-writer / producer-consumer code correctness
  • file allocation: contiguous / linked / indexed, best/first-fit
  • hard vs symbolic links after rm; ASCII/UTF-8/binary

6 · The "stock" hand-written problems

The big tasks are the same templates re-skinned with new numbers. Practice the template, not individual instances:

SlotWhat recurs
CODEPrecedence graph → semaphores (most common) · implement counting semaphore from mutexes · barrier · two-thread rendezvous · reader-writer / producer-consumer · mutually-recursive thread spawning
SCRIPTParse ls -l output (size + permissions) · count words/lines per line · find + filter + rename files · kill processes from ps aux by memory · merge/split .txt files
TRACECount how often a char prints under nested fork() + execlp + system · predict admissible thread interleavings under semaphores
SCHEDGantt chart for SRTF / Round Robin (most frequent) / Priority / FCFS / SJF → average waiting & turnaround
DEADLKBanker's: can request be granted, give safe sequence · Graph: which edge to remove to break the cycle