Question 1
EasyWhat is a drawback of contiguous file allocation?
- A.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Operating Systems
What is a drawback of contiguous file allocation?
It needs a pointer in every block
No support for sequential access
Very slow random access
External fragmentation and difficulty in growing files
Answer: D
Each file needs one run of free blocks, so space fragments and files can't easily grow.
What is the main weakness of linked allocation?
It needs contiguous blocks
It causes external fragmentation
Files can't grow
Random (direct) access is slow because the chain must be followed
Answer: D
To reach block n you must read the n − 1 blocks before it.
How does indexed allocation work?
Each block points to the next
Blocks are chosen at random each time
Blocks are stored next to each other
Each file has an index block holding pointers to all its data blocks
Answer: D
The index block supports direct access without external fragmentation.
Which of these is NOT stored in a Unix inode?
Pointers to the data blocks
The file size
The file name
The owner and permissions
Answer: C
Names live in directories, which map names to inode numbers; this is why one inode can have several names (hard links).
What does a directory do in a file system?
Stores the contents of every file
Maps file names to the files (or inodes) they refer to
Schedules disk requests
Allocates memory to processes
Answer: B
A directory is a table of name-to-file entries; directories can contain other directories.
How does a hard link differ from a symbolic (soft) link?
A symbolic link copies the file
A hard link stores a path; a symbolic link shares the inode
They are the same
A hard link points to the same inode; a symbolic link stores a path to another file
Answer: D
Hard links are extra names for the same inode. A symbolic link is a small file containing a path.
What does the File Allocation Table (FAT) store?
For each disk block, the number of the next block of the file
The file names
The process table
The free memory list
Answer: A
FAT is linked allocation with the links kept in a table, which can be cached in memory for faster access.
What is a file?
A named collection of related data stored on secondary storage
A type of cable
A running program
A part of the CPU
Answer: A
Files give a logical, named view of data stored on disks or SSDs.
What are file attributes?
Errors inside a file
The contents of a file
Copies of a file
Information about a file such as its name, size, type, owner and timestamps
Answer: D
Attributes (metadata) are kept separately from the file's data.
What is a file extension (such as .pdf or .jpg) mainly used for?
Encrypting the file
Showing the type of the file
Showing the file's size
Locking the file
Answer: B
Systems and users use the extension to decide which program opens the file.