All fields

“Annotations” in Information Technology

25 questions across 4 technologies.

Information Technology

25 questions in 4 technologies

#QuestionTechnologyTopicLevel
1What are annotations in Java, and what purpose do they serve? Java › AnnotationsJavaAnnotationsBeginner
2What do the built-in @Override, @Deprecated, and @SuppressWarnings annotations do? Java › AnnotationsJavaAnnotationsBeginner
3How do you apply multiple different annotations to the same element, and does their order matter? Java › AnnotationsJavaAnnotationsBeginner
4What are Java's meta-annotations (@Retention, @Target, @Documented, @Inherited), and what does each control? Java › AnnotationsJavaAnnotationsIntermediate
5How do annotations with elements (parameters) work, including default values and the special `value` element? Java › AnnotationsJavaAnnotationsIntermediate
6What is the difference between the @Nullable/@NonNull annotations (from libraries like JetBrains or JSR-305) and Java's built-in Optional type for expressing nullability? Java › AnnotationsJavaAnnotationsIntermediate
7How 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
8How do repeatable annotations work in Java (using @Repeatable), and what problem do they solve? Java › AnnotationsJavaAnnotationsAdvanced
9How do type annotations (introduced in Java 8, JSR 308) differ from traditional declaration annotations, and what new locations can they target? Java › AnnotationsJavaAnnotationsAdvanced
10How does a marker interface (an interface with no methods at all, like Serializable or Cloneable) work, and what's the modern alternative approach (annotations) for achieving similar 'tagging' purposes? Java › Interfaces & Abstract ClassesJavaInterfaces & Abstract ClassesAdvanced
11How do nullable annotations affect API design? C# › Nullable Reference TypesC#Nullable Reference TypesIntermediate
12How do rest parameters work with type annotations, and what type must the annotation be? TypeScript › Function Types, Overloads & Optional/Default ParametersTypeScriptFunction Types, Overloads & Optional/Default ParametersIntermediate
13How do you share validation logic between a Blazor form (using EditForm and DataAnnotationsValidator) and a corresponding ASP.NET Core Web API's model validation? ASP.NET Core › Blazor Integration with ASP.NET CoreASP.NET CoreBlazor Integration with ASP.NET CoreIntermediate
14How do 'this' parameter annotations work in a function type, and what problem do they solve? TypeScript › Function Types, Overloads & Optional/Default ParametersTypeScriptFunction Types, Overloads & Optional/Default ParametersAdvanced
15How do you validate configuration options at application startup to fail fast on misconfiguration, using ValidateDataAnnotations and ValidateOnStart? ASP.NET Core › Configuration & Options PatternASP.NET CoreConfiguration & Options PatternAdvanced
16How do you write a custom IValidateOptions<T> implementation for validation logic beyond what DataAnnotations attributes can express? ASP.NET Core › Configuration & Options PatternASP.NET CoreConfiguration & Options PatternAdvanced
17How would you use Lombok's @EqualsAndHashCode and @ToString annotations to eliminate equals()/hashCode()/toString() boilerplate, and what specific configuration options handle inheritance and field exclusion correctly? Java › equals(), hashCode() & toString() ContractsJavaequals(), hashCode() & toString() ContractsAdvanced
18How do you create a custom annotation in Java, and what role do @Retention and @Target play? Java › AnnotationsJavaAnnotationsIntermediate
19What is the difference between compile-time annotation processing (via javax.annotation.processing.Processor) and runtime reflection-based annotation reading? Java › AnnotationsJavaAnnotationsIntermediate
20What is the purpose of the @FunctionalInterface annotation, and is it required for an interface to actually be treated as a functional interface? Java › AnnotationsJavaAnnotationsIntermediate
21How would you implement annotation-based validation (similar to Bean Validation's @NotNull, @Size) using a custom annotation and a reflection-based validator? Java › AnnotationsJavaAnnotationsAdvanced
22How does Java's annotation processing API (javax.annotation.processing) enable compile-time code generation frameworks like Lombok or Dagger, and what are its key limitations? Java › AnnotationsJavaAnnotationsAdvanced
23How would you design a custom annotation-driven caching mechanism (similar to Spring's @Cacheable) using a dynamic proxy combined with reflection? Java › AnnotationsJavaAnnotationsAdvanced
24What is the difference between a compile-time constant expression and a regular final variable, and why does this distinction matter for switch statement case labels and certain compiler optimizations? Java › Java Fundamentals: Syntax, Data Types & OperatorsJavaJava Fundamentals: Syntax, Data Types & OperatorsIntermediate
25How would you use the 'requires static' directive to declare an optional, compile-time-only dependency that isn't required to be present at runtime? Java › Java Platform Module System (JPMS)JavaJava Platform Module System (JPMS)Advanced