Core OOP concepts, C# OOP language features and the design judgement senior .NET engineers are expected to show.
-
How do structs work in C#? Explain value semantics and copying, constructors and default values, readonly structs and readonly members, ref structs and Span, record structs, boxing, and the bugs that mutable structs cause.
C# structs in depth: copying, default(T), parameterless constructors, readonly structs and defensive copies, ref structs, C# 13 interface support, boxing and mutable-struct bugs.
Senior
Theory
C# OOP Features
Β· π 3 follow-ups Β· π 1 real-world
-
What access modifiers does C# have, and how do you use them to design a clean API? Explain public, private, protected, internal, protected internal, private protected and file, the default accessibility of each declaration, and InternalsVisibleTo.
C# access modifiers including private protected and file, defaults per declaration, accessor-level modifiers, InternalsVisibleTo, and using accessibility to keep API surface small.
Junior
Theory
C# OOP Features
Β· π 2 follow-ups Β· π 1 real-world
-
How do properties work in C#? Explain auto-properties and backing fields, get/set/init accessors, required members (C# 11), the C# 14 field keyword, computed properties, and when to use a property, a field or a method.
C# properties: how they compile, init and required, the C# 14 field keyword, validation, computed properties, binary compatibility and property-versus-method guidelines.
Mid-Level
Theory
C# OOP Features
Β· π 2 follow-ups Β· π 1 real-world
-
What are indexers in C#? Explain how to declare and overload them, how they compile, how they work with Index and Range (^1 and ..), ref-returning indexers, and when an indexer is or is not a good API.
C# indexers: syntax, overloading, the Item property in metadata, implicit Index/Range support, ref returns as in `Span<T>`, dictionary indexer semantics and design guidelines.
Mid-Level
Theory
C# OOP Features
Β· π 3 follow-ups Β· π 1 real-world
-
How does operator overloading work in C#? Explain the rules for declaring operators, which operators come in pairs, equality operators and Equals, conversion operators, checked operators, generic math interfaces, and C# 14 user-defined compound assignment operators.
C# operator overloading: syntax and rules, required pairs, == with Equals/GetHashCode, implicit and explicit conversions, checked operators, generic math, C# 14 compound assignment and design guidelines.
Mid-Level
Theory
C# OOP Features
Β· π 3 follow-ups Β· π 1 real-world
-
Composition or inheritance: how do you decide which to use in a C# design? Walk through the criteria you apply, a case where inheritance is the right answer, and how you would refactor a hierarchy that has gone wrong.
Design judgement on composition versus inheritance: is-a versus has-a, Liskov, number of variation axes, framework extension points, and refactoring a broken hierarchy to composition.
Senior
Architecture
Design Judgment
Β· π 3 follow-ups Β· π 1 real-world
-
Interface or abstract class: how do you choose in modern C#, now that interfaces can have default implementations and static abstract members? Give the criteria, real BCL examples of each, and when you would use both together.
Design judgement on interfaces versus abstract classes in C# 14: state, multiple implementation, versioning, default interface methods, static abstract members, and the interface-plus-base-class pattern.
Senior
Architecture
Design Judgment
Β· π 3 follow-ups Β· π 1 real-world
-
Record or class: how do you decide which to use for a given C# type? Explain the criteria, typical examples on each side, the pitfalls of choosing wrongly, and how the decision interacts with EF Core, serialisation and caching.
Design judgement on records versus classes: value versus identity semantics, immutability, inheritance, EF Core entities, JSON contracts, cache keys and pitfalls of each wrong choice.
Senior
Architecture
Design Judgment
Β· π 2 follow-ups Β· π 1 real-world
-
Struct or class: how do you decide in C#, and how do you prove the choice was right? Explain the criteria, the costs on each side (copying, boxing, allocation, GC), the defaults you would recommend, and how you would measure the impact.
Design judgement on structs versus classes: semantics first, size and copying, allocation and GC, boxing risks, readonly and ref structs, and measuring with BenchmarkDotNet and allocation profiling.
Senior
Architecture
Design Judgment
Β· π 3 follow-ups Β· π 1 real-world
-
Mutable or immutable types: how do you decide in a C# system? Explain the benefits and costs of immutability, the C# tools for it (readonly, init, records, immutable and frozen collections), the difference between read-only and immutable, and where mutability is still the right choice.
Design judgement on mutability: thread safety, caching, reasoning and hash keys versus allocation cost; readonly, init, records, ImmutableArray, FrozenDictionary; read-only views versus true immutability.
Senior
Architecture
Design Judgment
Β· π 3 follow-ups Β· π 1 real-world
-
Domain model versus DTO: what is the difference, why should you keep them separate, and how do you map between them in a .NET application? Discuss over-posting, API versioning, EF Core entities and when sharing one type is acceptable.
Design judgement on domain models versus DTOs: responsibilities, boundaries, over-posting and data leaks, versioning, mapping options (manual, Mapster, Mapperly, projections) and pragmatic exceptions.
Senior
Architecture
Design Judgment
Β· π 2 follow-ups Β· π 1 real-world
-
Rich domain model or anemic domain model: what is the difference, what problems does an anemic model cause, and how would you move a .NET codebase towards a richer model without over-engineering it?
Design judgement on rich versus anemic domain models: behaviour with data, invariants, transaction scripts, when anemic is acceptable, and incremental refactoring with EF Core.
Senior
Architecture
Design Judgment
Β· π 2 follow-ups Β· π 1 real-world