New
Spring Boot
- How would you configure a Spring Boot application to connect to multiple databases? Describe the steps and considerations.
- Explain how you would set up a Spring Boot application to handle high availability and load balancing.
- Describe how you would implement a custom health check in a Spring Boot application and why it might be necessary.
- How do you handle application configuration for different environments (development, testing, production) in Spring Boot?
- What are the best practices for managing application properties and secrets in a Spring Boot application?
- Explain how you would use Spring Boot’s Actuator to monitor application metrics and perform diagnostics.
- How do you handle logging in a Spring Boot application, and how would you configure different log levels for various environments?
- Describe how you would implement internationalization (i18n) in a Spring Boot application.
Spring Security
- How would you secure a REST API in a Spring Boot application using Spring Security? Describe the steps for both authentication and authorization.
- Explain how to configure OAuth2 authentication and authorization for a Spring Boot application.
- Describe a scenario where you would use Spring Security’s method-level security annotations and how you would implement them.
- How would you handle user role management and permissions in a Spring Boot application using Spring Security?
- Explain how you would implement single sign-on (SSO) in a Spring Boot application.
- What are some common vulnerabilities in web applications, and how does Spring Security help mitigate them?
- How would you handle security for a microservices architecture with Spring Boot and Spring Security?
- Describe how to use Spring Security to protect a web application from common attacks such as CSRF and XSS.
Spring Transaction Management
- Describe a scenario where you would use the
REQUIRES_NEW
propagation type in a Spring Boot application. - How do you handle transactions in a Spring Boot application that needs to interact with multiple data sources?
- Explain how you would implement and configure transaction management in a Spring Boot application that uses a combination of JPA and JDBC.
- How would you handle transaction management in a Spring Boot application that involves a distributed transaction across microservices?
- Describe how to use
@Transactional
to ensure data consistency in a Spring Boot application with complex business logic. - How would you test transaction management in a Spring Boot application to ensure proper rollback and commit behavior?
- What strategies would you use to optimize transaction performance in a Spring Boot application?
- How does Spring Boot handle transaction management in a batch processing scenario?
Spring Data JPA
- How would you handle a situation where a Spring Data JPA repository method needs to perform complex queries that are not supported by the JPA query methods?
- Describe how you would implement pagination and sorting in a Spring Boot application using Spring Data JPA.
- How do you handle optimistic locking and pessimistic locking in a Spring Data JPA application?
- Explain how you would use custom repository implementations in Spring Data JPA to extend functionality beyond the standard repository methods.
- Describe a scenario where you would use the
@Query
annotation with native SQL queries in a Spring Data JPA repository. - How would you manage entity relationships (e.g., one-to-many, many-to-many) in Spring Data JPA? Provide an example of how to configure these relationships.
- What are some best practices for handling large data sets and performance tuning in Spring Data JPA applications?
- How would you configure a Spring Data JPA repository to support multi-tenancy in a Spring Boot application?