TomoLink
Core CS Subject

Operating System Interview Questions 2025

Top OS concepts asked in TCS, Infosys, Wipro, Amazon & all major placement interviews — with concise answers.

Why OS matters for placements

OS is consistently one of the top 3 technical interview topics in India (alongside DBMS and CN). Companies like TCS, Infosys, Wipro, Cognizant, Amazon, and Microsoft all ask OS questions in the Technical round. Aim to cover all 12 questions below.

Top OS Interview Questions & Answers

Q1

What is an operating system? What are its main functions?

An OS manages hardware resources, provides a user interface, and runs applications. Core functions: process management, memory management, file system, I/O management, security.

Q2

What is the difference between a process and a thread?

A process is an independent program with its own memory space. A thread is a lightweight unit within a process that shares memory with other threads in the same process.

Q3

What is a deadlock? What are its four necessary conditions?

Deadlock is when processes wait for each other indefinitely. Four conditions: Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait — all must hold simultaneously.

Q4

Explain the different CPU scheduling algorithms.

FCFS (First Come First Serve), SJF (Shortest Job First), Priority Scheduling, Round Robin (with time quantum), Multilevel Queue Scheduling.

Q5

What is virtual memory? How does paging work?

Virtual memory extends RAM using disk space. Paging divides memory into fixed-size pages — the OS maps virtual pages to physical frames via a page table.

Q6

What is thrashing in an OS?

Thrashing occurs when a process spends more time paging than executing — too many page faults. Prevented by working set model or increasing RAM.

Q7

Explain semaphores and how they prevent race conditions.

Semaphore is an integer variable with two atomic operations: wait() (decrement) and signal() (increment). Used to control access to shared resources.

Q8

What is the difference between preemptive and non-preemptive scheduling?

Preemptive: OS can interrupt a running process (Round Robin, Priority). Non-preemptive: Process runs until it voluntarily gives up CPU (FCFS, SJF non-preemptive).

Q9

What is a context switch?

Saving the state of a running process and loading the state of the next process. Involves saving/restoring registers, program counter, and stack pointer.

Q10

What is the difference between internal and external fragmentation?

Internal: wasted space within an allocated block. External: total free memory is sufficient but not contiguous. Paging eliminates external fragmentation.

Q11

Explain the Banker's Algorithm.

A deadlock avoidance algorithm. Before allocating resources, it checks if the system remains in a 'safe state' — a sequence in which all processes can complete.

Q12

What is a system call? Give examples.

System calls are the interface between user programs and the OS kernel. Examples: fork(), exec(), read(), write(), open(), close(), wait(), exit().

OS Topics Cheat Sheet

Process Management

  • PCB
  • Process states
  • Context switch
  • fork/exec

CPU Scheduling

  • FCFS
  • SJF
  • Round Robin
  • Priority

Synchronization

  • Mutex
  • Semaphore
  • Monitor
  • Deadlock

Memory Management

  • Paging
  • Segmentation
  • Virtual memory
  • TLB

File Systems

  • FAT
  • inode
  • Directory structure
  • File permissions

I/O Management

  • Disk scheduling
  • SCAN
  • SSTF
  • Spooling

Prepare OS with company-specific questions

TomoLink curates OS questions asked by TCS, Infosys, Wipro, Amazon & more.

Start Preparing Now

Related Guides