Operating Systems MCQs

Operating systems, the way the papers ask them — what an operating system is, the types, the kernel and the shell, processes and threads, CPU scheduling, memory management, file systems, deadlocks and security, with the Windows and Linux facts the one-paper exams repeat.

Facts checked 28 November 2026.180 practice MCQs on this topic

Operating Systems — Study Notes

What to learn in Operating Systems

This topic is operating systems the way the one-paper exams ask them: not theory for its own sake, but the facts that decide which option is right. There are 180 practice questions on this page: 148 from the bank and 37 new ones written to fill the gaps the bank leaves — most of them in memory management, scheduling, deadlocks and security, which the bank covers thinly. The order below is the order to learn in. Start with what an operating system is and what it does, because every later section is one of its jobs. Then the types, then how it is built — the kernel, the shell and booting — then processes and threads, then CPU scheduling, then memory management, then file systems, then deadlocks, then security, and finally Windows and Linux in practice. Past papers — PPSC, FPSC, NTS, BPSC, KPPSC, STS and ETEA — ask the same core facts again and again: which system is which, what the kernel does, which scheduling algorithm gives the shortest wait, what paging divides memory into, and which four conditions a deadlock needs. Learn each fact once, then practise it in the questions until the right option feels obvious. Two boundary rules for this page: physical memory and devices belong to the Hardware topic, so the two cache-memory questions in the bank were moved out there; and viruses and malware belong to the Computer Security & Viruses topic, so security here means what the operating system itself does — user accounts, permissions and authentication.

What an operating system is

An operating system is the program that manages the computer's hardware and lets other programs run. It is system software, not application software: MS Word, MS Excel and Photoshop are applications that run on it, while Windows, Linux, macOS and Android are operating systems. Its jobs are file management, task management, memory management and input/output management — it organises and stores files, runs programs, shares the processor and the memory between them, and talks to the hardware through device drivers. The first operating system used for real work was GM-NAA I/O, built by General Motors for the IBM 704 in 1956; it ran jobs one after another automatically, which was batch processing. Unix began at Bell Labs in 1969, written by Ken Thompson and Dennis Ritchie, and it shaped almost everything after it: Linux, which Linus Torvalds began in 1991, and macOS both descend from Unix ideas, and Android runs on the Linux kernel. Microsoft released Windows 1.0 in 1985, and Windows is still the operating system on most desktop computers in the world.

Operating systems and who makes them
  • Windows — Microsoft; the operating system on most desktop computers
  • macOS — Apple; runs on Apple Mac computers
  • Linux — open source; the kernel was created by Linus Torvalds in 1991
  • Android — Google; runs on most smartphones and tablets, and uses the Linux kernel
  • iOS — Apple; runs on iPhones
  • ChromeOS — Google; runs on Chromebooks
  • Unix — Bell Labs, 1969; the multi-user system that Linux and macOS descend from
Is it an operating system?
  • Operating systems: Windows, Linux, macOS, Android, iOS, Unix, ChromeOS, MS-DOS
  • Not operating systems: MS Word, MS Excel, MS Access, Photoshop, Google Chrome, Adobe Reader — these are applications
  • Oracle is a database system, not an operating system
What the operating system does
  • Manages hardware and software resources
  • Manages files and folders, and the memory
  • Runs application software and shares the CPU between programs
  • Boots the computer and loads itself into memory

Types of operating system

Operating systems are sorted by how many users and jobs they handle, and by how strictly they must answer on time. A batch operating system collects jobs together and runs them as a group without user interaction while they run — that is how GM-NAA I/O worked in 1956. A time-sharing system lets many users share one computer by giving each a short time slice in turn, which is why a time-sharing system can also be called a multitasking one. A real-time operating system guarantees that tasks finish within strict time limits: in a hard real-time system missing a deadline is a failure of the whole system, as in aircraft controls or a pacemaker, while in a soft real-time system a missed deadline only makes the service worse, as in video streaming. VxWorks is a real-time operating system. An embedded operating system has a small footprint, does one specific job, and has a very limited user interface. MS-DOS was a single-user, single-task operating system with a command-line interface. Four words that the papers love to mix up: multiprogramming keeps several programs in memory at the same time; multitasking lets several programs run at the same time by sharing the processor in rapid turns; multiprocessing uses two or more processors to run programs in parallel; multithreading lets one process run several threads at the same time.

