BCA / B.Tech 36 min read

Operating System (OS) All Important Questions and Answers in English (MDSU)

1. What is an Operating System (OS)?

Ans. An Operating System is software that works between the computer and the user. It manages all the resources of the computer and allows users to run programs.

2. What are the main goals of an OS?

Ans. The main goals of an OS are:

  • Convenience: To make the system easy for the user.
  • Efficiency: To use hardware and software effectively.
  • Security: To keep data and programs safe.
  • Resource Management: To control the CPU, memory, and input-output devices.

3. How does an OS work?

Ans. When the computer is turned on, the OS is loaded into memory (which is called booting). After that, it runs programs and manages all resources.

4. What is a Resource Allocator?

Ans. The OS acts as a Resource Allocator, meaning it divides the CPU, memory, and devices among different programs so that everything runs smoothly.

5. What are the types of OS?

Ans. OS is divided into 5 main classes:

  • Batch OS: Programs are executed one after another in a queue.
  • Multiprocessing OS: More than one CPU works at the same time.
  • Time-Sharing OS: Each process is given a fixed amount of time.
  • Distributed OS: Multiple computers work together as one system.
  • Real-Time OS: Where execution time is very important, like airplane control systems.

6. What is a Batch Processing OS?

Ans. In this OS, similar jobs are stored together in a queue and are executed automatically.

7. What is a Multi-processing OS?

Ans. When a computer has more than one processor and they can process multiple tasks at the same time, it is called a Multiprocessing OS.

8. What is a Time-Sharing OS?

Ans. In this, each user or process is given a time slice so that all processes get a chance to use the CPU.

9. What is a Distributed OS?

Ans. This is an OS where multiple computers are connected to each other and work together, like cloud computing.

10. What is a Real-Time OS?

Ans. This OS is used in systems where execution time is very important, such as medical systems or airplane control.

11. What are System Calls?

Ans. When a program wants the OS to do a task (like opening a file or allocating memory), it uses a System Call.

12. What are System Programs?

Ans. These are programs that help manage the OS, such as a file manager, text editor, and compiler.

13. What is the Structure of an OS?

Ans. The structure of an OS varies; some common structures are:

  • Layered OS: Divided into different layers.
  • Microkernel OS: Contains only essential functions, with the rest in user-space.
  • Monolithic OS: The entire OS executes as a single unit.

14. What is the Layer Design of DOS and Unix?

Ans. DOS: It is a simple OS with direct hardware access.
Unix: It is a multi-user and multi-tasking OS that is divided into different layers.

15. What is a Virtual Machine OS?

Ans. This is an OS that allows multiple OSs to run on one computer, like VMware.

16. What is a Kernel-Based OS?

Ans. In this, the main part of the OS is the Kernel, which controls all hardware and software.

17. What is a Process?

Ans. When a program is being executed, it is called a process.

18. What are Interacting Processes?

Ans. When two or more processes share data with each other, they are called interacting processes.

19. What is a Thread?

Ans. A thread is a small part of a process that can run independently.

20. What is Scheduling?

Ans. When the OS decides which process will use the CPU and when, it is called scheduling.

21. What are Scheduling Criteria?

Ans. Some important scheduling criteria are:

  • CPU Utilization: The CPU should be used to its maximum.
  • Throughput: How many processes are completed in a fixed time.
  • Response Time: The time it takes for a process to get a response.

22. What are Short, Medium, and Long Term Scheduling?

Ans.

  • Short-Term Scheduler: It assigns the next process to the CPU.
  • Medium-Term Scheduler: It moves some processes out of memory (swapping).
  • Long-Term Scheduler: It allows new processes to enter the system.

23. What are the types of Scheduling Algorithms?

Ans. Some common scheduling algorithms:

  • FCFS (First Come First Serve) – The one that comes first will be executed first.
  • SJF (Shortest Job First) – The smallest process will be executed first.
  • Round Robin – Each process is given a time slice.
  • Priority Scheduling – The process with the highest priority will be executed first.

24. What is a Concurrent System?

Ans. A system where multiple processes are running at the same time is called a concurrent system.

25. What is a Critical Section?

Ans. When two or more processes are accessing the same resource, that part is called the Critical Section. Synchronization techniques are used to manage it.


26. What is a Critical Region?

Ans. When two or more processes are accessing shared resources, the section where data corruption can occur is called the Critical Region.

27. What is Inter-Process Communication (IPC)?

Ans. When two or more processes send or receive data from each other, it is called IPC (Inter-Process Communication). It happens in two ways:

  • Shared Memory: Both processes access the same memory.
  • Message Passing: Processes send messages to each other.

28. What are Monitors and Semaphores?

Ans.

  • Monitor: It is a high-level synchronization tool that keeps shared data safe.
  • Semaphore: It is a signal variable that allows multiple processes to coordinate.

29. What is the difference between Logical and Physical Address?

Ans.

  • Logical Address: This is the address visible to the program, generated by the CPU.
  • Physical Address: This is the actual address in memory where data is stored.

