DSA Tracker

DSA Tracker

← Back to interactive practice

Print or save this cheat sheet to PDF for quick interview revision.

Operating Systems: Top 40 Fresher Interview Questions

Ranked by how many of the surveyed prep sources list each question. Curated for fast active recall.

Q1 • os-001medium • 12 sources

What is thrashing in an operating system, and how does it degrade system performance?

Answer: Thrashing occurs when an operating system spends significantly more time swapping virtual memory pages than executing useful process instructions.

Q2 • os-002easy • 11 sources

What are the core differences between a process and a thread?

Answer: A process is an isolated program instance with its own address space, while a thread is a lightweight execution unit sharing memory inside that process.

Q3 • os-003medium • 11 sources

Under a demand paging scheme in virtual memory, when is a page brought from disk into physical RAM?

Answer: In demand paging, a page is loaded into physical memory only when a running process references an address on that page and triggers a page fault.

Q4 • os-004medium • 11 sources

What is a deadlock in an operating system, and what basic situation causes it?

Answer: A deadlock is a permanent stall where each process in a set holds a resource and waits for another resource held by another process in that set.

Q5 • os-005easy • 10 sources

What fundamental capability does virtual memory provide to modern computing systems?

Answer: Virtual memory creates an illusion of a large contiguous address space, allowing programs larger than physical RAM to execute reliably.

Q6 • os-006medium • 10 sources

How do operating system CPU scheduling algorithms differ across preemptive and non-preemptive strategies?

Answer: CPU scheduling chooses which ready process gets the CPU next, balancing throughput, turnaround time, and latency using preemptive or non-preemptive policies.

Q7 • os-007medium • 10 sources

Explain the concepts of process starvation and aging in operating system scheduling.

Answer: Starvation occurs when a runnable process is indefinitely postponed by higher-priority tasks, and aging prevents this by steadily raising its priority over time.

Q8 • os-008easy • 9 sources

What is an operating system, and what are its primary resource management responsibilities?

Answer: An operating system is system software that manages hardware resources and provides a secure, abstracted platform for user applications to execute.

Q9 • os-009easy • 9 sources

Which data structure does the operating system kernel use to track the state, resources, and execution context of a process?

Answer: A process is a program in active execution, represented in kernel memory by a Process Control Block containing its complete runtime context.

Q10 • os-010easy • 9 sources

Describe the standard states a process transitions through during its execution lifecycle.

Answer: A process moves through New, Ready, Running, Waiting, and Terminated states as the OS allocates CPU time and manages I/O events.

Q11 • os-011easy • 9 sources

According to standard operating system definitions, what is the defining characteristic of the kernel?

Answer: The kernel is the one program running at all times on the computer, executing in privileged mode to manage system resources.

Q12 • os-012medium • 9 sources

What occurs during a CPU context switch, and why is context switching considered pure overhead?

Answer: A context switch saves the CPU register state of a running process and restores another, introducing pure overhead because no user code executes.

Q13 • os-013medium • 9 sources

List and explain the four Coffman conditions necessary for a deadlock to occur.

Answer: Deadlock requires four simultaneous Coffman conditions: mutual exclusion, hold and wait, no preemption, and circular wait.

Q14 • os-014easy • 9 sources

What is the difference between a logical address and a physical address in operating systems?

Answer: A logical address is generated by the CPU during program execution, whereas a physical address identifies an actual hardware location in physical RAM.

Q15 • os-015easy • 9 sources

Compare internal fragmentation and external fragmentation in operating system memory management.

Answer: Internal fragmentation is wasted space inside an allocated memory partition, while external fragmentation is scattered free memory outside allocated blocks.

Q16 • os-016easy • 8 sources

From an architectural perspective, what are the two primary purposes of a modern computer operating system?

Answer: The dual purpose of an operating system is to multiplex hardware resources efficiently and to provide clean, secure abstractions for application programs.

Q17 • os-017easy • 8 sources

Which type of operating system is strictly required for environments where missing a processing deadline causes mission-critical system failure?

Answer: A hard real-time OS is needed when a missed deadline is catastrophic, because it guarantees bounded, deterministic response times.

Q18 • os-018easy • 8 sources

Which resources are private to an individual thread and NOT shared with other threads in the same process?

Answer: A thread is a lightweight execution stream within a process, sharing code, data, and open files while keeping its own stack and registers.

Q19 • os-019medium • 8 sources

What are the core architectural differences between paging and segmentation in memory management?

Answer: Paging splits memory into fixed-size hardware blocks eliminating external fragmentation, whereas segmentation divides memory into variable-size logical units reflecting program structure.

Q20 • os-020medium • 8 sources

What is Belady's anomaly in operating systems, and which page replacement algorithm demonstrates it?

Answer: Belady's anomaly is the counter-intuitive behavior where increasing physical page frames increases total page faults under FIFO page replacement.

Q21 • os-021medium • 8 sources

