Katkat

Assess Spring IoC, AOP, JDBC, Security

TestGorillaSoftware Engineer · Online Assessment

Last updated

Assess Spring IoC, AOP, JDBC, Security evaluates engineering fundamentals, trade-offs, examples, pitfalls, and operational implications in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

Answer the following Spring Framework questions (some are single-choice):

  1. How do you instantiate a single Spring IoC container that loads multiple configuration files and is shared across the application?
  2. To log method arguments for auditing, which AOP advice should you use? Choose one: @Before, @After, @Around, or @AfterReturning.
  3. When multiple beans implement the same interface, how do you inject a specific implementation?
  4. What is the simplest way to inject a dependency/resource into a class in Spring?
  5. What is the easiest way to map a JDBC ResultSet to a Java bean when using Spring's JdbcTemplate?
  6. To connect to a MySQL database in Spring, which bean type should encapsulate the database connection? Choose one: DataSource, SQLConnector, MySqlConnector, or MySQLJDBC.
  7. In a Spring MVC/REST request handler, how do you access the currently authenticated user's details for logging?
  8. Using @PreAuthorize on a method, why might @PreAuthorize("hasRole('ROLE_ABC')") result in access denied, and what is the correct usage?