0% found this document useful (0 votes)
4 views47 pages

QB

The document covers the basics of operating systems, including their history, types, structures, and functions. It includes multiple-choice questions and explanations regarding system calls, process management, and threading models. Additionally, it discusses the challenges faced by modern operating systems and provides a comprehensive overview of UNIX and Linux operating systems.

Uploaded by

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

QB

The document covers the basics of operating systems, including their history, types, structures, and functions. It includes multiple-choice questions and explanations regarding system calls, process management, and threading models. Additionally, it discusses the challenges faced by modern operating systems and provides a comprehensive overview of UNIX and Linux operating systems.

Uploaded by

revicse
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

CS25C11 OPERATING SYSTEMS

Basics of Operating Systems

History and Evolution of Operating Systems-Types of Operating Systems – Operating


Systems structures- Functions of Operating Systems- challenges of Operating Systems-
Unix & Linux Operating Systems

PART – A

1. Which of the following is the primary purpose of an Operating System?


A) To compile programs
B) To manage computer hardware and software resources
C) To design computer hardware
D) To create databases
Answer: B

2. Which generation of computers introduced operating systems?


A) First Generation
B) Second Generation
C) Third Generation
D) Fourth Generation
Answer: B

3. Early computers executed programs using:


A) Batch processing
B) Interactive systems
C) Manual operation without an operating system
D) Time-sharing systems
Answer: C

4. Which operating system was developed at Bell Labs?


A) Windows
B) Linux
C) UNIX
D) DOS
Answer: C

5. Linux was developed by:


A) Dennis Ritchie
B) Bill Gates
C) Linus Torvalds
D) Ken Thompson
Answer: C

1
6. Which of the following is NOT a type of Operating System?
A) Batch Operating System
B) Real-Time Operating System
C) Distributed Operating System
D) Spreadsheet Operating System
Answer: D

7. Which operating system executes jobs without user interaction?


A) Time-sharing OS
B) Batch OS
C) Real-Time OS
D) Distributed OS
Answer: B

8. Which operating system provides immediate response within a specified time?


A) Batch OS
B) Multiprogramming OS
C) Real-Time OS
D) Network OS
Answer: C

9. Which operating system allows multiple users to access the system


simultaneously?
A) Single-user OS
B) Multi-user OS
C) Embedded OS
D) Standalone OS
Answer: B

10. Which operating system is commonly used in embedded devices?


A) Windows Server
B) UNIX
C) Embedded Operating System
D) Network Operating System
Answer: C

11. Which operating system structure consists of a single large program?


A) Layered Structure
B) Monolithic Structure
C) Microkernel Structure
D) Virtual Machine Structure
Answer: B

2
12. Which operating system structure provides better modularity?
A) Monolithic
B) Layered
C) Batch
D) Single-user
Answer: B

13. In a microkernel architecture, only essential services run in the kernel.


A) True
B) False
Answer: A

14. Which operating system structure improves reliability by reducing kernel size?
A) Monolithic
B) Layered
C) Microkernel
D) Batch
Answer: C

15. Which operating system structure is used by MINIX?


A) Monolithic
B) Layered
C) Microkernel
D) Hybrid
Answer: C

16. Which of the following is NOT a function of an Operating System?


A) Memory Management
B) Process Management
C) Device Management
D) Hardware Manufacturing
Answer: D

17. Which component of the OS manages CPU allocation to processes?


A) Memory Manager
B) File Manager
C) Process Manager
D) Device Driver
Answer: C

18. Which OS function is responsible for organizing files and directories?


A) File Management
B) Device Management

3
C) Process Scheduling
D) Memory Allocation
Answer: A

19. Which OS function controls access to computer resources?


A) Scheduling
B) Security and Protection
C) Memory Allocation
D) Process Synchronization
Answer: B

20. Which memory management technique allows efficient utilization of RAM?


A) Paging
B) Formatting
C) Partitioning
D) Printing
Answer: A

21. Which of the following is a major challenge faced by modern operating systems?
A) Security
B) Scalability
C) Energy Efficiency
D) All of the above
Answer: D

22. Which challenge arises due to increasing cyber-attacks?


A) Memory Leak
B) Security Threats
C) Fragmentation
D) Scheduling
Answer: B

23. Which challenge is important in mobile operating systems?


A) High CPU utilization
B) Power Management
C) Compiler Optimization
D) Database Design
Answer: B

24. UNIX was primarily developed using which programming language?


A) Java
B) C
C) Python
D) Assembly

4
Answer: B

25. Which command is used to display the current working directory in Linux?
A) ls
B) pwd
C) mkdir
D) who
Answer: B

26. Which Linux command lists files in a directory?


A) pwd
B) cp
C) ls
D) mv
Answer: C

27. Which command is used to create a directory in Linux?


A) mkdir
B) rmdir
C) touch
D) cd
Answer: A

28. Which command changes the current directory?


A) pwd
B) ls
C) cd
D) rm
Answer: C

29. Which command removes a file in Linux?


A) cp
B) rm
C) mv
D) cat
Answer: B

30. Which of the following is an advantage of Linux?


A) Open-source
B) Secure
C) Multi-user support
D) All of the above
Answer: D

5
1. Define an Operating System. [CO1,LOT,K1]

6
2. State any two objectives of an Operating System. [CO1,LOT,K1]
3. List the different generations in the evolution of Operating [CO1,LOT,K1]
Systems.
4. What is a Batch Operating System? [CO1,LOT,K1]
5. Define a Multiprogramming Operating System. [CO1,LOT,K1]
6. What is a Multitasking Operating System? [CO1,LOT,K1]
7. Define a Time-sharing Operating System. [CO1,LOT,K1]
8. What is a Real-Time Operating System (RTOS)? [CO1,LOT,K1]
9. List any four types of Operating Systems. [CO1,LOT,K1]
10. Define Operating System Structure. [CO1,LOT,K1]
11. Name the different Operating System structures. [CO1,LOT,K1]
12. What is a Monolithic Kernel? [CO1,LOT,K1]
13. Define a Layered Operating System. [CO1,LOT,K1]
14. What is a Microkernel? [CO1,LOT,K1]
15. Define System Call. [CO1,LOT,K1]
16. Explain why an Operating System is called a resource manager. [CO1,LOT,K2]
17. Differentiate between Multiprogramming and Multitasking [CO1,LOT,K2]
Operating Systems.
18. Describe how an Operating System improves system performance. [CO1,LOT,K2]
19. Explain the role of system calls in user-program execution. [CO1,LOT,K2]
20. Compare Monolithic Kernel and Microkernel structures. [CO1,LOT,K2]
21. What are the major challenges of modern Operating Systems? [CO1,LOT,K1]
22. What is Virtualization in Operating Systems? [CO1,LOT,K1]

