1. Which of these is a type of operating system?
Operating systems can be classified by how they manage tasks: batch, time-sharing, real-time, etc. A batch operating system schedules jobs without manual intervention.
Get the Preplance app for a seamless learning experience. Practice offline, get daily streaks, and stay ahead with real-time interview updates.
Get it on
Google Play
4.9/5 Rating on Store
Microsoft · OS
Practice OS questions specifically asked in Microsoft interviews – ideal for online test preparation, technical rounds and final HR discussions.
Questions
46
Tagged for this company + subject
Company
Microsoft
View company-wise questions
Subject
OS
Explore topic-wise practice
Go through each question and its explanation. Use this page for targeted revision just before your Microsoft OS round.
Operating systems can be classified by how they manage tasks: batch, time-sharing, real-time, etc. A batch operating system schedules jobs without manual intervention.
For complete preparation, combine this company + subject page with full company-wise practice and subject-wise practice. You can also explore other companies and topics from the links below.
A process is an independent program in execution. It has its own memory space, resources, address space. A thread is a smaller unit of execution within a process. Threads share the same address space and resources of their parent process but have their own program counter and stack. Using threads is lighter weight, faster to switch between, and useful for concurrency inside a process, but you must handle synchronization carefully.
A system call is the mechanism by which a user program requests a service from the kernel of the operating system. It allows safe transition from user mode to kernel mode to execute privileged operations like file I O, process control or creating threads. It is important because it enforces protection, isolates user code from kernel code, and enables resource management.
In a time-sharing system the CPU switches among many users’ interactive tasks rapidly, giving the illusion that each user has their own machine. The OS allocates short time slices to tasks and context switches quickly. It improves responsiveness for many users.
The bootstrap program is the initial code run when a machine starts (after BIOS or firmware). It loads the operating system kernel into memory and starts execution of the OS.
A Process Control Block, or PCB, is a data structure used by the operating system to store all information about a process. It holds the process identifier (PID), process state (such as ready, running, waiting), CPU register values, memory limits, list of open files, scheduling information like priority or quantum, and pointers to parent and children processes. The OS uses the PCB when it needs to switch into or out of a process, resume the process later, or manage its resources.
In priority scheduling, if processes with low priority keep arriving, then a low priority process might never get CPU time. Without an aging mechanism (which increases priority over time), starvation becomes possible. FCFS and non-preemptive SJF will eventually serve everyone; Round Robin gives each process a time slice so starvation is less likely.
In preemptive scheduling the operating system can interrupt a running process (for example when its time slice expires or a higher priority process arrives) and switch to another process. For instance, Round Robin and priority with preemption are preemptive algorithms. Non-preemptive scheduling means once a process starts running it will continue until it finishes or blocks for I/O; the OS does not forcibly take the CPU away. First-Come-First-Served (FCFS) and non-preemptive SJF are examples. Preemptive gives better responsiveness but adds overhead from context switches; non-preemptive is simpler but may lead to worse response times and poor handling of interactive tasks.
The ready queue is the data structure or list maintained by the operating system where all processes that are ready and waiting for CPU time reside. The scheduler picks one from this queue to run next. Other queues include waiting (blocked) queue for I/O, and termination queue for completed processes.
External fragmentation happens when the free memory is split into small non-contiguous blocks and so a large request cannot be met although the sum of free memory would suffice. Internal fragmentation is wasted space inside an allocated block. Understanding fragmentation is key to memory management design. :contentReference[oaicite:1]{index=1}
Virtual memory allows processes to execute even if they are partially in physical RAM by using disk space as an extension and swapping pages in and out. This gives the illusion that the system has more memory than physically present, enables more processes to run, and simplifies memory management. :contentReference[oaicite:4]{index=4}
The Least Recently Used algorithm replaces the page that has been idle longest based on past usage. It approximates the optimal algorithm and helps reduce page faults. FIFO is simpler but may cause more faults; optimal is theoretical; MRU is usually worse in general. Interviewers expect you to know the trade-offs in overhead and complexity. :contentReference[oaicite:6]{index=6}
In first-fit allocation the OS searches the free list and allocates the first block that is large enough. It is simple and fast but may leave many small leftover blocks (external fragmentation). Best-fit tries to find the smallest adequate block but can suffer from many tiny unusable fragments; worst-fit picks the largest block leaving larger smallest leftover. These trade-offs are common interview topics. :contentReference[oaicite:8]{index=8}
In linked allocation, each file is a linked list of disk blocks and the directory holds a pointer to the first block. This method avoids external fragmentation but random access is slow because you must traverse links. It’s one of the basic allocation strategies asked in interviews. :contentReference[oaicite:1]{index=1}
In Linux system directories, /etc is the standard directory where system configuration files are kept. This question tests familiarity with file system structure, which often shows up in interviews. :contentReference[oaicite:3]{index=3}
Extent-based allocation assigns a file one or more large contiguous regions (extents) of disk blocks rather than many small scattered blocks. This reduces fragmentation, improves I/O performance for large sequential reads/writes, and simplifies block mapping. Many modern file systems such as XFS and ext4 use extents for scalability and performance. Demonstrating knowledge of extents can impress interviewers. :contentReference[oaicite:5]{index=5}
Mounting is the process by which the operating system makes a file system accessible at a certain directory (the mount point) in the directory tree. The mount point is the directory where the root of the new file system is attached. After mounting, users and programs can access files on that file system by traversing the directory tree. In interviews it’s useful to mention unmounting, mount flags (read-only, noexec) and how mount points tie multiple storage devices into one hierarchical namespace.
An interrupt is a signal from a device to the CPU indicating that it requires service. When the interrupt occurs, the CPU stops the current execution, saves state, and jumps to the interrupt service routine (ISR) to handle the device. In polling (or programmed I O), the CPU repeatedly checks the device’s status in a loop, which wastes CPU cycles. Interrupts allow more efficient use of the CPU since it can perform other work until a device signals. However interrupts add complexity in context switching and latency management.
Buffering is the technique where a temporary memory area (buffer) is used to hold data while it moves between two devices or between device and main memory. The purposes include: decoupling producer and consumer speeds, reducing number of I O operations, and smoothing out bursts of data. The trade-offs are: using additional memory, possible latency for filling buffer, and complexity in flushing or synchronising buffer contents. For example print spooling uses a buffer queue to accumulate print jobs before the printer handles them.
A Trusted Execution Environment (TEE) is a hardware-supported secure area of a processor that ensures confidentiality and integrity of code and data inside it, shielding them from even higher privilege software like the OS kernel. TEEs represent modern OS security extensions and show up in advanced interview discussion.
A cache is a small fast memory that stores copies of frequently accessed data or instructions to reduce access latency, often between CPU and main memory. A buffer is a temporary storage area used when data is moving between two devices or between device and memory, often to accommodate speed mismatch. The key difference is purpose: caching aims for reducing access time by exploiting locality, buffering aims for smoothing data transfer. In I O systems you might buffer disk writes and also cache disk reads; distinguishing these roles and trade-offs shows thorough understanding in interviews.
Aging is a technique used in scheduling and concurrency to gradually increase the priority of a process that has been waiting for a long time so as to prevent starvation. This ensures fairness. Interviewers expect you to know both starvation risk and aging mitigation.
The reader-writer problem is a classic concurrency scenario where multiple threads/processes can read a shared data resource simultaneously, but writes must be exclusive. The OS or synchronization library must ensure that while writers are active no readers read, and vice versa, or else consistency might break. For read-heavy workloads you might favour many concurrent readers and delay writers (reader-preference), but this risks writer starvation; for write-heavy you might favour writers or use priorities. Solutions include read/write locks, semaphores, or monitors. In interviews, showing awareness of trade-offs (fairness vs performance) is valuable.
In a resource allocation graph where each resource has a single instance, a directed cycle implies that a set of processes are waiting in a circular chain for resources held by each other — this indicates a deadlock condition. Recognising graph-based detection is a common interview point.
In Mandatory Access Control systems the OS enforces a central policy that limits how subjects (processes) can access objects based on security labels. The classic Bell-LaPadula model states ‘no read up’ and ‘no write down’ to preserve confidentiality. MAC is commonly discussed in OS security contexts.
The W^X (Write XOR Execute) policy means that memory pages are never both writable and executable at the same time. In other words a page is either writable (data) or executable (code), but not both. This mitigates a class of attacks where malicious code writes into a memory region and then executes it (such as buffer‐overflow shellcode). Many modern OS kernels and user code runtimes enforce W^X, making it harder for attackers to exploit memory corruption vulnerabilities.
Resource over-commit means that the hypervisor or virtualisation platform allows virtual machines collectively to hold more CPUs, RAM or storage allocations than the underlying physical host provides, relying on the fact that not all VMs will use their maximum at the same time. This improves utilisation but also introduces risk of contention and performance degradation. Knowing this risk-vs-benefit is useful in interviews.
In practice live migration is used to move running workloads off a host for maintenance without stopping services. While hardware compatibility matters, the key interview point is that migration enables high availability and service continuity. Explaining host compatibility, shared storage, network dependencies adds depth.
The SCAN algorithm (also called the elevator algorithm) moves the disk arm in one direction, servicing requests as it goes, until it hits one end of the disk, then reverses direction. This approach reduces arm movement and can offer better average wait times than simple methods. In interview settings, explaining the ‘elevator’ metaphor and its trade-offs (for example with SSTF) is valuable.
DMA allows a hardware controller (the DMA engine) to move data between memory and a device without continuous CPU intervention. This frees the CPU to perform other tasks while large blocks of I/O are transferred. An OS using DMA must coordinate memory buffers, interrupt service routines and bus arbitration. Understanding DMA is often asked in system-level OS interviews because it touches hardware-software boundary.
For an operating system to support hot-plug devices (such as USB drives or external peripherals) it must allow device drivers (often kernel modules) to load and unload dynamically at runtime. This ensures that the system recognizes new devices and removes them safely without rebooting. This topic demonstrates system internals knowledge in interviews.
In a monolithic kernel architecture many OS services (file system, network stack, device drivers) run in kernel space, giving high performance but larger trusted code base. A microkernel aims to keep the kernel minimal (basic services such as scheduling, IPC) and move other services to user space. This improves modularity, isolation and reliability but can incur overhead from message passing between services.
In a cloud infrastructure environment operating systems evolve to support massively scalable workloads, multi-tenant isolation, live migration, and hardware abstraction. Two important optimisations are: 1) Lightweight virtual machines or containers as first-class citizens rather than full user desktops, reducing overhead and enabling fast deployment. 2) Live migration of VMs or containers between hosts to enable maintenance, load balancing, scaling without downtime. Additionally OS kernels often incorporate I/O vertical scaling (e.g., SR-IOV for network devices), NUMA awareness for large servers, and software-defined storage or network abstractions. Holding awareness of these modern OS trends strengthens interview responses.
Observability in modern operating systems and platforms means having visibility into performance, reliability and resource usage at runtime so that operators can detect anomalies, diagnose faults and optimise behaviour. OS-level metrics to track include CPU utilisation, queue lengths of ready and I/O queues, memory usage, page fault rate, context-switch rate, interrupt rate, I/O latency, scheduler load, and for cloud OS also VM/container migration events, network packet drops and NUMA node imbalances. Referencing case studies of production OS helps you show applied knowledge in interviews.
Paging divides processes and memory into fixed-sized pages and frames. A process’s pages may reside in non-contiguous frames, which reduces external fragmentation and simplifies allocation. However internal fragmentation may still happen because a page may not be fully used. Paging relies on a page table to map logical pages to physical frames. :contentReference[oaicite:2]{index=2}
Programmed I O is the simplest I O method where the CPU repeatedly checks device status and then transfers data, causing the CPU to be busy with I O. Interrupt-driven I O improves efficiency: the device signals the CPU when it is ready and the CPU handles the transfer only then. Direct Memory Access (DMA) is the most efficient: the device controller or DMA hardware moves data between memory and device without busy CPU, freeing the CPU for other tasks. The trade-off is added complexity in hardware and handling synchronization of memory and bus access.
Direct Memory Access (DMA) permits devices to transfer data to or from main memory directly without continuous CPU intervention. A dedicated DMA controller requests control of the system bus, transfers a block of data, and then returns control to the CPU. The major advantages are: the CPU is freed from busy waiting for I O, overall system efficiency increases, large data transfers are more efficient, and I O throughput improves. The trade-off is increased complexity in the I O subsystem, handling of bus arbitration and ensuring coherence of data between CPU caches and memory.
There are four classic conditions that must simultaneously hold for a deadlock: mutual exclusion (resources cannot be shared and only one process may use a resource at a time), hold and wait (a process holds at least one resource and is waiting to acquire additional resources held by others), no preemption (resources cannot be forcibly taken from a process; they must be released voluntarily), and circular wait (a closed chain of processes exists where each process holds a resource needed by another process in the chain). If you break any one of these, you can prevent deadlock.
An OS can prevent deadlock by ensuring at least one of the four necessary conditions never holds. Two common techniques are: 1) Resource ordering – assign a global ordering to resources and require all processes to request resources in that order, thereby avoiding circular wait. 2) Preemption – allow the OS to preempt a resource from a process (breaking the no-preemption condition). For example, if a process holds some resources and requests others and cannot get them, the OS may force it to release its held resources. The trade-offs: ordering can be rigid and complex for many resource types; preemption can lead to wasted work or inconsistent state if resources are forcibly removed. In interviews, stating trade-offs shows deeper understanding.
A mutex lock is designed to provide mutual exclusion by allowing only one thread to hold the lock and enter a critical section at a time, thus preventing data races on shared data. Barriers wait for all threads, spin-locks busy-wait and semaphores may allow more than one holder unless used as binary; so understanding the subtle differences is important for interviews.
Kernel Patch Protection (such as PatchGuard in 64-bit Windows) periodically checks critical system structures to detect unauthorized modifications of the kernel. If tampering is detected, the OS may trigger a bug check or shut down to protect integrity. This defense elevates OS security by blocking rootkits and kernel-level malware.
Virtualisation is the process of creating virtual instances of physical resources — for example servers, storage or networks — so that you can run multiple separate environments on the same hardware. This improves resource utilisation and flexibility.
A virtual machine includes a full guest operating system and virtualised hardware, so each VM is isolated and runs independently. It uses a hypervisor to manage resources. A container, by contrast, shares the host OS kernel but isolates the user-space environment; containers are lighter weight, start faster and use fewer resources. Use-cases: VMs are good when full isolation and different OSs are needed (for instance running Windows and Linux on one host). Containers are ideal for microservices, rapid deployment and when many similar processes need to run in isolation but share host resources. Mentioning the trade-offs (isolation vs lightweight, flexibility vs overhead) is important for interviews.
A cache is aimed at reducing access latency by storing copies of frequently used data near the CPU or device; a buffer smooths data transfer by holding data temporarily between two entities with mismatched speeds. These are commonly confused in interview questions, so clearly stating the difference shows clarity.
When an OS encounters a kernel panic or fatal error the typical steps are: 1) Immediately halt or freeze further non-critical activities to prevent corruption. 2) Log diagnostic information (stack trace, register state, memory dump) so engineers can analyse root cause. 3) Attempt automatic recovery if supported (e.g., reboot to safe mode or use a redundant node in high availability systems). 4) For critical services the OS or platform might trigger fail-over to a standby system, preserve user sessions or state if possible, and restore service quickly. 5) On restart perform integrity checks (file system check, memory diagnostic) before resuming full operations. Mentioning high-availability OS patterns (redundant kernel, live patching) adds depth.
Live patching is the ability to apply changes (patches) to a running kernel or OS components without rebooting. This is critical for high-availability systems where downtime must be minimised. It typically involves loading new code modules, redirecting function calls, ensuring state consistency, and monitoring for regressions. By enabling hotfixes, security updates or module upgrades without taking the system offline, live patching supports service continuity and maintenance windows. In interview discussion you might mention how OS ensures safe patching (symbol versioning, interrupt quiescence, duplication of code) and risks (memory leaks, inconsistent state).