30. What is Swapping?

Ans. When a process is temporarily moved from memory to secondary storage (hard disk) and later brought back, this is called Swapping.

31. What is Contiguous Allocation?

Ans. When a process is given a continuous block of memory, it is called Contiguous Allocation.

32. What is Segmentation?

Ans. In this, memory is divided into different segments, such as Code Segment, Data Segment, and Stack Segment.

33. What is Paging?

Ans. In this, memory is divided into fixed-size pages, and processes are stored in frames of the same size.

34. What is Segmentation with Paging?

Ans. This is a hybrid system where both memory segmentation and paging are used.

35. What is Kernel Memory Allocation?

Ans. This is a memory allocation technique in which the kernel assigns memory to processes in different ways, such as the Buddy System and Slab Allocation.

36. What is a Page Replacement Algorithm?

Ans. When a new page needs to be brought into virtual memory and an old page has to be removed, it is done by a Page Replacement Algorithm.

  • FIFO (First In First Out)
  • LRU (Least Recently Used)
  • Optimal Algorithm

37. What is Virtual Memory?

Ans. It is a technique where more memory is visible than the physical RAM, and secondary storage (HDD/SSD) is used.

38. What is Demand Paging?

Ans. In this, pages are loaded into memory only when they are needed, which increases RAM efficiency.

39. What is a Deadlock?

Ans. When two or more processes block the resources needed by each other and none can proceed, it is called a Deadlock.

40. How is a Deadlock Handled?

Ans. A Deadlock can be handled in four ways:

  1. Prevention: Not allowing a deadlock to occur at all.
  2. Avoidance: Keeping the system in a safe state using the Banker's Algorithm.
  3. Detection: Detecting a deadlock and stopping a process.
  4. Recovery: Terminating some processes to end the deadlock.

41. What is Thrashing?

Ans. When the system repeatedly brings pages from and removes them to memory, causing performance to become very slow, it is called Thrashing.

42. What is Frame Allocation?

Ans. This is a technique for allocating memory to processes, which decides how many frames each process will get.

43. What is the Architecture of a Distributed System?

Ans. It is a network of multiple machines, where all machines work together and share data.

44. What is an Inter-Process Communication Protocol?

Ans. In Distributed Systems, processes communicate with each other through TCP/IP, RPC (Remote Procedure Call), and Message Queue.

45. What is a Network OS?

Ans. This is an OS that connects multiple computers in a network and allows them to interact with each other, like Windows Server and Linux Server.

46. What is a Distributed File System (DFS)?

Ans. This file system is distributed over a network, allowing multiple users to access files at the same time.

47. What is Linux and what is its history?

Ans. Linux is an open-source OS, created by Linus Torvalds in 1991. It is a multi-user and multi-tasking OS.

48. How is File Manipulation done in Linux?

Ans. There are some commands to manage files in Linux:

  • ls → To show files and folders
  • cp → To copy files
  • rm → To delete files
  • mv → To move/rename files

49. What is Shell Scripting?

Ans. A Shell Script is a program that contains multiple shell commands to automate tasks.

50. How are C Language and Linux connected?

Ans. The Linux kernel is written in the C Language. We can compile and execute C Programs in Linux.

Extra Questions (Advanced and Practical Topics)

51. What is the Kernel in Linux and what are its main functions?

Ans. The Kernel is the core part of any operating system. It is the bridge between hardware and software. No OS can work without a Kernel. It is the first thing to load and remains in memory until the system shuts down.

Main functions of the Linux Kernel:

  1. Process Management: It divides the CPU to run multiple processes.
  2. Memory Management: The Kernel decides how much memory each process gets.
  3. Device Management: It manages input/output devices (mouse, keyboard, printer, etc.).
  4. File System Management: The Kernel manages files and directories in Linux.
  5. Security & Access Control: It handles user permissions and system security.

Types of Linux Kernel:

  1. Monolithic Kernel: The entire kernel is in a single module (e.g., Linux Kernel).
  2. Microkernel: It is divided into small parts (e.g., MINIX Kernel).
  3. Hybrid Kernel: A mix of Monolithic and Microkernel (e.g., Windows NT).

Why is the Linux Kernel special?

  • It is Open Source, meaning anyone can modify it.
  • It is a very stable and secure OS.
  • Android also runs on the Linux Kernel.

52. What are Signals in Linux and how are they used?

Ans. Signals are used for a process to communicate with another process. They are used to control processes asynchronously (suddenly).

Types of Signals:

  1. Terminating Signals: To end a process (e.g., SIGKILL, SIGTERM)
  2. Ignore Signals: Which a process can ignore (e.g., SIGCONT)
  3. Stop Signals: To temporarily stop a process (e.g., SIGSTOP)

Ways to Send Signals:

  1. kill Command:
    kill -9 1234 # Forcefully kill Process ID 1234
    
  2. Ctrl + C (SIGINT): To stop a running program
  3. Ctrl + Z (SIGTSTP): To send a process to the background