PART – B

1. Explain the history and evolution of Operating Systems from batch [CO1,HOT,K2]
systems to modern operating systems with suitable examples.
2. Discuss the various types of Operating Systems and explain their [CO1,HOT,K2]
characteristics, advantages, and applications.
3. Explain the functions of an Operating System and describe how [CO1,HOT,K2]

7
each function contributes to efficient system performance.
4. Describe the different Operating System structures (Monolithic, [CO1,HOT,K2]
Layered, Microkernel, Modular, and Hybrid) with neat diagrams.
5. Explain the major challenges faced by modern Operating Systems [CO1,HOT,K2]
and discuss how they affect system performance and security.
6. Illustrate the evolution of Operating Systems and classify different [CO1,HOT,K3]
Operating Systems suitable for various computing environments
such as desktop, mobile, embedded, and cloud computing.
7. Analyze the functions performed by an Operating System during [CO1,HOT,K4]
the execution of multiple user applications and explain their
significance.
8. Compare and analyze Monolithic Kernel and Microkernel [CO1,HOT,K4]
architectures with respect to performance, reliability, scalability,
and security.
9. Analyze the advantages and limitations of different Operating [CO1,HOT,K4]
System structures and recommend the most suitable structure for
modern computing systems.
10. Evaluate the suitability of UNIX and Linux Operating Systems for [CO1,HOT,K5]
enterprise server environments by considering performance,
security, scalability, and cost.

8
System Calls and Process Management

System Calls-Process Concepts and Lifecycle, Process Control Block (PCB)- Context
Switching - Threading Models, Process vs Thread Process Creation and Termination-
Case study.

PART – A

1. What is a system call?


A) A command to shut down the computer
B) An interface between a user program and the operating system
C) A programming language
D) A hardware interrupt
Answer: B

2. Which of the following is NOT a category of system calls?


A) Process Control
B) File Management
C) Device Management
D) Compiler Design
Answer: D

3. Which system call is used to create a new process in UNIX/Linux?


A) exec()
B) fork()
C) wait()
D) exit()
Answer: B

4. Which system call replaces the current process image with a new program?
A) fork()
B) wait()
C) exec()
D) exit()
Answer: C

5. Which system call terminates a process?


A) fork()
B) exec()
C) exit()
D) wait()
Answer: C

6. Which system call causes the parent process to wait for its child process?

9
A) wait()
B) fork()
C) exec()
D) sleep()
Answer: A

7. A process is defined as:


A) A program stored on disk
B) A program in execution
C) A hardware device
D) A compiler
Answer: B

8. Which of the following is NOT a process state?


A) New
B) Ready
C) Running
D) Compiling
Answer: D

9. Which process state indicates that the process is waiting for an event?
A) Running
B) Waiting (Blocked)
C) Ready
D) Terminated
Answer: B

10. Which process state comes immediately after process creation?


A) Ready
B) Running
C) New
D) Waiting
Answer: C

11. Which data structure stores information about a process?


A) FAT
B) PCB
C) Page Table
D) Cache
Answer: B

12. PCB stands for:


A) Process Communication Block
B) Process Control Block

10
C) Program Control Buffer
D) Processor Cache Block
Answer: B

13. Which of the following is stored in a PCB?


A) Process ID
B) Program Counter
C) CPU Registers
D) All of the above
Answer: D

14. Which component uniquely identifies a process?


A) Process ID (PID)
B) Memory Address
C) Program Counter
D) Stack Pointer
Answer: A

15. Context switching occurs when:


A) A file is opened
B) CPU switches from one process to another
C) Memory is allocated
D) A program is compiled
Answer: B

16. During context switching, the operating system saves the:


A) File contents
B) Process context in PCB
C) Disk partitions
D) Cache memory only
Answer: B

17. Which of the following increases context switching overhead?


A) Frequent CPU scheduling
B) Large RAM
C) More hard disks
D) Faster compiler
Answer: A

18. A thread is:


A) An independent computer
B) The smallest unit of CPU execution
C) A disk partition
D) A memory segment

11
Answer: B

19. Threads belonging to the same process share:


A) Process ID only
B) Address space and resources
C) Separate memory
D) Separate files
Answer: B

20. Which threading model maps many user threads to one kernel thread?
A) One-to-One
B) Many-to-One
C) Many-to-Many
D) Two-to-One
Answer: B

21. Which threading model provides better parallelism on multicore processors?


A) Many-to-One
B) One-to-One
C) Single-to-Single
D) Batch-to-One
Answer: B

22. Which threading model allows many user threads to be multiplexed over many
kernel threads?
A) One-to-One
B) Many-to-One
C) Many-to-Many
D) None of the above
Answer: C

23. Which of the following is an advantage of multithreading?


A) Improved responsiveness
B) Better resource sharing
C) Faster execution
D) All of the above
Answer: D

24. Which statement is TRUE regarding processes and threads?


A) Processes share memory by default.
B) Threads have separate address spaces.
C) Threads within the same process share memory.
D) Processes execute within threads.
Answer: C

12
25. Compared to processes, threads are:
A) More expensive to create
B) Faster to create and switch
C) Independent programs
D) Slower to execute
Answer: B

26. Which of the following is NOT shared among threads?


A) Program code
B) Heap memory
C) Registers and stack
D) Open files
Answer: C

27. Which function is primarily responsible for creating a child process in Linux?
A) exec()
B) fork()
C) kill()
D) open()
Answer: B

28. Which event marks the end of a process lifecycle?


A) Ready state
B) Running state
C) Terminated state
D) Waiting state
Answer: C

29. Which real-world application commonly uses multithreading?


A) Web Browser
B) Text Editor
C) Web Server
D) All of the above
Answer: D

30. In a web browser, downloading files while browsing different tabs is an example
of:
A) Batch Processing
B) Process Scheduling
C) Multithreading
D) Deadlock
Answer: C

