Operating System Structures MCQs for NSCT

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

Operating system structures cover two things: how programs ask the OS for services (system calls), and how the kernel itself is organised (monolithic, layered, microkernel, modular or hybrid). This is topic 2 of the Operating Systems area, which carries 5% of the NSCT according to HEC's Areas of Competencies. OS had the lowest 2026 accuracy of any area, 33.8%, per the HEC NSCT report and APP.

Definitions follow Silberschatz, Operating System Concepts. If kernel mode and traps are new to you, start with Introduction to Operating Systems.

System calls

A system call is the programming interface to the services the kernel provides. It traps from user mode into kernel mode, the kernel does the work, and control returns. Programmers usually call an API (POSIX, the Windows API or the Java API) instead. The API is portable and easier, and the run-time library (the system-call interface) makes the real calls. For example, printf() is a library function that buffers text and then calls write().

Silberschatz groups system calls into six categories:

Category UNIX examples Windows examples
Process control fork(), exit(), wait() CreateProcess(), ExitProcess(), WaitForSingleObject()
File management open(), read(), write(), close() CreateFile(), ReadFile(), WriteFile(), CloseHandle()
Device management ioctl(), read(), write() SetConsoleMode(), ReadConsole()
Information maintenance getpid(), alarm(), sleep() GetCurrentProcessID(), SetTimer(), Sleep()
Communications pipe(), shm_open(), mmap() CreatePipe(), CreateFileMapping(), MapViewOfFile()
Protection chmod(), umask(), chown() SetFileSecurity(), SetSecurityDescriptorGroup()

Parameters reach the kernel in three ways: in registers, in a block in memory whose address goes in a register, or on the stack. Linux uses registers for five or fewer parameters and the block method for more.

Communication calls support two models. Message passing copies data through the kernel and suits small amounts. Shared memory needs system calls only for setup and is faster for bulk data, but the processes must synchronise themselves.

Exam angle: when counting calls in a copy loop, include the final read() that returns 0 at end of file; it has no matching write().

Monolithic

In a monolithic kernel, everything between the system-call interface and the hardware runs as one program in kernel mode: file system, CPU scheduling, memory management and drivers. Traditional UNIX is the classic example, and Linux is monolithic too.

Its strength is speed, because services call each other directly. Its weakness is safety: a bad pointer in one driver can crash the whole system.

Linux is monolithic but modular. Loadable kernel modules (LKMs) add drivers and file systems at run time without a reboot. Modules still run in kernel space, so modular does not mean microkernel.

Exam angle: "supports modules" never makes a kernel a microkernel. Ask where the services run.

Microkernel

A microkernel removes every non-essential component from the kernel and runs it as a user-level process. The kernel keeps only minimal process and memory management plus a message-passing facility. Mach (Carnegie Mellon, mid-1980s) and QNX are the standard examples.

Monolithic Microkernel
Services run in Kernel space User space (separate servers)
Communication Direct function calls Messages through the kernel
Performance Faster Slower (message overhead)
Fault isolation A driver bug can crash all A crashed server can be restarted
Examples Traditional UNIX, Linux Mach, QNX

Benefits: easier extension, easier porting, and more security and reliability. The cost is performance. Windows NT 1.0 had a layered microkernel design and ran slowly, so NT 4.0 moved layers back into kernel space. Most real systems are hybrids. macOS and iOS use Darwin, which combines the Mach microkernel with the BSD UNIX kernel, and Windows is largely monolithic with some microkernel features.

Exam angle: if a question adds two messages per request, the microkernel's extra cost scales with the number of requests.

Layered

The layered approach splits the OS into levels: layer 0 is the hardware and layer N is the user interface. Each layer uses only the services of the layers below it. In a six-layer system, layer 3 may call layers 2, 1 and 0, never 4 or 5.

