What is the exact name of a specific namespace of a core library in a given programming language?
Asked in the Onsite Interview stage. Candidate was asked granular development-level questions regarding exact library and namespace naming during the technical dive deep portion.
Implement resolve_namespace(imports, target) for Python import statements. Return the module namespace associated with target, or None if the target is not imported. Support import module, import module as alias, from module import name, and from module import name as alias. Each line contains one import and may have a trailing comment.
def resolve_namespace(imports, target):