Memory Systems Interview Prep Checklist
Table of Contents
A quick checklist for understanding memory systems in computer architecture
Memory Systems Interview Prep
Based on CSAPP Chapter 6: The Memory Hierarchy
Week 1 Day 1-2: Memory Hierarchy
CSAPP 6.1-6.2: Storage Technologies & Locality
- Why do we need a memory hierarchy? What problems would we have if we only used one type of memory?
- What is temporal locality? Give a concrete code example.
- What is spatial locality? Give a concrete code example.
- What are the typical speed differences between CPU registers, L1 cache, L2 cache, L3 cache, DRAM, and Disk? (Order of magnitude is fine, no need for exact numbers)
- Why are smaller caches faster? Why can't we make all caches as fast as L1?
- What kind of programs have good locality? What kind of programs have poor locality?
other:
- What is firmware?
- Can you draw CPU, bus interface, I/O bridge, memory bus, I/O bus, memory archetructure graph?
To ask
- what is memory mapped io?
- why rom (ssd) cannot modify one byte only?
Week 1 Day 3-4: Cache Basics
CSAPP 6.4: Cache Memories
- What is a cache line? Why does cache operate on lines instead of individual bytes?
- What is a direct-mapped cache? What are its advantages and disadvantages?
- What is a set-associative cache? How does it differ from direct-mapped cache?
- Given a 32-bit address, cache line size = 64 bytes, and 256 sets, how do you divide the address into tag, index, and offset?
- What's the difference between write-through and write-back? What are the pros and cons of each?
- What's the difference between cold miss, conflict miss, and capacity miss? Give an example of each.
- Why is this code slow?
int sum = 0;
for
for
sum += arr; // assume row-major
- What is loop blocking (tiling)? Why does it improve cache performance?
Week 1 Day 5-6: Virtual Memory Part 1
CSAPP 9.1-9.3: Physical and Virtual Addressing, Address Spaces, VM as a Tool for Caching
- Why do we need virtual memory? List at least 3 reasons.
- What's the difference between virtual address and physical address?
- What is a page? What's a typical page size?
- What is a page table? Where is it stored?
- Draw the translation flow from virtual address to physical address (VPN → PPN)
- What is a page fault? What does the OS do when it happens?
- Why does each process have its own page table?
- If page size = 4KB and virtual address is 32-bit, how many bits for VPN? How many bits for offset?
Week 1 Day 7: Virtual Memory Part 2 + TLB
CSAPP 9.6: Address Translation
- What is a TLB? Why do we need it?
- What's the difference between a TLB miss and a page fault?
- Is it possible to have a TLB hit but a page fault?
- Is it possible to have a page fault but a TLB hit?
- Why is a multi-level page table better than a single-level page table?
- Why don't we need to actually access the page table for most memory accesses?
- Why is sequential access much faster than random access? (Explain from virtual memory perspective)