-
How do params work in modern C#, and what changed with C# 13 params collections? Explain params arrays and their hidden allocations, params ReadOnlySpan<T>, params IEnumerable<T> and List<T>, how overload resolution chooses between them, the new BCL overloads in .NET 9, and API design guidance.
params arrays versus C# 13 params collections, allocations, overload resolution and API design.
Mid-Level
Theory
Memory-Oriented C#
Β· π 3 follow-ups Β· π 1 real-world
-
What does readonly mean in each place it can appear in C#? Explain readonly fields, static readonly versus const (and the versioning trap), readonly structs, readonly members, readonly ref returns, how the JIT treats static readonly values, and why readonly does not make an object immutable.
readonly across fields, structs, members and refs, const versus static readonly, and immutability limits.
Mid-Level
Theory
Memory-Oriented C#
Β· π 3 follow-ups Β· π 1 real-world
-
What is a ref struct and when would you write one? Explain the rules (stack-only, no boxing, no class fields, no lambda capture), ref fields (C# 11), C# 13 changes (implementing interfaces, the allows ref struct anti-constraint, use in async and iterator methods), the Dispose pattern for ref structs, and walk through a ValueStringBuilder-style type.
Writing ref structs: rules, ref fields, C# 13 interface and generic support, and a stack-first builder example.
Senior
Coding
Memory-Oriented C#
Β· π 3 follow-ups Β· π 1 real-world
-
How do you use stackalloc safely in modern C#? Explain stackalloc into Span<T>, the unmanaged type requirement, stack size limits and why a stack overflow kills the process, the hybrid stackalloc-or-ArrayPool pattern, why you must not stackalloc in loops, SkipLocalsInit, and how to choose a threshold.
Safe stackalloc: span usage, size limits, hybrid pooling pattern, loops and SkipLocalsInit.
Mid-Level
Coding
Memory-Oriented C#
Β· π 3 follow-ups Β· π 1 real-world
-
When is unsafe code justified in modern C#, and what tools exist beyond raw pointers? Explain unsafe blocks, pointers and fixed (pinning), function pointers, NativeMemory, the System.Runtime.CompilerServices.Unsafe class, MemoryMarshal, what can go wrong (GC holes, buffer overruns, pinning cost), and how to keep unsafe code safe.
Unsafe C#: pointers, fixed, NativeMemory, the Unsafe class and MemoryMarshal, risks and guidelines.
Senior
Theory
Memory-Oriented C#
Β· π 3 follow-ups Β· π 1 real-world
-
A service using ArrayPool<T> intermittently returns corrupted data, and once returned another customer's data in a response. How do you debug and fix ArrayPool misuse? Cover use-after-return, double return, assuming the rented length, not clearing sensitive data, returning foreign arrays, and the tools and test techniques that catch these bugs.
Debugging ArrayPool<T> misuse: lifetime bugs, length assumptions, clearing, diagnostics and safe patterns.
Senior
Debugging
Memory-Oriented C#
Β· π 3 follow-ups Β· π 1 real-world
-
How do MemoryPool<T> and IMemoryOwner<T> work, and when would you use them instead of ArrayPool<T>? Explain renting and disposing owners, why the buffer can be larger than requested, ownership transfer between components, how System.IO.Pipelines uses a memory pool, writing a custom pool or MemoryManager<T> for native or pinned memory, and common mistakes.
MemoryPool<T> and IMemoryOwner<T>: ownership-based pooling, pipelines and custom memory managers.
Senior
Theory
Memory-Oriented C#
Β· π 3 follow-ups Β· π 1 real-world
-
What is the Common Language Runtime (CLR), and which services does it give your .NET application?
The CLR as the execution engine of .NET: loading, JIT, type safety, GC, exceptions, threading and interop.
Mid-Level
Theory
CLR Fundamentals
Β· π 3 follow-ups Β· π 1 real-world
-
What is the Common Type System (CTS), and how does it let different .NET languages share types?
The CTS rules for value and reference types, members, inheritance and how language keywords map to CTS types.
Mid-Level
Theory
CLR Fundamentals
Β· π 3 follow-ups Β· π 1 real-world
-
What is the Common Language Specification (CLS), and when should you mark a library as CLSCompliant?
CLS rules for cross-language public APIs, the CLSCompliant attribute and the compiler warnings it enables.
Mid-Level
Theory
CLR Fundamentals
Β· π 2 follow-ups Β· π 1 real-world
-
What is a .NET assembly, and what does assembly identity (name, version, culture, public key token) mean in modern .NET?
Assemblies as the unit of deployment and versioning, their contents, identity and how modern .NET treats versions and strong names.
Mid-Level
Theory
CLR Fundamentals
Β· π 3 follow-ups Β· π 1 real-world
-
What are metadata and the manifest in a .NET assembly, and how can you read them without loading the assembly?
Metadata tables and tokens, the assembly manifest, type forwarding, and reading them with System.Reflection.Metadata.
Senior
Theory
CLR Fundamentals
Β· π 3 follow-ups Β· π 1 real-world
-
What is IL (Intermediate Language), and how do you read the IL the C# compiler produces?
CIL as a stack-based instruction set, common opcodes, callvirt, boxing in IL, and tools to inspect it.
Mid-Level
Theory
CLR Fundamentals
Β· π 3 follow-ups Β· π 1 real-world
-
How does the JIT compiler work in .NET, and how can you see the machine code it generates?
Just-in-time compilation per method via stubs, what the JIT produces, and inspecting output with DOTNET_JitDisasm.
Senior
Theory
CLR Fundamentals
Β· π 3 follow-ups Β· π 1 real-world
-
How does tiered compilation work in .NET, including Tier 0, Tier 1 and on-stack replacement (OSR)?
Tiered JIT: quick unoptimised code first, call counting, background Tier 1 recompilation, OSR for loops and the settings that control it.
Senior
Theory
CLR Fundamentals
Β· π 2 follow-ups Β· π 1 real-world
-
What is Dynamic PGO in .NET, and how does guarded devirtualisation make interface and virtual calls faster?
Profile-guided optimisation at run time: instrumentation, guarded devirtualisation, hot/cold layout and how traffic shape affects it.
Senior
Theory
CLR Fundamentals
Β· π 3 follow-ups Β· π 1 real-world
-
What is ReadyToRun (R2R), and when should you publish with it?
ReadyToRun precompilation with crossgen2: startup benefits, size cost, version resilience, composite images and how it interacts with tiering.
Mid-Level
Theory
CLR Fundamentals
Β· π 3 follow-ups Β· π 1 real-world
-
What is NativeAOT in .NET, what does it give you and what are its restrictions?
Native ahead-of-time compilation: startup and memory gains, required trimming, reflection and dynamic code limits, ASP.NET Core support and analysers.
Senior
Theory
CLR Fundamentals
Β· π 3 follow-ups Β· π 1 real-world
-
What does single-file publish do in .NET, and what breaks when you switch an app to it?
PublishSingleFile bundling, framework-dependent versus self-contained, native library extraction, Assembly.Location and IL3000.
Mid-Level
Theory
CLR Fundamentals
Β· π 3 follow-ups Β· π 1 real-world
-
How does IL trimming work in .NET, and how do you make an app or library trim-safe?
ILLink trimming, TrimMode, trim warnings, DynamicallyAccessedMembers and RequiresUnreferencedCode, feature switches and IsTrimmable.
Senior
Theory
CLR Fundamentals
Β· π 3 follow-ups Β· π 1 real-world