Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.
Modules, Packages & LibrariesEasy
Q1. What is a module in programming?
- A.A data structure for storing elements
- B.A variable type for storing data values
- C.A self-contained unit of related code✓ Correct
- D.A type of iterative loop construct
Explanation
A module is a file or unit containing related code that can be imported and used by other parts of the program.
Report an error in this question
Modules, Packages & LibrariesEasy
Q2. What is the purpose of the import statement?
- A.To include functionality from another module✓ Correct
- B.To delete a module from the project files
- C.To compile code into executable binaries
- D.To export code to other modules or files
Explanation
The import statement brings in definitions from another module, making them available in the current file.
Report an error in this question
Modules, Packages & LibrariesEasy
Q3. What is a package in Python?
- A.A single Python source code file only
- B.A Python class with methods and attributes
- C.A directory containing modules and __init__.py✓ Correct
- D.A standalone Python function definition
Explanation
In Python, a package is a directory containing Python modules and typically an __init__.py file.
Report an error in this question
Modules, Packages & LibrariesEasy
Q4. What is an API?
- A.A general-purpose programming language for development
- B.A relational database for storing structured data records
- C.A set of definitions and protocols for software integration✓ Correct
- D.A compiler that translates source code to machine language
Explanation
An API defines how software components should interact.
Report an error in this question
Modules, Packages & LibrariesEasy
Q5. What is npm?
- A.A Python-specific development tool only
- B.A database for storing application data values
- C.A compiler for JavaScript source code files
- D.Node Package Manager for JavaScript packages✓ Correct
Explanation
npm is the default package manager for Node.js.
Report an error in this question
Modules, Packages & LibrariesEasy
Q6. What is the difference between a module and a package?
- A.They are exactly the same thing with different names
- B.A module is a single file; a package is a collection✓ Correct
- C.A package is smaller in size compared to a module
- D.A module contains multiple packages within itself
Explanation
A module is typically a single file; a package is a directory or collection of related modules.
Report an error in this question
Modules, Packages & LibrariesEasy
Q7. What is pip in Python?
- A.A general-purpose programming language for development
- B.A compiler that converts Python to machine code binary
- C.A debugger tool for finding errors in Python programs
- D.The package installer for Python that downloads packages✓ Correct
Explanation
pip is Python's package manager used to install and manage third-party packages from PyPI.
Report an error in this question
Modules, Packages & LibrariesEasy
Q8. What is a library in programming?
- A.A collection of pre-written reusable code modules✓ Correct
- B.A place for storing reference books and manuals
- C.An integrated development environment application
- D.A single function defined in the source code file
Explanation
A library is a collection of pre-written, reusable code organized into modules or packages.
Report an error in this question
Modules, Packages & LibrariesMedium
Q9. What is a package.json file?
- A.A database schema definition for SQL table structures
- B.A log file recording application events and errors
- C.A Node.js config file listing metadata and dependencies✓ Correct
- D.A generic JSON data file for storing values
Explanation
package.json is the manifest file for Node.js projects, defining project metadata, scripts, and dependencies.
Report an error in this question
Modules, Packages & LibrariesMedium
Q10. What is dependency management?
- A.Managing memory allocation for program variables only
- B.Tracking and maintaining external libraries and versions✓ Correct
- C.Sorting functions in alphabetical order within modules
- D.Managing source code files in a project directory
Explanation
Dependency management involves tracking which external libraries a project needs and resolving version conflicts.
Report an error in this question
Modules, Packages & LibrariesEasy
Q11. What does 'from math import sqrt' do in Python?
- A.Creates a new sqrt function in the current file
- B.Imports only the sqrt function from math module✓ Correct
- C.Deletes the sqrt function from the math module
- D.Imports the entire math module with all functions
Explanation
This imports only the specified function from the math module.
Report an error in this question
Modules, Packages & LibrariesEasy
Q12. What is a namespace?
- A.A string type for storing text data values in memory
- B.A file extension that identifies the programming language
- C.A container for identifiers to avoid naming conflicts✓ Correct
- D.A variable name in the source code program
Explanation
A namespace provides a scope for identifiers, preventing naming conflicts.
Report an error in this question
Modules, Packages & LibrariesMedium
Q13. What is tree shaking?
- A.A data structure operation on binary tree nodes only
- B.A sorting technique that organizes elements by weight
- C.Removing trees from the project code repository
- D.Removing unused dead code from the final build bundle✓ Correct
Explanation
Tree shaking eliminates unused code from the final bundle, reducing its size.
Report an error in this question
Modules, Packages & LibrariesMedium
Q14. What is a circular dependency?
- A.When two or more modules depend on each other✓ Correct
- B.A circular buffer data structure for streaming
- C.A loop in the code that repeats indefinitely
- D.A recursive function calling itself repeatedly
Explanation
A circular dependency occurs when module A depends on module B and module B depends on module A.
Report an error in this question
Modules, Packages & LibrariesMedium
Q15. What is the difference between devDependencies and dependencies in npm?
- A.devDependencies are completely optional and never actually installed
- B.dependencies are operating system packages not application libraries
- C.There is no meaningful difference between the two dependency types
- D.dependencies are for production; devDependencies for development only✓ Correct
Explanation
dependencies are packages required to run the application. devDependencies are needed only during development.
Report an error in this question
Modules, Packages & LibrariesMedium
Q16. What is the purpose of a lock file (e.g., package-lock.json)?
- A.To lock the project and prevent any code changes
- B.To encrypt installed packages for secure data storage use
- C.To record exact dependency versions for reproducible builds✓ Correct
- D.To prevent anyone from making changes to the source code
Explanation
Lock files record the exact resolved version of every dependency for identical installations across machines.
Report an error in this question
Modules, Packages & LibrariesMedium
Q17. What is a monorepo?
- A.A repository containing only a single source file
- B.A read-only repository that cannot accept any changes
- C.A private repository with restricted access permissions
- D.A single repository containing multiple related projects✓ Correct
Explanation
A monorepo houses multiple projects in a single repository, sharing tools and configurations.
Report an error in this question
Modules, Packages & LibrariesMedium
Q18. What is a virtual environment in Python?
- A.A Docker container with a bundled application inside
- B.An isolated Python environment with its own packages✓ Correct
- C.A cloud-hosted computing environment for deployment
- D.A full virtual machine running a complete OS image
Explanation
A virtual environment creates an isolated Python installation, allowing different projects to have different dependencies.
Report an error in this question
Modules, Packages & LibrariesMedium
Q19. What is semantic versioning (SemVer)?
- A.Alphabetical versioning using letter-based identifiers
- B.Date-based versioning using release date as version
- C.MAJOR.MINOR.PATCH scheme indicating type of changes✓ Correct
- D.Random version numbers assigned without any rules
Explanation
SemVer uses MAJOR.MINOR.PATCH: MAJOR for breaking changes, MINOR for features, PATCH for bug fixes.
Report an error in this question
Modules, Packages & LibrariesMedium
Q20. What is the difference between static and dynamic linking of libraries?
- A.Static includes library at compile time; dynamic loads at runtime✓ Correct
- B.Dynamic linking is always slower than static linking in every case
- C.Static linking uses less memory than dynamic linking at all times
- D.There is no meaningful difference between the two linking methods
Explanation
Static linking embeds library code in the executable. Dynamic linking references shared libraries loaded at runtime.
Report an error in this question
Modules, Packages & LibrariesHard
Q21. What is the difference between CommonJS and ES Modules?
- A.They are identical module systems with no meaningful differences
- B.ES Modules do not support any form of async module loading
- C.CommonJS uses require synchronously; ESM uses import/export✓ Correct
- D.CommonJS is the newer standard developed after ES Modules
Explanation
CommonJS loads modules synchronously at runtime. ES Modules are statically analyzable and support tree shaking.
Report an error in this question
Modules, Packages & LibrariesHard
Q22. What is dependency injection?
- A.Installing package dependencies from the package registry
- B.A package manager for downloading and installing third-party libs
- C.Providing dependencies from outside rather than creating internally✓ Correct
- D.An import statement for including external module code in file
Explanation
Dependency injection provides objects with their dependencies from external sources rather than having them create dependencies internally.
Report an error in this question
Modules, Packages & LibrariesHard
Q23. What is the OSGi framework?
- A.A build tool for compiling and packaging Java applications
- B.A dynamic Java module system supporting runtime bundle mgmt✓ Correct
- C.An operating system for mobile devices and desktops
- D.A testing framework for writing and running automated tests
Explanation
OSGi is a Java framework providing a dynamic component model, allowing modules to be managed at runtime.
Report an error in this question
Modules, Packages & LibrariesHard
Q24. What is a plugin architecture?
- A.A fixed codebase that cannot be extended or modified at all
- B.A build system for compiling and packaging application binaries
- C.A testing framework for automated integration and unit testing
- D.A design allowing runtime extension via external loaded modules✓ Correct
Explanation
A plugin architecture defines extension points allowing third-party modules to add functionality without changing the core code.
Report an error in this question
Modules, Packages & LibrariesHard
Q25. What is the diamond dependency problem in package management?
- A.Two dependencies requiring different versions of the same package✓ Correct
- B.A class inheritance issue in object-oriented programming code
- C.A circular dependency between two modules in the same project
- D.A build error caused by missing configuration files in project
Explanation
The diamond dependency problem occurs when two packages depend on different, incompatible versions of a third package.
Report an error in this question
Modules, Packages & LibrariesHard
Q26. What is ABI (Application Binary Interface) compatibility?
- A.A network protocol for communication between distributed services
- B.The same as API compatibility with no additional constraints
- C.Binary-level interface ensuring compiled modules interact correctly✓ Correct
- D.A data format for serializing objects to disk or network transfer
Explanation
ABI compatibility ensures compiled binaries can work together without recompilation.
Report an error in this question
Modules, Packages & LibrariesHard
Q27. What is the Inversion of Control (IoC) container?
- A.A framework component managing object creation and dependencies✓ Correct
- B.A data structure for storing elements in a specific order only
- C.A reversed loop that iterates in backward order through data
- D.A version control system for tracking changes to source code
Explanation
An IoC container manages the lifecycle and dependencies of objects, automatically creating and injecting dependencies.
Report an error in this question
Modules, Packages & LibrariesHard
Q28. What is the difference between peer dependencies and regular dependencies?
- A.Regular dependencies are always shared between all project packages
- B.There is no meaningful difference between the two dependency types
- C.Peer dependencies require the consumer to provide a shared version✓ Correct
- D.Peer dependencies are completely optional and never need installing
Explanation
Peer dependencies declare that a package expects a specific dependency to be provided by the consuming project.
Report an error in this question
Modules, Packages & LibrariesHard
Q29. What is the Service Provider Interface (SPI) pattern?
- A.A web service for hosting API endpoints on the internet
- B.A physical network interface for connecting hardware devices
- C.A design where providers implement a service-defined interface✓ Correct
- D.A build tool for automating compilation and deployment tasks
Explanation
SPI allows a service to define an interface that third-party implementations fulfill, discovered via mechanisms like Java's ServiceLoader.
Report an error in this question
Modules, Packages & LibrariesHard
Q30. What is reproducible builds and why is it important for packages?
- A.Building projects as fast as possible to save developer time
- B.Building multiple modules in parallel across available cores
- C.Building the same project twice in a row for verification
- D.Ensuring same source always produces bit-identical output binary✓ Correct
Explanation
Reproducible builds guarantee identical binary output from the same source, enabling independent verification.
Report an error in this question