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 is not an operating system for mobile computing?
Option D
A mobile operating system (Mobile OS) is system software designed to control and manage the hardware and software resources of mobile devices such as smartphones, PDAs, and other handheld devices.
MANET generally stands for Mobile Ad hoc Network, which is a type of wireless network in which mobile devices communicate directly without fixed infrastructure.
Q: 10Which 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. |
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.