By how jobs are handled
  • Batch — jobs run in groups, no user interaction while they run
  • Time-sharing — many users share one computer, each gets a short time slice
  • Multiprogramming — several programs kept in memory at the same time
  • Multitasking — several programs run at the same time, sharing the processor
  • Multiprocessing — two or more processors run programs in parallel
  • Multithreading — one process runs several threads at the same time
By timing and purpose
  • Real-time — tasks must finish within strict time limits; VxWorks is the textbook example
  • Hard real-time — a missed deadline is a system failure (aircraft controls, medical devices)
  • Soft real-time — a missed deadline only degrades the service (video streaming)
  • Embedded — small footprint, one specific job, very limited user interface
  • Distributed — many separate computers managed as one system
  • Network — manages resources and services over a network
  • Client — a desktop system such as Windows 10, as opposed to a server edition

How the operating system is built: kernel, shell and booting

The kernel is the core of the operating system: it runs in privileged mode, controls the hardware directly, and manages the CPU, the memory and the devices. Around it sits the shell, the program that gives the user a command-line interface — the user types commands, and the shell passes them to the kernel. A program never touches the hardware itself; it asks the kernel through a system call, such as a request to read a file or create a process. The hardware keeps the two apart with dual-mode operation: user programs run in user mode, and only a system call switches the processor into kernel mode. A device driver is the software that lets the operating system communicate with one particular piece of hardware, such as a printer or a graphics card. In a monolithic kernel, like Linux, all operating system services run in kernel space as one large program; in a microkernel only the basic services run in kernel space and the rest run as ordinary programs in user space. When the computer is switched on, the BIOS — firmware that runs first — checks the hardware and starts the boot process; UEFI is the modern replacement for BIOS. The bootstrap loader then loads the operating system into memory, which is why starting a computer is called booting. Without an operating system to load, a computer cannot boot at all. An interrupt is the signal that tells the processor to pause its current work temporarily to handle an event, such as a key press.

The parts and what each does
  • Kernel — the core; runs in privileged mode and controls hardware directly
  • Shell — the command-line interface between the user and the operating system
  • System call — how a program requests a service from the kernel
  • Device driver — lets the operating system communicate with one piece of hardware
  • Dual-mode operation — user mode for programs, kernel mode for the operating system
Starting the computer, in order
  • BIOS (or UEFI) runs first and checks the hardware
  • The bootstrap loader loads the operating system into memory
  • Booting is the whole process of starting the computer and loading the operating system
  • Rebooting is starting it again; without an operating system, it cannot boot

Processes and threads

A process is a program in execution — a program loaded into memory and running, with its own resources and state. A program sitting on the disk is not a process until it is loaded; loading is the process of bringing it from disk into memory. A thread is the smallest unit of execution inside a process: a single lightweight sequence of instructions that shares the process's memory, so one process can run several threads at the same time. A process can be in the running, ready or waiting state: ready means it is waiting for the CPU, running means it has the CPU, and waiting means it is waiting for something else, such as input or a file. The Process Control Block (PCB) stores everything the operating system needs to know about a process — its state, its program counter and its registers. Context switching is the operation of saving one process's state and loading another's, so the CPU can switch between them. Spooling holds jobs for a slow device, such as a printer, in a queue on disk, so the CPU can carry on with other work while the printer works through them. Two processes that share data need synchronisation, or the result depends on the order they run in — a race condition. The part of a program that touches the shared resource is its critical section, and only one process may be in it at a time. A semaphore synchronises processes and controls access to a shared resource; a mutex is a lock that allows only one thread to access a resource at a time. In Unix, the fork system call creates a new process. A zombie process has finished running but its entry stays in the process table until its parent reads its exit status; an orphan process is one whose parent has finished first, so the init process adopts it.

Process states
  • New — the process is being created
  • Ready — waiting for the CPU
  • Running — using the CPU
  • Waiting — waiting for input, a file or another event
  • Terminated — finished running
What the PCB stores
  • Process state (ready, running, waiting)
  • Program counter — where the process is in its code
  • CPU registers
  • Memory information
Synchronisation tools
  • Semaphore — synchronises processes and controls access to a shared resource
  • Mutex — a lock that allows only one thread at a time
  • Critical section — the code that accesses the shared resource
  • Race condition — the result depends on the order processes run in

CPU scheduling

