AMCAT Operating Systems Fundamentals Flashcards
6 cards from real AMCAT practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 AMCAT Operating Systems Fundamentals flashcards as text
Which page replacement algorithm is known as the optimal algorithm but is impractical for real-time use?
Answer: Optimal Page Replacement (OPT/Belady's)
The Optimal Page Replacement algorithm (also known as Belady's algorithm) replaces the page that will not be used for the longest time in the future. While it produces the minimum number of page faults, it requires future knowledge of memory references, making it impractical for real systems. It is used as a benchmark to evaluate other algorithms.
What is the main advantage of a multilevel feedback queue scheduling algorithm?
Answer: It can adapt to the behavior of processes by moving them between queues of different priorities
A multilevel feedback queue scheduler dynamically adjusts process priorities based on their behavior. CPU-bound processes that use their full time quantum are moved to lower-priority queues, while I/O-bound processes that release the CPU early stay in higher-priority queues. This adaptability makes it versatile.
In a system using demand paging, when is a page loaded into memory?
Answer: Only when the page is actually accessed and causes a page fault
Demand paging is a lazy loading strategy where pages are loaded into physical memory only when they are actually needed (demanded) by the process. When a process accesses a page not in memory, a page fault occurs, and the OS loads that specific page from disk.
What is the Banker's Algorithm used for in operating systems?
Answer: Deadlock avoidance by determining if resource allocation will leave the system in a safe state
The Banker's Algorithm, proposed by Dijkstra, is a deadlock avoidance strategy. Before granting a resource request, it simulates the allocation to check if the system would remain in a 'safe state' — meaning all processes can still complete. If the allocation would lead to an unsafe state, the request is denied.
Which of the following best describes thrashing in an operating system?
Answer: The system spending most of its time swapping pages in and out of memory rather than executing processes
Thrashing occurs when the system is overcommitted on memory, causing processes to continuously generate page faults. The OS spends almost all its time swapping pages between RAM and disk, and very little time doing actual useful computation. CPU utilization drops drastically during thrashing.
What is the difference between preemptive and non-preemptive scheduling?
Answer: In preemptive scheduling, a running process can be interrupted and moved to ready state; in non-preemptive, a process runs until it voluntarily yields or completes
In preemptive scheduling, the OS can forcibly interrupt a running process (e.g., when a higher-priority process arrives or a time quantum expires) and place it back in the ready queue. In non-preemptive scheduling, a process keeps the CPU until it terminates or voluntarily enters a waiting state.