LearnThatStack Ace your next interview
Computer Science Fundamentals
Operating Systems.
Change topic Change
Practice · Questions

All questions

Showing of 50
Beginner 12
01

What does an operating system actually do for a running program?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

An operating system stands between your program and the raw hardware. Your code never talks to the disk or network directly. It asks the OS, which grants access through system calls.

Three jobs dominate. The OS schedules CPU time, so many programs take turns on limited cores. It hands each program its own memory view, so one bug cannot scribble on another. It manages files, devices, and network behind uniform interfaces.

This design lets your program pretend it owns the machine. In reality dozens of programs share one box. Without the OS enforcing boundaries, a single careless loop could freeze everything or read another program's secrets. That isolation and sharing is the whole point.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

02

What is a process, and what does the OS track about it?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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. It records the process ID, current registers, the program counter, and memory layout. It also holds open file descriptors, the parent process, scheduling priority, and current state like 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 exactly where it stopped. The tracked state is the process's whole identity to the kernel.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

03

What is the difference between a process and a thread?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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 just reading the same variables. Two processes cannot; 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. Separate processes stay isolated, so a crash in one usually leaves the others standing. Pick threads for tight cooperation, processes for isolation.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

04

What is the difference between the stack and the heap in memory?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Both hold your program's data, but they behave very differently. The stack stores local variables and function call frames. The heap stores memory you request explicitly and control by hand.

The stack is automatic and fast. Each function call pushes a frame; returning pops it. Sizes must be known up front, and the space is freed the instant the function returns. The heap is flexible. You allocate a block, use it as long as you like, then free it yourself.

That flexibility carries a cost. Heap allocation is slower and can fragment over time. Forget to free, and you leak memory. Use the stack for short-lived, fixed-size data, and the heap when size or lifetime outlives one function call.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

05

What is virtual memory, and why does each process get its own address space?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Virtual memory gives each process a private set of addresses that the OS maps to real physical RAM. Your program sees a clean, 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 simply has no entry for anyone else's pages.

That isolation is the main payoff. 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 familiar layout. And it lets the machine run programs whose combined footprint exceeds the RAM actually installed.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

06

What is a system call, and how does it differ from a normal function call?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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 allocating memory all end in system calls.

A normal function call stays inside your program's own code and privileges. A system call crosses a hard 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 plain calls. There is mode-switching overhead and saved state on each side. Libraries often batch or buffer work to make fewer of them. So treat system calls as the expensive doorway between your code and the machine's protected parts.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

07

What are user mode and kernel mode, and why do we need both?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Modern CPUs run in at least two privilege levels. Kernel mode can touch any hardware and any memory. User mode is restricted, and that is where your application code lives.

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, which safely transfers control to kernel code running in kernel mode.

We need both because trust is not free. If every program ran with full privileges, one bug or one malicious line could crash the machine or steal data. The two-mode split lets the kernel police every dangerous action. User code stays sandboxed, and the kernel stays the single gatekeeper.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

08

What is a context switch, and why is it considered expensive?

Part of Pro
09

What is a file descriptor, and how does a program use one?

Part of Pro
10

What is a page fault, and does it always mean something is wrong?

Part of Pro
11

What actually happens, step by step, when you run a program?

Part of Pro
12

What is CPU scheduling, and why must the OS decide who runs next?

Part of Pro
Intermediate 18
13

Why is creating a thread cheaper than creating a whole new process?

Part of Pro
14

How does the OS translate a virtual address into a physical one?

Part of Pro
15

What is the TLB, and why does a miss slow things down?

Part of Pro
16

Why does fork use copy-on-write instead of copying all the memory?

Part of Pro
17

Why do you call fork and exec separately instead of in one step?

Part of Pro
18

What is the difference between blocking and non-blocking I/O?

Part of Pro
19

Why is buffered I/O faster than writing one byte at a time?

Part of Pro
20

How do memory-mapped files differ from ordinary read and write calls?

Part of Pro
21

What is a signal, and how does a process respond to one?

Part of Pro
22

What are zombie and orphan processes, and how do they come about?

Part of Pro
23

What is demand paging, and why not load the whole program upfront?

Part of Pro
24

How does malloc get memory from the OS, and does free return it?

Part of Pro
25

Why does the stack have a fixed limit while the heap can grow?

Part of Pro
26

What is thrashing, and why does adding more load make it worse?

Part of Pro
27

How does a preemptive scheduler differ from a cooperative one?

Part of Pro
28

When should you use multiple processes instead of multiple threads?

Part of Pro
29

What are the main regions of a process's memory layout, and what lives where?

Part of Pro
30

What hardware mechanism lets a system call cross into kernel mode?

Part of Pro
Expert 20
31

How do multi-level page tables keep the page table from getting huge?

Part of Pro
32

What are huge pages, and when do they actually improve performance?

Part of Pro
33

Why can frequent context switches quietly wreck CPU cache performance?

Part of Pro
34

What is a TLB shootdown, and why does it worsen with more cores?

Part of Pro
35

Why does fork get slow for a process using lots of memory?

Part of Pro
36

How do epoll and select differ when handling a hundred thousand connections?

Part of Pro
37

What is memory overcommit, and what does the OOM killer do about it?

Part of Pro
38

What happens when you memory-map a file larger than physical RAM?

Part of Pro
39

How does zero-copy I/O like sendfile avoid unnecessary memory copies?

Part of Pro
40

What is the page cache, and how does fsync relate to durability?

Part of Pro
41

How can a single page fault cause a latency spike on a hot path?

Part of Pro
42

What restricts which functions are safe to call inside a signal handler?

Part of Pro
43

How does NUMA change the cost of reaching memory across sockets?

Part of Pro
44

What limits how many file descriptors a process or system can open?

Part of Pro
45

How do guard pages catch a stack that grows past its limit?

Part of Pro
46

How does a debugger use the OS to stop and inspect a process?

Part of Pro
47

When is direct I/O a better choice than going through the page cache?

Part of Pro
48

How does the OS choose which page to evict when memory fills up?

Part of Pro
49

How does a scheduler stay fair and fast with thousands of runnable threads?

Part of Pro
50

How would you diagnose a program that has grown slow because of paging?

Part of Pro

No matches

Try a different filter or search term.

Know someone prepping for Operating Systems? Send them this set.
Pro · $10/mo

43 of 50 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.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

Serverless on AWS

Serverless Architecture on AWS

Flutter Mobile

Flutter Cross-Platform Mobile Development

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

AI Engineer

LLMs, RAG, Agents, Evals

AI-Powered Developer

Claude Code, Copilot, Agentic Workflows

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git