Swapping vs. Paging
Answer
Imagine a classroom with limited desks. In swapping, a student leaves the classroom entirely so another student can enter. In paging, only the required pages of a student's notebook are brought into the classroom when needed.
Explanation:
- Swapping moves an entire process between RAM and secondary storage.
- Paging moves only fixed-size memory pages between RAM and disk.
Key Differences:
- Swapping transfers the whole process.
- Paging transfers only the required pages.
- Paging is more memory efficient.
- Swapping takes more time.
Interview Tip:
Modern operating systems rely mainly on paging rather than swapping entire processes.
Contiguous vs. Non-Contiguous Memory Allocation
Answer
Example: Think of how an operating system allocates memory to multiple programs.
- Contiguous Allocation stores a process in one continuous memory block.
- Non-Contiguous Allocation divides a process into multiple blocks stored in different locations.
Key Differences:
- Contiguous allocation is simple but suffers from external fragmentation.
- Non-contiguous allocation improves memory utilization through paging or segmentation.
Use Contiguous Allocation: Small or simple systems.
Use Non-Contiguous Allocation: Modern operating systems with virtual memory.
Buffering vs. Spooling
Answer
Example: Think of one user streaming a video while another user sends multiple documents to a printer at the same time.
- Buffering temporarily stores data during transfer to match speed differences.
- Spooling stores jobs in a queue for sequential processing by a shared device.
Key Differences:
- Buffering improves data transfer efficiency.
- Spooling allows multiple users to share devices like printers.
Use Buffering: Audio, video, and network communication.
Use Spooling: Printers and batch-processing devices.
GUI vs. CLI
Answer
Imagine two users on different systems: one operates a computer using icons and visual menus, while another works entirely by typing commands into a terminal.
- GUI (Graphical User Interface) uses windows, icons, and menus.
- CLI (Command Line Interface) requires text-based commands.
Key Differences:
- GUI is easier for beginners.
- CLI is faster and more powerful for experienced users.
Use GUI: Everyday personal computing.
Use CLI: System administration and automation.
Symmetric vs. Asymmetric Multiprocessing (SMP vs. AMP)
Answer
Example: Consider a server running multiple CPUs to process tasks simultaneously.
- Symmetric Multiprocessing (SMP): All processors are equal and share memory.
- Asymmetric Multiprocessing (AMP): One master processor controls the other slave processors.
Key Differences:
- SMP provides better load balancing.
- AMP is commonly used in specialized embedded systems.
Use SMP: General-purpose servers and desktops.
Use AMP: Dedicated control systems.
Parent Process vs. Child Process
Answer
Example: Think of a command-line shell starting up a new program to execute a specific command.
- A Parent Process creates one or more child processes.
- A Child Process inherits certain resources from its parent.
Key Differences:
- Child processes execute independently after creation.
- Parent Process: Responsible for creating children.
- Child Process: Performs assigned tasks separately.
Zombie Process vs. Orphan Process
Answer
Imagine two different execution issues: one process finishes its work but stays in the system, while another loses its creator unexpectedly.
- A Zombie Process has finished execution but still occupies an entry in the process table until its parent collects the exit status.
- An Orphan Process continues running after its parent terminates and is adopted by the init/system process.
Key Differences:
- Zombie: Dead but not removed from the process table.
- Orphan: Alive but running with a newly assigned parent.
Internal Command vs. External Command
Answer
Example: Consider a user executing different commands inside a terminal.
- Internal Commands are built directly into the shell/command interpreter.
- External Commands exist as separate standalone executable files on the disk.
Key Differences:
- Internal commands load instantly because they reside in memory.
- External commands provide heavy-lifting or additional functionality.
Examples:
- Internal: cd, dir, echo
- External: ping, format, gcc
Shared Memory vs. Message Passing
Answer
Imagine two parallel processes that need to exchange data quickly and efficiently.
- Shared Memory allows processes to directly access the exact same region of physical memory.
- Message Passing exchanges information safely using discrete send and receive system calls.
Key Differences:
- Shared memory is faster but requires complex synchronization to avoid conflicts.
- Message passing is simpler and safer, making it ideal for distributed systems.
Use Shared Memory: High-speed communication on a single machine.
Use Message Passing: Distributed and loosely coupled networks.
Polling vs. Interrupts
Answer
Imagine a CPU waiting for a keyboard keypress. It can either stare at the keyboard continuously asking "Is a key pressed yet?", or it can work on other things until the keyboard taps it on the shoulder.
- Polling repeatedly checks hardware device status in a loop.
- Interrupts notify the CPU via signals only when hardware attention is actually needed.
Key Differences:
- Polling wastes valuable CPU cycles doing nothing.
- Interrupts drastically improve CPU efficiency.
Use Polling: Simple or highly predictable embedded hardware.
Use Interrupts: Most modern general-purpose operating systems.
Hard Link vs. Soft Link
Answer
Example: A user wants two different filenames to refer back to the exact same file.
- Hard Link directly references the physical data blocks (inode) of the file.
- Soft Link (Symbolic Link) acts like a shortcut, storing the text path to another filename.
Key Differences:
- Hard links remain perfectly valid even if the original filename is deleted.
- Soft links break and become invalid if the target file is moved or removed.
Use Hard Link: Same filesystem with reliable references.
Use Soft Link: Flexible linking across different directories or filesystems.
FAT vs. NTFS
Answer
Example: A user needs to format an external USB flash drive versus formatting their primary Windows installation drive.
- FAT is simple, lightweight, and widely compatible across various platforms.
- NTFS supports advanced options like security permissions, encryption, compression, and massive file sizes.
Key Differences:
- FAT has lower overhead but caps individual file sizes at 4GB.
- NTFS offers vastly better reliability, data recovery features, and modern capabilities.
Use FAT: USB flash drives and cross-platform compatibility.
Use NTFS: Windows system drives and large internal hard drives.
Static Linking vs. Dynamic Linking
Answer
Example: A software application depends heavily on several shared system libraries to run.
- Static Linking copies all the required library code directly into the final executable file during compilation.
- Dynamic Linking leaves the libraries outside and links/loads them at runtime.
Key Differences:
- Static executables are much larger but completely standalone.
- Dynamic linking keeps file sizes small and allows libraries to be updated independently without rebuilding the app.
Use Static Linking: Standalone applications where absolute self-containment is needed.
Use Dynamic Linking: Standard practice for most modern operating systems.
Demand Paging vs. Pre-Paging
Answer
Imagine a program starting up that only needs a tiny fraction of its total memory space right away.
- Demand Paging loads a page into RAM only when the CPU explicitly tries to access it.
- Pre-Paging anticipates needs and loads multiple pages into RAM in advance.
Key Differences:
- Demand paging minimizes unnecessary memory waste from the start.
- Pre-Paging reduces initial page faults if future memory access patterns are highly predictable.
Use Demand Paging: General-purpose, multi-tasking operating systems.
Use Pre-Paging: Specific workloads with highly predictable sequential memory access.
Static Partitioning vs. Dynamic Partitioning
Answer
Imagine dividing up physical system memory before any user programs even start running.
- Static Partitioning cuts memory into fixed-size, permanent slots.
- Dynamic Partitioning carves out custom slots on the fly based exactly on the size of the incoming process.
Key Differences:
- Static partitioning is easy to implement but creates heavy internal fragmentation (wasted space inside a slot).
- Dynamic partitioning optimizes memory usage but can cause external fragmentation over time as processes open and close.
Use Static Partitioning: Simple or specialized embedded systems.
Use Dynamic Partitioning: Modern operating systems handling unpredictable process sizes.
Premium Content
Unlock Comparison - Part 2 and all premium lessons with a subscription.
All premium lessons
Ad-free experience
Priority support
From ₹199.99/year — See plans