377 questions for senior .NET engineer interviews, each with a 30-second answer, the full answer, a deep dive, the follow-ups interviewers ask next, and real-world production problems.
CPU architecture, registers, ALU, control unit, the fetch-decode-execute cycle, pipelining, branch prediction and cache locality, and what they mean for .NET code.
A tour of CPU architecture for software engineers: cores and hardware threads, the register file, the ALU and other execution units, the control unit, the cache hierarchy and the clock, and why each matters for .NET performance.
The instruction cycle (fetch, decode, execute, memory access, write-back), the instruction pointer, how jumps, calls and returns change the flow, and how to read a few lines of JIT-generated x64 or Arm64 assembly.
Instruction pipelining, superscalar issue, out-of-order execution with register renaming and the reorder buffer, the hazards that stall pipelines (data dependencies, branches, cache misses), and how dependency chains show up in .NET code.
How CPUs predict conditional and indirect branches, what a misprediction costs, the classic sorted-versus-unsorted example, branchless techniques, how the .NET JIT uses conditional moves and Dynamic PGO, and how to measure mispredictions.
Spatial and temporal locality, cache lines and hardware prefetching, row-major layout of C# multidimensional arrays, arrays of structs versus arrays of references, struct-of-arrays layouts, and benchmarking the effects.
Cache coherence and why two threads writing different variables on the same cache line slow each other down, how to recognise and measure false sharing, and fixes: thread-local accumulation, padding, and avoiding shared writes.
CISC versus RISC design, instruction sets, memory ordering models and SIMD differences between x64 and Arm64, and the practical checklist for .NET: RIDs, native dependencies, multi-arch container images, concurrency correctness, performance testing and cost.
Single instruction, multiple data: vector registers and instruction sets (SSE, AVX2, AVX-512, NEON), the .NET hardware-intrinsic APIs, vectorised BCL methods and TensorPrimitives, writing a vectorised loop with a scalar tail, and when SIMD is or isn't worth it.