01.01 · Cheat sheet
Operating Systems
The OS questions that come up in almost every technical round, in one place.
Process vs thread
| Process | Thread | |
|---|---|---|
| Memory | Its own address space | Shares code, data and heap; own stack and registers |
| Create / switch | Slow (heavy) | Fast (light) |
| Communicate | IPC: pipes, sockets, shared memory, message queues | Shared variables (need locks) |
| If it crashes | Others usually keep running | Can take the whole process down |
States: New → Ready → Running → Waiting → Terminated. PCB stores the PID, state, program counter, registers, memory info and open files.
CPU scheduling
| Algorithm | Key point |
|---|---|
| FCFS | Simple; a long job blocks short ones (convoy effect) |
| SJF | Lowest average waiting time; long jobs can starve |
| SRTF | Preemptive SJF |
| Priority | Starvation → fix with aging |
| Round Robin | Time quantum; good response time |
| Multilevel feedback queue | Jobs move between queues by behaviour |
- Turnaround = Completion − Arrival
- Waiting = Turnaround − Burst
- Response = First run − Arrival
solulu Pro
Continue this cheat sheet with Pro
Inside: 8 sections.
- Process vs thread
- CPU scheduling
- Synchronisation
- Deadlock
- Memory
- Page replacement
- +2 more
Lifetime ₹1,999 ₹999 · Launch offer
Item 1 of 12 · updated 2026-10-13