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

OS_Lab_Viva_Questions

The document provides a comprehensive list of operating system (OS) lab viva questions and their answers, covering key concepts such as processes, threads, multitasking, scheduling algorithms, deadlocks, virtual memory, and file systems. It explains essential OS functions, system calls, and process synchronization mechanisms. Additionally, it highlights differences between various OS components and algorithms, such as monolithic vs microkernel and paging vs segmentation.

Uploaded by

asishpunoff231
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)
6 views

OS_Lab_Viva_Questions

The document provides a comprehensive list of operating system (OS) lab viva questions and their answers, covering key concepts such as processes, threads, multitasking, scheduling algorithms, deadlocks, virtual memory, and file systems. It explains essential OS functions, system calls, and process synchronization mechanisms. Additionally, it highlights differences between various OS components and algorithms, such as monolithic vs microkernel and paging vs segmentation.

Uploaded by

asishpunoff231
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/ 3

OS Lab Viva Questions with Answers

1. What is an Operating System?


- An OS manages hardware and software resources, providing services for applications.

2. What are the main functions of an OS?


- Process management, memory management, file system management, device management.

3. What is a process? How is it different from a program?


- A process is a running program with resources allocated, while a program is static.

4. What are the different states of a process?


- New, Ready, Running, Waiting, and Terminated.

5. What is a thread? How does it differ from a process?


- A thread is a lightweight process that shares resources within a process.

6. What is multitasking in an OS?


- The ability of the OS to run multiple processes simultaneously.

7. What is the difference between multitasking and multiprocessing?


- Multitasking shares CPU time among processes, while multiprocessing runs processes on multiple CPUs.

8. What is a system call? Give an example.


- A system call allows programs to interact with the OS. Example: fork().

9. What is process scheduling? Name some scheduling algorithms.


- Process scheduling decides which process runs next. Algorithms: FCFS, SJF, RR, Priority Scheduling.

10. What is the difference between preemptive and non-preemptive scheduling?


- Preemptive allows process switching anytime, non-preemptive runs a process until completion.

11. What is a deadlock? What are the conditions for a deadlock to occur?
- Deadlock is when processes block each other. Conditions: Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait.

12. How can deadlocks be prevented or avoided?


- Prevention removes one of the four conditions. Avoidance uses algorithms like the Banker’s Algorithm.

13. What is virtual memory? How does it work?


- Virtual memory extends RAM using disk space, loading only needed parts into memory.

14. What is paging in OS?


- Paging divides memory into fixed-size blocks, reducing fragmentation.

15. What is the difference between paging and segmentation?


- Paging is fixed-size, segmentation is variable-size based on program structure.

16. What is a page fault? How is it handled?


- Occurs when a process accesses a page not in RAM. The OS loads it from disk.

17. What is the role of the kernel in an OS?


- The kernel is the core of the OS, managing resources and system calls.

18. What is the difference between a monolithic kernel and a microkernel?


- Monolithic includes all services, microkernel runs minimal services in kernel mode.

19. What is a semaphore? How is it used in process synchronization?


- A semaphore controls access to shared resources to prevent race conditions.
20. What is the difference between a binary semaphore and a counting semaphore?
- Binary is 0 or 1, used for mutual exclusion. Counting manages multiple resources.

21. What is a file system? What are its main functions?


- A file system organizes data storage. Functions: file creation, deletion, and access.

22. What is the difference between FAT and NTFS file systems?
- FAT is simpler but limited, NTFS supports security, compression, and larger files.

23. What is a context switch? Why is it important?


- A context switch saves a process state to switch execution to another process.

24. What is the purpose of the fork() system call in UNIX?


- Creates a new process identical to the parent.

25. What is the role of the shell in an OS?


- The shell interprets user commands and executes them via the OS.

26. What is CPU scheduling? Why is it needed?


- CPU scheduling decides process execution to optimize system performance.

27. What is the Round Robin scheduling algorithm?


- A time-sharing algorithm that assigns a fixed time slice to each process.

28. What is the First-Come-First-Serve (FCFS) scheduling algorithm?


- Executes processes in order of arrival.

29. What is the Shortest Job First (SJF) scheduling algorithm?


- Executes the shortest job first, reducing waiting time.

30. What is thrashing in OS?


- Excessive paging leading to performance degradation.

31. What is demand paging?


- Pages are loaded only when needed, reducing memory usage.

32. What is the difference between internal and external fragmentation?


- Internal: wasted space within allocated memory. External: scattered free memory.

33. What is a critical section in process synchronization?


- A code segment that accesses shared resources, requiring mutual exclusion.

34. What is the purpose of the exec() system call?


- Replaces the current process memory with a new program.

35. What is a zombie process?


- A terminated process whose exit status hasn’t been collected by the parent.

36. What is the Banker’s Algorithm?


- A deadlock avoidance method ensuring safe resource allocation.

37. What is a race condition?


- Unpredictable behavior when multiple processes access shared resources simultaneously.

38. What is inter-process communication (IPC)?


- Mechanisms for processes to communicate (e.g., pipes, shared memory).

39. What is the difference between a pipe and a FIFO?


- Pipe is for related processes, FIFO is named and can be used by unrelated processes.
40. What is the role of swap space in an OS?
- Swap space stores temporarily unused memory pages on disk.

You might also like