C# Interview

Advanced C# Language Features

C# interview questions covering advanced c# language features.

10 Questions Filter by level

Interview questions

Open a question for the full answer, code and interview guidance.

10 Results
81
Mid-LevelIntermediate

What are extension methods in C#?

Extension methods allow developers to add method-like functionality to an existing type without modifying that type or creating a derived class.

82
Mid-LevelIntermediate

What is pattern matching in C#?

Pattern matching allows code to test an object's type, value, shape, or properties and optionally extract information at the same time.

83
Mid-LevelIntermediate

What is a switch expression in C#?

A switch expression is a concise expression-based form of switch that returns a value based on pattern matching.

84
Mid-LevelIntermediate

What is the null-coalescing operator (??) in C#?

The null-coalescing operator returns its left operand when that value is not null; otherwise, it evaluates and returns the right operand.

85
Mid-LevelIntermediate

What are the null-conditional operators ?. and ?[] in C#?

Null-conditional operators safely access a member or index only when the target object is not null.

86
Mid-LevelIntermediate

What are ref, out, and in parameters in C#?

ref, out, and in pass arguments by reference rather than passing the parameter value normally.

87
Mid-LevelIntermediate

What are tuples in C#?

Tuples allow a method or expression to group multiple values without defining a separate class or struct for every temporary result.

88
Mid-LevelIntermediate

What is the yield keyword in C#?

The yield keyword is used to implement an iterator without manually building and returning the entire collection.

89
Mid-LevelIntermediate

What is reflection in C#?

Reflection allows code to inspect metadata about assemblies, types, properties, methods, attributes, constructors, and other members at runtime.

90
Mid-LevelIntermediate

What are attributes in C#?

Attributes attach declarative metadata to assemblies, classes, methods, properties, parameters, and other program elements.