Difficulty: Beginner
What is an operating system? Explain its main functions and why we need one.
Let's start with the question that opens almost every OS round, because a crisp answer here sets the tone for everything that follows. Think of an operating system as the manager of a busy restaurant kitchen. The hardware (CPU, memory, disk, network card) is the kitchen equipment, the applications are the cooks, and without a manager everyone would fight over the same stove, overwrite each other's ingredients, and burn the place down. The OS is the software layer that sits between applications and hardware and makes sure everyone gets what they need safely and fairly.
The definition interviewers like is that an OS does two jobs. First, it is a resource manager: it allocates and reclaims the CPU, memory, storage and I/O devices among competing programs. Second, it is an extended machine, meaning it hides ugly hardware details behind clean abstractions. You call open() and read() on a file; you never think about disk sectors, controller registers or interrupt lines. A process abstracts the CPU, virtual memory abstracts RAM, a file abstracts a disk block, and a socket abstracts a network card.
The main functions map neatly onto these abstractions. Process management covers creating and terminating processes, scheduling them on the CPU, and providing synchronization and communication. Memory management tracks which memory is used by whom, allocates and frees it, and provides virtual memory so that programs can be larger than physical RAM and are isolated from each other. File system management provides files and directories, permissions, and the mapping from names to disk blocks. Device management uses drivers, buffering and interrupts to talk to hardware. Protection and security ensures one user or process cannot read or corrupt another's data. Finally there is the user interface, which can be a shell (CLI) or a GUI, and accounting or logging of resource usage.
It also helps to classify operating systems, since it is a frequent follow-up. A batch system runs jobs one after another without user interaction. A multiprogramming system keeps several jobs in memory so the CPU never sits idle during I/O. A time-sharing or multitasking system switches rapidly between jobs so each user feels they own the machine. A real-time OS guarantees a response within a deadline, and is used in cars, medical devices and, relevant for Samsung and Qualcomm interviews, embedded firmware. Distributed and network operating systems coordinate multiple machines.
A point that impresses interviewers is distinguishing the OS from the kernel. The kernel is the always-resident core that runs in privileged mode and implements the functions above. The complete OS distribution also includes system libraries, shells, compilers, utilities and GUI toolkits. Linux is strictly a kernel; Ubuntu is an operating system built around it. Saying this shows you understand the layering rather than repeating a textbook line.
Finally, be ready for why we need an OS at all. Without it each program would need to include its own device drivers, could monopolize the CPU, and could scribble over other programs' memory. The OS gives convenience (easy APIs), efficiency (high CPU and device utilization), and safety (isolation between programs). If you can say that in your own words within a minute, you have already earned the first easy marks of the round.
OS basics, resource management, abstraction, kernel