W3
Teacher
Explore
Browse by field
Artificial Intelligence
Accounting & Finance
Information Technology
Show all fields
Interview Q&A
All Interview Questions
Beginner
Intermediate
Advanced
Practice
MCQs
Quizzes
Mock Interviews
About
Light
Dark
Auto
Sign in
Get Started
Search interview questions
Search
All fields
“Attributes & Reflection” in Information Technology
14 questions across 1 technology.
Information Technology
14 questions in 1 technology
#
Question
Technology
Topic
Level
1
How does the .NET dependency injection container and ASP.NET Core's model binding use
reflection
and
attributes
together under the hood?
C# › Attributes & Reflection
C#
Attributes
&
Reflection
Advanced
2
What is
reflection
in C#, and what are its most common practical uses and performance trade-offs?
C# › Attributes & Reflection
C#
Attributes
&
Reflection
Intermediate
3
What is
reflection
, and what basic information can you retrieve from a Type object at runtime?
C# › Attributes & Reflection
C#
Attributes
&
Reflection
Beginner
4
How do you use
reflection
to read a custom attribute's values off a property at runtime?
C# › Attributes & Reflection
C#
Attributes
&
Reflection
Intermediate
5
How do you dynamically create an instance of a type and invoke a method on it using
reflection
, when the type isn't known at compile time?
C# › Attributes & Reflection
C#
Attributes
&
Reflection
Intermediate
6
How would you write a simple
reflection
-based object mapper that copies matching property values from one object to another of a different type?
C# › Attributes & Reflection
C#
Attributes
&
Reflection
Advanced
7
How do you use
reflection
to discover all types in an assembly that implement a specific interface, useful for plugin discovery?
C# › Attributes & Reflection
C#
Attributes
&
Reflection
Advanced
8
Why is
reflection
generally slower than direct code, and what techniques (like caching or compiled expressions) mitigate this cost?
C# › Attributes & Reflection
C#
Attributes
&
Reflection
Advanced
9
How would you use System.
Reflection
.Emit or source generators as faster, more modern alternatives to runtime
reflection
for code generation scenarios?
C# › Attributes & Reflection
C#
Attributes
&
Reflection
Advanced
10
What is an attribute in C#, and how do you apply one to a class or method?
C# › Attributes & Reflection
C#
Attributes
&
Reflection
Beginner
11
How do you create a custom attribute class, and what does AttributeUsage control?
C# › Attributes & Reflection
C#
Attributes
&
Reflection
Intermediate
12
How do generic
attributes
(introduced in C# 11) work, and what limitation did they finally remove compared to older attribute usage patterns?
C# › Generics
C#
Generics
Advanced
13
How do you create a 'flags' enum that supports combining multiple values using bitwise operations?
C# › Enums & Flags
C#
Enums & Flags
Intermediate
14
How does the 'file' access modifier (C# 11) create a type visible ONLY within its own source file, and what problem does this solve for source generators?
C# › Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)
C#
Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)
Advanced