0% found this document useful (0 votes)
2 views

OS Practice MCQs F24

The document consists of multiple-choice questions (MCQs) related to operating systems, covering topics such as the purpose of operating systems, system calls, memory management techniques, process scheduling algorithms, and synchronization mechanisms. Each question presents four options, testing knowledge on fundamental concepts in software engineering and operating systems. The document serves as a practice resource for students in the Software Engineering Department.

Uploaded by

xyz.roughuse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

OS Practice MCQs F24

The document consists of multiple-choice questions (MCQs) related to operating systems, covering topics such as the purpose of operating systems, system calls, memory management techniques, process scheduling algorithms, and synchronization mechanisms. Each question presents four options, testing knowledge on fundamental concepts in software engineering and operating systems. The document serves as a practice resource for students in the Software Engineering Department.

Uploaded by

xyz.roughuse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Software Engineering Department

Operating Systems Practice MCQs


Do Practice of the following MCQs.

1. What is the primary purpose of an operating system?

a) To manage hardware resources and provide services to applications

b) To develop software applications

c) To enhance computer performance

d) To manage networking protocols

2. Which component of the operating system interacts directly with the hardware?

a) Kernel

b) Shell

c) File System

d) Application Software

3. System calls provide an interface to the services made available by the operating system to:

a) Hardware components

b) Applications

c) Other operating systems

d) Network protocols

4. Which of the following is an example of a system call for file management?

a) fork()

b) open()

c) exec()

d) wait()

5. What is the purpose of a process control block (PCB)?

a) To manage the execution of multiple threads

1|Page
Engr. Majida Hassan Ghouri
Software Engineering Department

b) To store information about a process

c) To schedule processes

d) To manage virtual memory

6. Which scheduling algorithm aims to reduce the average waiting time?

a) Round Robin

b) Shortest Job First (SJF)

c) First Come First Serve (FCFS)

d) Priority Scheduling

7. Which of the following is an example of IPC (Inter-Process Communication) mechanism?

a) Pipes

b) Threads

c) CPU Scheduling

d) Context Switching

8. Semaphore and Mutex are used for:

a) Managing processes

b) Achieving synchronization

c) Memory allocation

d) File management

9. What is the purpose of demand paging?

a) To increase the speed of swapping

b) To reduce the amount of main memory needed

c) To bring pages into memory only when needed

d) To increase the size of the page file

10. Which memory allocation technique supports the concept of virtual memory?

2|Page
Engr. Majida Hassan Ghouri
Software Engineering Department

a) Contiguous Memory Allocation

b) Paging

c) Segmentation

d) Swapping

11. What is the primary advantage of using threads in a process?

a) Threads are easier to create than processes

b) Threads allow for better parallelism

c) Threads consume less memory

d) Threads do not require synchronization

12. Which threading model allows multiple threads to run concurrently on multiple processors?

a) Many-to-One Model

b) One-to-One Model

c) Many-to-Many Model

d) Two-level Model

13. What is the critical section problem concerned with in synchronization?

a) Ensuring only one process accesses a shared resource at a time

b) Preventing deadlock situations

c) Managing CPU scheduling

d) Allocating memory to processes

14. Which condition is necessary for a deadlock to occur?

a) Mutual exclusion

b) No preemption

c) Hold and wait

d) Circular wait

3|Page
Engr. Majida Hassan Ghouri
Software Engineering Department

15. What is the disadvantage of segmentation in memory management?

a) It does not support sharing of code and data

b) Segments are of variable size

c) Difficulty in implementation due to variable-length partitions

d) Inefficient use of memory space

16. In paging, what is a page fault?

a) Accessing a page that is not present in the main memory

b) Excessive memory allocation to a process

c) Fragmentation of memory pages

d) Paging the wrong page in a sequence

17. What is the purpose of a file allocation table (FAT) in file systems?

a) It stores the file names and their attributes

b) It manages free space on the disk

c) It maintains the structure of directories

d) It controls access permissions to files

18. Which disk scheduling algorithm aims to minimize the average seek time?

a) FCFS (First Come First Serve)

b) SCAN

c) C-LOOK

d) SSTF (Shortest Seek Time First)

19. What is the purpose of swap space in operating systems?

a) To store temporary files

b) To provide additional RAM when the physical memory is full

c) To swap user processes to the kernel space

