Job preparationOperating systems

Operating system interview questions and answers

10 questions · 7 min read

Processes and threads, context switching, deadlock, virtual memory, paging, file systems and system calls.

Operating system questions test your computer science foundations, particularly for systems and back-end roles.

Two are all but certain: the difference between a process and a thread, and deadlock. Prepare those thoroughly.

The questions

What is an operating system and what are its main jobs?

What to coverAn operating system is software that manages a computer's hardware and software resources and provides common services. Its main jobs are process management, memory management, file system management, and input/output management.

What is the difference between a process and a thread?

What to coverA process is an independent unit of work representing the execution of a program. A thread is a part of a process that shares resources with other threads. Threads are lightweight and need fewer resources than processes.

What is context switching and why does it matter?

What to coverContext switching is moving the CPU from one process to another: the state of the current process is saved and the state of the new one restored. It is what makes multitasking work.

What is deadlock and how can it be prevented?

What to coverDeadlock is a situation where several processes are each waiting on a resource held by another, so none can proceed. The strategies against it are deadlock prevention, deadlock avoidance, and detection with recovery.

What is virtual memory and how does it work?

What to coverVirtual memory is a memory management technique that extends memory beyond physical RAM. Using paging or segmentation, it gives processes a large address space.

What is the difference between paging and segmentation?

What to coverPaging divides memory into blocks of equal size. Segmentation divides it into segments of differing sizes.

What is a file system, and what are the common types?

What to coverA file system is the system used to store and retrieve data. Common types are FAT32, NTFS, ext3, ext4 and HFS+.

What is cache memory and what is it for?

What to coverCache memory is small, fast memory holding frequently used data and instructions so the CPU can reach them quickly.

What is a system call, and can you give examples?

What to coverA system call is how a program asks the operating system for a service. Examples include read(), write(), fork() and exec().

What are the main differences between Linux and Windows?

What to coverLinux is an open-source, Unix-like operating system offering a command line interface and a high degree of customisation. Windows is proprietary, and puts the emphasis on a graphical interface and ease of use.

Tips for this round

  • When you separate a process from a thread, bring up resource sharing — that is where the real difference lies.
  • Remembering the four conditions for deadlock makes that answer sound considerably stronger.

Want to learn this hands-on? Take a look at the related course.

Browse courses