Operating System Interview Questions for Freshers: The Ones That Keep Getting Asked
Operating system interview questions freshers face: processes vs threads, scheduling, the four deadlock conditions, virtual memory and synchronization, with speakable answers.

Operating system interview questions show up in almost every technical round for software roles in India, from service companies to product startups. The good news: the question pool is small and predictable. Interviewers keep returning to processes vs threads, scheduling, deadlocks, memory management and synchronization. Master those five areas with clear explanations and you will handle most of what gets asked. This guide covers the questions freshers actually face, with answers you can say out loud.
Processes, threads and the questions around them
This is where nearly every OS interview starts.
What is the difference between a process and a thread? A process is an independent program in execution with its own memory space; a thread is a lightweight unit of execution inside a process, sharing that process's memory with other threads. Processes are isolated (one crashing does not corrupt another) but expensive to create and switch between; threads are cheap but need synchronization because they share data.
What is context switching? Saving the state of a running process or thread and loading another's so the CPU can be shared. It is pure overhead - no useful work happens during the switch - which is why excessive threads can slow a system down.
What are the process states? New, ready, running, waiting (blocked) and terminated. Be ready to draw the diagram and say what triggers each transition - especially running to waiting (I/O request) and waiting to ready (I/O completes).
What is the difference between concurrency and parallelism? Concurrency is dealing with many tasks by interleaving them on one or more cores; parallelism is executing many tasks at the same instant on multiple cores. A single-core machine is concurrent, never parallel.
CPU scheduling questions
Which scheduling algorithms should I know? Four, with their one-line trade-offs:
| Algorithm | Idea | Main weakness |
|---|---|---|
| FCFS | First come, first served queue | Convoy effect - short jobs stuck behind long ones |
| SJF | Shortest job first | Needs to know burst time; long jobs can starve |
| Round Robin | Fixed time slice, cycling queue | Time quantum too small means switch overhead; too big means it behaves like FCFS |
| Priority | Highest priority runs first | Starvation of low-priority jobs (fixed by aging) |
What is a starvation-free way to fix priority scheduling? Aging - gradually raising the priority of processes that wait too long.
Deadlock questions
Deadlock is the single most-asked OS topic after processes vs threads.
What is a deadlock? A set of processes each holding a resource and waiting for a resource another member holds, so none can proceed.
What are the four necessary conditions? Mutual exclusion, hold and wait, no preemption, and circular wait. All four must hold simultaneously - break any one and deadlock is impossible. Interviewers love asking "how would you prevent deadlock?" and the honest answer is: attack one of the four conditions (for example, enforce a global ordering of resource requests to break circular wait).
Deadlock vs livelock vs starvation? Deadlock: stuck waiting on each other. Livelock: processes keep changing state in response to each other but make no progress. Starvation: a process never gets the resource because others keep jumping ahead.
Memory management questions
What is virtual memory? An abstraction that lets each process use a large, uniform address space, mapped by the OS onto physical RAM (and disk when RAM runs out). Benefits: processes are isolated, programs can exceed physical memory, and memory is used efficiently.
Paging vs segmentation? Paging splits memory into fixed-size frames and pages - no external fragmentation, simple mapping. Segmentation splits memory into variable-size logical units (code, stack, heap) matching how programs are structured - but suffers external fragmentation.
What is a page fault and thrashing? A page fault happens when a process touches a page not in RAM, and the OS must load it from disk - expensive. Thrashing is when the system spends more time servicing page faults than running processes, usually because too many processes compete for too little RAM.
What is internal vs external fragmentation? Internal: wasted space inside an allocated block (fixed-size paging). External: free memory scattered in small unusable gaps between allocations (variable-size allocation).
Synchronization questions
What is a race condition? When the result depends on the unpredictable order in which threads access shared data. The classic example is two threads incrementing a shared counter and losing an update.
Semaphore vs mutex? A mutex is a lock with ownership - only the thread that locked it can unlock it; it protects one resource. A semaphore is a counter controlling access to N identical resources - any thread can signal it. A binary semaphore can act like a mutex but has no ownership.
What is the critical section problem and its requirements? The critical section is the code touching shared data. A correct solution needs mutual exclusion, progress (no needless blocking), and bounded waiting (no starvation).
These topics pair naturally with the OOPs interview questions interviewers ask in the same rounds, and the database-side equivalents in DBMS interview questions.
How to use this list in prep
Do not memorize definitions word for word - interviewers rephrase. Instead, for each topic, practise explaining it in 30-45 seconds in your own words, then one real-world analogy (deadlock as four cars at a four-way crossing, virtual memory as a library that fetches books from the basement only when you ask). If you can teach it simply, you know it. For the broader round structure, see technical interview questions for freshers.
Networks questions pair naturally with OS ones in the same round - also practice these computer networks interview questions.
Frequently asked questions
How deep do OS questions go for freshers?
Usually definitions, differences and simple scenarios - you will not be asked to design a scheduler. Product companies may add one applied question like "why is my program slow", where they want you to reason about I/O, memory or threads.
Which OS topics are asked most often?
Process vs thread, the four deadlock conditions, paging and page faults, and mutex vs semaphore cover the large majority of fresher-level OS questions in Indian placement interviews.
Do service companies like TCS and Infosys ask OS questions?
Yes, but at a lighter level - definitions and differences rather than scenarios. Product companies and startups go deeper into reasoning and trade-offs.
Should I learn Linux commands for OS interviews?
Only the basics: ps, top, kill, grep for log inspection, and how to check memory. Occasionally an interviewer asks how you would find a runaway process, and one practical command answered confidently scores well.
How long does OS interview prep take?
Two to three focused weekends cover the core topics for fresher interviews if you already studied OS in college. Spend most of the time practising speaking answers aloud, not reading.





