📝 NTFS file system B+ tree in window 7 (8 MCQs)
Indexed Directory Organisation in NTFS
NTFS uses B-tree family indexing structures, commonly described as B+ tree style indexes, to organise directory entries and support efficient filename lookup. The index stores key information such as filename attributes and references to file records. This structure allows directories containing many entries to be searched and updated without scanning every filename sequentially.
Why Large Directories Need Balanced Indexes
A linear directory search becomes increasingly expensive as the number of entries grows. Balanced tree structures reduce the number of comparisons needed to locate a name and can support insertions and deletions efficiently. NTFS uses index allocation structures to manage directory entries beyond the smallest resident index representation.
Index Root, Allocation and Lookup
A directory contains an index root attribute holding initial index information. When the directory grows, additional index buffers are allocated and organised through index structures. NTFS compares filename keys during traversal and follows child references until it locates a matching entry or determines that the name is absent.
Example of Searching a Large Directory
A directory contains 10,000 filenames. Rather than comparing the requested name against every entry in sequence, NTFS uses its directory index to follow an ordered path through index nodes. The search visits a limited number of index levels, making lookup more efficient than a full linear scan.
Lookup Performance and Index Maintenance
Balanced indexing improves lookup and insertion behaviour for large directories. Index structures require additional metadata and maintenance when files are created, renamed, or deleted. The exact layout is an NTFS implementation detail, and textbook B+ tree descriptions simplify the actual index and collation rules used by Windows.
Misconceptions About NTFS Directory Indexes
'Every NTFS directory is stored as one flat list' ignores its index structures. 'The B+ tree stores all file contents' confuses filename indexing with data allocation. 'Tree lookup requires checking every entry' overlooks the efficiency of balanced hierarchical searching.
Exam Focus: Directory Index Searching and Growth
Explain how balanced indexes reduce directory lookup work and identify the roles of index root and index allocation. Compare indexed lookup with linear search. Questions may ask why large directories benefit from tree structures or distinguish filename indexes from MFT records and file data runs.
Key Terms of NTFS B+ Tree Indexing
- B+ tree - Balanced hierarchical search index.
- Index root - Directory's initial index structure.
- Index buffer - Storage for additional index entries.
- Key - Value used to order index entries.
- Lookup - Search for a directory entry.
📝 All NTFS file system B+ tree in window 7 MCQs
Q1. A Windows system is running low on physical memory. Which of the following actions will the VM manager most likely take first to free memory?
📖 Explanation: The VM manager follows a per‑working‑set LRU policy, so when memory is scarce it looks for the least‑recently used pages in each process. Trimming the oldest pages removes memory that has not been accessed recently, freeing space quickly. Option B describes this behavior. Options A and D would increase memory pressure, while C would stop the aging mechanism, preventing the manager from identifying candidates for removal.
Q2. If a process has a hard limit on its physical memory usage, what will happen when the system has plenty of free memory?
📖 Explanation: A hard limit caps the amount of physical memory a process may occupy, regardless of overall system availability. Therefore the process cannot exceed that cap, and the VM manager will enforce the limit by refusing to allocate additional pages, even if free RAM exists. Option D correctly reflects this enforcement. Option A is opposite, B would cause unnecessary swapping, and C suggests the limit is ignored, which contradicts the definition of a hard limit.
Q3. A page‑file PTE contains 5 bits for protection, a 32‑bit offset, 4 bits for paging‑file selection, and 20 reserved bits. How many bits in total are defined for this PTE?
📖 Explanation: Add the individual fields: 5 protection bits plus 32 bits for the offset, plus 4 bits that identify which paging file, plus 20 reserved bits. The sum is bits, which is the total size of the defined fields. Option A presents the correct calculation. The other options give common round numbers but do not match the actual field sizes described.
Q4. During the periodic pass that ages pages, the VM manager increments the age counter only for pages that have not been marked as referenced. How does this policy affect the ordering of pages for trimming?
📖 Explanation: By increasing the age only for pages that lacked a reference bit, the manager assigns larger age values to pages that have not been used recently. Those pages rise to the top of the trim list, so they are the first candidates for removal. Option C captures this effect. Option A reverses the relationship, B ignores the reference status, and D would erase the aging information each cycle, preventing any prioritization.
Q5. Why does Windows use a per‑working‑set LRU replacement policy instead of a single global LRU list?
📖 Explanation: A per‑working‑set LRU keeps each process’s memory management independent, so a single heavy‑user cannot evict pages belonging to other processes. This isolation promotes fairness and predictable performance. Option A describes that benefit. Option B is vague; the policy actually adds some complexity. Option C is inaccurate because the CPU overhead is comparable. Option D is false because limits still exist; the policy does not remove memory caps.
Q6. What is the significance of having 4 bits dedicated to selecting the paging file in a page‑file PTE?
📖 Explanation: Four bits can represent different values, so the OS can distinguish up to sixteen separate paging files. This capability is useful on systems that spread paging data across multiple files for performance or capacity reasons. Option C reflects this combinatorial capacity. Option A confuses bits with page count, B relates to size rather than file selection, and D invents a security function that is not part of the paging‑file selection field.
Q7. When the T, P, and V bits are all zero in a PTE, what does this indicate about the page?
📖 Explanation: All three control bits (T for transition, P for prototype, V for valid) being zero means the page is neither present in RAM nor a prototype; instead it resides in the page file awaiting demand load. Therefore the page is non‑resident. Option C matches this interpretation. Options A and D describe different states, and B would require the P bit to be set, which is not the case here.
Q8. How many bits are allocated for page protection in a page‑file PTE?
📖 Explanation: The specification states that the page‑file PTE includes 5 bits dedicated to page protection, which encode read, write, execute, and other attributes. Thus the correct answer is 5 bits. Option B provides this number. The other options (4, 6, 8) do not match the defined field size and would either omit needed protection flags or allocate unnecessary space.