CPU scheduling decides which ready process gets the processor next, and in which order. First-Come, First-Served (FCFS) serves processes strictly in the order they arrive, like a queue: no process can starve, because every process is eventually reached, but a long process at the front holds up every short process behind it — the convoy effect. Shortest Job First (SJF) runs the process with the shortest burst time first, and it gives the minimum average waiting time of the standard algorithms; its price is starvation, because a long job can wait indefinitely while shorter jobs keep arriving. Round Robin gives each process a fixed time slice, called a time quantum, in turn, cycling through them repeatedly, so every process gets a fair share and no process starves. Priority scheduling runs the process with the highest priority first, which can also starve a low-priority process. Three times to keep apart: waiting time is the time a job spends in the ready queue waiting for the CPU; turnaround time is the time from submission to completion; response time is the time from submission to the first response. Starvation is when a low-priority process waits indefinitely because higher-priority processes keep arriving; it is different from a deadlock, in which nobody can proceed at all. A multilevel feedback queue keeps several ready queues and moves a process between them according to how it behaves, so short interactive jobs stay near the top.

The algorithms
  • FCFS — in the order they arrive; no starvation, but the convoy effect
  • SJF — shortest burst time first; minimum average waiting time; can starve long jobs
  • Round Robin — a fixed time quantum each, in turn; fair, no starvation
  • Priority scheduling — highest priority first; low-priority jobs can starve
  • Multilevel feedback queue — several queues; a process moves down if it uses its whole quantum
The three times
  • Waiting time — time spent in the ready queue waiting for the CPU
  • Turnaround time — submission to completion
  • Response time — submission to the first response
What goes wrong
  • Starvation — a low-priority process waits indefinitely
  • Convoy effect — short processes stuck behind one long process in FCFS
  • Preemptive scheduling lets the operating system take the CPU away; FCFS is non-preemptive

Memory management

Memory management decides where programs live in RAM and what happens when RAM runs out. Paging divides memory into fixed-size blocks called pages, and the disk into same-size blocks called frames; a page table maps each page to a frame. Segmentation divides a program into variable-size segments based on its logical parts, such as code, data and stack. Virtual memory lets a computer run programs larger than its physical RAM by using disk space as an extension of RAM: the area on disk that holds pages not currently in RAM is the swap space. When a program tries to access a page that is not currently in main memory, a page fault occurs and the page must be loaded from disk. Demand paging loads a page only when it is actually needed. When memory is full, a page replacement algorithm chooses which page to throw out: FIFO throws out the page loaded longest ago, LRU throws out the page not used for the longest time, and Optimal throws out the page that will not be used for the longest time in the future — Optimal gives the fewest faults but cannot be used in practice, because the future cannot be known. FIFO can show Belady's anomaly, where giving a process more frames actually increases the number of page faults; LRU and Optimal never do. Thrashing is what happens when the system spends most of its time swapping pages in and out instead of doing useful work, because memory is overcommitted; the cure is to give each process its working set — the pages it is actively using — or to run fewer processes. Internal fragmentation is wasted space inside an allocated block, when the block is larger than the process that uses it; external fragmentation is free memory split into many small gaps that are each too small to use.

Paging and segmentation
  • Paging — fixed-size pages in memory, same-size frames on disk; a page table maps them
  • Segmentation — variable-size segments for the logical parts: code, data, stack
  • Page fault — the page needed is not in main memory; it must be loaded from disk
  • Demand paging — a page is loaded only when it is needed
Page replacement
  • FIFO — throw out the page loaded longest ago; can show Belady's anomaly
  • LRU — throw out the page not used for the longest time
  • Optimal — throw out the page not used for the longest time in the future; fewest faults, but needs the future
  • Clock (second chance) — goes round the frames like a clock hand, giving a page with its reference bit set a second chance
What goes wrong
  • Thrashing — most of the time spent swapping pages instead of doing useful work
  • Working set — the pages a process is actively using; keep it in memory to stop thrashing
  • Internal fragmentation — wasted space inside an allocated block
  • External fragmentation — free memory split into small unusable gaps
  • Swap space — the disk area used as an extension of RAM

File systems

A file is a named collection of data stored on a disk, and a file system is the method the operating system uses to organise files on a disk — it keeps track of where each file is stored, and a file manager is the program that lets the user find, open, copy, move and delete them. A directory, or folder, is a container that holds files and other folders; the topmost directory on a disk is the root directory. A file extension is the part of a file name that shows the file type: .txt is a plain text file, .jpg is a picture, .mp4 is a video, and .exe is an executable program in Windows. NTFS is the default file system of modern Windows, and it is also the file system Windows 7 uses; the File Allocation Table (FAT) is the table in the FAT file system that records where each part of a file is stored. APFS is the default file system on macOS, and ext4 is the file system most Linux systems use. In Linux, an inode stores a file's metadata — its size, owner and permissions and the addresses of its blocks — while the name lives in the directory. Files are laid out on disk in one of three ways: contiguous allocation stores a file in consecutive blocks, which is fast to read but hard to fit as the disk fragments; linked allocation chains blocks together; indexed allocation keeps an index block holding the addresses of all the blocks of a file, so any block can be reached directly. Files are usually read by sequential access, one record after another in order; direct access jumps straight to any record.

