Skip to content
Sharp

Project Structure interview questions

Continuous Integration, Java Modules (JPMS)

38 questions with answers and explanations · 38 flashcards

Questions

  1. Why does a build tool like Maven in managing dependencies for a Java project matter in this design?Multiple choiceMedium
  2. Why might you choose to use integration tests despite their higher resource cost compared to unit tests?Multiple choiceHard
  3. Why do teams use Continuous Integration in software development in production code?Multiple choiceEasy
  4. Which JUnit assertion would you use to verify that a method returns a null value?Multiple choiceMedium
  5. Why is it important to have strong encapsulation in a module system like JPMS?Multiple choiceMedium
  6. Which of the following strategies can prevent a bad merge into the main branch in a CI/CD workflow?Multiple choiceHard
  7. In a JPMS setup, what happens if a module exports a package but does not specify which other modules can access it?Multiple choiceMedium
  8. How would you explain a key advantage of using Gradle over Maven in Java projects in an interview?Multiple choiceEasy
  9. Why does the module-info.java file in a Java project matter in practice?Multiple choiceEasy
  10. Which Maven lifecycle phase is responsible for running integration tests?Multiple choiceHard
  11. Given the following module-info.java, which statement is true regarding package visibility?Multiple choiceHard
  12. In JPMS, what happens if a module does not explicitly export a package?Multiple choiceMedium
  13. 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
  14. How would you explain a key benefit of using automated testing over manual testing in a Java project in an interview?Multiple choiceMedium
  15. In a Maven project, what phase of the build lifecycle is responsible for running integration tests?Multiple choiceHard
  16. How would you explain a key advantage of using Java modules in a project in an interview?Multiple choiceEasy
  17. Why does a build tool like Maven or Gradle in a Java project matter in practice?Multiple choiceEasy
  18. What does the 'exports' directive do in a module-info.java file?Multiple choiceMedium
  19. How does the 'requires transitive' keyword in module-info.java affect module dependencies?Multiple choiceHard
  20. How does a CI pipeline serve as a quality gatekeeper in software development?Multiple choiceMedium
  21. In the context of dependency management with Maven, what is the purpose of a 'transitive dependency'?Multiple choiceHard
  22. Why is it important to configure a CI pipeline to use a clean environment for each build?Multiple choiceMedium
  23. Which of the following is a common use of mocking in unit tests?Multiple choiceEasy
  24. In Mockito, which method is used to verify that a mock object's method was called a specific number of times?Multiple choiceHard
  25. In a Maven project, where should you define a dependency that is only needed for testing?Multiple choiceMedium
  26. How can a CI pipeline help ensure that the e-commerce application is production-ready after each commit?Multiple choiceHard
  27. Why do teams use automated tests in a Continuous Integration (CI) pipeline in production code?Multiple choiceEasy
  28. Which build tool lifecycle phase in Maven is responsible for compiling the source code?Multiple choiceEasy
  29. Why does not specifying the 'requires' directive for a module in JPMS change runtime behavior?Multiple choiceMedium
  30. How does mocking help in unit testing an e-commerce application's payment service?Multiple choiceMedium
  31. Which of the following is a key benefit of using automated tests in a CI/CD pipeline?Multiple choiceEasy
  32. When setting up a CI pipeline, what is a key consideration for ensuring tests are truly representative of production environments?Multiple choiceHard
  33. In a CI pipeline for an e-commerce application, what role does mocking play in testing?Multiple choiceMedium
  34. When using Mockito, how can you verify that a method was called a specific number of times on a mock object?Multiple choiceHard
  35. Why might you choose to use Mockito for testing in a CI pipeline?Multiple choiceMedium
  36. 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
  37. 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
  38. In a Gradle build script, which section is used to specify external dependencies?Multiple choiceMedium