Signal Handling in C (Linux Programming):
If we want a process to handle a signal, we can use the signal() function.

#include 
#include 
void handle_sigint(int sig) {
printf("Signal %d received. Process will not stop!\n", sig);
}
int main() {
signal(SIGINT, handle_sigint);
while (1) {
printf("Running...\n");
sleep(1);
}
return 0;
}

This program will not terminate with Ctrl + C because we have handled SIGINT.


53. What are Deadlock Prevention Methods?

Ans. When multiple processes wait for resources and block each other, it is called a Deadlock.

Four Conditions for Deadlock (Coffman Conditions):

  1. Mutual Exclusion: A resource can be used by only one process at a time.
  2. Hold and Wait: A process holds one resource and waits for another.
  3. No Preemption: No process can forcefully take a resource from another process.
  4. Circular Wait: One process waits for another, and the other waits for the first, forming a circle.

Deadlock Prevention Techniques:

  1. Remove Mutual Exclusion: If possible, share resources.
  2. Avoid Hold and Wait: Allocate all resources to a process at once.
  3. Allow Preemption: Forcefully take resources when needed.
  4. Break Circular Wait: Allocate resources in a fixed order.

Banker's Algorithm (Deadlock Avoidance)

  • This algorithm checks whether the system will remain in a safe state after allocating a resource to a process.
  • If there is a chance of entering an unsafe state, the resource is not allocated.

54. Virtual Memory vs. Physical Memory – What is the difference?

Ans. Physical Memory is the actual RAM, while Virtual Memory is a part of the hard disk that supplements the RAM when it is full.

Feature Physical Memory (RAM) Virtual Memory (HDD/SSD)
Location In RAM On Hard Disk/SSD
Speed Very fast Quite slow
Cost Expensive Cheap
Size Limited Can be large, depending on the Hard Disk
Usage Used for fast execution of programs Used as a backup when RAM is full

How does Virtual Memory work?

  • When a process needs more memory, the OS uses the paging technique to use the hard disk like RAM.
  • It makes the process feel like it has more RAM, but the performance becomes a bit slower.

55. What is a Shell Script in Linux and why is it important?

Ans. A Shell Script is a file that contains multiple Linux commands. It is used to automate repetitive tasks.

Why is a Shell Script important?

  1. Automation: You can automate daily tasks.
  2. Efficiency: No need to write commands repeatedly.
  3. Error Handling: System tasks can be managed better.

Shell Script Example:

#!/bin/bash
echo "Hello, $USER!"
echo "Today's date is: $(date)"
echo "Current Directory: $(pwd)"

To run this script:

chmod +x script.sh # Make it executable
./script.sh # Run it

This will print the current user, date, and directory to the screen.

In this Chapter

Operating System (OS) All Important Questions and Answers in English (MDSU)
Distributed System in Operating System
Real-Time System in Operating System
System Calls in Operating System
System Programs in Operating System
Structure of an Operating System
Layered Design of an Operating System Structure
UNIX in Operating System
Virtual Machine in Operating System
Kernel-Based Operating System
Process Concept in Operating System
Interacting Processes in Operating System
Threads in Operating System
Fundamentals of Scheduling in Operating System
Scheduling Criteria in Operating System
Long, Medium, and Short-Term Scheduling
Scheduling Algorithms in Operating System
Structure of a Concurrent System
Critical Region in Operating System
Critical Section in Operating System
Inter-process Communication (IPC) in Operating System
Monitors in Operating System
Semaphores in Operating System
Semaphore Implementation & Uses in Operating System
Logical and Physical Address in Operating System
Swapping in Operating System
Contiguous Allocation in Operating System
Segmentation in Operating System
Paging in Operating System
Virtual Memory using Segmentation in Operating System
Interprocess Communication Protocol in Operating System
Network Operating System
Design Issues in Distributed File System
Network Structure in Operating System
Structure of a Distributed System
File System and Coordination in Operating System
History of Linux in Operating System
Linux Commands
Programmer Interface & File Manipulation in Linux
Process Control in Linux
Kernel & Signals in Linux
File System in Linux
Blocks and Inodes in Linux
System Editors in Linux
Character Transliteration in Linux
The `ed` Line Editor in Linux
The `vi` Editor and Its Commands
Shell Scripting in Linux
Looping & Decision Making in Linux Shell Scripting
Variables & File Name Expansion in Linux
Arrays in Linux Shell Scripting
Subprograms (Functions) in Linux Shell Scripting
C Interface with Linux
Simple Shell Programs in Linux
BCA Part-1 | Operating Systems | Semester-I | MDSU Exam Paper 2023 (Held in 2024)
What is an Operating System (OS)
BCA || Operating System 2025 Paper || MDSU Exam Paper
BCA | OS(Operating System) 2023 Paper | MDSU Exam Paper
Types of Operating Systems
Goals of an Operating System
Operations of an Operating System
Resource Allocation & Functions in an Operating System
Classes of Operating System
Batch Processing in Operating System
Multiprocessing in Operating System
Time-Sharing in Operating System