The file systems
  • NTFS — the default file system of modern Windows
  • FAT — the File Allocation Table records where each part of a file is stored
  • exFAT — for USB flash drives; supports files larger than 4 GB, unlike FAT32
  • APFS — the default file system on macOS
  • ext4 — the file system most Linux systems use
Allocation methods
  • Contiguous — the file is stored in consecutive blocks; fast to read, hard to fit later
  • Linked — blocks are chained together
  • Indexed — an index block holds the addresses of all the blocks; any block can be reached directly
Files and folders
  • A file is a collection of data stored on a disk
  • A folder keeps related files together
  • The root directory is the topmost directory on the disk
  • A file extension shows the file type: .txt text, .exe program, .jpg picture

Deadlocks

A deadlock is a state in which two or more processes wait forever for resources held by each other, so none of them can proceed. It is not a crash and not a slowdown: a program that stops working is a hung program, and a process that waits indefinitely while others proceed is starving, not deadlocked. A deadlock can only happen when all four of the Coffman conditions hold at the same time — they were set out by Coffman and his co-authors in 1971. Mutual exclusion means a resource can be held by only one process at a time. Hold and wait means a process holds one resource while waiting for another. No preemption means a resource cannot be taken away by force; only its holder releases it. Circular wait means there is a cycle: process one waits for process two, which waits for process one. Break any one of the four and a deadlock becomes impossible, which is exactly what deadlock prevention does: make processes ask for all their resources at once to break hold and wait, or number every resource and always take them in increasing order to break circular wait — lock ordering is the prevention used most in real code. Deadlock avoidance lets all four conditions exist but refuses any grant that could lead to a deadlock: Dijkstra's Banker's algorithm grants a request only if the system stays in a safe state, meaning there is some order in which every process can get what it still needs and finish. Note carefully: the Banker's algorithm is avoidance, not detection. Detection draws a resource allocation graph — processes as circles, resources as squares — and looks for a cycle. Recovery then kills one of the deadlocked processes or preempts a resource from one and gives it to another. Checkpoints, which save the state of the system so work can be restored, are used for recovery.

The four Coffman conditions (all four must hold)
  • Mutual exclusion — a resource can be held by only one process at a time
  • Hold and wait — a process holds one resource while waiting for another
  • No preemption — a resource cannot be taken away; only its holder releases it
  • Circular wait — the waiting forms a cycle
The four ways to handle deadlock
  • Prevention — make sure one Coffman condition can never hold
  • Avoidance — the Banker's algorithm grants a request only if the state stays safe
  • Detection — a cycle in the resource allocation graph means a deadlock
  • Recovery — kill a deadlocked process, or preempt a resource from one
Do not confuse them
  • Deadlock — processes wait for each other forever; nobody proceeds
  • Starvation — one process waits indefinitely while others proceed normally
  • Thrashing — the system spends its time swapping pages, not deadlocked
  • Banker's algorithm — avoidance, not detection

Security in the operating system

The operating system is the first line of defence for the computer, and it protects it in three ways: it checks who you are, it controls what you may do, and it keeps users apart from each other. Authentication is the check that a user is who they claim to be, usually with a username and password; authorisation is the separate step that decides what that user is allowed to do once they are in. Every user has an account: the administrator account has full control over the computer — it can change system settings, install software and manage other accounts — while a standard account can only use the programs already installed. File permissions control who can read, write or execute a file: on Linux and Unix every file carries read, write and execute permissions for its owner, its group and everyone else, and the chmod command changes them. Checkpoints save the state of the system so that work can be restored after a failure, which is recovery, not security — but it is the operating system's way of making sure a crash does not lose everything. Viruses, malware, firewalls and passwords as a subject belong to the Computer Security & Viruses topic; here, security means the controls the operating system itself provides.

Who are you, and what may you do?
  • Authentication — checking a user is who they claim to be (username and password)
  • Authorisation — deciding what an authenticated user is allowed to do
  • Administrator account — full control: settings, software, other accounts
  • Standard account — can only use what is already installed