13
1. Define a system call. Give any two examples of system calls. [CO2,LOT,K1]
2. List any three categories of system calls with one example each. [CO2,LOT,K1]
3. What is a process? Mention its main characteristics. [CO2,LOT,K1]
4. Draw and explain the process lifecycle (process states). [CO2,LOT,K2]
5. Define Process Control Block (PCB). List any four information [CO2,LOT,K1]
stored in a PCB.
6. Explain the purpose of the Process Control Block (PCB) in an [CO2,LOT,K2]
operating system.
7. What is context switching? Why is it required? [CO2,LOT,K2]
8. List the steps involved in a context switch. [CO2,LOT,K2]
9. Differentiate between a process and a thread. [CO2,LOT,K2]
10. Define a thread. State any two advantages of multithreading. [CO2,LOT,K2]
11. Explain the many-to-one threading model with a neat diagram. [CO2,LOT,K2]
12. Explain the one-to-one threading model and mention one [CO2,LOT,K2]
advantage and one disadvantage.
13. Explain the many-to-many threading model. [CO2,LOT,K2]
14. Compare user-level threads and kernel-level threads. [CO2,LOT,K2]
15. What is process creation? List the situations in which a process is [CO2,LOT,K1]
created.
16. Explain the steps involved in process creation. [CO2,LOT,K2]
17. What is process termination? List any three reasons for process [CO2,LOT,K1]
termination.
18. Distinguish between normal and abnormal process termination. [CO2,LOT,K2]
19. Explain the role of the fork() and exec() system calls in [CO2,LOT,K2]
UNIX/Linux.
20. What is the purpose of the wait() system call? [CO2,LOT,K2]
21. Explain the relationship between parent and child processes. [CO2,LOT,K2]
22. Explain why threads are considered lightweight compared to [CO2,LOT,K2]
processes.

14
PART – B

1. Explain the different categories of system calls with suitable [CO2,HOT,K2]


examples. Illustrate how system calls provide an interface between
the user program and the operating system.
2. Describe the process concept and explain the various process states [CO2,HOT,K2]
with a neat process state transition diagram.
3. Explain the Process Control Block (PCB) in detail. Discuss its [CO2,HOT,K2]
structure, components, and role in process management with a neat
diagram.
4. What is context switching? Explain the sequence of operations [CO2,HOT,K3]
involved during a context switch and discuss its overhead on
system performance.
5. Compare processes and threads. Explain their advantages, [CO2,HOT,K4]
disadvantages, and suitable application scenarios.
6. Explain the different threading models (Many-to-One, One-to- [CO2,HOT,K2]
One, and Many-to-Many) with neat diagrams. Compare their
advantages and limitations.
7. Explain the process creation and termination mechanisms in [CO2,HOT,K3]
UNIX/Linux using fork(), exec(), wait(), and exit() system calls
with suitable examples.
8. Analyze the role of threads in improving system performance. [CO2,HOT,K4]
Compare user-level threadsand kernel-level threads with suitable
examples.
9. A UNIX system creates a child process using fork(), loads a new [CO2,HOT,K5]
program using exec(), and synchronizes using wait(). Explain the
execution flow with a process tree and discuss the role of each
system call.
10. Explain how the operating system manages process scheduling [CO2,HOT,K3]
using the Process Control Block (PCB) and context switching.
Illustrate with a suitable example.

15
CPU Scheduling

Scheduling Criteria and Objectives-Scheduling Algorithms - Preemptive and non-


preemptive scheduling

PART – A

1. What is the primary objective of CPU scheduling?


A) Increase memory size
B) Maximize CPU utilization
C) Reduce disk space
D) Increase cache memory

Answer: B) Maximize CPU utilization

2. Which scheduling criterion measures the percentage of time the CPU is busy?
A) Turnaround time
B) Waiting time
C) CPU utilization
D) Response time

Answer: C) CPU utilization

3. Which scheduling criterion should be minimized?


A) Throughput
B) CPU utilization
C) Waiting time
D) Number of processes

Answer: C) Waiting time

4. Which scheduling criterion refers to the number of processes completed per unit
time?
A) Throughput
B) Turnaround time
C) Waiting time
D) Response time

Answer: A) Throughput

5. Turnaround time is calculated as:


A) Completion Time – Arrival Time
B) Burst Time – Arrival Time

16
C) Waiting Time + Arrival Time
D) Completion Time – Waiting Time

Answer: A) Completion Time – Arrival Time

6. Response time is the time between:


A) Arrival and completion
B) Arrival and first CPU allocation
C) Completion and waiting
D) Execution and termination

Answer: B) Arrival and first CPU allocation

7. Which scheduling algorithm follows the First Come First Served principle?
A) FCFS
B) SJF
C) Round Robin
D) Priority Scheduling

Answer: A) FCFS

8. FCFS scheduling is an example of:


A) Preemptive scheduling
B) Non-preemptive scheduling
C) Multilevel scheduling
D) Dynamic scheduling

Answer: B) Non-preemptive scheduling

9. Which scheduling algorithm selects the process with the shortest CPU burst?
A) FCFS
B) Round Robin
C) Shortest Job First
D) Priority Scheduling

Answer: C) Shortest Job First

10. SJF scheduling is optimal for minimizing:


A) CPU utilization
B) Average waiting time
C) Throughput
D) Response time

Answer: B) Average waiting time

17
11. Which scheduling algorithm requires knowledge of CPU burst time?
A) FCFS
B) SJF
C) FIFO
D) LIFO

Answer: B) SJF

12. Which scheduling algorithm allocates CPU based on process priority?


A) Round Robin
B) FCFS
C) Priority Scheduling
D) SJF

Answer: C) Priority Scheduling

13. Starvation is commonly associated with:


A) FCFS
B) Priority Scheduling
C) Round Robin
D) FIFO

Answer: B) Priority Scheduling

14. Aging is used to prevent:


A) Deadlock
B) Starvation
C) Thrashing
D) Paging

Answer: B) Starvation

15. Which scheduling algorithm is widely used in time-sharing systems?


A) FCFS
B) Round Robin
C) SJF
D) Priority Scheduling

Answer: B) Round Robin

16. Round Robin scheduling uses:


A) Priority levels
B) Time quantum

18
C) CPU burst prediction
D) Memory partitions

Answer: B) Time quantum

17. If the time quantum is too small in Round Robin scheduling:


