← All Spring Framework Flashcard Decks

Spring Core & Dependency Injection Flashcards

6 cards from real Spring Framework practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 6 Spring Core & Dependency Injection flashcards as text
  1. What annotation limits the @Autowired candidate beans to a specific name?

    Answer: @Qualifier

    @Qualifier is used alongside @Autowired to narrow down the injection candidate when multiple beans of the same type exist.

  2. Which interface must be implemented to create a custom BeanPostProcessor in Spring?

    Answer: BeanPostProcessor

    Implementing the BeanPostProcessor interface allows custom logic to be applied before and after a bean's initialization callbacks.

  3. How do you specify the initialization method for a Spring bean in a @Bean definition?

    Answer: @Bean(initMethod="methodName")

    The initMethod attribute of @Bean specifies the name of the method to call after the bean is initialized by the container.

  4. What is the purpose of @Primary in Spring dependency injection?

    Answer: Designates a bean as the default candidate when multiple beans of the same type exist

    @Primary designates a bean as the preferred candidate for auto-wiring when multiple beans of the same type are present in the container.

  5. What is a Spring bean's lifecycle callback that executes before the bean is destroyed?

    Answer: @PreDestroy

    @PreDestroy marks a method to be called just before the bean is removed from the container, allowing cleanup of resources.

  6. In Spring, what is meant by 'circular dependency'?

    Answer: Two or more beans that depend on each other either directly or indirectly

    A circular dependency occurs when Bean A depends on Bean B and Bean B depends on Bean A, which can cause Spring to throw a BeanCurrentlyInCreationException with constructor injection.

How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy

Sources & references

Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy

  1. docs.broadcom.com — Test delivery, retake policy, exam information · verified Oct 2026
  2. spring-academy.broadcom.com — Eligibility · verified Oct 2026
  3. broadcom.com — Fees, exam format, passing score, time limit · verified Oct 2026