
Interview Answer:
An operating system (OS) manages hardware resources and provides essential services to applications. Process management involves creating, scheduling, and terminating processes. Each process has its own address space, file descriptors, and execution context. The OS maintains a process table storing metadata such as state (ready, running, blocked), priority, and CPU registers.
Memory management ensures that each process receives isolated and protected memory. Modern OSes use virtual memory and paging. Pages are mapped to physical frames, allowing processes to exceed physical RAM through swapping. Memory allocation strategies include first-fit, best-fit, and buddy allocation. The OS prevents memory corruption through protection bits and address translation via the MMU.
Scheduling determines which process gets CPU time. Algorithms include round-robin, shortest job first, multi-level feedback queues, and priority scheduling. Modern systems use preemptive scheduling to maximize responsiveness. Context switching allows multitasking by saving and restoring process states.
Together, these mechanisms enable multi-process execution, efficient resource allocation, and stable system performance.
Post a Comment