A) CPU utilization decreases
B) Context switches increase
C) Waiting time becomes zero
D) Throughput doubles

Answer: B) Context switches increase

18. Which scheduling algorithm is preemptive by design?


A) FCFS
B) Round Robin
C) Non-preemptive SJF
D) FIFO

Answer: B) Round Robin

19. Which scheduling algorithm is also known as Shortest Remaining Time First
(SRTF)?
A) Preemptive SJF
B) FCFS
C) Round Robin
D) Priority Scheduling

Answer: A) Preemptive SJF

20. In preemptive scheduling:


A) A running process cannot be interrupted.
B) The CPU is assigned permanently.
C) A running process may be interrupted.
D) Only one process exists.

Answer: C) A running process may be interrupted.

21. Which of the following is NOT a scheduling objective?


A) Fairness
B) Maximum CPU utilization
C) Infinite waiting time
D) High throughput

19
Answer: C) Infinite waiting time

22. Which scheduling algorithm may suffer from the convoy effect?
A) FCFS
B) Round Robin
C) Priority Scheduling
D) SRTF

Answer: A) FCFS

23. Which scheduling algorithm gives every process an equal opportunity to


execute?
A) FCFS
B) Round Robin
C) Priority Scheduling
D) SJF

Answer: B) Round Robin

24. Which scheduling algorithm generally provides the best average turnaround
time?
A) FCFS
B) SJF
C) Round Robin
D) FIFO

Answer: B) SJF

25. Which scheduling algorithm may cause starvation for long processes?
A) SJF
B) FCFS
C) Round Robin
D) FIFO

Answer: A) SJF

26. Which scheduling type allows the operating system to take the CPU from a
running process?
A) Non-preemptive scheduling
B) Preemptive scheduling
C) Batch scheduling
D) Static scheduling

Answer: B) Preemptive scheduling

20
27. Which of the following is NOT a CPU scheduling algorithm?
A) FCFS
B) Round Robin
C) SJF
D) Paging

Answer: D) Paging

28. Which scheduling criterion measures how quickly the first response is provided?
A) Waiting time
B) Turnaround time
C) Response time
D) Throughput

Answer: C) Response time

29. Which scheduling algorithm is simplest to implement?


A) SJF
B) FCFS
C) Priority Scheduling
D) Multilevel Queue

Answer: B) FCFS

30. Which scheduling algorithm is considered fair because each process receives
CPU time in turns?
A) FCFS
B) Round Robin
C) SJF
D) Priority Scheduling

Answer: B) Round Robin

1. Define CPU scheduling. [CO3,LOT,K1]


2. What is a CPU scheduler? [CO3,LOT,K1]
3. Define scheduling algorithm. [CO3,LOT,K1]
4. What is meant by scheduling criteria? [CO3,LOT,K1]
5. List any four scheduling criteria. [CO3,LOT,K1]
6. Define CPU utilization. [CO3,LOT,K1]

21
7. What is throughput? [CO3,LOT,K1]
8. What is preemptive scheduling? [CO3,LOT,K1]
9. Define non-preemptive scheduling. [CO3,LOT,K1]
10. Explain how scheduling algorithms improve CPU efficiency. [CO3,LOT,K2]
11. Compare FCFS and SJF scheduling algorithms. [CO3,LOT,K2]
12. Explain how starvation occurs in Priority Scheduling. [CO3,LOT,K2]
13. Compare waiting time and turnaround time. [CO3,LOT,K2]
14. Differentiate between preemptive and non-preemptive scheduling. [CO3,LOT,K1]
15. Describe the impact of dispatch latency on system performance. [CO3,LOT,K2]
16. What is the time quantum in Round Robin scheduling? [CO3,LOT,K1]
17. What is aging in scheduling? [CO3,LOT,K1]
18. What is convoy effect? [CO3,LOT,K1]
19. Explain why context switching affects system performance. [CO3,LOT,K2]
20. What is context switching? [CO3,LOT,K1]
PART – B

1. Analyze how different scheduling criteria such as CPU utilization, [CO3,HOT,K4]


throughput, turnaround time, waiting time, and response time
influence the selection of a CPU scheduling algorithm.
2. Explain the working principles of FCFS, SJF, Priority, and Round [CO3,HOT,K2]
Robin scheduling algorithms with suitable examples.
3. Explain the role of the dispatcher and dispatch latency in CPU [CO3,HOT,K2]
scheduling and their impact on system performance.
4. Analyze the performance of FCFS, SJF, Priority, and Round Robin [CO3,HOT,K4]
scheduling algorithms by comparing CPU utilization, waiting time,
turnaround time, throughput, and response time.
5. Process Arrival Time (AT) Burst Time (BT) [CO3,HOT,K3]
P1 0 8
P2 1 4
P3 2 9
P4 3 5
1. Draw the Gantt chart using the FCFS scheduling algorithm.
2. Calculate the waiting time and turnaround time for each process.

22
3. Determine the average waiting time and average turnaround
time.

6. Process Arrival Time (AT) Burst Time (BT) [CO3,HOT,K3]


P1 0 6
P2 2 8
P3 4 7
P4 5 3
1. Construct the Gantt chart using Non-Preemptive SJF.
2. Compute waiting time and turnaround time.
3. Find the average waiting time and turnaround time.

7. Process Arrival Time Burst Time Priority [CO3,HOT,K4]


P1 0 9 3
P2 1 5 1
P3 2 3 4
P4 3 7 2
1. Schedule the processes using:

 FCFS
 Non-Preemptive SJF
 Priority Scheduling
 Round Robin (Time Quantum = 2 ms)

2. Draw the Gantt chart for each algorithm.


3. Calculate average waiting time and turnaround time.
4. Compare the performance of all four algorithms based on waiting
time, turnaround time, response time, fairness, and CPU utilization.
5. Recommend the most suitable algorithm for a time-sharing
operating system with justification.

23
Synchronization and Deadlocks

Concurrency Issues and Critical Section Problem Synchronization Tools: Mutex,


Semaphores-Deadlock: Necessary Conditions, Prevention, Avoidance, Detection, and
Recovery

PART – A

1. What is the primary purpose of process synchronization?


A) Increase CPU speed
B) Manage concurrent access to shared resources
C) Reduce memory usage
D) Improve disk performance

Answer: B) Manage concurrent access to shared resources

