Modules & Packaging interview questions

15 Modules & Packaging questions from the Python bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.

Free to start: the 2-minute IT readiness check — six questions and a result.

Take the free IT readiness check

or take a mock interview set up for this area

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

Answer + AI explanation with Pro

2. Which term means: "a single .py file whose top-level names become attributes importable elsewhere"?

Junior
  1. A.pyproject.toml
  2. B.virtual environment
  3. C.__name__ guard
  4. D.module

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

5. Which term means: "a directory of related modules, traditionally marked by an __init__ file, imported as a namespace"?

Junior
  1. A.pyproject.toml
  2. B.__name__ guard
  3. C.virtual environment
  4. D.package

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

8. Which term means: "the if check comparing the module's name to "__main__" to run code only when executed directly, not imported"?

Mid
  1. A.__name__ guard
  2. B.virtual environment
  3. C.pyproject.toml
  4. D.module

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

11. Which term means: "the standardized configuration file declaring build system, metadata, and dependencies for a project"?

Mid
  1. A.module
  2. B.pyproject.toml
  3. C.virtual environment
  4. D.__name__ guard

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

14. Which term means: "an isolated directory with its own interpreter and installed packages, keeping project dependencies separate"?

Senior
  1. A.module
  2. B.__name__ guard
  3. C.virtual environment
  4. D.pyproject.toml

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

Free to start

Start with a free readiness check

Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every Modules & Packaging question come with Pro.

Take the free IT readiness check

or take a mock interview set up for this area

24,000+ questions & coding problemsSoftware & IT16,274 questionsGovernment jobs26 examsAptitudenew questions every timeAI practice interviewwith feedback65 topics to practiseMechanical1,149 questionsGATE ME9 papersEngineering Mathematics381 questions2-minute checkfreeDSA Problems1,422Civil1,005 questionsGATE CE9 papersCS Fundamentals1,209 questionsYour scores6 skillsSystem Design25Electrical / EEE1,047 questionsGATE EE9 papersRun your codeC++ · Java · PythonLow-Level Design144Electronics & Comm.975 questionsGATE EC9 papersAI help on every questionFull-Stack6,282Chemical1,005 questionsGATE CH9 papersAI whiteboardsystem designWork abroadEurope · remote · transfersESE ME1 paperGATE practice papers2019–2026ESE CE1 paperDate alertsbefore the last dateESE EE1 paperBehavioural courseHR round practiceESE ET1 paperResume optimizerProSSC JE ME1 paperApplication trackerSSC JE CE1 paperCompany-wise prepSSC JE EE1 paperRole roadmapsRRB JE1 subjectPriced in ₹UPI · cardsISRO SC1 paperGATE CS9 papersIBPS SO IT1 paperUGC NET CS1 paperSSC CGL26 papersIBPS PO26 papersRRB NTPC26 papersSSC CHSL26 papersIBPS Clerk26 papersSBI Clerk26 papersRRB Group D26 papersSSC CPO26 papersSSC GD26 papers