The IoC (Inversion of Control) Container is the core component of the Spring Framework responsible for creating, configuring, and managing Spring Beans. It controls the lifecycle of objects and automatically injects required dependencies, enabling loose coupling between application components.
In a Spring application, if a UserService depends on a UserRepository, the IoC container creates both objects and automatically injects the UserRepository into the UserService without requiring manual object creation.
@Service
public class UserService {
@Autowired
private UserRepository userRepository;
}A concise interview answer is
The IoC container is the core of Spring. It manages the creation, configuration, and lifecycle of beans and automatically injects dependencies, helping build loosely coupled, maintainable, and testable applications.
Last updated: 11 November 2026
Previous question: What are IoC and dependency injection (DI) in Spring?
Next question: What are the types of IoC containers in Spring?