Which RAID configuration stripes data across multiple disks with distributed parity to provide both fault tolerance and high read throughput?

Answer: RAID combines multiple physical disk drives into a single logical storage array to provide redundancy, enhanced performance, or both.

Q22 • os-022medium • 8 sources

How does a counting semaphore behave when a process invokes the wait() (or P) operation versus the signal() (or V) operation?

Answer: A semaphore is a synchronization variable accessed only through atomic wait() and signal() operations to manage concurrent access to shared resources.

Q23 • os-023easy • 8 sources

What is the defining distinction between Hard Real-Time and Soft Real-Time operating systems?

Answer: In a hard real-time system, missing a deadline results in total system failure, while a soft real-time system tolerates occasional delays with reduced quality.

Q24 • os-024medium • 7 sources

What is the primary role of Dijkstra's Banker's Algorithm in operating system resource management?

Answer: The Banker's algorithm is a deadlock avoidance algorithm that grants resource requests only if the resulting allocation leaves the system in a guaranteed safe state.

Q25 • os-025easy • 7 sources

What does Spooling (Simultaneous Peripheral Operations On-Line) accomplish in an operating system?

Answer: Spooling buffers data for slow peripheral devices on high-speed disk storage, allowing the CPU to complete processing without blocking.

Q26 • os-026medium • 7 sources

What defines a zombie process in Unix-like operating systems, and how is it properly eliminated?

Answer: A zombie process has finished executing but retains an entry in the process table until its parent reads its exit status code.

Q27 • os-027medium • 7 sources

What is Inter-Process Communication (IPC), and what are the primary mechanisms operating systems provide for it?

Answer: Inter-Process Communication provides mechanisms like shared memory, message queues, pipes, and sockets for isolated processes to exchange data and coordinate execution.

Q28 • os-028medium • 7 sources

Contrast the architectural designs of a monolithic kernel and a microkernel.

Answer: Monolithic kernels run all OS services in privileged kernel space for raw speed, while microkernels move most services to user space for modularity and fault isolation.

Q29 • os-029easy • 6 sources

Explain the fundamental differences between a program and a process in computer systems.

Answer: A program is a passive executable file stored on disk, whereas a process is an active program instance currently executing in memory with dedicated resources.

Q30 • os-030easy • 6 sources

What fundamental rule dictates the difference between preemptive and non-preemptive CPU scheduling?

Answer: In preemptive scheduling the OS can forcibly reclaim the CPU from a running process, whereas in non-preemptive scheduling the process controls the CPU until it yields.

Q31 • os-031medium • 6 sources

In Round Robin (RR) CPU scheduling, what is the impact of choosing an excessively large versus an excessively small time quantum?

Answer: Round Robin assigns each ready process a fixed time slice in circular order, balancing fairness against context switching overhead.

Q32 • os-032easy • 6 sources

What are the four primary benefits of multithreaded programming in modern software systems?

Answer: Multithreading improves application responsiveness, enables lightweight resource sharing, lowers context switching overhead, and scales across multiple CPU cores.

Q33 • os-033medium • 6 sources

What fundamental memory management problem does paging solve, and how does it accomplish this?

Answer: Paging eliminates external fragmentation by allowing physical memory to be allocated to processes non-contiguously in fixed-size frames.

Q34 • os-034easy • 6 sources

Under what specific condition does external fragmentation occur in primary memory?

Answer: External memory fragmentation occurs when total free memory is sufficient to satisfy a request, but the memory is split into non-contiguous blocks.

Q35 • os-035medium • 6 sources

Which page replacement algorithm is provably optimal by replacing the page that will not be used for the longest period of time, serving as a theoretical benchmark?

Answer: Optimal page replacement evicts the page unreferenced for the longest future time, while LRU uses past references to approximate this ideal.

Q36 • os-036easy • 6 sources

What is a system call in an operating system, and how does user software invoke one?

Answer: A system call provides the essential programmatic interface allowing user-space programs to safely request privileged services from the operating system kernel.

Q37 • os-037easy • 6 sources

In network operating systems and inter-process communication, what two core elements define a network socket endpoint?

Answer: A socket is an endpoint for bidirectional network communication uniquely identified by the combination of an IP address and a port number.

Q38 • os-038medium • 5 sources

What is a primary functional distinction between a mutex and a binary semaphore?

Answer: A mutex is a locking mechanism owned solely by the thread that locked it, whereas a semaphore is a signaling mechanism without ownership.

Q39 • os-039medium • 5 sources

What constitutes a critical section in concurrent programming, and what fundamental requirement must a solution satisfy?

Answer: A critical section is a code block accessing shared mutable data that must execute with mutual exclusion to prevent race conditions.

Q40 • os-040easy • 5 sources

Why do modern processors and operating systems implement dual-mode operation with user mode and kernel mode?

Answer: Dual-mode operation protects the system by restricting privileged CPU instructions and direct hardware access exclusively to kernel mode.

DSA Tracker • https://dsatracker.tech/core-cs/os