2. Which problem occurs when multiple processes access shared data


simultaneously?
A) Fragmentation
B) Concurrency issue
C) Paging
D) Thrashing

Answer: B) Concurrency issue

3. The critical section is the part of a program where:


A) Variables are declared
B) Shared resources are accessed
C) Functions are called
D) Memory is allocated

Answer: B) Shared resources are accessed

4. Which of the following is NOT a requirement of the critical section problem?


A) Mutual exclusion
B) Progress
C) Bounded waiting
D) Starvation

Answer: D) Starvation

24
5. Mutual exclusion ensures that:
A) All processes execute simultaneously
B) Only one process enters the critical section at a time
C) Every process waits forever
D) CPU utilization is maximized

Answer: B) Only one process enters the critical section at a time

6. Which requirement ensures that processes not in the critical section cannot
prevent others from entering it?
A) Progress
B) Mutual exclusion
C) Bounded waiting
D) Context switching

Answer: A) Progress

7. Which requirement guarantees that every waiting process will eventually enter
the critical section?
A) Deadlock
B) Starvation
C) Bounded waiting
D) Paging

Answer: C) Bounded waiting

8. Which synchronization tool uses lock() and unlock() operations?


A) Semaphore
B) Mutex
C) Monitor
D) Message Queue

Answer: B) Mutex

9. A mutex can be held by:


A) Multiple processes simultaneously
B) Only one process at a time
C) Infinite processes
D) No process

Answer: B) Only one process at a time

25
10. Which synchronization mechanism uses wait() and signal() operations?
A) Mutex
B) Semaphore
C) Cache
D) Scheduler

Answer: B) Semaphore

11. Which semaphore can have values greater than one?


A) Binary semaphore
B) Counting semaphore
C) Mutex
D) Spinlock

Answer: B) Counting semaphore

12. A binary semaphore can take values:


A) 0 and 1
B) 1 and 2
C) Any positive integer
D) Negative values only

Answer: A) 0 and 1

13. Which synchronization tool is best suited for protecting a single shared
resource?
A) Counting semaphore
B) Mutex
C) Paging
D) Virtual memory

Answer: B) Mutex

14. Which of the following is a consequence of improper synchronization?


A) Race condition
B) Virtual memory
C) Paging
D) Context switching

Answer: A) Race condition

15. A race condition occurs when:


A) Two processes compete for CPU scheduling
B) Multiple processes access shared data concurrently without proper synchronization

26
C) Memory becomes full
D) CPU remains idle

Answer: B) Multiple processes access shared data concurrently without proper


synchronization

16. A deadlock occurs when:


A) A process terminates unexpectedly
B) Two or more processes wait indefinitely for resources held by each other
C) CPU utilization becomes high
D) Memory allocation fails

Answer: B) Two or more processes wait indefinitely for resources held by each
other

17. Which of the following is NOT one of the necessary conditions for deadlock?
A) Mutual exclusion
B) Hold and wait
C) Paging
D) Circular wait

Answer: C) Paging

18. Which necessary condition states that resources cannot be forcibly taken from a
process?
A) Circular wait
B) Mutual exclusion
C) No preemption
D) Hold and wait

Answer: C) No preemption

19. Which necessary condition requires a process to hold one resource while waiting
for another?
A) Circular wait
B) Hold and wait
C) Mutual exclusion
D) Progress

Answer: B) Hold and wait

20. Circular wait means:


A) Resources are released immediately
B) Processes form a circular chain waiting for each other's resources

27
C) CPU scheduling follows FCFS
D) Memory is allocated circularly

Answer: B) Processes form a circular chain waiting for each other's resources

21. Deadlock prevention aims to:


A) Detect deadlocks after they occur
B) Ensure at least one necessary condition never holds
C) Increase CPU utilization
D) Improve throughput

Answer: B) Ensure at least one necessary condition never holds

22. Which deadlock handling technique requires advance knowledge of resource


requirements?
A) Prevention
B) Avoidance
C) Detection
D) Recovery

Answer: B) Avoidance

23. Which algorithm is commonly used for deadlock avoidance?


A) Round Robin Algorithm
B) Banker's Algorithm
C) FCFS Algorithm
D) SJF Algorithm

Answer: B) Banker's Algorithm

24. The Banker's Algorithm keeps the system in a:


A) Critical state
B) Safe state
C) Deadlock state
D) Idle state

Answer: B) Safe state

25. A system is said to be in a safe state if:


A) Every process has completed execution
B) There exists a safe sequence of process execution
C) CPU utilization is 100%
D) No resources are allocated

28
Answer: B) There exists a safe sequence of process execution

26. Which deadlock handling technique periodically checks for deadlocks?


A) Prevention
B) Avoidance
C) Detection
D) Scheduling

Answer: C) Detection

27. Which graph is commonly used to detect deadlocks in systems with single
instances of resources?
A) Activity Graph
B) Resource Allocation Graph
C) Flow Graph
D) Tree Graph

Answer: B) Resource Allocation Graph

28. A cycle in a Resource Allocation Graph with a single instance of each resource
indicates:
A) Safe state
B) Deadlock
C) Paging
D) Starvation

Answer: B) Deadlock

29. Which of the following is a deadlock recovery technique?


A) Process termination
B) Increasing CPU speed
C) Virtual memory
D) Paging

Answer: A) Process termination

30. Which recovery method involves taking resources away from selected processes?
A) Preemption
B) Prevention
C) Scheduling
D) Synchronization

Answer: A) Preemption

29
1. Define process synchronization. [CO4,LOT,K1]
2. What is concurrency? [CO4,LOT,K1]
3. Define the critical section. [CO4,LOT,K1]
4. What is the Critical Section Problem? [CO4,LOT,K1]
5. List the three requirements of a correct solution to the Critical [CO4,LOT,K1]
Section Problem.
6. Define mutual exclusion. [CO4,LOT,K1]
7. What is a race condition? [CO4,LOT,K1]
8. Define synchronization tools. [CO4,LOT,K1]
9. What is a mutex? [CO4,LOT,K1]
10. Define semaphore. [CO4,LOT,K1]
11. Differentiate between binary semaphore and counting semaphore. [CO4,LOT,K2]
12. What is busy waiting? [CO4,LOT,K1]
13. Define deadlock. [CO4,LOT,K1]
14. List the four necessary conditions for deadlock. [CO4,LOT,K1]
15. What is a safe state? [CO4,LOT,K1]
16. Explain the producer-consumer problem and the need for [CO4,LOT,K2]
synchronization.
17. Explain the role of the Resource Allocation Graph in deadlock [CO4,LOT,K2]
analysis.
18. Explain the difference between livelock and deadlock. [CO4,LOT,K2]
19. What is starvation? [CO4,LOT,K1]
20. Define Banker's Algorithm. [CO4,LOT,K1]
PART – B