4|Page
Engr. Majida Hassan Ghouri
Software Engineering Department

d) To manage file system metadata

20. How does Virtual Memory aid in system protection?

a) By encrypting the entire memory

b) By dividing the memory into secure and insecure sections

c) By implementing memory segmentation

d) By providing memory protection through address spaces

21. Which directory structure organizes files and folders in a hierarchical tree-like structure?

a) Flat directory structure

b) Binary tree structure

c) Hierarchical directory structure

d) Indexed directory structure

22. What is the purpose of the Master File Table (MFT) in the NTFS file system?

a) It contains information about file permissions

b) It stores file names and their corresponding data blocks

c) It maintains a log of disk operations

d) It stores metadata about files and directories

23. Which free space management technique maintains a list of free disk blocks?

a) Bit vector

b) Linked list

c) Counting method

d) Bitmap

24. In disk scheduling algorithms, which technique prioritizes requests that are closest to the
current position of the disk arm?

a) FCFS (First-Come, First-Served)

b) SCAN

5|Page
Engr. Majida Hassan Ghouri
Software Engineering Department

c) C-LOOK

d) SSTF (Shortest Seek Time First)

25. What is the primary purpose of virtual machines in operating systems?

a) To simulate physical hardware components

b) To create an isolated environment for applications

c) To accelerate CPU performance

d) To enhance file system security

26. How does a Type-1 hypervisor differ from a Type-2 hypervisor?

a) Type-1 runs directly on the hardware, while Type-2 runs on a host operating system

b) Type-2 provides better performance than Type-1

c) Type-1 is used in desktop virtualization, while Type-2 is used in server virtualization

d) Type-1 requires internet connectivity, whereas Type-2 does not

27. Which file access method allows reading and writing operations at any point in the file?

a) Sequential access

b) Direct access

c) Indexed access

d) Contiguous access

28. What does the 'inode' contain in Unix-like file systems?

a) File contents

b) File name and attributes

c) Directory structure

d) File metadata and pointers to data blocks

29. How does memory mapping of files enhance performance in an operating system?

a) By reducing the file size

6|Page
Engr. Majida Hassan Ghouri
Software Engineering Department

b) By eliminating the need for file system access for I/O operations

c) By compressing the file contents in memory

d) By removing file access restrictions

30. Which term describes the situation where the operating system spends a significant amount
of time swapping pages instead of executing instructions?

a) Fragmentation

b) Paging

c) Thrashing

d) Contention

31. Which system call is used to create a new process in Unix-like operating systems?

a) exec()

b) fork()

c) wait()

d) pipe()

32. What is the purpose of the 'chmod' command in Unix-like operating systems?

a) Change file ownership

b) Change file permissions

c) Compress files

d) Copy files

33. Which of the following describes a disadvantage of paging compared to segmentation?

a) Overhead in table management

b) Difficulty in implementing protection and sharing

c) Unequal partition sizes

d) Fragmentation issues

7|Page
Engr. Majida Hassan Ghouri
Software Engineering Department

34. How does segmentation differ from paging in memory management?

a) Segmentation uses fixed-size blocks, while paging uses variable-sized blocks

b) Segmentation allows logical division of programs into segments, while paging divides
programs into fixed-size pages

c) Segmentation eliminates fragmentation while paging causes fragmentation

d) Segmentation is faster than paging in accessing memory blocks

35. Which scheduling algorithm gives priority to the process with the highest CPU burst time?

a) First Come First Serve (FCFS)

b) Round Robin

c) Shortest Job First (SJF)

d) Priority Scheduling

36. What is a race condition in multithreading?

a) A condition where multiple threads try to access a shared resource


simultaneously

b) A situation where only one thread can access a resource at a time

c) A deadlock situation in threads

d) A condition where threads cannot be scheduled

37. What is the purpose of the Translation Lookaside Buffer (TLB) in virtual memory systems?

a) It stores recently accessed disk blocks

b) It caches frequently accessed pages' frame numbers

c) It manages memory allocation for processes

d) It maintains the page table hierarchy

38. In demand paging, what happens when a page fault occurs?

a) The operating system terminates the process

b) The required page is fetched from the disk to main memory

8|Page
Engr. Majida Hassan Ghouri
Software Engineering Department

c) The page table is cleared

d) The processor switches to kernel mode

