Q: 1 How many times the following C program prints “Hello”?
main()
{
fork();
fork();
printf(“Hello”);
}
Twice
Four Times
Six Times
Only Once
[ Option B ]
The fork() System Call
The fork() system call in C is used to create a new process by duplicating the existing one.
After a fork() call, there are two processes running the same code, the parent process and the child process. Each process continues execution from the point where the fork() was called. So, if you call fork() multiple times, the number of processes increases exponentially.
There is no loop, and each fork() doubles the number of processes. Hence, total “Hello” prints = 2number of forks
Finally, 22 = 4.
Q: 2 If three threads are trying to share a single object at the same time which condition will arise in the scenario?
Time-Lapse
Critical Situation
Race Condition
Recursion
[ Option C ]
A Race Condition occurs when two or more threads or processes try to access and modify the same shared resource (like an object) at the same time without proper synchronization. This leads to unpredictable and incorrect behavior.
For instance, if three threads attempt to share and modify a single object concurrently, and there is no mechanism to control access (like locks or mutex), a race condition occurs causing data corruption or inconsistent results.
Q: 3 What does OS X has?
Monolithic kernel with modules
Microkernel
Monolithic kernel
Hybrid kernel
[ Option D ]
The MacOS (formerly OS X) uses the XNU kernel, which is a hybrid kernel. This kernel architecture combines features from both the microkernel and monolithic kernel designs.
| Kernel Type | Definition |
|---|---|
| Monolithic Kernel | A monolithic kernel is an operating system architecture where the entire OS, including device drivers, file system, and memory management, runs in kernel space. It is very fast but less modular, and a single fault can crash the whole system. An example is Linux. |
| Microkernel | A microkernel keeps only essential services such as CPU scheduling, memory management, and interprocess communication in kernel space. Other services run in user space. This makes the system more modular and stable, but it is slower due to message passing. An example is Minix. |
| Hybrid Kernel | A hybrid kernel combines features of monolithic and microkernel architectures. Critical services run in kernel space while others are modularized in user space. It balances performance and stability but is more complex in design. Examples include MacOS (XNU) and Windows NT. |
Q: 4 What are the functions of operating system?
Choose the most appropriate answer from the options given below:
1, 2 and 3 only
2 and 3 only
1,3 and 4 only
1 and 4 only
[ Option C ]
An Operating System (OS) is a system software that acts as an interface between the user and the computer hardware. It manages hardware resources and provides essential services for running applications.
| OS FUNCTION | DESCRIPTION |
|---|---|
| Memory Management | Allocates and deallocates memory to different processes efficiently. |
| Processor Management | Manages CPU time among multiple processes (CPU Scheduling). |
| File Management | Handles creation, deletion, reading, and writing of files or folders. |
| Device Management | Controls and coordinates input-output devices. |
Q: 5 Operating system allows the file system to –
Rearrange the characters of the files.
Create, Access, Maintain a directory and protection of file from unauthorized access.
Change the extension of the file.
Transferring files from one computer to another.
[ Option B ]
The File System in an Operating System (OS) provides a way to store, organize, and manage files on storage devices. It allows the system to:
Q: 6 In MS-DOS, when power is turned on, BIOS does the following tasks.
Choose the answer with correct sequence of tasks from the option given below:
5, 4, 2, 3, 1
2, 5, 3, 4, 1
5, 2, 4, 1, 3
2, 3, 5, 1, 4
[ Option C ]
When a computer is powered on, the BIOS (Basic Input/Output System) is responsible for initializing hardware, performing system checks, and loading the operating system into main memory so that the computer can start functioning.
| STEP | TASK | DESCRIPTION |
|---|---|---|
| 1 | Self-Test (POST) | BIOS performs Power-On Self-Test to check hardware components and system integrity. |
| 2 | Load Boot Loader | BIOS loads a small portion of OS called the boot loader from the storage device. |
| 3 | Load Boot Loader into Main Memory | The boot loader is loaded into RAM so it can start execution. |
| 4 | Pull Rest of OS | Boot loader fetches the remaining operating system from disk into memory. |
| 5 | Store OS in Main Memory | The rest of the OS is stored in RAM, completing the loading process so the system can run. |
Q: 7 Which component of an operating system is responsible for managing the files?
Memory Manager
Process Manager
Device Driver
File System Manager
[ Option D ]
An OS has several key components, each responsible for managing a specific part of the computer:
Q: 8 Which of the following does NOT characterize an executing process?
Program counter
Context Data
Priority
Source Code Length
[ Option D ]
A Process is a program in execution. When a program is loaded into memory for execution, the OS assigns it various attributes to help manage and control it effectively. These attributes are part of the Process Control Block (PCB), which contains all the important information about a running process.
| ATTRIBUTE | DESCRIPTION |
|---|---|
| Process ID (PID) | Unique identifier assigned to each process. |
| Process State | Shows the current status, New, Ready, Running, Waiting, or Terminated. |
| Program Counter (PC) | Holds the address of the next instruction to be executed. |
| CPU Registers | Store temporary data and intermediate results during execution. |
| Context Data | Contains saved information when a process is switched out, used to restore the process later. |
| Memory Management Information | Includes base and limit registers or page table references for memory allocation. |
| Priority | Defines the scheduling order of processes based on importance. |
| Accounting Information | Keeps track of CPU usage time and other resource statistics. |
| I/O Status Information | Lists the files opened or I/O devices currently used by the process. |
Q: 9 Binary file contains machine readable characters in ____ and ____ format.
1,0
Alphabets and Numbers
Special Characters and Numbers
Alphabets and Special Characters
[ Option A ]
A Binary File stores data in machine-readable format using binary digits (bits), which are 0s and 1s. These digits represent the on and off states in digital circuits, making it a format that computers can directly read and process.
Unlike Text Files which store alphabets, numbers, and special characters in readable format, binary files store data in a very compact and efficient way using only 0s and 1s.
Q: 10 A special software to create a job queue is called—
Linkage Editor
Interpreter
Drive
Spooler
[ Option D ]
A SPOOLER is special system software used to manage and create a job queue. It stands for Simultaneous Peripheral Operations On-Line. The spooler collects jobs and stores them in a queue (FIFO), then executes them one by one in order, ensuring efficient use of resources. The spooler ensures jobs are executed in the correct order without conflicts or loss.
Q: 11 Which of the following is not a component of NTFS volume layout?
Partition boot sector
Master bytes
File area
System files
[ Option B ]
NTFS (New Technology File System) is the main file system used by Windows operating systems to store and organize data on hard drives. It is more advanced than FAT and FAT32 because it supports features like file permissions, encryption, compression, and large storage sizes.
An NTFS volume layout is divided into several main components that define how data is stored and accessed:
| COMPONENT | DESCRIPTION |
|---|---|
| Partition Boot Sector | Contains information needed to start the operating system and details about the NTFS structure. |
| System Files | Includes essential metadata files like the Master File Table (MFT), which keeps records of all files and directories. |
| File Area | The space where the actual data and files created by users are stored. |
There is no component called “Master bytes” in the NTFS layout.
Q: 12 Which of the following is NOT a condition for deadlock to be possible?
Mutual Exclusion
Hold and Wait
Pre-emption
No resources can be forcibly removed from a process holding it.
[ Option C ]
A Deadlock is a situation in an operating system where two or more processes are waiting for each other indefinitely to release resources. For a deadlock to occur, four necessary conditions (Coffman’s conditions) must hold simultaneously.
| CONDITION | MEANING |
|---|---|
| Mutual Exclusion | At least one resource must be held in a non-shareable mode, only one process can use it at a time. |
| Hold and Wait | A process is holding at least one resource and is waiting for another that is currently held by another process. |
| No Pre-emption | A resource cannot be forcibly taken away from a process. It must be released voluntarily. |
| Circular Wait | A circular chain of processes exists, where each process holds one resource and waits for the next process resource. |
Deadlock happens only when resources cannot be pre-empted. Therefore, Pre-emption itself is not a condition for deadlock. In fact, it helps prevent deadlock.
Q: 13 What is the purpose of swapping in an operating system?
To permanently terminate long-running processes.
To move processes between different CPU cores for load balancing.
To increase the CPU's clock speed during peak usage.
To temporarily remove a process from memory and resume it later.
[ Option D ]
Swapping is a memory management technique used when the system’s main memory (RAM) becomes full.
In a multitasking environment, several processes are loaded into memory, but sometimes there is not enough space for all of them. To handle this, the operating system temporarily moves some inactive processes from main memory to the hard disk (swap space). This process is called swapping out.
When the process is needed again, it is swapped back into memory, called swapping in. This allows the OS to manage limited memory more efficiently and ensures that active processes get enough memory to run.
| TERM | MEANING |
|---|---|
| Swapping Out | Moving a process from main memory to disk. |
| Swapping In | Bringing the process back from disk to main memory when needed. |
Q: 14 What is the key difference between user-level threads and kernel-level threads?
User threads are created by the hardware, while kernel threads are created by the user.
Kernel threads can run without an operating system, while user threads cannot.
User threads are managed without kernel support, while kernel threads are managed by the operating system.
There is no relationship between kernel threads and user threads.
[ Option C ]
A Thread is a lightweight unit of a process that allows multiple parts of a program to execute concurrently. There are two main types of threads.
User-Level Threads (ULTs):
Kernel-Level Threads (KLTs):
Q: 15 Which Register holds the address of the next instruction to be executed?
Instruction Register
Accumulator
Program Counter
Data Register
[ Option C ]
The Program Counter (PC) is a special register in the CPU that stores the address of the next instruction to fetch and execute from memory.
After fetching the current instruction, the PC increments to point to the next instruction’s address unless modified by a jump or branch instruction.
This allows the CPU to execute the sequence of instructions in order and supports control flow changes.
Q: 16
Which of the following statements are correct with respect to the given system call?
| System Call | Statement |
|---|---|
| A. fork() | Creates a new process that starts from the main() function again. |
| B. wait() | Waits for the child process to terminate and retrieves its exit status. |
| C. exec() | Replaces the current process image with a new program executable. |
Options B, C are correct.
Options A, C are correct.
Options A, B are correct.
Options A, B, C are correct.
[ Option A ]
System Calls are special functions provided by the OS that allow user programs to request services from the kernel, such as process creation, file handling, or communication.
In process management, three important system calls are fork(), wait(), and exec(), each serving a specific purpose in process control.
| System Call | Used For |
|---|---|
| fork() | Creates a new process, called the child process, which is a copy of the parent process. The child process starts execution from the next instruction after fork(), not from the main() function again. |
| wait() | Makes the parent process wait until its child process finishes. It also retrieves the exit status of the child process. |
| exec() | Replaces the current process image with a new program executable, allowing a process to run a different program in the same process ID. |
Q: 17 Which one of the following errors will be handled by the operating system?
Lack of paper in printer
Connection failure in the network
Power failure
All of the above
[ Option D ]
Operating systems handle a variety of errors that may arise during process execution or hardware interaction.
Lack of paper in printer, the OS detects and handles this by notifying the user or pausing the printing process until paper is available.
Connection failure in the network, the OS manages network errors by detecting connection failures, reporting issues, and attempting reconnections or switching to backup networks.
Power failure, the OS can handle power failures by initiating safe shutdown procedures, saving unsaved data, and preserving system integrity through battery backups or power management features.
Q: 18 Which of the following is not a classifications of Operating System?
Multithreading OS
Time-Batch Processing OS
Multi-Programming OS
Multitasking OS
[ Option B ]
Multithreading OS refers to operating systems that support multiple threads within a single process to improve efficiency. Basically, multithreading is a feature of modern OS.
Multiprogramming OS allows multiple programs to run on a computer at the same time by managing CPU time effectively.
Multitasking OS lets users run multiple applications simultaneously by rapidly switching between tasks.
| Classification | Description |
|---|---|
| Batch Processing OS | Executes jobs in batches without user interaction and is used in early computers. |
| Time-Sharing / Multitasking OS | Allows multiple tasks or users to share CPU time for example UNIX, Windows. |
| Multi-Programming OS | Runs multiple programs simultaneously to maximize CPU utilization for example IBM OS/360. |
| Real-Time OS (RTOS) | Responds immediately to inputs and is used in medical devices, embedded systems, robotics. |
Q: 19 Round robin is a method of ___________________ scheduling.
Preemptive Scheduling
Non-Preemptive Scheduling
Both Preemptive and Non-Preemptive
Neither Preemptive nor Non-Preemptive
[ Option A ]
Round Robin (RR) is a preemptive CPU scheduling algorithm used in operating systems.
CPU Scheduling is the method by which an operating system decides which process in the ready queue will get the CPU next. The main goal is to maximize CPU utilization, minimize waiting time, and ensure fair access to processes. The CPU scheduling mainly two types:
Q: 20 Match memory management techniques in Column – I to their description in Column – II.
| Column – I | Column – II |
|---|---|
| a. Simple Segmentation | i. it is not necessary to load all of the segments of a process. Non- resident segments that are needed are brought in later automatically. |
| b. Virtual Memory Paging | ii. A process is loaded by loading all of its pages into available, not necessarily contiguous, frames. |
| c. Virtual Memory Segmentation | iii. It is not necessary to load all of the pages of a process. Non-resident pages that are needed are brought in later automatically. |
| d. Simple Paging | iv. A process is loaded by loading all of its segments into dynamic partitions that need not be contiguous. |
Choose the correct option:
a – ii, b – i, c – iii, d – iv
a – iv, b – i, c – iii, d – ii
a – ii, b – iii, c – i, d – iv
a – iv, b – iii, c – i, d – ii
[ Option D ]
In memory management, different techniques are used to load and manage processes in main memory.
Q: 21 When a user initiates multiple process to the computer then the computer follows FIFO method. The expansion of FIFO is
Formula In Formula Out
First In First Out
Figure In Figure Out
Flash In Flash Out
[ Option B ]
FIFO (First In First Out) is a scheduling or data handling method where the first process or item that enters the queue is the first one to be processed or removed. It works much like a queue where the earliest request is served before others.
Q: 22 How many states can be processed in operating system?
2
3
4
5
[ Option D ]
In an Operating System (OS), a process is a program in execution. Each process moves through various states during its life cycle, from creation to termination. Typically, a process can exist in five main states.
| State | Description |
|---|---|
| New | The process is being created. |
| Ready | The process is loaded into memory and waiting for CPU allocation. |
| Running | The process is currently executing on the CPU. |
| Waiting (Blocked) | The process is waiting for some event, input-output, or resource before it can proceed. |
| Terminated (Exit) | The process has finished execution and is removed. |
Q: 23 Which statement is correct about the /proc file system in Linux?
It is a disk-based file system used to save long-term process logs.
It resides in kernel memory and is used for querying process and kernel statistics.
It contains static information for processes that have already exited.
It is designed to store loadable kernel binaries permanently.
[ Option B ]
The /proc file system in Linux is a virtual file system that provides information about the system’s processes and kernel in real time. It does not exist on the disk like regular files, instead, it resides in kernel memory and is generated dynamically when accessed.
The /proc directory contains files and folders that represent system information such as CPU usage, memory details, running processes, and kernel parameters.
Q: 24 If a process fails, most operating systems write the error information to a -
New file
Another running process
Log file
None of the mentioned
[ Option C ]
When a process fails, most operating systems record the error information in a log file. This log file serves as a permanent record to help system administrators, developers, and support personnel diagnose and troubleshoot problems.
By recording details such as the time of failure, type of error, and sometimes even a memory dump, log files help developers and administrators trace the cause of the failure. This approach provides a reliable and centralized way to analyze problems and ensure system stability.
| Operating System | Log File | Purpose |
|---|---|---|
| Linux / Unix | /var/log/syslog | Stores general system messages and errors. |
| Linux / Unix | /var/log/messages | Contains kernel and system-level messages, including startup logs. |
| Linux / Unix | /var/log/auth.log | Records authentication attempts such as login successes and failures. |
| Linux / Unix | /var/log/dmesg | Contains boot-time kernel messages and hardware detection logs. |
| Windows | Event Viewer – System Log | Stores system-level events such as driver failures, shutdowns, and reboots. |
| Windows | Event Viewer – Application Log | Contains error and status information from user applications. |
| Windows | Event Viewer – Security Log | Records login attempts, account management, and security-related events. |
Q: 25 Every OS has a __________ which permanently resides in the main memory of the computer to perform some of the basic functions.
Centre
Kernel
Hardware
Node
[ Option B ]
The Kernel is the core part of an operating system that permanently resides in main memory (RAM).
Q: 26 An INI file in Windows 95 is –
A Program File
A Message File
A Text File
Link File
[ Option C ]
An INI file (initialization file (.ini)) in Windows 95 is a plain text configuration file used to store settings and configuration data for the operating system and applications. These files are organized into sections containing key-value pairs and are readable and editable using any text editor like Notepad.
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.