Interview kitsBlog

Your dream job? Lets Git IT.
Interactive technical interview preparation platform designed for modern developers.

XGitHub

Platform

  • Categories

Resources

  • Blog
  • About the app
  • FAQ
  • Feedback

Legal

  • Privacy Policy
  • Terms of Service

© 2026 LetsGit.IT. All rights reserved.

LetsGit.IT/Categories/Operating Systems
Operating Systemsmedium

Explain virtual memory and paging.

Tags
#virtual-memory#paging#performance
Back to categoryPractice quiz

Answer

Virtual memory gives each process its own address space mapped to physical memory. Paging moves fixed-size pages between RAM and disk, enabling isolation and larger memory than RAM.

Advanced answer

Deep dive

VM provides isolation and flexibility:

  • Page tables map virtual to physical addresses.
  • Page faults occur when a page is not in RAM.
  • The OS uses replacement policies (e.g., LRU approximations).
  • Too many faults cause thrashing and severe slowdown.

Examples

Page fault flow:

Access page -> fault -> load from disk -> update page table -> resume

Common pitfalls

  • Assuming swap is “free memory.”
  • Ignoring working set size (thrashing).
  • Overcommitting memory without monitoring.

Interview follow-ups

  • What is the working set of a process?
  • How does copy-on-write use paging?
  • How do huge pages affect performance?

Related questions

Operating Systems
What is context switching and why is it expensive?
#context-switch#scheduler#performance
JavaScript
What are debounce and throttle and when would you use each?
#performance#debounce#throttle
MongoDB
Text indexes: when would you use them and what’s a limitation?
#mongo#text-index
#search
MongoDB
`$lookup`: what does it do and what is a common pitfall?
#mongo#lookup#aggregation
PostgreSQL
Materialized view vs view: what’s the difference?
#postgres#views#materialized-view