2. Bean Lifecycle and Scope
What scopes are available: singleton, prototype, request, and session? Which one is the default?
What is the difference between the Spring Singleton scope and the Singleton design pattern?
What happens if a prototype bean is injected into a singleton bean?
What is the bean lifecycle, from creation to destruction, and what are its stages?
What do @PostConstruct and @PreDestroy do?
What are BeanPostProcessor and BeanFactoryPostProcessor? How do they differ?
What is @Lazy, and when is it needed?
What are profiles (@Profile), and how can they be used to manage environments?