-
What is graph traversal? Explain breadth-first search (BFS) with a C# implementation, why it finds the shortest path in an unweighted graph, and where you would use it in a real system.
Graph traversal fundamentals and BFS: queue-based implementation, visited sets, shortest paths in unweighted graphs, levels, and real uses like degrees of separation and dependency impact.
Intermediate
Coding
Algorithms
Β· π 3 follow-ups
-
Explain depth-first search (DFS). Implement it recursively and iteratively in C#, and show how DFS detects cycles in a directed graph and produces a topological order, for example for build or migration dependencies.
Depth-first search: recursive and iterative implementations, pre/post order, three-colour cycle detection, topological sort, connected components and backtracking.
Mid-Level
Coding
Algorithms
Β· π 3 follow-ups Β· π 1 real-world
-
A .NET API endpoint was fast in testing but gets slower every month as production data grows, and now times out for your biggest customers. How would you find and fix an algorithmic complexity problem, and stop it happening again?
End-to-end handling of a production complexity problem: spotting non-linear growth in metrics, profiling, identifying hidden O(n²) or N+1 patterns, fixing them, and preventing regressions.
Senior
RealWorldScenario
Algorithms
Β· π 3 follow-ups Β· π 1 real-world
-
What is the difference between a local variable, a const, a readonly field and a static readonly field in C#, and how do literals such as numeric suffixes, digit separators and raw string literals work?
Variables, constants and literals in C# 14: definite assignment, const versus readonly, the const versioning trap, and every literal form you meet in real code.
Junior
Theory
Language Basics
Β· π 2 follow-ups
-
What are the built-in numeric data types in C#? When do you use int, long, double or decimal, and how do overflow, checked arithmetic and floating-point precision affect real code?
Choosing numeric types in C#: integral versus binary floating point versus decimal, silent overflow and checked contexts, NaN and Infinity, rounding, and money calculations.
Junior
Coding
Language Basics
Β· π 2 follow-ups Β· π 1 real-world
-
Explain the C# operators you use daily, including the null operators (?., ??, ??=), short-circuit evaluation, integer division and operator precedence. Where do they cause bugs?
Arithmetic, comparison, logical, null-handling, pattern and index/range operators in C# 14, with precedence rules and the bugs each one commonly causes.
Junior
Theory
Language Basics
Β· π 3 follow-ups
-
What is the difference between an expression and a statement in C#? Explain switch expressions, pattern matching and expression-bodied members, and when you would use each.
Expressions versus statements in C# 14, and the expression-oriented features built on that split: switch expressions, the pattern kinds, throw expressions and expression-bodied members.
Mid-Level
Theory
Language Basics
Β· π 2 follow-ups Β· π 1 real-world
-
Walk through C# control flow: if, switch, for, foreach, while, break, continue and return. What does foreach compile to, and which loop bugs should you watch for?
C# selection, iteration and jump statements, how foreach is lowered for arrays, List<T> and IEnumerable<T>, and the classic loop bugs: closure capture, modifying during enumeration, off-by-one and multiple enumeration.
Junior
Debugging
Language Basics
Β· π 2 follow-ups
-
How are arguments passed to methods in C#? Explain pass-by-value for value and reference types, ref, out, in, ref readonly, params, and optional and named parameters.
C# parameter passing in depth: copies of values versus copies of references, the ref/out/in/ref readonly modifiers, params collections (C# 13), optional and named arguments, and their performance and versioning trade-offs.
Mid-Level
Theory
Language Basics
Β· π 3 follow-ups Β· π 1 real-world
-
Code review: a service method returns null when an order is not found, reports errors through two out parameters, returns its internal List<Order> directly, and is called from async code. How would you redesign its return types, and what return options does C# give you?
Choosing method return types in C#: void, values, tuples, out parameters, result objects, ref returns, IEnumerable and IAsyncEnumerable, Task and ValueTask, reviewed through a realistic service method.
Senior
CodeReview
Language Basics
Β· π 2 follow-ups Β· π 1 real-world
-
What are local functions in C#? How do they differ from lambdas in capture, allocation and recursion, and when do you use a static local function?
Local functions versus lambdas in C#: syntax, struct versus class closures, delegate allocation, recursion, generics, static local functions, and the eager-validation pattern for iterators and async methods.
Mid-Level
Theory
Language Basics
Β· π 2 follow-ups Β· π 1 real-world
-
How do methods work in C#? Explain instance versus static methods, method signatures and overloading (and how overload resolution picks a method), expression-bodied methods, and extension methods including the C# 14 extension members syntax.
C# methods end to end: instance and static, signatures, overloading rules, expression-bodied form, and classic and C# 14 extension members.
Mid-Level
Theory
Language Basics
Β· π 3 follow-ups Β· π 1 real-world
-
What is the difference between value types and reference types in C#? Explain copy semantics, equality, where they are stored, and why "value types live on the stack" is only partly true.
Value types versus reference types in .NET 10: what each kind is, copy and assignment semantics, default equality, real storage locations, object overhead, and how to choose.
Junior
Theory
Types
Β· π 3 follow-ups
-
What are nullable value types (Nullable<T>, int?) in C#? How do HasValue, Value, GetValueOrDefault, lifted operators and boxing of a null nullable work?
Nullable value types in C#: the Nullable<T> struct, safe access patterns, lifted arithmetic and comparison operators, three-valued bool logic, boxing behaviour and database mapping.
Junior
Theory
Types
Β· π 2 follow-ups
-
What are nullable reference types in C#? Explain the annotations (? and !), how the compiler's null-state flow analysis works, attributes such as [NotNullWhen] and [MemberNotNull], and their limits at run time.
Nullable reference types (NRT) in C# 14: nullable contexts, annotations and the null-forgiving operator, flow analysis, nullable attributes, generics, and the gaps where nulls still get through at run time.
Mid-Level
Theory
Types
Β· π 3 follow-ups Β· π 1 real-world
-
What are boxing and unboxing in C#? Where does hidden boxing happen, what does it cost, and how do you find and remove it?
Boxing and unboxing in .NET 10: what the runtime does, the exact-type rule for unboxing, the common hidden boxing sites, the cost in allocations and GC, and the tools and fixes to remove it.
Mid-Level
Debugging
Types
Β· π 2 follow-ups Β· π 1 real-world
-
How does type inference work in C#? When should you use var, target-typed new and inferred lambda types, and when does explicit typing read better?
Type inference in C# 14: var and its rules, anonymous types, target-typed new and collection expressions, generic method inference, natural lambda types, and the readability and LINQ traps that guide when to be explicit.
Junior
Theory
Types
Β· π 2 follow-ups
-
What does default mean in C#? Explain default(T), the default literal, default values of structs, enums and reference types, and how default is used in generics and optional parameters.
The default keyword and default values in C# 14: all-zero memory, default(T) and the default literal, struct and enum pitfalls, generic code that returns default, and the other meanings of the word default in C#.
Junior
Theory
Types
Β· π 2 follow-ups
-
Every C# type derives from System.Object. What members does it give you? Then review a Customer class that overrides Equals to compare Email but does not override GetHashCode: what breaks, and how do you implement equality correctly (or use a record)?
System.Object's members and contracts, reviewed through a broken Equals override: the Equals/GetHashCode contract, IEquatable<T>, operators, inheritance pitfalls, records, ToString and MemberwiseClone.
Mid-Level
CodeReview
Types
Β· π 2 follow-ups Β· π 1 real-world
-
What is dynamic in C#? How does the DLR bind calls at run time, how does it differ from object and var, and when is it a reasonable choice?
The dynamic type in C#: run-time binding through the DLR and call-site caches, comparison with object and var, the costs (errors at run time, performance, trimming and AOT), and the narrow cases where it is still justified.
Mid-Level
Theory
Types
Β· π 2 follow-ups Β· π 1 real-world