1. Explain the concept of process synchronization and discuss the [CO4,HOT,K2]


Critical Section Problem. Describe the three requirements for a
correct solution with suitable examples.
2. Explain the working principles of synchronization tools such as [CO4,HOT,K2]
Mutex and Semaphores. Compare their advantages and limitations.

30
3. Explain the Producer–Consumer problem and Readers–Writers [CO4,HOT,K2]
problem. Discuss how semaphores are used to solve these
synchronization problems.
4. Explain the concept of deadlock. Describe the four necessary [CO4,HOT,K2]
conditions for deadlock with suitable examples.
5. Explain the techniques used for deadlock handling, namely [CO4,HOT,K2]
prevention, avoidance, detection, and recovery, highlighting their
advantages and disadvantages.
6. Apply the Banker's Algorithm to determine whether the given [CO4,HOT,K3]
system is in a safe state. If safe, determine the safe sequence. A
system has 5 processes and 3 resource types (A, B, C).
Process Allocation Maximum Available
P0 0 1 0 7 5 3 3 3 2
P1 2 0 0 3 2 2
P2 3 0 2 9 0 2
P3 2 1 1 2 2 2
P4 0 0 2 4 3 3
7. Analyze the effectiveness of deadlock prevention, avoidance, [CO4,HOT,K4]
detection, and recovery techniques for different computing
environments.
8. Analyze the impact of deadlocks on operating system performance. [CO4,HOT,K4]
Compare various deadlock handling techniques and recommend
the most suitable approach for a multi-user operating system.

31
Memory Management

Memory Allocation: Contiguous, Paging, Segmentation-Virtual Memory, Demand


Paging, Page Replacement Algorithms (FIFO, LRU, Optimal)

PART – A

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


A) Increase CPU speed
B) Manage and allocate memory efficiently
C) Improve network performance
D) Manage input devices
Answer: B) Manage and allocate memory efficiently

2. Which memory allocation technique allocates one continuous block of memory to


a process?
A) Paging
B) Segmentation
C) Contiguous Allocation
D) Virtual Memory
Answer: C) Contiguous Allocation

3. Which type of fragmentation occurs in contiguous memory allocation when free


memory is scattered?
A) Internal fragmentation
B) External fragmentation
C) Paging
D) Swapping
Answer: B) External fragmentation

4. Internal fragmentation occurs when:


A) Free memory is divided into many small holes
B) Allocated memory block is larger than the requested memory
C) Pages are swapped
D) Segments overlap
Answer: B) Allocated memory block is larger than the requested memory

5. Which memory management technique eliminates external fragmentation?


A) Contiguous Allocation
B) Paging
C) Swapping
D) Overlaying
Answer: B) Paging

32
6. In paging, physical memory is divided into:
A) Segments
B) Frames
C) Blocks
D) Partitions
Answer: B) Frames

7. In paging, logical memory is divided into:


A) Frames
B) Pages
C) Blocks
D) Segments
Answer: B) Pages

8. Which data structure maps logical addresses to physical addresses in paging?


A) Segment Table
B) Page Table
C) PCB
D) Cache Table
Answer: B) Page Table

9. Paging primarily helps in reducing:


A) Internal fragmentation
B) External fragmentation
C) Deadlock
D) Context switching
Answer: B) External fragmentation

10. Which memory management technique divides memory based on logical


program units?
A) Paging
B) Contiguous Allocation
C) Segmentation
D) FIFO
Answer: C) Segmentation

11. In segmentation, a logical address consists of:


A) Page Number and Offset
B) Segment Number and Offset
C) Frame Number and Offset
D) Block Number and Offset
Answer: B) Segment Number and Offset

33
12. Which memory management scheme supports the user's logical view of
memory?
A) Paging
B) Segmentation
C) Swapping
D) Partitioning
Answer: B) Segmentation

13. Virtual memory allows:


A) Execution of processes larger than physical memory
B) Faster CPU execution
C) Larger cache memory
D) Better disk scheduling
Answer: A) Execution of processes larger than physical memory

14. Virtual memory primarily uses:


A) Cache
B) Hard disk (secondary storage)
C) Registers
D) ROM
Answer: B) Hard disk (secondary storage)

15. Demand paging loads a page into memory:


A) Before execution starts
B) Only when it is required
C) After process completion
D) During compilation
Answer: B) Only when it is required

16. Which event occurs when a required page is not present in main memory?
A) Context switch
B) Page fault
C) Segmentation fault
D) Interrupt
Answer: B) Page fault

17. Which hardware component helps speed up address translation?


A) ALU
B) TLB (Translation Lookaside Buffer)
C) Cache Controller
D) DMA Controller
Answer: B) TLB (Translation Lookaside Buffer)

18. Which page replacement algorithm removes the page that entered memory first?

34
A) LRU
B) FIFO
C) Optimal
D) LFU
Answer: B) FIFO

19. FIFO page replacement stands for:


A) First In First Out
B) First Input First Output
C) Fast In Fast Out
D) File In File Out
Answer: A) First In First Out

20. Which page replacement algorithm replaces the page that has not been used for
the longest time?
A) FIFO
B) Optimal
C) LRU
D) Random
Answer: C) LRU

21. LRU stands for:


A) Least Recently Used
B) Last Recently Used
C) Least Required Unit
D) Logical Replacement Unit
Answer: A) Least Recently Used

22. Which page replacement algorithm provides the minimum possible page faults?
A) FIFO
B) LRU
C) Optimal
D) Clock
Answer: C) Optimal

23. The Optimal page replacement algorithm replaces the page:


A) Used most recently
B) That will not be used for the longest future time
C) Loaded first
D) Loaded last
Answer: B) That will not be used for the longest future time

24. Which page replacement algorithm is mainly used as a benchmark?

35
A) FIFO
B) Optimal
C) LRU
D) Random
Answer: B) Optimal

