Project Structure interview questions
Continuous Integration, Java Modules (JPMS)
38 questions with answers and explanations · 38 flashcards
Questions
- Why does a build tool like Maven in managing dependencies for a Java project matter in this design?Multiple choiceMedium
- Why might you choose to use integration tests despite their higher resource cost compared to unit tests?Multiple choiceHard
- Why do teams use Continuous Integration in software development in production code?Multiple choiceEasy
- Which JUnit assertion would you use to verify that a method returns a null value?Multiple choiceMedium
- Why is it important to have strong encapsulation in a module system like JPMS?Multiple choiceMedium
- Which of the following strategies can prevent a bad merge into the main branch in a CI/CD workflow?Multiple choiceHard
- In a JPMS setup, what happens if a module exports a package but does not specify which other modules can access it?Multiple choiceMedium
- How would you explain a key advantage of using Gradle over Maven in Java projects in an interview?Multiple choiceEasy
- Why does the module-info.java file in a Java project matter in practice?Multiple choiceEasy
- Which Maven lifecycle phase is responsible for running integration tests?Multiple choiceHard
- Given the following module-info.java, which statement is true regarding package visibility?Multiple choiceHard
- In JPMS, what happens if a module does not explicitly export a package?Multiple choiceMedium
- In a CI pipeline, which type of testing is most effective for verifying the behavior of a service without requiring actual external dependencies?Multiple choiceMedium
- How would you explain a key benefit of using automated testing over manual testing in a Java project in an interview?Multiple choiceMedium
- In a Maven project, what phase of the build lifecycle is responsible for running integration tests?Multiple choiceHard
- How would you explain a key advantage of using Java modules in a project in an interview?Multiple choiceEasy
- Why does a build tool like Maven or Gradle in a Java project matter in practice?Multiple choiceEasy
- What does the 'exports' directive do in a module-info.java file?Multiple choiceMedium
- How does the 'requires transitive' keyword in module-info.java affect module dependencies?Multiple choiceHard
- How does a CI pipeline serve as a quality gatekeeper in software development?Multiple choiceMedium
- In the context of dependency management with Maven, what is the purpose of a 'transitive dependency'?Multiple choiceHard
- Why is it important to configure a CI pipeline to use a clean environment for each build?Multiple choiceMedium
- Which of the following is a common use of mocking in unit tests?Multiple choiceEasy
- In Mockito, which method is used to verify that a mock object's method was called a specific number of times?Multiple choiceHard
- In a Maven project, where should you define a dependency that is only needed for testing?Multiple choiceMedium
- How can a CI pipeline help ensure that the e-commerce application is production-ready after each commit?Multiple choiceHard
- Why do teams use automated tests in a Continuous Integration (CI) pipeline in production code?Multiple choiceEasy
- Which build tool lifecycle phase in Maven is responsible for compiling the source code?Multiple choiceEasy
- Why does not specifying the 'requires' directive for a module in JPMS change runtime behavior?Multiple choiceMedium
- How does mocking help in unit testing an e-commerce application's payment service?Multiple choiceMedium
- Which of the following is a key benefit of using automated tests in a CI/CD pipeline?Multiple choiceEasy
- When setting up a CI pipeline, what is a key consideration for ensuring tests are truly representative of production environments?Multiple choiceHard
- In a CI pipeline for an e-commerce application, what role does mocking play in testing?Multiple choiceMedium
- When using Mockito, how can you verify that a method was called a specific number of times on a mock object?Multiple choiceHard
- Why might you choose to use Mockito for testing in a CI pipeline?Multiple choiceMedium
- In the context of continuous integration for a Java e-commerce project, how can you ensure that only production-ready code is merged into the main branch?Multiple choiceMedium
- Which JUnit assertion would you use to check if two lists in a unit test contain the same elements in the same order?Multiple choiceMedium
- In a Gradle build script, which section is used to specify external dependencies?Multiple choiceMedium