Skip to content
Interview questions

Operating system interview questions

Practise answering common OS questions clearly, like you would in a real interview.

Categories

Showing 60 of 60

Mode

01

OS fundamentals

Let us start with the basics. What does an operating system actually do?

02

OS fundamentals

Why do operating systems separate kernel mode from user mode?

03

OS fundamentals

What happens when a program makes a system call?

04

OS fundamentals

How would you distinguish an interrupt, a trap, and an exception?

05

OS fundamentals

What is the main trade-off between a monolithic kernel and a microkernel?

06

OS fundamentals

Can you walk me through what happens when a computer boots?

07

Processes and threads

What is the difference between a program and a process?

08

Processes and threads

What states can a process move through during its lifetime?

09

Processes and threads

What information does the operating system keep in a process control block?

10

Processes and threads

Suppose I ask you to compare a process with a thread. How would you explain it?

11

Processes and threads

What exactly is saved during a context switch, and why is the switch not free?

12

Processes and threads

Why do Unix-like systems have both fork and exec?

13

CPU scheduling

What is a CPU scheduler trying to optimize?

14

CPU scheduling

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

15

CPU scheduling

When would Round Robin be a better choice than FCFS or Shortest Job First?

16

CPU scheduling

What happens if the time quantum in Round Robin is too small or too large?

17

CPU scheduling

Can a scheduling policy cause starvation? How would you prevent it?

18

CPU scheduling

How does a multilevel feedback queue respond to different kinds of workloads?

19

Synchronization

What makes a race condition possible?

20

Synchronization

What properties should a correct critical-section solution provide?

21

Synchronization

I often hear mutex and semaphore used interchangeably. Are they actually the same?

22

Synchronization

When would you use a counting semaphore instead of a binary semaphore?

23

Synchronization

When can a spinlock make more sense than a mutex?

24

Synchronization

Why do we need condition variables if we already have mutexes?

25

Deadlocks

What is a deadlock, in your own words?

26

Deadlocks

Which conditions must hold for a deadlock to be possible?

27

Deadlocks

How do deadlock prevention, avoidance, and detection differ?

28

Deadlocks

What does Banker's algorithm check before granting a resource request?

29

Deadlocks

How is starvation different from deadlock?

30

Deadlocks

A service occasionally freezes when two locks are involved. What would you inspect first?

31

Memory management

Why do modern operating systems use virtual memory?

32

Memory management

How would you compare paging with segmentation?

33

Memory management

What role does a page table play in address translation?

34

Memory management

Why is a TLB important if we already have page tables?

35

Memory management

Does every page fault mean the program has crashed?

36

Memory management

How does copy-on-write make fork more efficient?

37

File systems

What abstractions does a file system provide?

38

File systems

What is an inode, and what information is not stored in it?

40

File systems

What does a file descriptor represent inside a process?

41

File systems

How does journaling help a file system recover from a crash?

42

File systems

What does it mean to mount a file system?

43

I/O and storage

What problem does a device driver solve?

44

I/O and storage

When would polling be preferable to interrupts for I/O?

45

I/O and storage

How does DMA reduce CPU involvement in I/O?

46

I/O and storage

Can you distinguish buffering, caching, and spooling?

47

I/O and storage

Why do disk-scheduling algorithms matter more for HDDs than SSDs?

48

I/O and storage

What are we trading when we choose a RAID level?

49

Protection and security

How do protection and security differ in an operating system?

50

Protection and security

What is the difference between authentication and authorization?

51

Protection and security

Why is the principle of least privilege important at the OS level?

52

Protection and security

When are basic owner-group-other permissions not enough?

53

Protection and security

What do ASLR and non-executable memory protect against?

54

Protection and security

Why is process isolation considered a security boundary?

55

Practical scenarios

A production process is using almost 100 percent CPU. How would you investigate it?

56

Practical scenarios

An application's memory usage keeps growing. Is that automatically a memory leak?

57

Practical scenarios

The system is spending most of its time handling page faults. What might be happening?

58

Practical scenarios

A process appears stuck in I/O wait. What would you check?

59

Practical scenarios

What could cause an unusually high number of context switches?

60

Practical scenarios

A server becomes slow only under heavy load. Which OS-level limits would you consider?