25. Which page replacement algorithm may suffer from Belady's anomaly?
A) FIFO
B) LRU
C) Optimal
D) LFU
Answer: A) FIFO

26. Belady's anomaly refers to:


A) Increased page faults with increased memory frames
B) Reduced CPU utilization
C) Increased throughput
D) Deadlock occurrence
Answer: A) Increased page faults with increased memory frames

27. Which page replacement algorithm does NOT suffer from Belady's anomaly?
A) FIFO
B) LRU
C) Random
D) FCFS
Answer: B) LRU

28. Which memory management technique uses fixed-size blocks?


A) Segmentation
B) Paging
C) Contiguous Allocation
D) Overlaying
Answer: B) Paging

29. Which memory management technique uses variable-sized blocks?


A) Paging
B) Segmentation
C) FIFO
D) Demand Paging
Answer: B) Segmentation

30. Which of the following is NOT a page replacement algorithm?


A) FIFO
B) LRU

36
C) Optimal
D) Round Robin
Answer: D) Round Robin

1. Define memory management. [CO2,LOT,K1]


2. What is contiguous memory allocation? [CO2,LOT,K1]
3. What is internal fragmentation? [CO2,LOT,K1]
4. What is external fragmentation? [CO2,LOT,K1]
5. Define compaction. [CO2,LOT,K1]
6. What is paging? [CO2,LOT,K1]
7. What is a frame? [CO2,LOT,K1]
8. What is a page table? [CO2,LOT,K1]
9. What is address translation? [CO2,LOT,K1]
10. Define virtual memory. [CO4,LOT,K1]
11. Define page replacement algorithm. [CO3,LOT,K1]
12. What is Belady's anomaly? [CO3,LOT,K1]
13. List any three page replacement algorithms. [CO3,LOT,K1]
14. Describe the role of valid and invalid bits in a page table. [CO2,LOT,K2]
15. Explain how demand paging improves memory utilization. [CO4,LOT,K2]
16. Explain why the Optimal page replacement algorithm produces the [CO3,LOT,K2]
minimum number of page faults.
17. Describe the advantages of paging over contiguous memory [CO2,LOT,K2]
allocation.
18. What is locality of reference? [CO2,LOT,K1]
19. Define swapping. [CO2,LOT,K1]
20. What is thrashing? [CO4,LOT,K1]
PART – B

1. Explain the various memory allocation techniques, including fixed [CO2,HOT,K2]


partitioning, dynamic partitioning, and contiguous memory
allocation. Discuss their advantages and disadvantages.
2. Explain the concept of paging and describe the address translation [CO2,HOT,K2]
37
process using a page table with a neat diagram.
3. Explain the concept of segmentation. Discuss its architecture, [CO2,HOT,K2]
address translation mechanism, and advantages over contiguous
memory allocation.
4. Explain the concepts of virtual memory and demand paging. [CO4,HOT,K2]
Describe the page fault handling mechanism with a neat flowchart.
5. Explain the working principles of FIFO, LRU, and Optimal page [CO3,HOT,K2]
replacement algorithms. Compare their advantages and limitations.
6. Analyze the differences between paging and segmentation with [CO2,HOT,K4]
respect to memory allocation, fragmentation, address translation,
and memory protection.
7. Analyze the performance of different page replacement algorithms [CO3,HOT,K4]
for a given page reference string. Identify the algorithm with the
minimum page faults and justify your answer.
8. A system has: [CO2,HOT,K3]
Logical Address Space = 16 bits
Physical Address Space = 14 bits
Page Size = 1 KB
Questions:
i. Determine the number of bits required for the page number
and offset.
ii. Calculate the total number of pages and frames.
iii. Translate the logical address 3584 into page number and
offset.
9. Consider the page reference string: [CO3,HOT,K3]
7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2
Number of page frames = 3
Questions:
i. Draw the page frame allocation after each page reference.
ii. Calculate the total number of page faults.

38
iii. Determine the page hit ratio.

39
File Systems and I/O Management

File System Concepts – Directory and File Access Control - I/O Management - Disk
Scheduling Buffering, Caching - Case study.

PART – A

1. What is the primary purpose of a file system?


A) Manage CPU scheduling
B) Organize and store files on secondary storage
C) Allocate main memory
D) Control network communication
Answer: B) Organize and store files on secondary storage

2. A file is a:
A) Collection of related data stored on secondary storage
B) Collection of CPU instructions
C) Collection of memory addresses
D) Collection of registers
Answer: A) Collection of related data stored on secondary storage

3. Which of the following is NOT a file attribute?


A) File name
B) File size
C) CPU clock speed
D) File type
Answer: C) CPU clock speed

4. Which file operation opens an existing file for use?


A) Create
B) Open
C) Delete
D) Rename
Answer: B) Open

5. Which file operation permanently removes a file from storage?


A) Read
B) Close
C) Delete
D) Seek
Answer: C) Delete

6. A directory is primarily used to:

40
A) Schedule CPU processes
B) Organize files and folders
C) Manage memory
D) Allocate registers
Answer: B) Organize files and folders

7. Which directory structure has only one directory for all users?
A) Tree-structured
B) Single-level directory
C) Two-level directory
D) Acyclic graph directory
Answer: B) Single-level directory

8. Which directory structure provides each user with a separate directory?


A) Single-level directory
B) Two-level directory
C) Tree directory
D) Graph directory
Answer: B) Two-level directory

9. Which directory structure supports subdirectories?


A) Single-level directory
B) Tree-structured directory
C) Flat directory
D) Circular directory
Answer: B) Tree-structured directory

10. File access control determines:


A) CPU allocation
B) Who can read, write, or execute a file
C) Memory allocation
D) Page replacement
Answer: B) Who can read, write, or execute a file

11. Which of the following is a common file access permission?


A) Execute
B) Compile
C) Encrypt
D) Compress
Answer: A) Execute

12. Which access method allows records to be read in order?


A) Random Access
B) Sequential Access

41
C) Indexed Access
D) Direct Mapping
Answer: B) Sequential Access

13. Which access method allows data to be accessed directly without reading
previous records?
A) Sequential Access
B) Random (Direct) Access
C) Indexed Sequential
D) Stack Access
Answer: B) Random (Direct) Access

14. I/O management is responsible for:


