Modules & Packaging interview questions

15 real Modules & Packaging questions from the Python bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What is module?

Junior
  1. A.a single .py file whose top-level names become attributes importable elsewhere
  2. B.an isolated directory with its own interpreter and installed packages, keeping project dependencies separate
  3. C.the standardized configuration file declaring build system, metadata, and dependencies for a project
  4. D.a directory of related modules, traditionally marked by an __init__ file, imported as a namespace
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. A.module — the if check comparing the module's name to "__main__" to run code only when executed directly, not imported
  2. B.module — a single .py file whose top-level names become attributes importable elsewhere
  3. C.module — a directory of related modules, traditionally marked by an __init__ file, imported as a namespace
  4. D.module — the standardized configuration file declaring build system, metadata, and dependencies for a project
Reveal the answer + AI explanation — free account

4. What is package?

Junior
  1. A.the if check comparing the module's name to "__main__" to run code only when executed directly, not imported
  2. B.an isolated directory with its own interpreter and installed packages, keeping project dependencies separate
  3. C.a single .py file whose top-level names become attributes importable elsewhere
  4. D.a directory of related modules, traditionally marked by an __init__ file, imported as a namespace
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Junior
  1. A.package — an isolated directory with its own interpreter and installed packages, keeping project dependencies separate
  2. B.package — a directory of related modules, traditionally marked by an __init__ file, imported as a namespace
  3. C.package — a single .py file whose top-level names become attributes importable elsewhere
  4. D.package — the standardized configuration file declaring build system, metadata, and dependencies for a project
Reveal the answer + AI explanation — free account

7. What is __name__ guard?

Mid
  1. A.the if check comparing the module's name to "__main__" to run code only when executed directly, not imported
  2. B.a directory of related modules, traditionally marked by an __init__ file, imported as a namespace
  3. C.an isolated directory with its own interpreter and installed packages, keeping project dependencies separate
  4. D.a single .py file whose top-level names become attributes importable elsewhere
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Mid
  1. A.__name__ guard — a single .py file whose top-level names become attributes importable elsewhere
  2. B.__name__ guard — a directory of related modules, traditionally marked by an __init__ file, imported as a namespace
  3. C.__name__ guard — an isolated directory with its own interpreter and installed packages, keeping project dependencies separate
  4. D.__name__ guard — the if check comparing the module's name to "__main__" to run code only when executed directly, not imported
Reveal the answer + AI explanation — free account

10. What is pyproject.toml?

Mid
  1. A.a single .py file whose top-level names become attributes importable elsewhere
  2. B.the standardized configuration file declaring build system, metadata, and dependencies for a project
  3. C.a directory of related modules, traditionally marked by an __init__ file, imported as a namespace
  4. D.the if check comparing the module's name to "__main__" to run code only when executed directly, not imported
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Mid
  1. A.pyproject.toml — the standardized configuration file declaring build system, metadata, and dependencies for a project
  2. B.pyproject.toml — an isolated directory with its own interpreter and installed packages, keeping project dependencies separate
  3. C.pyproject.toml — a single .py file whose top-level names become attributes importable elsewhere
  4. D.pyproject.toml — the if check comparing the module's name to "__main__" to run code only when executed directly, not imported
Reveal the answer + AI explanation — free account

13. What is virtual environment?

Senior
  1. A.a directory of related modules, traditionally marked by an __init__ file, imported as a namespace
  2. B.an isolated directory with its own interpreter and installed packages, keeping project dependencies separate
  3. C.the standardized configuration file declaring build system, metadata, and dependencies for a project
  4. D.a single .py file whose top-level names become attributes importable elsewhere
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Senior
  1. A.virtual environment — the standardized configuration file declaring build system, metadata, and dependencies for a project
  2. B.virtual environment — the if check comparing the module's name to "__main__" to run code only when executed directly, not imported
  3. C.virtual environment — a directory of related modules, traditionally marked by an __init__ file, imported as a namespace
  4. D.virtual environment — an isolated directory with its own interpreter and installed packages, keeping project dependencies separate
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice Modules & Packaging free