← Questions
CPU performance and memory system fundamentals
0
I was asked this
No reports yet. Sign in to say where you were asked it.
A coding interview question asked in Apple's technical phone screen, last asked Feb 2026. It tests computer architecture, caches and hardware.
A computer architecture conversation for a CPU design or verification role. Explain each topic clearly, with a small worked example where it helps.
Topics
- Out-of-order execution. The main structures (reorder buffer, reservation stations or issue queue, load-store queue) and how one instruction flows from fetch to retire.
- Branch prediction. How a gshare predictor indexes its table of 2-bit counters with the global history, and how the counter and the history register update after a branch resolves.
- Register renaming. Given a short instruction sequence, update the rename table (each destination gets a new physical register) and give the final mapping.
- VLIW versus superscalar out-of-order. What moves from hardware to the compiler, and the trade-offs.
- Cache coherence. The problem it solves, and MSI, MESI and MOESI at a high level.
- Loads and stores. The store buffer and the load-store queue, what speculative loads and stores are, and when cache tags use virtual versus physical addresses.
-
Copy-on-write after
fork(). How parent and child share pages, what fault a write raises, and what the handler does. - Cache indexing math. From capacity, block size and associativity, compute sets, offset bits, index bits and tag bits for a 32-bit address. For example, a 32 KB, 8-way cache with 64-byte blocks has 64 sets, 6 offset bits, 6 index bits and 20 tag bits.
- VIPT caches. Why a virtually indexed, physically tagged cache can alias, and how designs avoid it.
- Asynchronous FIFOs. The problem they solve and why the pointers cross clock domains in Gray code.
What a strong answer covers
- Correct mechanics, not just names: what each structure stores and when entries are freed.
- Worked numbers for the cache math and a step-by-step rename trace.
- Trade-offs stated in terms of area, power, frequency and complexity.
- Links between topics, for example why VIPT works when index plus offset bits fit within the page offset.
Follow-ups
- How would you make a core faster without a newer manufacturing process? Wider issue, a bigger window, better prediction, larger or smarter caches, prefetching, specialized units, and what each costs in power and area.
- A gshare predictor does badly on one benchmark. How would you find out why?
- How would you verify that a coherence protocol never loses a write?
Where it's asked
- Apple · Technical phone screen · Last asked Feb 2026
What it tests
computer architecture · caches · hardware
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
