Variables, constants, data types, literals, operators, expressions, statements, control flow, methods, parameters, return types and local functions in C# 14.
-
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