30 Beans & DI questions from the Spring bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.
Free to start: the 2-minute IT readiness check — six questions and a result.
A.wiring directly onto a private member via reflection, discouraged because it hides dependencies and breaks plain testability
B.a method-level annotation inside a configuration class declaring that the returned object should be registered in the container
C.supplying an object's collaborators from outside rather than having the object construct them itself
D.the preferred wiring style passing dependencies as parameters, enabling immutable and final fields and easier unit testing
Answer + AI explanation with Pro
2. Which term means: "supplying an object's collaborators from outside rather than having the object construct them itself"?
Junior
A.Prototype scope
B.@Configuration
C.@Primary
D.Dependency injection
Answer + AI explanation with Pro
3. Which statement is correct?
Junior
A.Dependency injection — the default lifecycle where the container creates exactly one shared instance per context
B.Dependency injection — a method-level annotation inside a configuration class declaring that the returned object should be registered in the container
C.Dependency injection — a lifecycle where the container produces a brand-new instance on every request for that bean
D.Dependency injection — supplying an object's collaborators from outside rather than having the object construct them itself
Answer + AI explanation with Pro
4. What is @Autowired?
Junior
A.an annotation that disambiguates which candidate to inject when several beans of the same type exist
B.an annotation that tells the container to resolve and inject a matching collaborator by type
C.supplying an object's collaborators from outside rather than having the object construct them itself
D.a class-level annotation marking a source of bean definitions whose factory methods are proxied for singleton guarantees
Answer + AI explanation with Pro
5. Which term means: "an annotation that tells the container to resolve and inject a matching collaborator by type"?
Junior
A.@Autowired
B.Field injection
C.Constructor injection
D.Singleton scope
Answer + AI explanation with Pro
6. Which statement is correct?
Junior
A.@Autowired — an annotation marking one candidate as the default choice when multiple of a type could be injected
B.@Autowired — wiring directly onto a private member via reflection, discouraged because it hides dependencies and breaks plain testability
C.@Autowired — an annotation that tells the container to resolve and inject a matching collaborator by type
D.@Autowired — the preferred wiring style passing dependencies as parameters, enabling immutable and final fields and easier unit testing
Answer + AI explanation with Pro
7. What is Constructor injection?
Mid
A.an annotation marking one candidate as the default choice when multiple of a type could be injected
B.the preferred wiring style passing dependencies as parameters, enabling immutable and final fields and easier unit testing
C.wiring directly onto a private member via reflection, discouraged because it hides dependencies and breaks plain testability
D.an annotation that tells the container to resolve and inject a matching collaborator by type
Answer + AI explanation with Pro
8. Which term means: "the preferred wiring style passing dependencies as parameters, enabling immutable and final fields and easier unit testing"?
Mid
A.Constructor injection
B.@Bean
C.Singleton scope
D.@Qualifier
Answer + AI explanation with Pro
9. Which statement is correct?
Mid
A.Constructor injection — an annotation that tells the container to resolve and inject a matching collaborator by type
B.Constructor injection — a lifecycle where the container produces a brand-new instance on every request for that bean
C.Constructor injection — the preferred wiring style passing dependencies as parameters, enabling immutable and final fields and easier unit testing
D.Constructor injection — the default lifecycle where the container creates exactly one shared instance per context
Answer + AI explanation with Pro
10. What is Field injection?
Mid
A.a lifecycle where the container produces a brand-new instance on every request for that bean
B.an annotation marking one candidate as the default choice when multiple of a type could be injected
C.wiring directly onto a private member via reflection, discouraged because it hides dependencies and breaks plain testability
D.a method-level annotation inside a configuration class declaring that the returned object should be registered in the container
Answer + AI explanation with Pro
11. Which term means: "wiring directly onto a private member via reflection, discouraged because it hides dependencies and breaks plain testability"?
Mid
A.Dependency injection
B.Field injection
C.@Qualifier
D.Constructor injection
Answer + AI explanation with Pro
12. Which statement is correct?
Mid
A.Field injection — a method-level annotation inside a configuration class declaring that the returned object should be registered in the container
B.Field injection — an annotation marking one candidate as the default choice when multiple of a type could be injected
C.Field injection — a class-level annotation marking a source of bean definitions whose factory methods are proxied for singleton guarantees
D.Field injection — wiring directly onto a private member via reflection, discouraged because it hides dependencies and breaks plain testability
Answer + AI explanation with Pro
13. What is Singleton scope?
Junior
A.an annotation that disambiguates which candidate to inject when several beans of the same type exist
B.an annotation marking one candidate as the default choice when multiple of a type could be injected
C.a lifecycle where the container produces a brand-new instance on every request for that bean
D.the default lifecycle where the container creates exactly one shared instance per context
Answer + AI explanation with Pro
14. Which term means: "the default lifecycle where the container creates exactly one shared instance per context"?
Junior
A.Constructor injection
B.Dependency injection
C.@Configuration
D.Singleton scope
Answer + AI explanation with Pro
15. Which statement is correct?
Junior
A.Singleton scope — a method-level annotation inside a configuration class declaring that the returned object should be registered in the container
B.Singleton scope — the default lifecycle where the container creates exactly one shared instance per context
C.Singleton scope — the preferred wiring style passing dependencies as parameters, enabling immutable and final fields and easier unit testing
D.Singleton scope — a lifecycle where the container produces a brand-new instance on every request for that bean
Answer + AI explanation with Pro
16. What is Prototype scope?
Mid
A.supplying an object's collaborators from outside rather than having the object construct them itself
B.wiring directly onto a private member via reflection, discouraged because it hides dependencies and breaks plain testability
C.an annotation marking one candidate as the default choice when multiple of a type could be injected
D.a lifecycle where the container produces a brand-new instance on every request for that bean
Answer + AI explanation with Pro
17. Which term means: "a lifecycle where the container produces a brand-new instance on every request for that bean"?
Mid
A.Dependency injection
B.Singleton scope
C.Prototype scope
D.Constructor injection
Answer + AI explanation with Pro
18. Which statement is correct?
Mid
A.Prototype scope — an annotation that disambiguates which candidate to inject when several beans of the same type exist
B.Prototype scope — a lifecycle where the container produces a brand-new instance on every request for that bean
C.Prototype scope — an annotation marking one candidate as the default choice when multiple of a type could be injected
D.Prototype scope — the default lifecycle where the container creates exactly one shared instance per context
Answer + AI explanation with Pro
19. What is @Qualifier?
Mid
A.an annotation that disambiguates which candidate to inject when several beans of the same type exist
B.the preferred wiring style passing dependencies as parameters, enabling immutable and final fields and easier unit testing
C.a method-level annotation inside a configuration class declaring that the returned object should be registered in the container
D.supplying an object's collaborators from outside rather than having the object construct them itself
Answer + AI explanation with Pro
20. Which term means: "an annotation that disambiguates which candidate to inject when several beans of the same type exist"?
Mid
A.@Autowired
B.Constructor injection
C.@Qualifier
D.@Configuration
Answer + AI explanation with Pro
21. Which statement is correct?
Mid
A.@Qualifier — supplying an object's collaborators from outside rather than having the object construct them itself
B.@Qualifier — an annotation marking one candidate as the default choice when multiple of a type could be injected
C.@Qualifier — a class-level annotation marking a source of bean definitions whose factory methods are proxied for singleton guarantees
D.@Qualifier — an annotation that disambiguates which candidate to inject when several beans of the same type exist
Answer + AI explanation with Pro
22. What is @Primary?
Mid
A.an annotation that disambiguates which candidate to inject when several beans of the same type exist
B.wiring directly onto a private member via reflection, discouraged because it hides dependencies and breaks plain testability
C.an annotation marking one candidate as the default choice when multiple of a type could be injected
D.an annotation that tells the container to resolve and inject a matching collaborator by type
Answer + AI explanation with Pro
23. Which term means: "an annotation marking one candidate as the default choice when multiple of a type could be injected"?
Mid
A.@Bean
B.Dependency injection
C.@Primary
D.@Autowired
Answer + AI explanation with Pro
24. Which statement is correct?
Mid
A.@Primary — an annotation that tells the container to resolve and inject a matching collaborator by type
B.@Primary — a lifecycle where the container produces a brand-new instance on every request for that bean
C.@Primary — the preferred wiring style passing dependencies as parameters, enabling immutable and final fields and easier unit testing
D.@Primary — an annotation marking one candidate as the default choice when multiple of a type could be injected
Answer + AI explanation with Pro
25. What is @Bean?
Mid
A.a lifecycle where the container produces a brand-new instance on every request for that bean
B.the preferred wiring style passing dependencies as parameters, enabling immutable and final fields and easier unit testing
C.a method-level annotation inside a configuration class declaring that the returned object should be registered in the container
D.the default lifecycle where the container creates exactly one shared instance per context
Answer + AI explanation with Pro
26. Which term means: "a method-level annotation inside a configuration class declaring that the returned object should be registered in the container"?
Mid
A.Field injection
B.@Configuration
C.Prototype scope
D.@Bean
Answer + AI explanation with Pro
27. Which statement is correct?
Mid
A.@Bean — the preferred wiring style passing dependencies as parameters, enabling immutable and final fields and easier unit testing
B.@Bean — a lifecycle where the container produces a brand-new instance on every request for that bean
C.@Bean — a method-level annotation inside a configuration class declaring that the returned object should be registered in the container
D.@Bean — supplying an object's collaborators from outside rather than having the object construct them itself
Answer + AI explanation with Pro
28. What is @Configuration?
Mid
A.the preferred wiring style passing dependencies as parameters, enabling immutable and final fields and easier unit testing
B.an annotation marking one candidate as the default choice when multiple of a type could be injected
C.a lifecycle where the container produces a brand-new instance on every request for that bean
D.a class-level annotation marking a source of bean definitions whose factory methods are proxied for singleton guarantees
Answer + AI explanation with Pro
29. Which term means: "a class-level annotation marking a source of bean definitions whose factory methods are proxied for singleton guarantees"?
Mid
A.@Bean
B.Dependency injection
C.@Configuration
D.@Autowired
Answer + AI explanation with Pro
30. Which statement is correct?
Mid
A.@Configuration — a class-level annotation marking a source of bean definitions whose factory methods are proxied for singleton guarantees
B.@Configuration — a method-level annotation inside a configuration class declaring that the returned object should be registered in the container
C.@Configuration — wiring directly onto a private member via reflection, discouraged because it hides dependencies and breaks plain testability
D.@Configuration — an annotation that disambiguates which candidate to inject when several beans of the same type exist
Answer + AI explanation with Pro
Free to start
Start with a free readiness check
Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every Beans & DI question come with Pro.