39. Which technique is used for deadlock avoidance in operating systems?

a) Banker's Algorithm

b) Deadlock Ignorance

c) Deadlock Detection

d) Deadlock Prevention

40. What is the purpose of a resource allocation graph in deadlock detection?

a) To identify processes waiting for resources

b) To represent processes and resources, identifying potential circular waits

c) To allocate resources efficiently

d) To prevent deadlock situations

41. Which synchronization mechanism allows multiple threads to access a shared resource
simultaneously?

a) Mutex

b) Semaphore

c) Critical section

d) Barrier

42. What is the purpose of a critical section in concurrent programming?

a) It ensures that only one process executes at a time

b) It ensures that a process executes without interruption

c) It protects shared resources from simultaneous access by multiple threads

d) It ensures fair access to resources

43. Which part of the address generated by the CPU is used as an index in the page table?

a) Offset

9|Page
Engr. Majida Hassan Ghouri
Software Engineering Department

b) Segment

c) Page number

d) Frame number

44. How does thrashing impact system performance in virtual memory?

a) Improves CPU utilization

b) Reduces the number of page faults

c) Degrades system performance due to excessive paging

d) Increases memory access time

45. In a Unix-like file system, what is the purpose of the 'unlink' system call?

a) Deletes a file

b) Creates a hard link to a file

c) Renames a file

d) Opens a file

46. Which disk scheduling algorithm optimizes disk arm movement by selecting requests in
the direction of disk head movement until there are no more requests in that direction?

a) SCAN

b) C-SCAN

c) LOOK

d) C-LOOK

47. What is the purpose of an Access Control List (ACL) in operating system security?

a) To control access to network resources

b) To manage permissions for users on files or directories

c) To prevent system crashes

d) To encrypt sensitive files

10 | P a g e
Engr. Majida Hassan Ghouri
Software Engineering Department

48. Which security mechanism restricts a process from accessing resources beyond its allocated
memory space?

a) Sandbox

b) Firewall

c) Encryption

d) Access Control

49. What is the purpose of swapping in operating systems?

a) To transfer data between CPU registers and main memory

b) To transfer data between RAM and secondary storage

c) To allocate memory dynamically to processes

d) To manage access permissions for files

50. Which memory management technique allows the allocation of memory blocks that aren't
necessarily contiguous?

a) Segmentation

b) Paging

c) Swapping

d) Contiguous Memory Allocation

51. Which security measure ensures that a system remains functional and operational despite
potential attacks or failures?

a) Intrusion Detection Systems (IDS)

b) Redundancy

c) Firewalls

d) Security Patching

52. In the context of security, what does the principle of "least privilege" mean?

a) Providing the most extensive system privileges to users

11 | P a g e
Engr. Majida Hassan Ghouri
Software Engineering Department

b) Granting access to all available resources

c) Providing only the necessary access rights for specific tasks

d) Limiting system access to administrators only

53. Which file system structure allows for the efficient and quick retrieval of files by using a
hash table?

a) Indexed allocation

b) Linked allocation

c) Indexed allocation with linked blocks

d) File Allocation Table (FAT)

54. What is the purpose of a file descriptor in Unix-like operating systems?

a) It is a unique identifier for a file used in file system indexing

b) It stores the file's contents

c) It manages file access permissions

d) It provides the file's metadata

55. In a two-level directory structure, what does the first level directory contain?

a) File names

b) File metadata

c) File pointers

d) Subdirectories

56. Which disk scheduling algorithm allows requests to be processed based on their priority?

a) Shortest Seek Time First (SSTF)

b) Priority-based Scheduling

c) Circular SCAN (C-SCAN)

d) First-Come, First-Served (FCFS)

12 | P a g e
Engr. Majida Hassan Ghouri
Software Engineering Department

57. What is the purpose of a TLB (Translation Lookaside Buffer) in a paging system?

a) To store page table entries

b) To store recently accessed pages

c) To store frame numbers of pages

d) To cache frequently used page table entries

58. What is the drawback of using large page sizes in paging systems?

a) Reduced internal fragmentation

b) Decreased TLB efficiency

c) Improved virtual memory management

d) Increased file system performance

59. Which system call is used to terminate a process in Unix-based operating systems?

a) exit()

b) fork()

c) wait()

d) exec()

60. In Unix-like file systems, what does the 'chmod' command do?

