Loading

Quipoin Menu

Learn • Practice • Grow

spring / Weaving Example
mcq
Direction: Choose the correct option

Q1.

What is weaving in AOP?
A. The process of integrating aspects with the main code
B. A type of advice
C. A pointcut expression
D. An aspect
Direction: Choose the correct option

Q2.

When does compile-time weaving occur?
A. During compilation of source code
B. At runtime
C. During class loading
D. After deployment
Direction: Choose the correct option

Q3.

What is load-time weaving (LTW)?
A. Weaving when classes are loaded into the JVM
B. Weaving during compilation
C. Weaving at runtime
D. None
Direction: Choose the correct option

Q4.

Which type of weaving does Spring AOP primarily use?
A. Runtime proxy-based weaving
B. Compile-time weaving
C. Load-time weaving
D. All of the above
Direction: Choose the correct option

Q5.

What is required for load-time weaving in Spring?
A. AOP XML configuration with load-time weaver
B. @EnableLoadTimeWeaving
C. AspectJ Weaver JAR
D. All of the above
Direction: Choose the correct option

Q6.

What is the difference between JDK dynamic proxy and CGLIB proxy?
A. JDK proxy requires interfaces; CGLIB works with classes
B. JDK proxy is faster
C. CGLIB is newer
D. None
Direction: Choose the correct option

Q7.

How does Spring decide which proxy mechanism to use?
A. If target implements at least one interface, JDK proxy; otherwise CGLIB
B. Always uses JDK
C. Always uses CGLIB
D. Configurable
Direction: Choose the correct option

Q8.

What is the purpose of the @EnableAspectJAutoProxy annotation?
A. To enable support for processing @Aspect annotations
B. To enable load-time weaving
C. To enable compile-time weaving
D. None
Direction: Choose the exact option

Q9.

What is AspectJ weaving?
A. AspectJ provides compile-time and load-time weaving with more power
B. AspectJ is same as Spring AOP
C. AspectJ only does compile-time
D. None
Direction: Choose the correct option

Q10.

In a typical Spring weaving example, which proxy is used for a @Repository class (no interface)?
A. CGLIB proxy
B. JDK dynamic proxy
C. Both
D. None