Unit 6 - Practice Quiz

CSE316

1 Which of the following acts as an interface between the user and the file system to effectively manipulate files?

A. Device Driver
B. Directory Structure
C. File Attributes
D. File Control Block

2 Which file attribute is a unique tag, usually a number, that identifies the file within the file system?

A. Name
B. Identifier
C. Location
D. Type

3 In which file access method is information in the file processed in order, one record after the other?

A. Direct Access
B. Sequential Access
C. Indexed Access
D. Relative Access

4 What is the main problem with a single-level directory structure?

A. Slow access time
B. Grouping of files is logical
C. Naming collision and grouping
D. Complex path names

5 In a tree-structured directory, a path name that begins at the root is known as:

A. Relative path name
B. Absolute path name
C. Indexed path name
D. Rooted path name

6 Which directory structure allows directories to share subdirectories and files, essentially permitting a file to appear in more than one directory?

A. Two-level directory
B. Tree-structured directory
C. Acyclic-graph directory
D. Single-level directory

7 The operating system function that makes a file system available for use at a specific location in the directory tree is called:

A. Formatting
B. Mounting
C. Linking
D. Spooling

8 In the context of file protection, which mechanism associates a list of users and their allowed access types with each file?

A. Password protection
B. Capability Lists
C. Access Control List (ACL)
D. Bit Vector

9 Which of the following file allocation methods suffers from external fragmentation?

A. Linked Allocation
B. Indexed Allocation
C. Contiguous Allocation
D. Hashed Allocation

10 In Linked Allocation, if a block size is 512 bytes and 4 bytes are used for the pointer, what is the effective data size per block?

A. 512 bytes
B. 516 bytes
C. 508 bytes
D. 500 bytes

11 What is the major disadvantage of Linked Allocation used alone (without a FAT)?

A. External fragmentation
B. Declaration of size required at creation
C. Inefficient for direct (random) access
D. Directory implementation is complex

12 Indexed allocation solves the external fragmentation problem and supports direct access by using:

A. A File Allocation Table (FAT)
B. An index block containing pointers to data blocks
C. A linked list of blocks
D. A contiguous set of blocks

13 In the UNIX 'inode' structure, what happens if a file is larger than what the direct blocks can address?

A. The file cannot be stored.
B. A single indirect block is used.
C. The system switches to contiguous allocation.
D. The file is compressed automatically.

14 Which free-space management method uses a string of binary digits where 1 represents a free block and 0 represents an allocated block (or vice versa)?

A. Linked List
B. Grouping
C. Counting
D. Bit Vector / Bitmap

15 If a disk has blocks and the bit vector method is used for free-space management, what is the size of the bit map in bytes?

A. bytes
B. bytes
C. bytes
D. bytes

16 In Directory Implementation, which method handles naming collisions in a Hash Table structure?

A. Linear probing or Chained overflow hash table
B. Creating a new partition
C. Converting to a linear list
D. Denying file creation

17 Devices that transfer data one character at a time, such as keyboards and serial ports, are known as:

A. Block devices
B. Character devices
C. Network devices
D. Direct access devices

18 A device that is assigned to only one process at a time (e.g., a tape drive) is called a:

A. Shared device
B. Virtual device
C. Dedicated device
D. Spooled device

19 What technique allows a dedicated device (like a printer) to appear as a shared device by intercepting output and writing it to a disk buffer?

A. Swapping
B. Spooling
C. Paging
D. Caching

20 Which component in the DASD architecture acts as an interface between the computer system's bus and the disk drives, often handling error correction?

A. Disk Platter
B. Disk Arm
C. Disk Controller / Control Unit
D. Read-Write Head

21 The time it takes for the disk arm to move the heads to the cylinder containing the desired sector is called:

A. Rotational Latency
B. Seek Time
C. Transfer Time
D. Access Time

22 Which Disk Scheduling algorithm selects the request with the least seek time from the current head position?

A. FCFS
B. SSTF
C. SCAN
D. C-SCAN

23 What is the primary disadvantage of the SSTF (Shortest Seek Time First) algorithm?

A. It is difficult to implement.
B. It does not minimize average seek time.
C. It may cause starvation for some requests.
D. It performs unnecessary head movements.

24 Which disk scheduling algorithm works like an elevator, moving the head in one direction servicing requests until it reaches the end, then reversing direction?

A. FCFS
B. SSTF
C. SCAN
D. C-LOOK

25 Consider a disk queue with requests for I/O to blocks on cylinders: 98, 183, 37, 122, 14, 124, 65, 67. If the head is at 53, what is the first request serviced by FCFS?

A. 14
B. 37
C. 65
D. 98

26 The C-SCAN algorithm differs from SCAN in that:

