All fields

“Reflection API” in Information Technology

17 questions across 3 technologies.

Information Technology

17 questions in 3 technologies

#QuestionTechnologyTopicLevel
1What is reflection in C#, and what are its most common practical uses and performance trade-offs? C# › Attributes & ReflectionC#Attributes & ReflectionIntermediate
2What is the difference between compile-time annotation processing (via javax.annotation.processing.Processor) and runtime reflection-based annotation reading? Java › AnnotationsJavaAnnotationsIntermediate
3How would you use a Class<T> token parameter to work around type erasure when a generic method genuinely needs runtime access to the actual type argument, such as for deserialization or reflection-based instantiation? Java › GenericsJavaGenericsIntermediate
4What is the difference between 'exports' and 'opens' in a module-info.java file, and why does reflection-heavy code (like many dependency injection or serialization frameworks) specifically require the latter? Java › Java Platform Module System (JPMS)JavaJava Platform Module System (JPMS)Intermediate
5How would you read custom annotations at runtime using reflection to implement annotation-driven behavior, such as a simple dependency injection or validation framework? Java › AnnotationsJavaAnnotationsAdvanced
6How would you implement annotation-based validation (similar to Bean Validation's @NotNull, @Size) using a custom annotation and a reflection-based validator? Java › AnnotationsJavaAnnotationsAdvanced
7How would you design a custom annotation-driven caching mechanism (similar to Spring's @Cacheable) using a dynamic proxy combined with reflection? Java › AnnotationsJavaAnnotationsAdvanced
8How does JPMS's strong encapsulation interact with reflection-heavy frameworks and libraries that predate the module system, and what specific JVM flags (like --add-opens) exist as an escape hatch for cases where proper module declarations aren't feasible? Java › Java Platform Module System (JPMS)JavaJava Platform Module System (JPMS)Advanced
9How do you enable and use gRPC reflection for service discovery and debugging tools like grpcurl or Postman? ASP.NET Core › gRPC ServicesASP.NET CoregRPC ServicesIntermediate
10What are annotations in Java, and what purpose do they serve? Java › AnnotationsJavaAnnotationsBeginner
11What is the role of the ClassLoader in the JVM, and what are the three built-in bootstrap/platform/application class loaders? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationBeginner
12How do you programmatically load a class by its fully-qualified name at runtime using Class.forName(), and what is a common real-world use case for this? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationBeginner
13How do you create a custom annotation in Java, and what role do @Retention and @Target play? Java › AnnotationsJavaAnnotationsIntermediate
14What are Java's meta-annotations (@Retention, @Target, @Documented, @Inherited), and what does each control? Java › AnnotationsJavaAnnotationsIntermediate
15How does the Java Platform Module System (JPMS, introduced in Java 9) change class loading and encapsulation compared to the traditional classpath model? Java › Class Loading & Bytecode VerificationJavaClass Loading & Bytecode VerificationIntermediate
16What is type erasure, and how does it explain why generic type information is unavailable at runtime (e.g., why you can't do `if (obj instanceof List<String>)`)? Java › GenericsJavaGenericsIntermediate
17How do repeatable annotations work in Java (using @Repeatable), and what problem do they solve? Java › AnnotationsJavaAnnotationsAdvanced