Java Interview Preparation
Auto-Configuration Interview Questions
Conditional configuration, auto-configuration internals, exclusions, and diagnostics.
Auto-Configuration Interview Focus
Conditional configuration, auto-configuration internals, exclusions, and diagnostics.
Interview questions
1. What is Spring Boot auto-configuration? Beginner
Auto-configuration configures common Spring components automatically when the required classes are present and the application has not already supplied its own bean. It is conditional, so it backs away when your configuration takes control.
2. How does auto-configuration work internally? Advanced
Auto-configuration configures common Spring components automatically when the required classes are present and the application has not already supplied its own bean. It is conditional, so it backs away when your configuration takes control.
3. What is the purpose of @EnableAutoConfiguration? Intermediate
@EnableAutoConfiguration tells Spring Boot to consider its auto-configuration classes. @SpringBootApplication already includes this annotation, so it is rarely written separately.
4. How does Spring Boot decide which auto-configurations to apply? Advanced
Auto-configuration configures common Spring components automatically when the required classes are present and the application has not already supplied its own bean. It is conditional, so it backs away when your configuration takes control.
5. What are conditional annotations in Spring Boot? Intermediate
Conditional annotations apply configuration only when a condition is true. They allow Boot to check classes, properties, beans, resources, or application type before creating a bean.
6. What is @ConditionalOnClass? Intermediate
@ConditionalOnClass activates a configuration only when a specified class is available on the classpath. It prevents configuration from being applied when its library is not installed.
7. What is @ConditionalOnMissingBean? Intermediate
@ConditionalOnMissingBean creates a default bean only when the application has not already defined a matching bean. This lets developers replace Boot’s default safely.
8. How can you exclude a specific auto-configuration? Intermediate
Auto-configuration configures common Spring components automatically when the required classes are present and the application has not already supplied its own bean. It is conditional, so it backs away when your configuration takes control.
9. How can you debug auto-configuration? Advanced
Auto-configuration configures common Spring components automatically when the required classes are present and the application has not already supplied its own bean. It is conditional, so it backs away when your configuration takes control.
10. What is the auto-configuration report? Advanced
Auto-configuration configures common Spring components automatically when the required classes are present and the application has not already supplied its own bean. It is conditional, so it backs away when your configuration takes control.
How to Prepare for Java Technical Interviews
Use this Java technical interview question bank to revise core concepts and practise explaining your decisions clearly. The questions cover Java fundamentals, object-oriented programming, collections, exceptions, multithreading, Spring Boot, Hibernate, databases, and other topics used in real software development interviews.
Start with the fundamentals, then move to scenario-based questions and advanced topics. Filter questions by difficulty to build confidence gradually. A strong answer should define the concept, explain why it matters, and include a practical example when appropriate.
Continue your preparation with the Java tutorials, or explore all interview preparation tracks for managerial and company-focused questions.
