Introduction to Operating Systems MCQs for NSCT

By the NSCT Exam Editorial Team · Updated 2026-11-24 · Facts checked against official sources on 2026-11-24

An operating system (OS) is the program that sits between users and the hardware: it allocates the CPU, memory, storage and devices, and it stops programs from harming each other. This is topic 1 of the Operating Systems area, which carries 5% of the NSCT according to HEC's Areas of Competencies. Small weightage, but in 2026 OS had the lowest accuracy of any area, 33.8%, per the HEC NSCT report and APP.

Definitions follow Silberschatz, Operating System Concepts. Later topics, from processes to deadlocks, build on these terms.

OS functions

From the user's side the OS makes the computer convenient to use. From the system's side it is a resource allocator (sharing CPU time, memory and I/O fairly) and a control program (preventing errors and misuse). The kernel is "the one program running at all times"; shells, compilers and apps run on top of it.

Function What the OS does
Process management Creates, schedules, suspends and ends processes
Memory management Tracks which memory is in use and by whom; moves processes in and out
File-system and storage management Files, directories, free space, disk scheduling
I/O management Device drivers, buffering, caching, DMA
Protection and security Controls access to resources; defends against attacks

A program is a passive file on disk; a process is a program in execution. Three students running one compiler binary give 1 program and 3 processes.

The OS is interrupt driven. A device raises an interrupt, and the CPU looks up the handler in the interrupt vector, a table of handler addresses. A trap (exception) is a software-generated interrupt, caused by an error such as division by zero or by a system call. With DMA (direct memory access), a controller moves a whole block to memory and raises one interrupt per block instead of one per byte.

Exam angle: questions often ask which OS function a duty belongs to. "Deciding which processes to move into and out of memory" is memory management, not process management.

Types

Type Key idea Example
Batch Jobs grouped and run with no interaction Overnight payroll
Multiprogramming Several jobs in memory so the CPU always has one to run Any modern OS
Time-sharing (multitasking) Switches so fast that users interact; response time typically under a second Linux server with many users
Multiprocessor (SMP) Several CPUs share memory; each runs OS and user code Multicore laptops
Clustered Separate computers share storage; one takes over if another fails High-availability servers
Hard real-time Missing a deadline is a failure Pacemaker, anti-lock brakes
Soft real-time Critical tasks get priority; occasional misses tolerated Video calls, streaming

Multiprogramming raises CPU utilisation. A simple model from Tanenbaum gives utilisation = 1 − pⁿ, where p is the fraction of time a process waits for I/O. With p = 0.8 and n = 3, utilisation = 1 − 0.512 = 48.8%.

For multiprocessors, Amdahl's law limits speedup: speedup = 1 / (S + (1 − S)/N). A program that is 25% serial (S = 0.25) on 4 cores speeds up only about 2.29 times. Multiprocessors also give graceful degradation: service continues in proportion to the surviving hardware.

Exam angle: hard versus soft real-time is about the cost of a missed deadline, not about speed.

Kernel vs user mode