Files
  • File permissions — who can read, write or execute a file
  • Linux permissions — read, write and execute, for owner, group and everyone else
  • chmod — the Linux command that changes file permissions

Windows and Linux in practice

Most of the Windows questions in the papers are about the tools you can see on the screen. File Explorer is the program used to manage files and folders in Windows, and the Taskbar gives access to the Start menu, pinned programs and the system tray with the volume controls. The Task Manager, opened with Ctrl + Shift + Esc, is used to view and manage running programs and processes and to close one that has stopped responding. The Control Panel is used to change system settings, such as display, sound, network and user accounts. The Windows Registry is the database that stores configuration settings for Windows and the programs installed on it; in early Windows those settings were recorded in WIN.INI. Disk Cleanup is the pre-installed program used for disk cleanup, and Notepad is the default text editor of Windows. Deleted files are first moved to the Recycle Bin, which Windows sets to about a tenth of the size of the hard disk; the wallpaper is the picture on the desktop background. Windows 10 needs a minimum of 32 GB of storage to install. On Linux, the commands to know are the short ones: ls lists files in a directory, cd changes the current directory, pwd shows the directory you are in, mkdir creates a new directory, cp copies a file, rm removes a file, and chmod changes a file's permissions. Ubuntu is a Linux distribution. In DOS, a file name could have at most 8 characters, the 8.3 format. The Run dialog opens programs by their executable name: powerpnt.exe opens PowerPoint. Useful Windows shortcuts the papers ask about: F2 renames a file or folder, Shift + Delete deletes a file permanently instead of sending it to the Recycle Bin, Win + Home minimises all windows except the active one, and Win + F or F3 searches for a file or folder.

Linux commands
  • ls — list files in a directory
  • cd — change the current directory
  • pwd — show the directory you are in
  • mkdir — create a new directory
  • cp — copy a file
  • rm — remove a file
  • chmod — change a file's permissions
Windows tools
  • File Explorer — manage files and folders
  • Task Manager — view and manage running programs (Ctrl + Shift + Esc)
  • Control Panel — change system settings
  • Windows Registry — the database of settings for Windows and its programs
  • Disk Cleanup — clean the disk; Notepad — the default text editor
  • Recycle Bin — deleted files go here first, about a tenth of the disk
Windows shortcuts
  • F2 — rename a file or folder
  • Shift + Delete — delete permanently, skipping the Recycle Bin
  • Win + Home — minimise all windows except the active one
  • Win + F or F3 — search for a file or folder
  • Ctrl + Shift + Esc — open the Task Manager

More facts to learn

  1. A few traps the papers set again and again
  2. First, starvation: both FCFS and Round Robin are free of starvation, because every process is eventually reached — so a question that asks which algorithm is least prone to starvation and offers both FCFS and Round Robin has no single right answer, and one such paper question has been held back from this page for exactly that reason; the kept question keys Round Robin against SJF, which can starve a long job
  3. Second, the Banker's algorithm: it is deadlock avoidance, not detection, so a question that asks for a detection algorithm and offers the Banker's algorithm has 'None of these' as its answer — one bank question was keyed the other way and has been corrected on this page
  4. Third, SJF gives the minimum average waiting time, but it is also the algorithm most prone to starvation; those two facts are the two sides of the same coin, and the papers ask both
  5. Fourth, the file systems: NTFS is Windows, APFS is macOS, ext4 is Linux, and FAT is the table, not the disk
  6. Fifth, the interfaces: a GUI uses windows, icons and menus and a pointer; a CLI needs typed text commands — and MS-DOS was a command-line, single-user, single-task system
  7. Sixth, booting: the BIOS or UEFI checks the hardware, the bootstrap loader loads the operating system, and the whole process is booting; restarting isrebooting
  8. Seventh, the words that sound alike: a process is a program in execution, a thread is the smallest unit inside a process, a program on the disk is neither yet
  9. Eighth, virtual memory is not extra RAM fitted to the machine: it is disk space used as if it were RAM, and the price is page faults and, when memory is overcommitted, thrashing
  10. Ninth, a semaphore and a mutex are not the same thing: a mutex is a lock held by one thread, while a semaphore is a counter that controls access to a shared resource
  11. Tenth, cache memory is not on this page at all: it is physical memory, so it belongs to the Hardware topic, which already carries the question about which cache level is fastest and smallest

Keep Learning — Operating Systems