Q: How kafka works? Q: How spring work? What's IoC? What's the difference between @Bean and @Component? Q: How mongodb indexing works? what's CDC?
For the coding portion, model the Spring IoC part as a dependency graph. Given component definitions and requested root components, return a deterministic initialization order in which every dependency appears before the component that requires it. Return an empty list if a dependency is missing or the reachable graph contains a cycle.
components maps component names to dependency-name arrays. requested is an array of root component names. Return a list of names or [].
def resolve_ioc_order(components, requested):