Questions & explanations
1. Give an example of a page reference string where FIFO produces more page faults than LRU, and explain why.
Consider the reference string: 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5 with 3 frames. FIFO would cause 9 page faults, while LRU would cause 10? Actually, let's check: FIFO: 1,2,3 (faults), 4 replaces 1 (fault), 1 replaces 2 (fault), 2 replaces 3 (fault), 5 replaces 4 (fault), 1 hits, 2 hits, 3 replaces 5 (fault), 4 replaces 1 (fault), 5 replaces 2 (fault) -> 9 faults. LRU: 1,2,3 (faults), 4 replaces 1 (fault), 1 replaces 2 (fault), 2 replaces 3 (fault), 5 replaces 4 (fault), 1 hits, 2 hits, 3 replaces 5 (fault), 4 replaces 1 (fault), 5 replaces 2 (fault) -> also 9? Actually, LRU might be same or better. A known example: 1,2,3,4,1,2,5,1,2,3,4,5 with 4 frames: FIFO gives 10 faults, LRU gives 8 faults. So FIFO can be worse.
2. How has deduplication evolved from early systems to modern cloud storage?
Early deduplication systems like Venti used fixed-size blocks and simple hash tables. Modern systems use variable-size blocks to better handle file changes, and they employ advanced algorithms like content-defined chunking. They also use faster hashing (e.g., SHA-1) and optimized indexes, sometimes with Bloom filters to reduce memory use. In cloud storage, deduplication is often combined with compression and erasure coding. Cloud providers use global deduplication across many users, but they must ensure data isolation and security. Some systems use inline deduplication (during write) to reduce bandwidth. Overall, deduplication has become a standard feature in backup, primary storage, and cloud services.
3. Compare deadlock detection with deadlock avoidance in terms of overhead and resource utilization.
Deadlock detection has lower runtime overhead because it does not require advance knowledge of future resource needs; it only checks for cycles periodically (e.g., every few seconds). However, when deadlock is detected, recovery (e.g., killing processes) can be costly and may lose work. Resource utilization can be high because there are no artificial restrictions. Deadlock avoidance (e.g., Banker's algorithm) has higher overhead because every resource request must be checked for safety, and it requires processes to declare maximum needs in advance, which may be unrealistic. Avoidance ensures no deadlock ever occurs, but can lead to lower resource utilization due to conservative granting.
4. Give an example of a protection problem that segmentation with paging can solve better than pure paging.
Consider a process that has two segments: one for code (read-execute) and one for data (read-write). In pure paging, all pages have the same protection bits per page table entry, so you can set code pages to read-execute and data pages to read-write. However, if a bug causes the program to treat a code page as data, it might accidentally write to it, causing a protection fault. Segmentation with paging adds an extra layer: the segment descriptor enforces that the entire code segment is not writable, even if individual page table entries allow write. This makes it harder for errors to bypass protection, because the segment check occurs before the page-level check.
5. What are the different types of 3D NAND cells (SLC, MLC, TLC, QLC) and their trade-offs?
SLC (single-level cell) stores one bit per cell, offering the fastest speed and highest endurance but lowest density. MLC (multi-level cell) stores two bits per cell, balancing speed and density. TLC (triple-level cell) stores three bits, increasing density but reducing speed and endurance. QLC (quad-level cell) stores four bits, achieving the highest density but with slower writes and lower lifespan. In 3D NAND, these cell types are used in different layers or products. For example, consumer SSDs often use TLC or QLC for cost, while enterprise drives use SLC or MLC for performance. The choice depends on the application's need for speed, capacity, or durability.
6. What is a hypervisor and how does it differ from a container runtime like Docker?
A hypervisor is software that creates and runs virtual machines (VMs) by emulating hardware, allowing multiple operating systems on one physical machine. A container runtime, like Docker, runs isolated user-space instances (containers) that share the host OS kernel. Hypervisors provide stronger isolation but more overhead, while containers are lighter and start faster. For example, you can run Windows and Linux VMs on one server using a hypervisor, but containers on the same host must use the same OS kernel. Container orchestration tools like Kubernetes manage many containers across servers, while hypervisor management is often done by platforms like VMware.
7. Compare the working set model with the page fault frequency (PFF) approach for thrashing prevention.
Both aim to prevent thrashing by controlling memory allocation. The working set model explicitly tracks the set of pages a process needs within a time window, and the OS ensures that set is in memory. The page fault frequency (PFF) approach monitors the rate of page faults per process. If a process's fault rate is above a high threshold, the OS gives it more frames; if below a low threshold, it takes frames away. PFF is easier to implement because it only needs a counter, while the working set model requires tracking the set of pages referenced in a window. Both can effectively prevent thrashing, but PFF reacts to faults rather than predicting needs.
8. Why did the Fifth Generation project not fully succeed?
The Fifth Generation project did not fully succeed because its goals were too ambitious. It aimed to create human-level intelligence, but AI technology at the time was not advanced enough. The project focused on logic programming and parallel machines, but these approaches turned out to be less effective for many tasks. Also, the project underestimated the difficulty of common-sense reasoning and natural language understanding. By the 1990s, other approaches like neural networks and statistical methods became more successful. The project ended in 1992 without producing a revolutionary AI system, but it advanced some areas like parallel computing.
9. How does printing electronics compare to traditional chip manufacturing?
Printing electronics is like printing a newspaper, while traditional chip manufacturing is like carving tiny patterns on a stone. Printing uses inks with conductive or semiconducting materials and deposits them layer by layer onto a flexible substrate like plastic. This process is much cheaper and faster for large-area devices, but the features are larger (micrometers vs nanometers) and less precise. Traditional chip making uses photolithography to etch tiny transistors on silicon wafers, achieving high speed and density. Printing is better for low-cost, flexible applications like smart labels, while silicon is for high-performance computers.
10. What is the difference between deadlock prevention and deadlock avoidance?
Deadlock prevention ensures that at least one of the four necessary conditions (mutual exclusion, hold and wait, no preemption, circular wait) cannot hold, making deadlock impossible. For example, requiring a process to request all resources at once prevents hold and wait. Deadlock avoidance, on the other hand, uses knowledge of future resource requests to decide whether to grant a request, ensuring the system stays in a safe state. The Banker's algorithm is a classic avoidance method. Prevention is more conservative and may reduce resource utilization, while avoidance allows more concurrency but requires advance knowledge of resource needs.
11. How did the Fifth Generation project influence AI research in other countries?
The Fifth Generation project alarmed other countries, especially the US and UK, who feared falling behind in AI. In response, the US launched the Strategic Computing Initiative in 1983, and the UK started the Alvey program. These projects funded AI research in areas like expert systems and parallel computing. The Japanese project also popularized logic programming languages like Prolog. However, the project's focus on symbolic AI and parallel hardware eventually became less influential as statistical methods and machine learning rose. Still, it showed the importance of government investment in AI and led to increased global research efforts.
12. What is assembly language, and why was it used for mainframe system programming instead of a high-level language like COBOL?
Assembly language is a low-level programming language where each instruction directly matches a machine code command for the processor. It was used for mainframe system programming because it gives the programmer full control over the hardware, memory, and registers. High-level languages like COBOL hide these details, making them less efficient for tasks like writing operating system components or device drivers. Assembly code can be faster and more compact, which was critical when mainframes had limited memory and CPU power. Today, most system programming is done in C or other languages, but assembly is still used for very low-level parts.