To protect the system, the hardware has a mode bit: 0 for kernel mode and 1 for user mode (Silberschatz's convention). Privileged instructions, such as I/O control, timer management and turning off interrupts, run only in kernel mode. If user code attempts one, the hardware traps to the OS, which usually ends the program.

User mode Kernel mode
Mode bit 1 0
Privileged instructions Trap to the OS Allowed
Who runs here Applications, shells, libraries The kernel
How you enter Return from a trap or interrupt System call, interrupt or exception

A timer ensures the OS gets the CPU back even if a program loops forever; setting it is privileged. MS-DOS on the Intel 8088 had no mode bit, so one buggy program could overwrite the OS.

Exam angle: kernel mode is a CPU state, not a user account. A root (administrator) program still runs in user mode and must make a system call. The Operating System Structures topic covers system calls in depth.

Common traps

Worked examples

Understanding. Which instruction must be privileged: reading the clock, issuing a system-call trap, or disabling interrupts? Answer: disabling interrupts. A program that disables interrupts could stop the OS ever regaining control. Reading the clock is harmless, and the trap is how user programs request services, so it must work in user mode.

Application. Each process waits for I/O 90% of the time. Using utilisation = 1 − pⁿ, how many processes give at least 50% utilisation? Answer: 7. 0.9⁶ = 0.531, giving 46.9%, which is too low. 0.9⁷ = 0.478, giving 52.2%.

Analysis. A program is 10% serial. A student expects 8 cores to make it 8 times faster. What does Amdahl's law predict? Answer: about 4.71 times. Speedup = 1 / (0.1 + 0.9/8) = 1 / 0.2125, about 4.71. The serial 10% never runs faster, so adding cores gives shrinking returns.

Practise

The quiz below has 98 Introduction to Operating Systems questions, which you can filter by tier and difficulty.

Practise: 98 questions

Interactive quiz loading. The first 10 questions are shown below.

  1. Silberschatz describes one program as 'the one program running at all times on the computer'. Which program is this?

    1. The shell (command interpreter)
    2. The bootstrap program
    3. The compiler
    4. The kernel
    Show answer

    Answer: D. The kernel

    The kernel is the core of the operating system that stays in memory and runs for the whole time the computer is on. Everything else, such as system programs and applications, runs on top of it and can start and stop.

  2. In the dual-mode operation described by Silberschatz, what values does the hardware mode bit take?

    1. 1 for kernel mode and 0 for user mode
    2. 0 for kernel mode and 1 for user mode
    3. 0 for user mode and 1 for interrupt mode
    4. It is 1 only while the system is booting
    Show answer

    Answer: B. 0 for kernel mode and 1 for user mode

    Silberschatz uses a mode bit of 0 for kernel (supervisor, privileged) mode and 1 for user mode. The hardware sets it to 0 on a trap or interrupt and the OS sets it back to 1 before returning control to a user program.

  3. When a computer is powered on, which program initialises the hardware and loads the operating system kernel into memory?

    1. The bootstrap program
    2. The dispatcher
    3. A device driver
    4. The shell
    Show answer

    Answer: A. The bootstrap program

    The bootstrap program is stored in firmware (ROM or EEPROM). At power-on it initialises CPU registers, device controllers and memory, then locates the kernel and loads it into memory so the OS can start.

  4. Which of these instructions should be privileged, so that it can run only in kernel mode?

    1. Read the clock
    2. Issue a trap (system call) instruction
    3. Add two registers
    4. Turn off interrupts
    Show answer

    Answer: D. Turn off interrupts

    Turning off interrupts would let a program stop the OS from ever regaining control, so it must be privileged. Reading the clock and adding registers are harmless, and the trap instruction must be usable in user mode because it is how programs request OS services.

  5. What is the main goal of multiprogramming?

    1. Let many users interact with their programs through terminals at once
    2. Guarantee that each task finishes before a fixed deadline
    3. Increase CPU utilisation by keeping several jobs in memory so the CPU always has one to run
    4. Run a single program across several processors
    Show answer

    Answer: C. Increase CPU utilisation by keeping several jobs in memory so the CPU always has one to run

    In multiprogramming the OS keeps several jobs in memory. When the running job waits for I/O, the CPU switches to another job instead of sitting idle, which raises CPU utilisation. Interactive use is the goal of time sharing, which builds on this idea.

  6. What defines a hard real-time system?

    1. Critical tasks get priority, but an occasional missed deadline is acceptable
    2. Jobs are collected and run in batches with no user interaction
    3. Many users share the CPU through short time slices
    4. Critical tasks must finish within their deadlines; a missed deadline counts as system failure
    Show answer

    Answer: D. Critical tasks must finish within their deadlines; a missed deadline counts as system failure

    A hard real-time system has strict timing constraints: a result delivered after its deadline is as bad as a wrong result. A soft real-time system only gives critical tasks priority over others and tolerates occasional misses.

  7. Which of these storage devices is volatile, losing its contents when power is removed?

    1. Hard disk drive
    2. Main memory (DRAM)
    3. Solid-state drive (flash NVM)
    4. Magnetic tape
    Show answer

    Answer: B. Main memory (DRAM)

    Main memory is built from DRAM, which needs power to hold data, so it is volatile. Hard disks, flash-based SSDs and tape are non-volatile secondary or tertiary storage that keep data without power.

  8. What is the interrupt vector?

    1. A queue of processes waiting for an I/O device
    2. A register that holds the current mode bit
    3. A table of addresses of interrupt service routines, indexed by interrupt number
    4. The list of open files kept in each process's PCB
    Show answer

    Answer: C. A table of addresses of interrupt service routines, indexed by interrupt number

    The interrupt vector is an array of pointers to the interrupt service routines. When an interrupt arrives, its number is used as an index into this table, so the CPU jumps straight to the right handler without searching.

  9. A user program divides an integer by zero. What kind of event does this raise?

    1. A hardware interrupt from a device controller
    2. A context switch requested by the timer
    3. A DMA completion interrupt
    4. A trap (exception), a software-generated interrupt
    Show answer

    Answer: D. A trap (exception), a software-generated interrupt

    Silberschatz defines a trap or exception as a software-generated interrupt caused by an error (such as division by zero or an invalid memory access) or by a request for an OS service. The CPU switches to kernel mode and runs the OS handler.

  10. From the computer's point of view, how does Silberschatz describe the operating system?

    1. As a compiler that turns user programs into machine code
    2. As a database that stores the user's files
    3. As an application the user starts only when needed
    4. As a resource allocator that manages CPU time, memory, storage and I/O devices
    Show answer

    Answer: D. As a resource allocator that manages CPU time, memory, storage and I/O devices

    From the system view the OS is a resource allocator: it decides how to share CPU time, memory, storage and I/O among competing programs fairly and efficiently. It is also a control program that prevents errors and misuse.

FAQs

What is the difference between an operating system and a kernel?

The kernel is the core of the OS that runs at all times in kernel mode and manages the CPU, memory and devices. The full operating system also includes system programs, libraries and user interfaces such as the shell or GUI.

Is multiprogramming the same as multiprocessing?

No. Multiprogramming keeps several jobs in memory so one CPU always has work while others wait for I/O. Multiprocessing means the computer has two or more CPUs (or cores) that can run processes at the same time. A single-core machine can multiprogram but cannot multiprocess.

Why does the OS need a timer?

Without a timer, a user program in an infinite loop, or one that never makes a system call, could keep the CPU forever. The OS loads the timer before giving the CPU to a program, and the timer interrupt returns control to the OS. Loading the timer is a privileged instruction.

What is the difference between an interrupt and a trap?

An interrupt is raised by hardware, such as a device finishing I/O or the timer expiring. A trap, or exception, is generated by software: an error like division by zero or an invalid memory access, or a deliberate system call. Both switch the CPU to kernel mode and run an OS handler.

Next step

Continue with Operating System Structures MCQs, go back to the Operating Systems hub, or try a timed NSCT mock test.