This section contains carefully selected MCQs and Previous Year Questions with explanations to help students understand concepts and prepare effectively for examinations, interviews, and competitive tests.
Q: 1How many times the following C program prints “Hello”?
main()
{
fork();
fork();
printf(“Hello”);
}
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: 2If three threads are trying to share a single object at the same time which condition will arise in the scenario?
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: 3What does OS X has?
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: 4What are the functions of operating system?
Choose the most appropriate answer from the options given below:
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: 5Panther, Jaguar, Puma and Cheetah are example of ____________?
Option B
In operating systems, different versions are often given specific names. Apple’s Mac Operating System (Mac OS / macOS) has used names of big cats for its earlier versions. Examples include:
These are all code names of different versions of Mac OS.
Q: 6Operating system allows the file system to –
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: 7In 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:
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: 8Which component of an operating system is responsible for managing the files?
Option D
An OS has several key components, each responsible for managing a specific part of the computer:
Q: 9Which of the following does NOT characterize an executing process?
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: 10Binary file contains machine readable characters in ____ and ____ format.
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: 11A special software to create a job queue is called—
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: 12Who is known as “Father of Linux”?
Option B
Linus Torvalds is known as the “Father of Linux” because he created the Linux kernel in 1991.
Linux is not a full operating system by itself, it is the kernel, which is the core part of an operating system that manages hardware and system resources. Over time, Linux became the foundation of many operating systems such as Ubuntu, Fedora, and Android.
Q: 13Which of the following is not a component of NTFS volume layout?
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: 14Which of the following is NOT a condition for deadlock to be possible?
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: 15What is the purpose of swapping in an operating system?
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. |
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.