Assess Spring IoC, AOP, JDBC, Security
Company: TestGorilla
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Take-home Project
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?
Quick Answer: This question evaluates knowledge of the Spring Framework — specifically IoC container configuration, AOP advice selection, bean injection and wiring, JdbcTemplate result mapping, DataSource-based database connectivity, and method-level security within the Software Engineering Fundamentals domain.