a) Changes the file's ownership

b) Changes the file's timestamp

c) Changes the file's permissions

d) Changes the file's size

61. Which disk scheduling algorithm aims to minimize the movement of the disk arm?

a) SCAN

b) C-LOOK

c) LOOK

13 | P a g e
Engr. Majida Hassan Ghouri
Software Engineering Department

d) FCFS (First-Come, First-Served)

62. What is the purpose of a FAT (File Allocation Table) in file systems like FAT32?

a) It stores file names and their attributes

b) It manages free disk space

c) It contains pointers to data blocks

d) It stores file metadata and permissions

63. Which condition is required for deadlock to occur?

a) Mutual exclusion

b) Hold and wait

c) No preemption

d) Circular wait

64. What is the purpose of a semaphore in synchronization?

a) To protect critical sections

b) To achieve mutual exclusion

c) To prevent deadlock

d) To coordinate access to shared resources

65. Which scheduling algorithm allows the process that has the highest priority to execute first?

a) Round Robin

b) Shortest Remaining Time First (SRTF)

c) Priority Scheduling

d) First-Come, First-Served (FCFS)

66. What is the primary advantage of multithreading?

a) Enhanced security

b) Improved process management

14 | P a g e
Engr. Majida Hassan Ghouri
Software Engineering Department

c) Increased parallelism

d) Reduced context switching

67. What is the purpose of the page table in virtual memory systems?

a) To store the physical addresses of pages

b) To manage memory allocation to processes

c) To translate logical addresses to physical addresses

d) To maintain a list of available memory pages

68. Which statement accurately describes thrashing in virtual memory systems?

a) It improves overall system performance

b) It occurs when processes require excessive paging, causing a decline in


performance

c) It indicates efficient memory utilization

d) It is a mechanism to prevent deadlock situations

69. What is the purpose of the directory entry in a file system?

a) To store file metadata

b) To manage file permissions

c) To keep track of file content

d) To store file names and associated information

70. Which disk scheduling algorithm scans in both directions, servicing all requests on its path?

a) SCAN

b) C-SCAN

c) LOOK

d) C-LOOK

71. Which security measure ensures that a user can access only the resources permitted for their
role?

15 | P a g e
Engr. Majida Hassan Ghouri
Software Engineering Department

a) Least privilege principle

b) User authentication

c) Access control lists (ACLs)

d) Role-based access control (RBAC)

72. What is the purpose of encryption in operating systems?

a) To enhance system performance

b) To prevent unauthorized access to data

c) To accelerate file access

d) To reduce memory overhead

73. What is the purpose of the working set model in virtual memory management?

a) To estimate the page fault rate

b) To calculate the number of frames required

c) To determine the set of pages used by a process

d) To identify thrashing situations

74. Which term describes the situation where a page is fetched from disk into memory but is
removed before being used?

a) Page fault

b) Page replacement

c) Page thrashing

d) Page aging

75. Which file allocation method uses pointers to link allocated disk blocks together?

a) Contiguous allocation

b) Linked allocation

c) Indexed allocation

d) File Allocation Table (FAT)

16 | P a g e
Engr. Majida Hassan Ghouri
Software Engineering Department

76. What is the primary role of the disk scheduler in an operating system?

a) To allocate free space on the disk

b) To manage file permissions

c) To optimize disk access by rearranging pending I/O requests

d) To store file metadata

77. Which access control model is based on defining rules that specify what actions subjects
can take on objects?

a) Mandatory Access Control (MAC)

b) Discretionary Access Control (DAC)

c) Role-Based Access Control (RBAC)

d) Access Control Lists (ACL)

78. What does the principle of "defense in depth" emphasize in operating system security?

a) Using strong encryption techniques

b) Implementing multiple layers of security mechanisms

c) Restricting user privileges

d) Regularly updating security patches

79. Which scheduling algorithm selects the process with the highest priority for execution?

a) Shortest Job First (SJF)

b) Round Robin (RR)

c) Priority Scheduling

d) First-Come, First-Served (FCFS)

80. What is the primary purpose of a semaphore in managing concurrent processes?

a) To protect critical sections

b) To synchronize processes

17 | P a g e
Engr. Majida Hassan Ghouri
Software Engineering Department

c) To create child processes

d) To allocate memory

81. What is the purpose of the MMU (Memory Management Unit) in a computer system?