Layering makes construction and debugging simple, one layer at a time. It has two problems. Defining the layers is hard (Silberschatz's backing-store driver and CPU scheduler each seem to need the other), and every request passes through several layers, which costs performance.

Exam angle: a question describing a circular dependency between components is testing the "hard to define layers" weakness, not the performance one.

Common traps

Worked examples

Understanding. A program calls alarm() to be signalled after 5 seconds. Which system-call category is this? Answer: information maintenance. Silberschatz lists alarm() and sleep() (Windows SetTimer() and Sleep()) with time and process-attribute calls in this category.

Application. A copy loop reads an 8,192-byte file with a 4,096-byte buffer until read() returns 0. How many read() and write() calls does it make? Answer: 3 reads and 2 writes. Two reads return 4,096 bytes each and both are written. A third read returns 0 at end of file and ends the loop.

Analysis. A client reads a file. In a monolithic kernel, how many traps into the kernel does this need, compared with a microkernel whose file system is a user-level server? Answer: 1 versus at least 2. Monolithic: one system call, and the kernel does the work. Microkernel: the client traps to send a request, the kernel delivers it to the file server, and the server traps again to send the reply. Those extra crossings and copies are the microkernel's performance cost.

Practise

The quiz below has 100 Operating System Structures questions, which you can filter by tier and difficulty.

Practise: 100 questions

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

  1. What is a system call?

    1. The programming interface through which a program requests a service from the operating system kernel
    2. A function call from one user program to another
    3. A hardware signal sent by a device when it finishes I/O
    4. A command typed into the shell by the user
    Show answer

    Answer: A. The programming interface through which a program requests a service from the operating system kernel

    System calls provide an interface to the services made available by the OS. A program makes one when it needs the kernel to do something it cannot do in user mode, such as open a file, create a process or send data over a network.

  2. In Silberschatz's six categories of system calls, which category does fork() belong to?

    1. Process control
    2. File management
    3. Device management
    4. Information maintenance
    Show answer

    Answer: A. Process control

    fork() creates a new process, so it is a process-control call, alongside exit(), wait() and exec(). The six categories are process control, file management, device management, information maintenance, communications and protection.

  3. Which category of system call does open() belong to?

    1. File management
    2. Process control
    3. Communications
    4. Protection
    Show answer

    Answer: A. File management

    open(), read(), write() and close() create, use and release files, so they are file-management (file manipulation) calls. In the Windows API the equivalents are CreateFile(), ReadFile(), WriteFile() and CloseHandle().

  4. getpid() returns the caller's process ID. Which system-call category is it in?

    1. Process control
    2. Information maintenance
    3. Device management
    4. Communications
    Show answer

    Answer: B. Information maintenance

    Information-maintenance calls transfer information between the program and the OS, such as the time, date or process attributes. getpid() (GetCurrentProcessID() in Windows) is Silberschatz's example of this category.

  5. Which Windows API function corresponds to the UNIX fork() call in Silberschatz's comparison table?

    1. CreateThread()
    2. WaitForSingleObject()
    3. CreateProcess()
    4. CreateFile()
    Show answer

    Answer: C. CreateProcess()

    Silberschatz pairs Windows CreateProcess() with UNIX fork() under process control. Note that CreateProcess() also loads a new program in one step, which in UNIX takes fork() followed by exec().

  6. Which of these operating systems is built on a microkernel design?

    1. MS-DOS
    2. Traditional UNIX
    3. QNX
    4. Linux
    Show answer

    Answer: C. QNX

    QNX is a real-time OS built on a microkernel that provides only messaging, scheduling and low-level services; most other services run as user processes. Traditional UNIX and Linux are monolithic, and MS-DOS had a simple unstructured design.

  7. What is a monolithic kernel?

    1. A kernel that runs only one user program at a time
    2. A kernel in which most OS services run together in one address space in kernel mode
    3. A kernel that keeps only message passing in kernel mode
    4. A kernel split into strictly ordered layers
    Show answer

    Answer: B. A kernel in which most OS services run together in one address space in kernel mode

    In a monolithic structure, everything below the system-call interface and above the hardware, such as the file system, CPU scheduling and memory management, is one large program running in kernel mode. Traditional UNIX and Linux are examples.

  8. In the layered approach to OS design, what are the bottom layer (layer 0) and the top layer (layer N)?

    1. Layer 0 is the user interface; layer N is the hardware
    2. Layer 0 is the hardware; layer N is the user interface
    3. Layer 0 is the file system; layer N is the CPU scheduler
    4. Layer 0 is the shell; layer N is the device drivers
    Show answer

    Answer: B. Layer 0 is the hardware; layer N is the user interface

    Silberschatz describes the OS as divided into layers built on top of each other: layer 0 is the hardware and the highest layer, layer N, is the user interface. Each layer uses only the services of the layers below it.

  9. What are the two common models of interprocess communication supported by system calls?

    1. Polling and interrupts
    2. Paging and segmentation
    3. Batch and time sharing
    4. Message passing and shared memory
    Show answer

    Answer: D. Message passing and shared memory

    In message passing, processes exchange messages through the kernel. In shared memory, processes map a common region of memory and read and write it directly. Both are covered under communication system calls.

  10. What is the shell in an operating system such as Linux?

    1. The part of the kernel that schedules the CPU
    2. A hardware component that protects memory
    3. The firmware that loads the kernel at power-on
    4. A command interpreter that reads user commands and carries them out
    Show answer

    Answer: D. A command interpreter that reads user commands and carries them out

    The command interpreter, called a shell on UNIX and Linux (for example bash or zsh), gets the next command from the user and executes it, either with built-in code or by running a separate program. It runs as a user program, not inside the kernel.

FAQs

What is the difference between a system call and an API?

An API is a set of library functions, such as POSIX read() or the Windows ReadFile(), that programmers call. A system call is the actual trap into the kernel. API functions usually invoke one or more system calls for you. Programming to the API keeps code portable across systems with different system-call numbers.

Is Linux monolithic or a microkernel?

Linux is monolithic. Its file systems, scheduler, memory manager and drivers all run in kernel space in one address space. It is also modular, because loadable kernel modules can be added at run time. Silberschatz describes Linux as monolithic yet modular, which gives flexibility without microkernel message overhead.

Why are microkernels slower?

Services such as the file system run as separate user processes, so a request becomes messages: from the client to the kernel, to the server, and back. Each message involves copying data and switching between processes and modes. A monolithic kernel handles the same request with direct function calls inside the kernel.

What is a hybrid kernel?

A hybrid kernel mixes structures to balance speed and modularity. Darwin, the kernel of macOS and iOS, combines the Mach microkernel with the BSD UNIX kernel. Windows is largely monolithic but keeps some microkernel features, such as separate subsystems. Most commercial systems today are hybrids.

Next step

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