Practise Operating Systems one question at a time. Answer out loud or in writing, get graded, and see exactly what you missed.
What does an operating system actually do for a running program?
An operating system sits between your program and the hardware and shares the CPU, memory and devices among every running program. Your code never talks to the disk or network directly. It asks the OS through system calls, and the OS grants access.
The OS has three main jobs. It schedules CPU time, so many programs take turns on limited cores. It gives each program its own view of memory, so a bug in one program cannot overwrite another program's memory. It also manages files, devices and the network behind uniform interfaces.
This design lets your program act as if it has the machine to itself, while dozens of programs share it. Without the OS enforcing those boundaries, a single careless loop could freeze everything or read another program's secrets.
Missed:
“A process is basically a program that's actually running, and each one gets its own memory space, so if I open the same program twice they're two separate processes that can't see each other's memory. The OS keeps a process control block for each one, which holds things like the process ID, its current state like running or waiting, the program counter and registers, its open files, and its priority for scheduling.”
Knew itThey've got the core definition and the main PCB fields - PID, state, program counter, registers, files, priority. Missing parent process and memory layout, and didn't mention that saving/restoring registers is what makes context switching possible.
Missed: Didn't mention the OS tracks the parent process
Missed: Didn't mention memory layout as something tracked separately in the PCB
Missed: Left out why this bookkeeping matters: it's what lets the OS pause a process and resume it later from where it stopped
Get your own answers graded
Sign up free. Your account comes with 50 credits for grading, and it remembers what you missed.
What it covers
- Kernel, system calls and privilege
- Processes and threads
- Process lifecycle, fork and exec
- CPU scheduling and context switches
- Signals, IPC and debugging
- Memory layout, stack and heap
- Virtual memory and address translation
- Page faults and memory pressure
- File descriptors and I/O models
- Page cache, mmap and zero-copy
All 56 questions
Kernel, system calls and privilege
What the OS does for a program, user and kernel mode, how system calls, interrupts and traps cross into the kernel, and how kernels are structured.
- What does an operating system actually do for a running program?
- What is a system call, and how does it differ from a normal function call?
- What are user mode and kernel mode, and why do we need both?
- What hardware mechanism lets a system call cross into kernel mode? Pro
- What is the difference between a monolithic kernel and a microkernel? Pro
- What is the difference between an interrupt and a trap? Pro
Processes and threads
What a process is, how threads differ from processes, why threads are cheaper, when to choose each, and user-level versus kernel-level threads.
- What is a process, and what does the OS track about it?
- What is the difference between a process and a thread?
- Why is creating a thread cheaper than creating a whole new process? Pro
- When should you use multiple processes instead of multiple threads? Pro
- What is the difference between user-level threads and kernel-level threads? Pro
Process lifecycle, fork and exec
How a program starts with fork and exec, why fork uses copy-on-write and can still be slow, and how zombie and orphan processes arise.
- What actually happens, step by step, when you run a program? Pro
- Why does fork use copy-on-write instead of copying all the memory? Pro
- Why do you call fork and exec separately instead of in one step? Pro
- What are zombie and orphan processes, and how do they come about? Pro
- Why does fork get slow for a process using lots of memory? Pro
CPU scheduling and context switches
How the OS picks who runs next, classic and modern scheduling policies, what context switches cost in caches, and how NUMA changes the cost of memory access.
- What is a context switch, and why is it considered expensive? Pro
- What is CPU scheduling, and why must the OS decide who runs next? Pro
- How does a preemptive scheduler differ from a cooperative one? Pro
- How do FCFS, shortest job first, and round robin scheduling compare? Pro
- Why can frequent context switches quietly wreck CPU cache performance? Pro
- How does NUMA change the cost of reaching memory across sockets? Pro
- How does a scheduler stay fair and fast with thousands of runnable threads? Pro
Signals, IPC and debugging
How processes receive signals and what is safe in a handler, the main ways processes communicate, and how a debugger stops and inspects a process.
Memory layout, stack and heap
The regions of a process's address space, how the stack and heap differ and grow, how malloc gets memory, and how guard pages catch stack overflow.
- What is the difference between the stack and the heap in memory?
- How does malloc get memory from the OS, and does free return it? Pro
- Why does the stack have a fixed limit while the heap can grow? Pro
- What are the main regions of a process's memory layout, and what lives where? Pro
- How do guard pages catch a stack that grows past its limit? Pro
Virtual memory and address translation
Why each process gets its own address space, how the MMU, page tables and TLB translate addresses, and the costs of huge pages and TLB shootdowns.
- What is virtual memory, and why does each process get its own address space?
- How does the OS translate a virtual address into a physical one? Pro
- What is the TLB, and why does a miss slow things down? Pro
- What is the difference between paging and segmentation? Pro
- How do multi-level page tables keep the page table from getting huge? Pro
- What are huge pages, and when do they actually improve performance? Pro
- What is a TLB shootdown, and why does it worsen with more cores? Pro
Page faults and memory pressure
Page faults and demand paging, page eviction, thrashing, overcommit and the OOM killer, and how to diagnose latency and slowdowns caused by paging.
- What is a page fault, and does it always mean something is wrong? Pro
- What is demand paging, and why not load the whole program upfront? Pro
- What is thrashing, and why does adding more load make it worse? Pro
- What is memory overcommit, and what does the OOM killer do about it? Pro
- How can a single page fault cause a latency spike on a hot path? Pro
- How does the OS choose which page to evict when memory fills up? Pro
- How would you diagnose a program that has grown slow because of paging? Pro
File descriptors and I/O models
What file descriptors are and what limits them, blocking versus non-blocking I/O, why buffering helps, and how epoll scales past select.
- What is a file descriptor, and how does a program use one? Pro
- What is the difference between blocking and non-blocking I/O? Pro
- Why is buffered I/O faster than writing one byte at a time? Pro
- What limits how many file descriptors a process or system can open? Pro
- How do epoll and select differ when handling a hundred thousand connections? Pro
Page cache, mmap and zero-copy
How the page cache serves file I/O and how fsync makes it durable, memory-mapped files, zero-copy with sendfile, and when direct I/O bypasses the cache.
- How do memory-mapped files differ from ordinary read and write calls? Pro
- What happens when you memory-map a file larger than physical RAM? Pro
- How does zero-copy I/O like sendfile avoid unnecessary memory copies? Pro
- What is the page cache, and how does fsync relate to durability? Pro
- When is direct I/O a better choice than going through the page cache? Pro
All questions
Showing of 56What does an operating system actually do for a running program?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
An operating system sits between your program and the hardware and shares the CPU, memory and devices among every running program. Your code never talks to the disk or network directly. It asks the OS through system calls, and the OS grants access.
The OS has three main jobs. It schedules CPU time, so many programs take turns on limited cores. It gives each program its own view of memory, so a bug in one program cannot overwrite another program's memory. It also manages files, devices and the network behind uniform interfaces.
This design lets your program act as if it has the machine to itself, while dozens of programs share it. Without the OS enforcing those boundaries, a single careless loop could freeze everything or read another program's secrets.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is a process, and what does the OS track about it?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
A process is a running instance of a program, with its own memory and resources. Launching the same program twice creates two processes that cannot see each other's memory.
The OS tracks each process in a structure often called a process control block.
- Process ID
- Current registers
- Program counter
- Memory layout
- Open file descriptors
- Parent process
- Scheduling priority
- Current state, such as running, ready or waiting
This bookkeeping is what makes pausing and resuming possible. When the OS switches away, it saves those registers, then restores them later so the process continues where it stopped.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is the difference between a process and a thread?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
The core difference is memory sharing. A process owns a private address space. Threads live inside one process and share that space, including the heap and global data.
Because threads share memory, they can pass data by reading and writing the same variables. Two processes cannot, so they need pipes, sockets or shared-memory setups. Each thread still gets its own stack and registers, so it can run its own function calls independently.
The tradeoff is safety versus speed. Shared memory makes thread communication fast but risky, since one thread's bad write can corrupt another's data. Separate processes stay isolated, so a crash in one usually leaves the others running. Pick threads for tight cooperation and processes for isolation.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is the difference between the stack and the heap in memory?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
The stack holds local variables and call frames that last until their function returns, while the heap holds memory you allocate and free yourself.
The stack is automatic and fast. Each function call pushes a frame, and returning pops it. The compiler must know each frame's size up front, and the return frees that space at once.
The heap is flexible. You allocate a block, use it as long as you like, then free it yourself.
That flexibility has a cost. Heap allocation is slower, and the heap can fragment over time. Forget to free a block, and you leak memory.
Use the stack for short-lived, fixed-size data, and the heap when the size is unknown or the data must outlive the call.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is virtual memory, and why does each process get its own address space?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Virtual memory gives each process a private address space, a range of addresses the OS maps onto physical RAM. Your program sees one continuous range starting near zero, even though physical memory is shared and scattered.
The hardware and OS translate every virtual address to a physical one during access. A process can only reach memory it owns, because its map has no entry for anyone else's pages.
That isolation is the main reason for separate address spaces. One process cannot read or corrupt another's data through a stray pointer. It also simplifies your code, since every program can assume the same layout. And because pages not in use can wait on disk, the machine can run programs whose combined footprint exceeds its RAM.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is a system call, and how does it differ from a normal function call?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
A system call is a request to the OS kernel to do something your program cannot do alone. Reading a file, opening a socket or asking the OS for more memory all end in system calls.
A normal function call stays inside your program's own code and privileges. A system call crosses the privilege boundary. The CPU switches from user mode into kernel mode, runs trusted kernel code, then switches back with a result.
That crossing is why system calls cost more than normal function calls. The mode switch takes time, and the kernel saves your registers on entry and restores them on return. Libraries often batch or buffer work to make fewer system calls.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What are user mode and kernel mode, and why do we need both?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
User mode and kernel mode are CPU privilege levels, and modern CPUs have at least these two. Kernel mode can touch any hardware and any memory. User mode is restricted, and that is where your application code runs.
Your program cannot directly access devices or other processes' memory while in user mode. When it needs a privileged action, it makes a system call. That call enters kernel code at a fixed entry point and runs it in kernel mode.
The split exists because programs cannot be trusted with full access. If every program ran with full privileges, one bug or one malicious line could crash the machine or steal data. With two modes, the kernel checks each privileged request before carrying it out.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is a context switch, and why is it considered expensive?
What is a file descriptor, and how does a program use one?
What is a page fault, and does it always mean something is wrong?
What actually happens, step by step, when you run a program?
What is CPU scheduling, and why must the OS decide who runs next?
Why is creating a thread cheaper than creating a whole new process?
How does the OS translate a virtual address into a physical one?
What is the TLB, and why does a miss slow things down?
Why does fork use copy-on-write instead of copying all the memory?
Why do you call fork and exec separately instead of in one step?
What is the difference between blocking and non-blocking I/O?
Why is buffered I/O faster than writing one byte at a time?
How do memory-mapped files differ from ordinary read and write calls?
What is a signal, and how does a process respond to one?
What are zombie and orphan processes, and how do they come about?
What is demand paging, and why not load the whole program upfront?
How does malloc get memory from the OS, and does free return it?
Why does the stack have a fixed limit while the heap can grow?
What is thrashing, and why does adding more load make it worse?
How does a preemptive scheduler differ from a cooperative one?
When should you use multiple processes instead of multiple threads?
What are the main regions of a process's memory layout, and what lives where?
What hardware mechanism lets a system call cross into kernel mode?
What is the difference between paging and segmentation?
How do FCFS, shortest job first, and round robin scheduling compare?
What is the difference between a monolithic kernel and a microkernel?
What is the difference between an interrupt and a trap?
What are the main ways processes communicate with each other?
What is the difference between user-level threads and kernel-level threads?
What limits how many file descriptors a process or system can open?
How do multi-level page tables keep the page table from getting huge?
What are huge pages, and when do they actually improve performance?
Why can frequent context switches quietly wreck CPU cache performance?
What is a TLB shootdown, and why does it worsen with more cores?
Why does fork get slow for a process using lots of memory?
How do epoll and select differ when handling a hundred thousand connections?
What is memory overcommit, and what does the OOM killer do about it?
What happens when you memory-map a file larger than physical RAM?
How does zero-copy I/O like sendfile avoid unnecessary memory copies?
What is the page cache, and how does fsync relate to durability?
How can a single page fault cause a latency spike on a hot path?
What restricts which functions are safe to call inside a signal handler?
How does NUMA change the cost of reaching memory across sockets?
How do guard pages catch a stack that grows past its limit?
How does a debugger use the OS to stop and inspect a process?
When is direct I/O a better choice than going through the page cache?
How does the OS choose which page to evict when memory fills up?
How does a scheduler stay fair and fast with thousands of runnable threads?
How would you diagnose a program that has grown slow because of paging?
This answer is part of Pro.
The full written answer, with the trade-offs and follow-ups an interviewer will probe.
No matches
Try a different filter or search term.
Operating Systems in pictures.
A quick recap of Operating Systems in 31 short animated pictures, one idea at a time. About 8 min to get the whole topic back in your head before you walk in. Pause any picture, slow it down, or step through it.
Pro The first chapter is free to play. The other 28 pictures come with Pro.
This picture is part of Pro. The first chapter is free to play; the other 28 pictures come with Pro.
Get Pro · $10/mo Already Pro? Sign in49 of 56 Operating Systems answers are in Pro.
Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.
- Full answers + code
- AI explanations, simpler or deeper
- 1,000 AI credits / month
- Cancel anytime
Change topic
Pick a different technology or stack. Your current topic stays put until you choose a new one.
MEAN
MongoDB, Express, Angular, Node.jsMERN
MongoDB, Express, React, Node.jsDjango
Python Full-Stack DevelopmentRuby on Rails
Convention over ConfigurationServerless on AWS
Serverless Architecture on AWSInterviewers also test these - they're common to every stack, whichever one you picked above.
Flutter Mobile
Flutter Cross-Platform Mobile DevelopmentInterviewers also test these - they're common to every stack, whichever one you picked above.
Spring Boot
Enterprise Java Development.NET
Microsoft EcosystemVue
Vue.js, Vite, TypeScript, Tailwind, Node.jsGo Backend
Golang, gRPC, PostgreSQL, Redis, RabbitMQInterviewers also test these - they're common to every stack, whichever one you picked above.
FastAPI
Python, FastAPI, SQLAlchemy, PostgreSQLReact Native
React, TypeScript, Redux, FirebaseiOS Native
Swift, SwiftUI, UIKit, FirebaseAndroid Native
Java, Jetpack Compose, FirebaseDevOps / Platform
Docker, Kubernetes, Terraform, CI/CDInterviewers also test these - they're common to every stack, whichever one you picked above.
AI Engineer
LLMs, RAG, Agents, EvalsAI-Powered Developer
Claude Code, Copilot, Agentic WorkflowsCore SWE Interview Prep
Data structures, algorithms, OS, concurrency, networking, gitInterviewers also test these - they're common to every stack, whichever one you picked above.
Interviewers also test these - they're common to every stack, whichever one you picked above.