a) To manage the allocation of virtual memory

b) To facilitate communication between CPU and cache memory

c) To translate logical addresses to physical addresses

d) To control the allocation of secondary memory

82. How does a TLB (Translation Lookaside Buffer) contribute to memory access in a paging
system?

a) It stores recently accessed pages for faster retrieval

b) It caches page table entries for quicker translations

c) It manages the allocation of memory pages

d) It handles page replacement algorithms

83. Which disk scheduling algorithm offers better response time for I/O requests closer to the
disk arm's current position?

a) SCAN

b) C-SCAN

c) LOOK

d) C-LOOK

84. What is the purpose of an indirect block in file systems?

a) To store file metadata

b) To speed up file access

c) To manage file permissions

d) To address additional data blocks for larger files

18 | P a g e
Engr. Majida Hassan Ghouri
Software Engineering Department

85. Which security principle ensures that one user's actions or access cannot negatively impact
other users or the system itself?

a) Least Privilege

b) Principle of Least Authority

c) Separation of Duties

d) Integrity

86. What does the term "authentication" refer to in the context of operating system security?

a) Restricting access to specific resources

b) Validating the identity of users or entities

c) Preventing unauthorized file modifications

d) Encrypting sensitive data

87. What is the purpose of a mutex in synchronization mechanisms?

a) To allow multiple threads to access a critical section simultaneously

b) To prevent priority inversion

c) To implement condition variables

d) To provide mutual exclusion

88. Which condition is necessary for a deadlock to occur in a system?

a) Mutual Exclusion

b) No Preemption

c) Hold and Wait

d) Circular Wait

89. What is a TLB (Translation Lookaside Buffer) used for in virtual memory systems?

a) To store page table entries

b) To cache recently accessed page table entries

c) To allocate physical memory to processes

19 | P a g e
Engr. Majida Hassan Ghouri
Software Engineering Department

d) To manage disk space

90. In the context of paging, what does the term "page fault" signify?

a) The page is not available in the cache

b) The page is available in the cache

c) The page is swapped out to disk

d) The page is not available in the main memory

91. Which file allocation method maintains a table for each file indicating the blocks it occupies
on the disk?

a) Contiguous allocation

b) Linked allocation

c) Indexed allocation

d) File Allocation Table (FAT)

92. What is the purpose of a directory entry in a file system?

a) To store the file contents

b) To store file permissions

c) To store file metadata

d) To associate a filename with its inode number

93. Which access control model uses labels to define the sensitivity and integrity of objects and
subjects?

a) Role-Based Access Control (RBAC)

b) Discretionary Access Control (DAC)

c) Mandatory Access Control (MAC)

d) Attribute-Based Access Control (ABAC)

94. What is the purpose of encryption in the context of operating system security?

a) To prevent unauthorized access to resources

20 | P a g e
Engr. Majida Hassan Ghouri
Software Engineering Department

b) To secure communication between devices

c) To restrict file system access

d) To protect data confidentiality

95. Which scheduling algorithm provides better response time for time-sharing systems?

a) Round Robin (RR)

b) Shortest Job First (SJF)

c) First-Come, First-Served (FCFS)

d) Priority Scheduling

96. What is the primary purpose of a monitor in concurrent programming?

a) To protect critical sections

b) To manage thread priorities

c) To provide mutual exclusion and condition synchronization

d) To allocate memory resources

97. What is the role of a page table in a virtual memory system?

a) To store the contents of pages in main memory

b) To manage the allocation of pages to processes

c) To translate virtual addresses to physical addresses

d) To manage disk space for virtual memory

98. Which term refers to a scenario where a required page is not found in the main memory?

a) Page fault

b) Page hit

c) Page replacement

d) Page allocation

21 | P a g e
Engr. Majida Hassan Ghouri
Software Engineering Department

99. In a file allocation method, what does contiguous allocation imply?

a) Files are stored in a continuous sequence of blocks

b) Files are linked with pointers to allocated blocks

c) Files are allocated in non-contiguous blocks

d) Files are indexed for allocation

100. What is the function of an inode in Unix-based file systems?

a) To store file contents

b) To maintain file permissions

c) To store file metadata and attributes

d) To manage file directory structure

//==========//==========//==========//==========//==========//

22 | P a g e
Engr. Majida Hassan Ghouri

You might also like