LearnThatStack Ace your next interview
Operating Systems · question
Question 1 of 56

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

beginner
← All Operating Systems questions
Re-explain

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.

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 ↓

The diagram below the answer is the concept . Jump to it ↓

Tailored explanation · switch back to · ·
What should the new diagram focus on?
Guided practice for Operating Systems One question at a time. Answer out loud, get graded, see what you missed.
How well did you know this?
AI:

Saved in this browser - sign in to keep your review list.

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.

Interview lens How interviewers actually use this question

Likely follow-ups

What you can say

  1. An operating system sits between my program and the hardware, and it shares the CPU, memory and devices among every running program.
  2. My code never touches the disk or network directly but asks the OS through a system call, and the OS grants the access.
  3. It has three main jobs, and the first is scheduling CPU time so many programs take turns on a limited number of cores.
  4. The second is giving each program its own view of memory, so a bug in one program can't overwrite another program's memory.
  5. The third is managing files, devices and the network behind uniform interfaces, and together these let each program act as if it has the machine to itself.
  6. Without those boundaries one careless loop could freeze the machine, and the price of having them is that every system call costs more than a normal function call.

Weak answers to avoid

  • Names operating systems instead of what they do Saying 'Windows or Linux' or 'it runs my apps' shows no mechanism. Name the jobs, which are CPU scheduling, memory isolation and device access through system calls.
  • Says programs talk to the hardware directly That misses the whole boundary. Your program asks the OS through a system call, and the OS decides whether to do the disk or network access for it.
  • Recites a textbook list with no why 'Process, memory and file management' sounds memorized. Say what each job prevents, like a bug in one program overwriting another program's memory.
  • Mixes up the OS with the desktop or shell The desktop and the terminal are programs the OS runs. The question is about the part that schedules the CPU, guards memory and handles devices.
Interview lens

Likely follow-ups, what you can say, and the weak answers to avoid.

Sign in free to open it Free account - the lens opens as soon as you're back.

Want a quick review of the fundamentals? See the Operating Systems cheatsheet.

← Back to all Operating Systems questions
Pro · $10/mo

49 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