A) Managing input and output devices
B) Scheduling processes
C) Allocating memory
D) Compiling programs
Answer: A) Managing input and output devices

15. Which component acts as an interface between hardware devices and the
operating system?
A) Device Driver
B) Compiler
C) Linker
D) Loader
Answer: A) Device Driver

16. Buffering is primarily used to:


A) Increase CPU speed
B) Reduce speed mismatch between devices
C) Increase disk size
D) Reduce RAM capacity
Answer: B) Reduce speed mismatch between devices

17. A buffer is:


A) Temporary storage area for data transfer
B) Permanent storage
C) CPU register
D) Cache memory only
Answer: A) Temporary storage area for data transfer

18. Caching improves system performance by:


A) Increasing file size
B) Storing frequently accessed data in faster memory

42
C) Increasing disk fragmentation
D) Reducing RAM
Answer: B) Storing frequently accessed data in faster memory

19. Which memory is commonly used for caching?


A) Secondary Storage
B) Main Memory (RAM)
C) ROM
D) Magnetic Tape
Answer: B) Main Memory (RAM)

20. Which disk scheduling algorithm serves requests in the order they arrive?
A) SSTF
B) SCAN
C) FCFS
D) C-SCAN
Answer: C) FCFS

21. FCFS disk scheduling stands for:


A) First Come First Served
B) First Call First Service
C) Fast Come Fast Service
D) File Control First System
Answer: A) First Come First Served

22. Which disk scheduling algorithm selects the request closest to the current head
position?
A) FCFS
B) SSTF
C) SCAN
D) LOOK
Answer: B) SSTF

23. SSTF stands for:


A) Shortest Seek Time First
B) Smallest Storage Transfer First
C) System Seek Time Function
D) Sequential Storage Transfer Function
Answer: A) Shortest Seek Time First

24. Which disk scheduling algorithm is also known as the Elevator Algorithm?
A) FCFS
B) SCAN

43
C) FIFO
D) LRU
Answer: B) SCAN

25. In the SCAN algorithm, the disk head:


A) Moves in one direction servicing requests and then reverses direction
B) Randomly selects requests
C) Always moves to the middle track
D) Never changes direction
Answer: A) Moves in one direction servicing requests and then reverses direction

26. Which disk scheduling algorithm moves in one direction only and then jumps
back to the beginning?
A) SCAN
B) LOOK
C) C-SCAN
D) SSTF
Answer: C) C-SCAN

27. Which disk scheduling algorithm avoids unnecessary movement to the end of the
disk?
A) LOOK
B) FCFS
C) FIFO
D) Round Robin
Answer: A) LOOK

28. Which Linux file system feature supports file permissions for users, groups, and
others?
A) NTFS
B) ext4
C) FAT32
D) exFAT
Answer: B) ext4

29. Which file system is commonly used in modern Linux operating systems?
A) FAT16
B) NTFS
C) ext4
D) ISO9660
Answer: C) ext4

30. Which of the following is NOT a disk scheduling algorithm?

44
A) SCAN
B) SSTF
C) LRU
D) C-SCAN
Answer: C) LRU

1. Define a file system. [CO2,LOT,K1]


2. What is a directory? [CO2,LOT,K1]
3. List any four file attributes. [CO2,LOT,K1]
4. List the different types of directory structures. [CO2,LOT,K1]
5. Define I/O management. [CO2,LOT,K1]
6. Define Direct Memory Access (DMA). [CO2,LOT,K1]
7. What is disk scheduling? [CO3,LOT,K1]
8. List any four disk scheduling algorithms. [CO3,LOT,K1]
9. What is buffering? [CO4,LOT,K1]
10. Define caching. [CO4,LOT,K1]
11. What is spooling? [CO4,LOT,K1]
12. What is rotational latency? [CO3,LOT,K1]
13. Differentiate between a file and a directory. [CO2,LOT,K2]
14. Compare single-level and tree-structured directories. [CO2,LOT,K2]
15. Explain how file systems and I/O management contribute to [CO5,LOT,K2]
efficient operating system performance.
16. Explain the importance of file access permissions in operating [CO2,LOT,K2]
systems.
17. Describe the role of file systems in managing secondary storage. [CO2,LOT,K2]
18. Explain the significance of caching in improving system [CO4,LOT,K2]
performance.
19. Differentiate between SCAN and C-SCAN disk scheduling. [CO3,LOT,K2]
20. Compare polling and interrupt-driven I/O. [CO2,LOT,K2]

45
PART – B

1. Explain the architecture and functions of a file system. Discuss [CO2,HOT,K2]


different file operations and file attributes with suitable examples.
2. Explain the various directory structures (Single-Level, Two-Level, [CO2,HOT,K2]
Tree-Structured, and Acyclic Graph) and compare their advantages
and disadvantages.
3. Explain the concept of file access control. Discuss file permissions, [CO2,HOT,K2]
Access Control Lists (ACLs), and their importance in securing
files.
4. Explain the I/O management system in an operating system. [CO2,HOT,K2]
Discuss the roles of device drivers, interrupts, polling, and Direct
Memory Access (DMA).
5. A disk has 200 cylinders (0–199). The current head position is 53, [CO3,HOT,K3]
and the request queue is 98, 183, 37, 122, 14, 124, 65, 67. Apply
the FCFS disk scheduling algorithm and calculate the total head
movement.
6. A disk contains cylinders numbered 0–199. The disk head is [CO3,HOT,K3]
initially at 53 and is moving towards higher-numbered cylinders.
Apply the SCAN disk scheduling algorithm for the request queue
98, 183, 37, 122, 14, 124, 65, 67. Draw the head movement and
calculate the total seek distance.
7. Explain how buffering and caching improve I/O performance. [CO4,HOT,K3]
Illustrate their operation with suitable examples and compare their
roles in operating systems.
8. Analyze the differences between FCFS, SSTF, SCAN, C-SCAN, [CO3,HOT,K4]
LOOK, and C-LOOK disk scheduling algorithms based on seek
time, throughput, fairness, and starvation. Recommend the most
suitable algorithm for a multi-user operating system.
9. A university maintains a centralized file server accessed by [CO5,HOT,K4]
students, faculty, and administrators. Analyze the requirements for

46
file organization, directory structure, access control, I/O
management, and disk scheduling. Propose an appropriate solution
to ensure security, performance, and efficient resource utilization.

47

You might also like