A. It services requests in both directions.
B. When it reaches the end, it immediately returns to the beginning without servicing requests on the return trip.
C. It only goes as far as the last request, not the end of the disk.
D. It selects the shortest seek time next.

27 Which version of SCAN only goes as far as the last request in each direction, rather than the full width of the disk?

A. C-SCAN
B. LOOK
C. F-SCAN
D. N-Step SCAN

28 Inter Process Communication (IPC) is required for processes that are:

A. Independent
B. Cooperating
C. Zombie
D. Orphan

29 Which of the following is NOT a standard method of IPC?

A. Shared Memory
B. Message Passing
C. Pipes
D. Cache Coherence

30 In a standard UNIX 'pipe' (ordinary pipe), communication is:

A. Bidirectional (Full Duplex)
B. Unidirectional (Half Duplex)
C. Network based
D. Persistent after process termination

31 Ordinary pipes typically require what relationship between the communicating processes?

A. They must be unrelated.
B. They must have a Parent-Child relationship.
C. They must run on different machines.
D. They must use a shared key.

32 Which C library function creates a pipe, forks a child, and invokes the shell to execute a command?

A. pipe()
B. mkfifo()
C. popen()
D. exec()

33 The function pclose() is used to:

A. Close a standard file pointer.
B. Close a stream opened by popen() and wait for the child process to terminate.
C. Delete a named pipe.
D. Detach shared memory.

34 What is the primary difference between a FIFO (Named Pipe) and an ordinary pipe?

A. FIFOs are slower.
B. FIFOs exist as a device file in the file system and allow unrelated processes to communicate.
C. FIFOs only allow parent-child communication.
D. FIFOs cannot be used for writing.

35 Which system call is used to create a Named Pipe (FIFO) in UNIX/Linux?

A. pipe()
B. shmget()
C. mkfifo()
D. msgget()

36 Which IPC method is generally considered the fastest because it avoids copying data between kernel and user space?

A. Message Queues
B. Pipes
C. Sockets
D. Shared Memory

37 When using Shared Memory, what additional mechanism is usually required to prevent race conditions?

A. Context Switching
B. Synchronization (e.g., Semaphores)
C. Paging
D. Disk Scheduling

38 In a Message Queue IPC, messages are stored in:

A. A contiguous block of shared memory
B. A linked list within the kernel
C. A text file on the disk
D. The CPU registers

39 Which property allows Message Queues to support retrieving specific types of messages (not just FIFO order)?

A. Message Type/Priority
B. Message Timestamp
C. Sender PID
D. Queue Size

40 Which of the following describes the Producer-Consumer problem in the context of IPC?

A. One process produces data that another process consumes.
B. One process writes to disk, another reads from network.
C. Two processes try to print at the same time.
D. The OS scheduling produces time slices.

41 If a file system uses 4KB blocks and a file is 5KB in size, how much space is wasted due to internal fragmentation?

A. 1 KB
B. 2 KB
C. 3 KB
D. 4 KB

42 Which disk scheduling algorithm guarantees that the disk arm moves in only one direction until it reaches the edge of the disk platter?

A. SCAN
B. C-SCAN
C. SSTF
D. Both SCAN and C-SCAN

43 What is a 'hard link' in UNIX file systems?

A. A special file containing the path to another file.
B. A directory entry that points to the same inode as another file.
C. A link that spans across different file systems.
D. A shortcut on the desktop.

44 In the context of DASD, what is a 'Sector'?

A. The smallest addressable unit of a disk.
B. The collection of all tracks at the same radius.
C. The device controller hardware.
D. The complete surface of a platter.

45 What is the result of popen("ls -l", "r")?

A. It executes ls -l and returns a file pointer to read the output.
B. It executes ls -l and writes the output to the screen directly.
C. It creates a file named ls -l.
D. It returns a process ID of the shell.

46 Which free space management technique involves keeping the address of the first free block in a specific location, and that block contains addresses of other free blocks?

A. Bit Vector
B. Linked List
C. Grouping
D. Counting

47 Which variation of the Linked List free space management stores free block addresses in the first free block?

A. Grouping
B. Counting
C. Bit Map
D. Indexing

48 In a Combined Scheme (like UFS inodes), if a block is 4KB and a pointer is 4 bytes, how many direct blocks can a single index block address?

A. 256
B. 512
C. 1024
D. 2048

49 Which access method is most suitable for a Database Management System?

A. Sequential Access
B. Direct / Random Access
C. Tape Access
D. Stack Access

50 What happens if a process attempts to write to a pipe that has no readers?

A. The data is buffered until a reader appears.
B. The writing process receives a SIGPIPE signal.
C. The write fails silently.
D. The pipe creates a temporary file.