What is the difference between multiprogramming, multitasking, and multiprocessing?
Why Interviewers Ask This
Interviewers use this question to quickly assess whether a candidate has the foundational knowledge required for Operating Systems development. It reveals whether you understand the building blocks that more complex concepts rely on.
Answer
These terms describe different aspects of concurrent execution: Multiprogramming: multiple programs are kept in memory simultaneously. When one process waits for I/O, the CPU switches to another instead of idling. Goal: maximize CPU utilization. CPU runs ONE program at a time, but multiple programs are loaded. Single-CPU system. Without: CPU → Run P1 → Wait I/O (idle) → Run P1 → ... With: CPU → Run P1 → Wait I/O → Run P2 → Wait I/O → Run P3 → ... Higher CPU utilization!. Multitasking (time-sharing): extension of multiprogramming where the OS rapidly switches among multiple jobs — giving each a small time slice (quantum). Users feel all programs are running simultaneously. Interactive response time is important. Same single CPU — context switching creates the illusion of parallelism. Focus: responsiveness, user experience. Multiprocessing: system has MULTIPLE physical CPUs (or cores). Processes genuinely run simultaneously on different CPUs — true parallelism. Types: Symmetric Multiprocessing (SMP — all CPUs equal, share memory, run OS and user processes); Asymmetric (one master CPU runs OS, others run user processes); NUMA (Non-Uniform Memory Access — CPUs have local fast memory and slower remote memory). Summary: multiprogramming = multiple programs in memory (CPU efficiency); multitasking = rapid switching between programs (responsiveness); multiprocessing = multiple physical CPUs (true parallelism). Modern systems have all three: multiple CPUs, each rapidly switching among many programs all loaded in memory.
Pro Tip
Before answering, structure your response: one-line definition → real-world analogy → concrete example from a project. This makes even complex Operating Systems answers easy to follow.