← Questions

CPU performance and memory system fundamentals

0
AppleCodingLast asked Feb 2026

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

  1. 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.
  2. 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.
  3. Register renaming. Given a short instruction sequence, update the rename table (each destination gets a new physical register) and give the final mapping.
  4. VLIW versus superscalar out-of-order. What moves from hardware to the compiler, and the trade-offs.
  5. Cache coherence. The problem it solves, and MSI, MESI and MOESI at a high level.
  6. 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.
  7. Copy-on-write after fork(). How parent and child share pages, what fault a write raises, and what the handler does.
  8. 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.
  9. VIPT caches. Why a virtually indexed, physically tagged cache can alias, and how designs avoid it.
  10. 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

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